Ok thanks! Yes I will have a look at Dierckx.jl, see if I can figure out how it does it.
Le jeudi 23 juin 2016 13:00:57 UTC+10, Tony Kelman a écrit : > > You have a few options. You can save the location of the library to a > module-level const variable and use that in your ccall's, or use BinDeps to > write the path of the found library (if any) to a generated file. I believe > Dierckx.jl is an example of using the former, where the library just gets > built or extracted to a known relative path w.r.t. the src of the package. > > > On Wednesday, June 22, 2016 at 10:22:08 PM UTC-4, Charles Ll wrote: >> >> Dear all, >> >> I use a Fortran code in my package Spectra.jl, it is working really >> nicely. However, I still use the absolute library path in ccall. From >> discussion in the Gitter, I know that I could use eval, but my ccall is in >> a function so as eval works on global variables, it seems not appropriate... >> >> So my question is, how can we properly provide the shared library path to >> the ccall function, with keeping in mind that this process needs some >> flexibility, required for instance by the installation of the package on >> different OS? This seems particularly important when trying to distribute >> my package. For now, users have to change manually the path in the >> installed package, which seems a bad situation... >> >> I'm sure that this has already done for Fortran library such as the >> LAPACK library for instance, but despite having looked at the Github for >> the LAPACK wrapper, I don't understand how this is implemented... >> >> So if you have any insides, this will be greatly appreciated! >> >> Best, >> Charles. >> >> >>