BinDeps.jl icon indicating copy to clipboard operation
BinDeps.jl copied to clipboard

Way to enforce specific library search path?

Open tbole opened this issue 6 years ago • 5 comments

I have an environment, where multiple versions of the same library are installed on the system. One version in /usr/lib and multiple others in /opt/... accessible through environment modules, which will automatically set PATH and LD_LIBRARY_PATH.

The package, in my case HDF5.jl, has defined multiple aliases for the library aliases = ["libhdf5", "libhdf5_openmpi", "libhdf5_mpich", "libhdf5_serial", "libhdf5_serial.so.10" ]. BinDeps will find the lib under multiple aliases, some in /usr/lib and some in /opt, but will always pick the one in /usr/lib. Is there a way to enforce a specific path through some flag, without changing HDF5.jl? This is probably the most simple functionality to ask for, no search, no installer, just use the specified path...

PS: I've already added the path to Libdl.DL_LOAD_PATH and as already mentioned all environment variables are set.

tbole avatar Jul 03 '18 10:07 tbole

You're probably best off manually editing the path in deps/deps.jl. That file will get overwritten if you re-do Pkg.build("HDF5") but there are a few ways you could delay that from happening.

tkelman avatar Jul 03 '18 20:07 tkelman

Of course I could edit ´deps.jl´, just thought there was something more elegant for such basic functionality.

tbole avatar Jul 03 '18 20:07 tbole

What about the library in /usr/lib do you not want BinDeps to accept? There's not much in the way of priority other than library groups or yes/no validity checks, the first acceptable thing BinDeps finds is usually what it will use.

tkelman avatar Jul 03 '18 20:07 tkelman

The libraries in '/usr/lib' are often ancient and may not support specific features such as MPI. BinDeps actually finds the right libs in ´/opt´, e.g. ´libhdf5´, but since there are some aliases defined, it will also find libhdf5_mpich or even worse libhdf5_serial in '/usr/lib' and use one of these. I was hoping for some CMake-ish feature, where you simply pass a preferred search paths (or preferred alias?), e.g. using environment variables.

tbole avatar Jul 03 '18 21:07 tbole

You might be able to entirely remove the search paths you know you don't want. Some might be hard-coded and harder to suppress, would have to check.

tkelman avatar Jul 03 '18 21:07 tkelman