Skip to content

Commit

Permalink
Copy adolc and dependencies to install folder on linux (#2930)
Browse files Browse the repository at this point in the history
* Copy adolc and dependencies to install folder (rpath not fixed yet)

* Update CMakeLists.txt

Change so names per linux convention

* UNIX is True on APPLE, account for that to fix Mac build

* minor cleanup

* modify rpath on linux

* Add custom file to change rpath for tropter depenedencies on linuxwq

* Update CMakeLists.txt

fix filename reference on linux

* Copy libraries on linux to install folder.

* Update CMakeLists.txt

Fix library name on linux

* add script to change rpath for tropter and dependent libraries on linux using patchelf

* fix rpath of tropter libs

* Remove some unused lines and add comments

* Add debugging message line in cmake

* more diagnostic messages

* debug patchelf command

* debug gfortran and quadmath libs

* Changed option --add-rpath by --set-rpath.

In the documentation of patchelf, the option used to change the rpath is --set-rpath. --add-rpath does not exist in the documentation. More info: https://manpages.ubuntu.com/manpages/bionic/man1/patchelf.1.html

* Updated gfortran and quadmath paths

* Changing rpath for tropter.

* Added runpath for ipopt and adolc.

* Update continuous_integration.yml

* Added rpath to coinmumps and coinmetis

* Update tropter_install_linux_dependency_libraries.cmake.in

* Update tropter_install_linux_dependency_libraries.cmake.in

casadi libraries were not able to detect libcasadi.so.3.6

* Changed ORIGIN by .

* use ORIGIN for default rpath

---------

Co-authored-by: Alberto <[email protected]>
  • Loading branch information
aymanhab and AlbertoCasasOrtiz authored Feb 16, 2023
1 parent c138570 commit ca98b50
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install packages
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools patchelf

- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -639,7 +639,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install packages
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools
run: sudo apt-get update && sudo apt-get install --yes build-essential libtool autoconf pkg-config gfortran libopenblas-dev liblapack-dev freeglut3-dev libxi-dev libxmu-dev doxygen python3 python3-dev python3-numpy python3-setuptools patchelf

- name: Install SWIG
# if: steps.cache-swig.outputs.cache-hit != 'true'
Expand Down
43 changes: 37 additions & 6 deletions Vendors/tropter/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,45 @@ if(TROPTER_COPY_DEPENDENCIES AND APPLE)
install(SCRIPT "${script}")

elseif(TROPTER_COPY_DEPENDENCIES AND UNIX)
get_filename_component(gcc_libdir "${pkgcfg_lib_IPOPT_gfortran}" DIRECTORY)
message(STATUS "getting dir for ${pkgcfg_lib_IPOPT_gfortran}" )
message(STATUS "ADOLC_DIR dir ${ADOLC_DIR}" )
message(STATUS "ColPack_ROOT_DIR dir ${ColPack_ROOT_DIR}" )
message(STATUS "IPOPT_LIBDIR dir ${IPOPT_LIBDIR}" )

get_filename_component(gcc_libdir "${pkgcfg_lib_IPOPT_gfortran}" DIRECTORY)

file(GLOB gfortran "${gcc_libdir}/libgfortran*.so")
file(GLOB quadmath "${gcc_libdir}/libquadmath*.so")
file(GLOB gfortran "${gcc_libdir}/../../../x86_64-linux-gnu/libgfortran*.so*")
file(GLOB quadmath "${gcc_libdir}/../../../x86_64-linux-gnu/libquadmath*.so*")
message(STATUS "gfortran list ${gfortran}" )
message(STATUS "quadmath list ${quadmath}" )

install(FILES
${ADOLC_DIR}/lib64/libadolc.so.2.1.0 DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
install(FILES
${ADOLC_DIR}/lib64/libadolc.so.2
${ADOLC_DIR}/lib64/libadolc.so.2.1.0
${ADOLC_DIR}/lib64/libadolc.so
# /usr/local/opt/boost/lib/libboost_system.so
${ColPack_ROOT_DIR}/lib/libColPack.so.0
${ColPack_ROOT_DIR}/lib/libColPack.so
${IPOPT_LIBDIR}/libipopt.so.1.10.8
${IPOPT_LIBDIR}/libipopt.so.1
${IPOPT_LIBDIR}/libipopt.so
${IPOPT_LIBDIR}/libcoinmumps.so.1.6.0
${IPOPT_LIBDIR}/libcoinmumps.so.1
${IPOPT_LIBDIR}/libcoinmumps.so
${IPOPT_LIBDIR}/libcoinmetis.so.1.3.5
${IPOPT_LIBDIR}/libcoinmetis.so.1
${IPOPT_LIBDIR}/libcoinmetis.so

${gfortran}
${quadmath}
${gcc_libdir}/libgcc_s.so

DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(script
${CMAKE_CURRENT_BINARY_DIR}/tropter_install_linux_dependency_libraries.cmake)
configure_file(tropter_install_linux_dependency_libraries.cmake.in
"${script}" @ONLY)
install(SCRIPT "${script}")
endif()


Loading

0 comments on commit ca98b50

Please sign in to comment.