Commit e52c6db1 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

fix issue with the installation of libfvm and simplenn

parent 71048e5e
Pipeline #3279490 passed with stage
in 33 seconds
......@@ -15,19 +15,26 @@ Phys/FlavourTagging
# Get and make available the header only libraries simplenn and libfvm
include(FetchContent)
set(SIMPLENN_TAG version-0.1.0 CACHE STRING "simpleNN version")
set(LIBFVM_TAG version-0.1.0 CACHE STRING "libfvm version (to set according to simpleNN)")
mark_as_advanced(SIMPLENN_TAG LIBFVM_TAG)
set(libfvm_disable_tests TRUE CACHE BOOL "Disable libfvm tests")
set(simplenn_disable_tests TRUE CACHE BOOL "Disable simplenn tests")
mark_as_advanced(SIMPLENN_TAG LIBFVM_TAG libfvm_disable_tests simplenn_disable_tests)
FetchContent_Declare(libfvm
URL "https://gitlab.cern.ch/mschille/libfvm/-/archive/${LIBFVM_TAG}/libfvm-${LIBFVM_TAG}.tar.gz"
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patches/libfvm.patch
)
FetchContent_Declare(simplenn
URL "https://gitlab.cern.ch/mschille/simplenn/-/archive/${SIMPLENN_TAG}/simplenn-${SIMPLENN_TAG}.tar.gz"
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/simplenn.patch
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patches/simplenn.patch
)
FetchContent_MakeAvailable(libfvm simplenn)
# Normal business from here on
gaudi_add_header_only_library(FlavourTaggingLib
......
diff -u libfvm-src.orig/CMakeLists.txt libfvm-src/CMakeLists.txt
--- libfvm-src.orig/CMakeLists.txt 2021-02-01 19:30:30.000000000 +0100
+++ libfvm-src/CMakeLists.txt 2021-11-24 14:31:35.203013243 +0100
@@ -70,7 +70,7 @@
add_subdirectory(tests)
endif()
-set(libfvm_header_destination ${CMAKE_INSTALL_PREFIX}/include CACHE STRING
+set(libfvm_header_destination include CACHE STRING
"destination for libfvm headers, i.e. headers can be found in ${libfvm_header_destination}/libfvm")
install(TARGETS libfvm DESTINATION lib EXPORT libfvmTargets)
@@ -79,15 +79,15 @@
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/libfvm/fvm-config.h
DESTINATION ${libfvm_header_destination}/libfvm)
install(EXPORT libfvmTargets FILE libfvmTargets.cmake
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/libfvm)
+ DESTINATION lib/cmake/libfvm)
install(FILES README.md LICENSE
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libfvm)
+ DESTINATION share/doc/libfvm)
include(CMakePackageConfigHelpers)
# generate the config file that is includes the exports
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/libfvmConfig.cmake"
- INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/example"
+ INSTALL_DESTINATION "lib/cmake/example"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
@@ -100,7 +100,7 @@
# install the configuration file
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/libfvmConfig.cmake
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/libfvm)
+ DESTINATION lib/cmake/libfvm)
export(EXPORT libfvmTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/libfvmTargets.cmake")
Common subdirectories: libfvm-src.orig/include and libfvm-src/include
Common subdirectories: libfvm-src.orig/tests and libfvm-src/tests
diff -u simplenn-src.orig/CMakeLists.txt simplenn-src/CMakeLists.txt
--- simplenn-src.orig/CMakeLists.txt 2021-11-24 14:34:35.541040982 +0100
+++ simplenn-src/CMakeLists.txt 2021-11-24 14:35:40.872500188 +0100
@@ -14,8 +14,7 @@
endif()
set(libfvm_MIN_VERSION 0.1)
-find_package(libfvm QUIET)
-if (NOT libfvm_FOUND)
+if (NOT TARGET libfvm)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libfvm/include)
message(STATUS getting libfvm from git submodule)
# libfvm is not installed on system, so build the submodule
@@ -91,7 +90,7 @@
add_subdirectory(tests)
endif()
-set(simplenn_header_destination ${CMAKE_INSTALL_PREFIX}/include CACHE STRING
+set(simplenn_header_destination include CACHE STRING
"destination for libfvm headers, i.e. headers can be found in ${simplenn_header_destination}/simplenn")
install(TARGETS simplenn DESTINATION lib EXPORT simplennTargets)
@@ -100,15 +99,15 @@
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/simplenn/simplenn-config.h
DESTINATION ${simplenn_header_destination}/simplenn)
install(EXPORT simplennTargets FILE simplennTargets.cmake
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/simplenn)
+ DESTINATION lib/cmake/simplenn)
install(FILES README.md LICENSE
- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/simplenn)
+ DESTINATION share/doc/simplenn)
include(CMakePackageConfigHelpers)
# generate the config file that is includes the exports
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/simplennConfig.cmake"
- INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/example"
+ INSTALL_DESTINATION "lib/cmake/example"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
@@ -121,7 +120,7 @@
# install the configuration file
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/simplennConfig.cmake
- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/simplenn)
+ DESTINATION lib/cmake/simplenn)
export(EXPORT simplennTargets
FILE "${CMAKE_CURRENT_BINARY_DIR}/simplennTargets.cmake")
Common subdirectories: simplenn-src.orig/include and simplenn-src/include
Common subdirectories: simplenn-src.orig/libfvm and simplenn-src/libfvm
Common subdirectories: simplenn-src.orig/tests and simplenn-src/tests
--- simplenn-src/CMakeLists.txt.orig 2021-11-23 13:16:41.184000000 +0100
+++ simplenn-src/CMakeLists.txt 2021-11-23 13:17:24.307331737 +0100
@@ -14,8 +14,7 @@
endif()
set(libfvm_MIN_VERSION 0.1)
-find_package(libfvm QUIET)
-if (NOT libfvm_FOUND)
+if (NOT TARGET libfvm)
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/libfvm/include)
message(STATUS getting libfvm from git submodule)
# libfvm is not installed on system, so build the submodule
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment