this may be easy but i could not see an immediate way to do it.
i’m on a linux machine without admin rights. i have a recent copy of GSL installed in a directory other than the system-wide standard (the sysadmin did this for me, it’s in /opt/gsl-2.4).
how can i
tell opam to install the gsl wrapper with correct linking to this version of GSL
tell ocamlbuild to link correctly afterwards?
i would love to just set some $LD_LIBRARY_PATH and be done with it but that does not seem to be enough?
Opam doesn’t really have knowledge about the C libraries, so it’s basically down to the packages’ build systems. Setting LD_LIBRARY_PATH (and possibly CPATH) should work, but depending on the ./configure scripts, some might depend on pkg-config, in which case you might have to check with e.g. PKG_CONFIG_PATH too.
All else failing, you might have to tweak the conf-gsl package by hand to make it accept your installation (use opam pin --edit). Opam 2 allows to add setenv: definitions in opam files, so that could be used to avoid having to set the variables each time (or from your .profile) too.