rpmbuild SPEC file - shared library path

arnaud gaboury arnaud.gaboury at gmail.com
Mon Sep 14 13:17:15 UTC 2015


On Mon, Sep 14, 2015 at 2:26 PM, Jonathan Wakely <jwakely at redhat.com> wrote:
> 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

I just found the root of my issue. The LD_LIBRARY_PATH in my shell
environment was not correctly set. In fact,  there are some issue in
the  parallel_studio_xe_2016, with bad sylink who prevent to access
the correct path to the libraries. Once I corrected the path:

poisonivy at poppy ➤➤ ~/rpmbuild % ldd
/home/poisonivy/rpmbuild/BUILD/R-3.2.1/bin/exec/R
.....................
libiomp5.so => /opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin/libiomp5.so
(0x00007f4b8f7f9000)

The missing shared library is here. Nothing to do with my spec file
and build environment.
poisonivy at poppy ➤➤ ~/rpmbuild % echo $LD_LIBRARY_PATH
/opt/intel/compilers_and_libraries_2016.0.109/linux/compiler/lib/intel64_lin:/opt/intel/compilers_and_libraries_2016.0.9/mkl/lib/intel64_lin

>
>
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct



-- 

google.com/+arnaudgabourygabx


More information about the devel mailing list