rpmbuild SPEC file - shared library path

Jonathan Wakely jwakely at redhat.com
Mon Sep 14 12:26:35 UTC 2015


On 14/09/15 12:00 +0200, arnaud gaboury wrote:
>I build my app with shared libraries. In my spec file, I source a
>script which export LD_LIBRARY_PATH.
>Below is how I proceed in my spec file:
>
>************************************
>%global _prod_dir /opt/intel/compilers_and_libraries_2016/linux
>%global _mklroot_dir %{_prod_dir}/mkl
>%global _mkllibpath %{_mklroot_dir}/lib/intel64_lin
>%global _openmplibpath %{_prod_dir}/compiler/lib/intel64_lin
>...............
>%build
>source /opt/intel/bin/compilervars.sh intel64
>export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:%{_mkllibpath}:%{_openmplibpath}:%{_builddir_full}/lib
>..............
>**************************************
>
>make complains at one point about not finding one shared library:
>
>/home/poisonivy/rpmbuild/BUILD/R-3.2.1/bin/exec/R: error while loading
>shared libraries: libiomp5.so: cannot open shared object file: No such
>file or directory
>
>This library is indeed in %{_openmplibpath}. I conclude that
>LD_LIBRARY_PATH has not been correctly populated in my build
>environment.

Instead of guessing, make the %build section print it out so you can
check it:

  echo $LD_LIBRARY_PATH




More information about the devel mailing list