install location is hardcoded to /opt/jsd
Closed this issue · 0 comments
NicolasRouquette commented
I need to build this package in a High-Performance Computing (HPC) cluster that runs read-only Apptainer containers.
With the following settings in CMakeLists.txt:
######### Install Rules #########
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(CMAKE_INSTALL_PREFIX /opt/jsd)
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/jsd DESTINATION include)
install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/ DESTINATION bin)
install(TARGETS jsd-lib DESTINATION lib)
install(TARGETS jsd_slaveinfo DESTINATION bin)
endif()
I get write errors because /opt is read-only.
To make /opt/jsd writable, I would have to add to Apptainer --bind options; however, this runs into another subtle limitation: Apptainer needs to create bind mounts for all the other folders in /opt. It is then easy to have a container with lots of /opt/* folders that exceed the bind mount limitation of the HPC environment.
More importantly, the above settings effectively ignore an explicit directive to install in a separate location, i.e. cmake -DCMAKE_INSTALL_PREFIX=/foo/bar would be ignored.