Re: [julia-users] C code in a Julia package

2014-12-24 Thread Elliot Saba
Great. So glad that we could get it working. -E On Wed, Dec 24, 2014 at 12:54 PM, John Lapeyre wrote: > Thanks for the help Elliot. My entire build works now. > > For the record, this is the code that differs from that for > a basic build of an external library with autotools: > > srcdir = Bin

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
Thanks for the help Elliot. My entire build works now. For the record, this is the code that differs from that for a basic build of an external library with autotools: srcdir = BinDeps.srcdir(cprimecount) srcdir = joinpath(BinDeps.depsdir(cprimecount),"src","cprimecount") provides(SimpleBuild,

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
Reading the BinDeps code, it seems that, unlike for Binaries, there is no other way to provide the source. https://github.com/JuliaLang/BinDeps.jl/blob/master/src/dependencies.jl#L261-L263 I also see that in a handwritten Provides(SimpleBuild line...), I explicitly ask to get the source: http

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
Ok, I pushed an update to the branch: https://github.com/jlapeyre/PrimeSieve.jl/tree/master In this dir, "configure && make && make install" do what I want: https://github.com/jlapeyre/PrimeSieve.jl/tree/addprimecount/deps/src/cprimecount After building by hand, this handwritten deps.jl works:

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
On 12/24/2014 08:32 PM, Elliot Saba wrote: Do you have your code posted anywhere so I can try it locally? Well, I just pushed the branch here: https://github.com/jlapeyre/PrimeSieve.jl/tree/addprimecount But it won't work as is. I have to bundle the Makefile back into the configure script, e

Re: [julia-users] C code in a Julia package

2014-12-24 Thread Elliot Saba
Do you have your code posted anywhere so I can try it locally? -E On Wed, Dec 24, 2014 at 11:29 AM, John Lapeyre wrote: > I think the BuildProcess step will not be a problem. I am almost > certain I can just say its plain vanilla Autotools. If not, there > are many examples in packages of compl

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
I think the BuildProcess step will not be a problem. I am almost certain I can just say its plain vanilla Autotools. If not, there are many examples in packages of complicated BuildProcess arguments. In all of the examples I have seen (maybe I missed something), the source is downloaded. My sourc

Re: [julia-users] C code in a Julia package

2014-12-24 Thread Elliot Saba
Autotools without a ./configure script can be done by using the MakeTargets buildstep generator. Here's an example for Cairo.jl , where the zlib dependency is built by downloading the sources for Zlib, then running make on

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
On 12/24/2014 07:22 PM, Elliot Saba wrote: I would suggest putting your C code and a Makefile in a > PACKAGE_ROOT/deps/src folder, then you can write up a set of simple btw. that's what I already did. But Pkg.build("PrimeSieve") still fails with this error: Could not obtain sources for de

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
Thanks. Seeing a list of packages that use BinDeps helps. In retrospect, I could have put BinDeps in the subject line so this thread could be found more easily. The two downloaded packages use Autotools. BinDeps works great once I got the incantation right. So, I have been trying to follow the B

Re: [julia-users] C code in a Julia package

2014-12-24 Thread Elliot Saba
BinDeps is pretty flexible. I'm guessing you have seen a BinDeps invocation that is based off of the Autotools step? (Here's an example for Nettle.jl ) That does a lot of things for you, and doesn't really show off the f

Re: [julia-users] C code in a Julia package

2014-12-24 Thread John Lapeyre
Hi Elliot, Thanks for the offer. > B) You want to write a wrapper that sits between Julia and the C++, written in C but used by Julia Yes. Writing the wrapper is not the problem. Really what I'd like to know is how to organize, compile and link C code. How do I find the toplevel of the pack

Re: [julia-users] C code in a Julia package

2014-12-23 Thread Elliot Saba
Hey John, If you can explain a bit as to what you want to do with your libraries, that would help. What I understand from you so far is that: A) You have to C++ libraries that you are able to download and compile B) You want to write a wrapper that sits between Julia and the C++, written in C b

[julia-users] C code in a Julia package

2014-12-23 Thread lapeyre . math122a
Can someone point me to examples of C code in Julia packages ? I am using BinDeps to download two C++ libraries. After a lot of blind trial and error I have a build.jl that does what I need. But, I need to write a c wrapper for the C++ libraries. One idea is to have BinDeps handle the build, if