Hi Lewis,
I think your recipe needs to be something like I’ve shown below, which (after experimentation and carefully reading the Release Notes) works for me on a RHEL-8 system. I suspect this doesn’t need
LD_LIBRARY_PATH to be set at all though. The
PYTHON=python3 setting is only necessary for RHEL-8 and above — EPICS builds only need python when you set
LINKER_USE_RPATH=ORIGIN. I am planning to replace the Python script with Perl though (thanks Argo!).
cswdev02% cat /etc/redhat-release
Red Hat Enterprise Linux release 8.9 (Ootpa)
cswdev02% mkdir /tmp/45
cswdev02% cd /tmp/45
cswdev02% mkdir distfiles opt src work
cswdev02% cd distfiles
cswdev02% curl -OL
https://epics.anl.gov/download/base/base-7.0.8.1.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3059k 100 3059k 0 0 4941k 0 --:--:-- --:--:-- --:--:-- 4941k
cswdev02% cd ../src
cswdev02% tar xzf ../distfiles/base-7.0.8.1.tar.gz
cswdev02% cd base-7.0.8.1
cswdev02% cat > configure/CONFIG_SITE.local
INSTALL_LOCATION=/tmp/45/work
FINAL_LOCATION=/tmp/45/opt/epics-7.0.8.1
LINKER_USE_RPATH=ORIGIN
LINKER_ORIGIN_ROOT=/tmp/45
export LD_LIBRARY_PATH=$(INSTALL_LOCATION)/lib/$(EPICS_HOST_ARCH)
PYTHON=python3
^D
cswdev02% setenv EPICS_HOST_ARCH linux-x86_64
cswdev02% make -sj
...
cswdev02% cd /tmp/45
cswdev02% ldd work/bin/linux-x86_64/caget
linux-vdso.so.1 (0x00007ffcbc3dd000)
libca.so.4.14.4 => /tmp/45/work/bin/linux-x86_64/../../lib/linux-x86_64/libca.so.4.14.4 (0x00007f31e0ced000)
libCom.so.3.23.1 => /tmp/45/work/bin/linux-x86_64/../../lib/linux-x86_64/libCom.so.3.23.1 (0x00007f31e0a6f000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f31e06da000)
libm.so.6 => /lib64/libm.so.6 (0x00007f31e0358000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f31e0140000)
libc.so.6 => /lib64/libc.so.6 (0x00007f31dfd7b000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f31dfb5b000)
libreadline.so.7 => /lib64/libreadline.so.7 (0x00007f31df90c000)
librt.so.1 => /lib64/librt.so.1 (0x00007f31df704000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f31df500000)
/lib64/ld-linux-x86-64.so.2 (0x00007f31e0f53000)
libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f31df2d3000)
cswdev02% mv work opt/epics-7.0.8.1
cswdev02% ldd opt/epics-7.0.8.1/bin/linux-x86_64/caget
linux-vdso.so.1 (0x00007fff2212b000)
libca.so.4.14.4 => /tmp/45/opt/epics-7.0.8.1/bin/linux-x86_64/../../lib/linux-x86_64/libca.so.4.14.4 (0x00007f30c97b6000)
libCom.so.3.23.1 => /tmp/45/opt/epics-7.0.8.1/bin/linux-x86_64/../../lib/linux-x86_64/libCom.so.3.23.1 (0x00007f30c9538000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f30c91a3000)
libm.so.6 => /lib64/libm.so.6 (0x00007f30c8e21000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f30c8c09000)
libc.so.6 => /lib64/libc.so.6 (0x00007f30c8844000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f30c8624000)
libreadline.so.7 => /lib64/libreadline.so.7 (0x00007f30c83d5000)
librt.so.1 => /lib64/librt.so.1 (0x00007f30c81cd000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f30c7fc9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f30c9a1c000)
libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f30c7d9c000)
One thing I haven’t tried is to move $(FINAL_LOCATION) outside of
$(LINKER_ORIGIN_ROOT), but I don’t think that should be a problem.
- Andrew
Complexity comes for free, Simplicity you have to work for.
Hi, Tech-Talkers!
On RHEL 7 (linux-x86_64), using the DESTDIR-like build behavior
of EPICS 7.0.8.1 by setting INSTALL_LOCATION, FINAL_LOCATION, and
LINKER_USE_RPATH doesn't seem to work. Is this broken, or am I doing
something wrong?
I did the following:
====
$ mkdir /tmp/45
$ cd /tmp/45
$ mkdir distfiles opt src work
$ cd distfiles
$ curl -OL
https://epics.anl.gov/download/base/base-7.0.8.1.tar.gz
$ cd ../src
$ tar xzf ../distfiles/base-7.0.8.1.tar.gz
$ cd base-7.0.8.1
$ vi configure/CONFIG_SITE
----
INSTALL_LOCATION=/tmp/45/work
FINAL_LOCATION=/tmp/45/opt/epics-7.0.8.1
LINKER_USE_RPATH=NO
----
$ export EPICS_HOST_ARCH=linux-x86_64
$ export PATH="/tmp/45/work/bin/$EPICS_HOST_ARCH:$PATH"
$ export LD_LIBRARY_PATH=/tmp/45/work/lib/$EPICS_HOST_ARCH
$ make
====
After the build completes, /tmp/45/opt is empty; that's as expected
since that's the final location, and it's up to me to move them into
their final location, potentially on a different machine.
In /tmp/45/work, all the installed files are there; that's as expected
also. But unfortunately, the RPATH information is wrong. For example,
caget doesn't have correct RPATH entries for libca nor libCom:
====
$ ldd /tmp/45/work/bin/linux-x86_64/caget
linux-vdso.so.1 => (0x00007fff0d2b8000)
libca.so.4.14.4 => not found
libCom.so.3.23.1 => not found
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fa226e61000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa226b5f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fa226949000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa22657b000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa227169000)
====
And libca doesn't have a correct RPATH entry for libCom:
====
$ ldd /tmp/45/work/lib/linux-x86_64/libca.so
linux-vdso.so.1 => (0x00007ffd80bd2000)
libCom.so.3.23.1 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb2bd6a2000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fb2bd45c000)
librt.so.1 => /lib64/librt.so.1 (0x00007fb2bd254000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb2bd050000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb2bcd48000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb2bca46000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb2bc830000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb2bc462000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb2bdb28000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fb2bc238000)
====
Wondering whether setting LINKER_USE_RPATH=NO above was the wrong
thing to do, I tried again as above but with LINKER_USE_RPATH=YES in
CONFIG_SITE. Unfortunately, that also results in broken RPATH entries,
but different. For example, caget's RPATH entries for libca and libCom
are both under INSTALL_LOCATION (/tmp/45/work), which is wrong; they
should be under FINAL_LOCATION (/tmp/45/opt/epics-7.0.8.1):
====
$ ldd /tmp/45/work/bin/linux-x86_64/caget
linux-vdso.so.1 => (0x00007ffff5ffd000)
libca.so.4.14.4 => /tmp/45/work/lib/linux-x86_64/libca.so.4.14.4 (0x00007f6356d92000)
libCom.so.3.23.1 => /tmp/45/work/lib/linux-x86_64/libCom.so.3.23.1 (0x00007f6356b15000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f635680d000)
libm.so.6 => /lib64/libm.so.6 (0x00007f635650b000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f63562f5000)
libc.so.6 => /lib64/libc.so.6 (0x00007f6355f27000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6355d0b000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f6355ac5000)
librt.so.1 => /lib64/librt.so.1 (0x00007f63558bd000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f63556b9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6356ffc000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f635548f000)
====
And libca's RPATH entry for libCom is similarly under INSTALL_LOCATION
(/tmp/45/work), which is wrong; it should be under FINAL_LOCATION
(/tmp/45/opt/epics-7.0.8.1):
====
$ ldd /tmp/45/work/lib/linux-x86_64/libca.so
linux-vdso.so.1 => (0x00007ffce6921000)
libCom.so.3.23.1 => /tmp/45/work/lib/linux-x86_64/libCom.so.3.23.1 (0x00007fc58b491000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc58b275000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fc58b02f000)
librt.so.1 => /lib64/librt.so.1 (0x00007fc58ae27000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc58ac23000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc58a91b000)
libm.so.6 => /lib64/libm.so.6 (0x00007fc58a619000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc58a403000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc58a035000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc58b978000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fc589e0b000)
====
Thanks!
Lewis