BOOST_ROOT configuration doesn't work for EPEL boost1.78 on RHEL8
I am trying to get pvaPy 5.4.1 to compile for ITER's RHEL 8 systems. To comply with the "boost >= 1.78" requirement, I installed the boost1.78 packages from the official EPEL repositories. These get installed in
/usr/include/boost1.78/boost/...
/usr/lib64/boost1.78/*.so
The pvaPy configuration option BOOST_ROOT does not cover boost being installed in such a "distributed" fashion.
Hmm. I can add something like BOOST_LIB_DIR and BOOST_INCLUDE_DIR to allow for this that will default to BOOST_ROOT/lib and BOOST_ROOT/include. Would this work? In the meantime, you can simply skip autoconf process and generate configuration file manually. If you need help, I can post an example of what needs to be done.
Also, the current version of boost I used for packaging is 1.85.
I think I'll just switch to manual configuration, as you suggest. That's probably fine. I'm not sure yet if the parallel installation of Boost 1.66 (default on RHEL 8) and Boost 1.78 (from EPEL) will be handled correctly by the build. The installation happens in separate directories and doesn't create conflicts.
Maybe adding a hint on how to configure manually on RHEL8+EPEL will be enough. (I would regard that a pretty standard setup on RedHat.) Just let me get the build working, first...
Lots of:
[WARN] from /usr/include/boost1.78/boost/python/detail/is_auto_ptr.hpp:9,
[WARN] from /usr/include/boost1.78/boost/python/detail/copy_ctor_mutates_rhs.hpp:8,
[WARN] from /usr/include/boost1.78/boost/python/detail/value_arg.hpp:7,
[WARN] from /usr/include/boost1.78/boost/python/object/forward.hpp:10,
Looking good...
Doc building fails:
make[3]: Entering directory '.../pvaPy-5.4.1/documentation/sphinx'
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v5.3.0
making output directory... done
[autosummary] generating autosummary for: index.rst, pvaccess.rst, pvapy.rst
Failed to import pvapy.
Possible hints:
* ModuleNotFoundError: No module named 'pvaccess.pvaccess'
* KeyError: 'pvapy'
Failed to import pvaccess.
Possible hints:
* KeyError: 'pvaccess'
* ModuleNotFoundError: No module named 'pvaccess.pvaccess'
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [ 33%] index
reading sources... [ 66%] pvaccess
reading sources... [100%] pvapy
[ERROR] WARNING: autodoc: failed to import module 'pvaccess'; the following exception was raised:
[WARN] No module named 'pvaccess.pvaccess'
[ERROR] WARNING: autodoc: failed to import class 'PvObject' from module 'pvaccess'; the following exception was raised:
[WARN] No module named 'pvaccess.pvaccess'
[ERROR] WARNING: autodoc: failed to import class 'PvScalar' from module 'pvaccess'; the following exception was raised:
[WARN] No module named 'pvaccess.pvaccess'
[ERROR] WARNING: autodoc: failed to import class 'PvBoolean' from module 'pvaccess'; the following exception was raised:
What's missing there?
I am not quite sure. Can you post your CONFIG_SITE.local file? I will try to get RHEL8 VM tomorrow and see what is going on. Also, you are building against system installed python, correct?
System installed python36 = 3.6.8-38.module+el8.5.0+12207+5c5719bc which identifies as
$ python3 -VV
Python 3.6.8 (default, Sep 9 2021, 07:49:02)
[GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
Ahhrgh. Linking went wrong.
$ ldd .../pvaPy-5.4.1/lib/python/3.6/linux-x86_64/pvaccess.so
linux-vdso.so.1 (0x00007ffce2f89000)
libpvaClient.so.4.8.0 => /opt/codac-7.3/epics/lib/linux-x86_64/libpvaClient.so.4.8.0 (0x00007f0eac0ce000)
[...]
libboost_python3.so.1.66.0 => /lib64/libboost_python3.so.1.66.0 (0x00007f0eaa8b1000)
libboost_numpy3.so.1.66.0 => /lib64/libboost_numpy3.so.1.66.0 (0x00007f0eaa6a4000)
[...]
Using the system default boost 1.66.
Fixed the linking: in that EPEL boost 1.78 install, the library names have changed ("3" -> "36"; see below).
The doc warnings are mostly silenced by fixing the PYTHONPATH.
Instead of the ../.. setting (hardcoded in the top Makefile), I need to set it to the location of pvaccess.so and the top location.
I assume the top module pvaccess is supposed to pull in the library (that would explain the hardcoded PYTHONPATH for both pvapy and pvaccess), but it doesn't.
I will ignore the remaining warnings
Running Sphinx v5.3.0
making output directory... done
[autosummary] generating autosummary for: index.rst, pvaccess.rst, pvapy.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [ 33%] index
reading sources... [ 66%] pvaccess
reading sources... [100%] pvapy
[ERROR] WARNING: autodoc: failed to import class 'adOutputFileProcessor.AdOutputFileProcessor' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'PIL'
[ERROR] WARNING: autodoc: failed to import class 'hdf5AdImageWriter.Hdf5AdImageWriter' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'h5py'
[ERROR] WARNIlooking for now-outdated files... none found
NG: autodoc: failed to import class 'dataDecryptor.DataDecryptor' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'rsa'
[ERROR] WARNING: autodoc: failed to import class 'adImageDataDecryptor.AdImageDataDecryptor' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'rsa'
[ERROR] WARNING: autodoc: failed to import class 'dataEncryptor.DataEncryptor' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'rsa'
[ERROR] WARNING: autodoc: failed to import class 'adImageDataEncryptor.AdImageDataEncryptor' from module 'pvapy.hpc'; the following exception was raised:
[WARN] No module named 'rsa'
Diff of the checked-out project:
--- pvaPy-5.4.1/Makefile (revision 162145)
+++ pvaPy-5.4.1/Makefile (working copy)
@@ -73,7 +73,7 @@
endif # Command-line goal
doc:
- PYTHONPATH=../.. $(MAKE) -C $(DOC_DIR)
+ $(MAKE) -C $(DOC_DIR)
doc-clean:
$(MAKE) -C $(DOC_DIR) clean
My RELEASE.local only sets EPICS_BASE.
My CONFIG_SITE.local (with some macros that are expanded during the build):
PVAPY_CPPFLAGS = -I/usr/include/boost1.78 -I/usr/include/python3.6m
PVAPY_LDFLAGS = -L/usr/lib64/boost1.78
PVAPY_SYS_LIBS = boost_python36 boost_numpy36
PVA_API_VERSION = 483
PVA_RPC_API_VERSION = 483
HAVE_BOOST_NUMPY = 0
HAVE_BOOST_PYTHON_NUMPY = 1
PYTHON_VERSION = 3.6
PVAPY_PYTHON = /usr/bin/python3
PVAPY_PYTHONPATH = @@project.build.directory@@/@@buildpath@@/lib/python/$(PYTHON_VERSION)/linux-x86_64
PVAPY_LD_LIBRARY_PATH = /usr/lib64/boost1.78
PVAPY_SPHINX_BUILD = /usr/bin/sphinx-build
PVAPY_EPICS_BASE = $(EPICS_BASE)
PVAPY_EPICS4_DIR = $(EPICS_BASE)
PVAPY_HOST_ARCH = linux-x86_64
PVAPY_SETUP_SH = @@project.build.directory@@/@@buildpath@@/bin/linux-x86_64/pvapy_setup_full.$(PYTHON_VERSION).sh
The LD_LIBRARY_PATH setting is not necessary.
(I started from a copy of the autoconfigured output file of my former pvaPy version.)
Okay, thanks for posting this. So, are you okay for now?
I will try to see what I get in my environment and fix stuff you found. Last night I remembered that autoconf macros actually look for system installed boost, so BOOST_ROOT may not be needed in the first place. I have not tested that in a while though.
I'm fine with my build for CODAC Core 7.3 ... next round next year. Thanks for your support and willingness to fix things. Appreciated!
The latest release supports BOOST_LIB_DIR and BOOST_INCLUDE_DIR environment variables.