Packages with C code, and the packaging system

81 views
Skip to first unread message

lgautier

unread,
Dec 22, 2012, 10:53:04 AM12/22/12
to juli...@googlegroups.com
Hi,

The package contains C code for a library (stored in deps/, as the documentation seems to suggest this directory to be the right location), and is in a Git repository (mirrorred on GitHub). In order to compile the C part, I was kinldly sent a nifty snippet of Julia code in a pull request (thanks Tom). That code is checking is the .so library file is around and if not call 'make' (I have a Makefile).

Beside the need to also add ".dll" to ".so" in order to accommodate Windows users (and this might challenge the view that users can become contributors to packages right away - getting a development environment with Windows is for the brave, as far as my experience with Python and R on that is concerned), I already added a comparison on mtime to assess whether a compilation is needed for the main C file but I am just aping what "make" is already doing (and quite not as well as "make" does it). That particular point is making me think that the current (Git) repository-only approach has one shortcoming: startup speed (and Julia does not need that).

Packages with C libraries shipped with the package could obviously call "make" each time the package is required/loaded, but this is looking like a rather heavy-weight requirement as a general solution as larger libraries with many C files might mean performance issues (even more if several packages are required by a Julia program - I am thinking of non-interactive usage, such as a webserver spawning a Julia for a given calculation, or distributed remote computing).

I understand that the packaging system is WIP. I am chiming so this point is not forgotten.

Best,


Laurent

John Myles White

unread,
Dec 22, 2012, 11:23:36 AM12/22/12
to juli...@googlegroups.com
We definitely need to start coming up with a strategy here. I believe that R's solution here is to pre-compile per-platform binaries on a special server and then ship those.

On a related note, I suspect that RMath should be moved into the Distributions package and out of Julia's deps directory at some point.

-- John
> --
>
>
>

Avik Sengupta

unread,
Dec 22, 2012, 2:18:38 PM12/22/12
to juli...@googlegroups.com
I was hoping the packaging system would provide a "after install" hook. That could be used to compile the native code. I've also wanted it to be able to show a message to the user, maybe informing them about optional dependencies. 

Regards
-
Avik

Patrick O'Leary

unread,
Dec 23, 2012, 11:14:58 AM12/23/12
to juli...@googlegroups.com
 You might take a look at refactoring the else branch of _resolve() to provide for that in base/pkg.jl. I think this is work just waiting for someone to do it.
Reply all
Reply to author
Forward
0 new messages