EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work?
From: Han Lee via Tech-talk <tech-talk at aps.anl.gov>
To: "Johnson, Andrew N." <anj at anl.gov>
Cc: EPICS Tech-Talk <tech-talk at aps.anl.gov>
Date: Tue, 21 Jan 2025 12:57:29 -0800
Hi Andrew,

On Tue, Jan 21, 2025 at 12:19 PM Johnson, Andrew N. <anj at anl.gov> wrote:

Hi Han,

 

The first line of this comment in configure/CONFIG_SITE says:

 

# Only used when LINKER_USE_RPATH=ORIGIN

# The build time root(s) of the relocatable tree (separate multiple w/ ':').

# Linking to libraries under any root directory will be relative.

# Linking to libraries outside of this root will be absolute.

# All root directories are considered to be the same.

LINKER_ORIGIN_ROOT = $(INSTALL_LOCATION)

 

That implies that setting LINKER_USE_RPATH = YES should make the build ignore the LINKER_ORIGIN_ROOT setting completely. I can quite believe that the comment is out of date though, can you confirm that the value of the path does actually make a difference with that LINKER_USE_RPATH setting?

 


From my weak memory, only these two combination, with them, I could have "different installation location" and "all libraries have the consistent path through ldd" after separating sources files.
If one would like to keep everything in the same folder, there is no issue on them. But I don't want to keep sources files into the production path.

There was a issue regarding 'RULES_DIRS" to understand where "all headers files" and "compiled lib files" are during building EPICS base with INSTALL_LOCATION.

My base is 7.0.7, not 7.0.8. And I will evaluate it with 7.0.8 if I am available.


Overall, "INSTALL_LOCATION" has a lot of issues through multiple EPICS modules, I saw. It will be better to collect the requirement first before updating configuration overall. 

Thanks,
Han


 

There’s nothing dirty about your settings though, these variables are intended to be set by the person doing the installation as necessary.

 

- Andrew

 

-- 

Complexity comes for free, Simplicity you have to work for.

 

 

On 1/21/25, 1:41PM, "Tech-talk" <tech-talk-bounces at aps.anl.gov> wrote:

 

 

Hi,

 

I have my own solution for them, two variables are customized as follows:

 

LINKER_USE_RPATH?=YES

LINKER_ORIGIN_ROOT?=$(INSTALL_LOCATION):$(TOP)/$(SRC_PATH_BASE)

 

, where TOP is the my working folder, and SRC_PATH_BASE is the epics base sources. So in your case you can replace TOP/SRC_PATH+BASE as the absolute path of your EPICS base source folder.

 

They may be a dirty solution, but it works for my environment well. And I don't use FINAL_LOCATION

 

HTH,

Han

 

On Tue, Jan 21, 2025 at 11:33AM Johnson, Andrew N. via Tech-talk <tech-talk at aps.anl.gov> wrote:

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.

 

 

On 1/18/25, 12:45PM, "Tech-talk" <tech-talk-bounces at aps.anl.gov> wrote:

 

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



--

Jeong Han Lee, Dr.rer.nat.

Lawrence Berkeley National Laboratory

https://orcid.org/0000-0002-1699-2660



--
Jeong Han Lee, Dr.rer.nat.
Lawrence Berkeley National Laboratory
https://orcid.org/0000-0002-1699-2660

References:
EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? J. Lewis Muir via Tech-talk
Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Johnson, Andrew N. via Tech-talk
Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Han Lee via Tech-talk
Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Johnson, Andrew N. via Tech-talk
Next: Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Johnson, Andrew N. via Tech-talk
Next: Re: EPICS INSTALL_LOCATION/FINAL_LOCATION doesn't work? Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025