From 5d9f764950360b5b1a469ffabdecb5da4a7caf95 Mon Sep 17 00:00:00 2001 From: David McKenna Date: Sun, 6 Oct 2024 11:18:31 +0200 Subject: [PATCH] Attempt 2 of fixing CLI headers --- CMakeLists.txt | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bd5b307..92297fd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,7 +183,7 @@ message("") message ("Configuring PSRDADA") # Disable CUDA for the PSRDADA compile -set(CUDAToolkit_FOUND "NO" CACHE INTERNAL "Disable CUDA search for PSRDADA") +set(CUDAToolkit_FOUND "NO" PARENT_SCOPE "Disable CUDA search for PSRDADA") FetchContent_Declare(psrdada_src GIT_REPOSITORY https://github.com/mirror-psrdada/mirror-psrdada-code.git GIT_TAG bf9a02e @@ -245,20 +245,18 @@ add_library(lofudpman STATIC src/lib/lofar_udp_reader.c src/lib/lofar_udp_structs.c src/lib/lofar_udp_metadata.c - src/lib/lofar_udp_time.c) - -add_library(lofudpman_cli STATIC + src/lib/lofar_udp_time.c src/CLI/lofar_cli_meta.c) -add_dependencies(lofudpman libzstd_static psrdada libhdf5 libz libh5bshuf install_python_requirements) # libfftw3fomp) ##yaml) #CSpice::cspice) -add_dependencies(lofudpman_cli lofudpman) + +add_dependencies(lofudpman libzstd_static psrdada libhdf5 libz libh5bshuf install_python_requirements dada_db dada_dbmeminfo dada_dbmetric dada_dbmonitor) # libfftw3fomp) ##yaml) #CSpice::cspice) # Include all of our library headers target_include_directories(lofudpman PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/lib ${CMAKE_CURRENT_BINARY_DIR}/src/lib # Configured headers # ${CMAKE_CURRENT_SOURCE_DIR}/src/CLI -# ${CMAKE_CURRENT_BINARY_DIR}/src/CLI # Configured headers + ${CMAKE_CURRENT_BINARY_DIR}/src/CLI # Configured headers ${CMAKE_CURRENT_SOURCE_DIR}/src/metadata ) # Include all of our dependency headers @@ -268,12 +266,7 @@ target_include_directories(lofudpman PUBLIC ${psrdada_src_SOURCE_DIR}/src/) target_include_directories(lofudpman PUBLIC ${zstd_SOURCE_DIR}/lib/) #target_include_directories(lofudpman PUBLIC ${yaml_SOURCE_DIR}/include/) -file(GLOB_RECURSE UDP_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/lib/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/lib/*.hpp" "${CMAKE_CURRENT_BINARY_DIR}/src/lib/*.h" "${CMAKE_CURRENT_BINARY_DIR}/src/lib/*.hpp") - -target_include_directories(lofudpman_cli PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/src/CLI - ${CMAKE_CURRENT_BINARY_DIR}/src/CLI -) +file(GLOB_RECURSE UDP_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/lib/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/lib/*.hpp" "${CMAKE_CURRENT_BINARY_DIR}/src/lib/*.h" "${CMAKE_CURRENT_BINARY_DIR}/src/lib/*.hpp" "${CMAKE_CURRENT_BINARY_DIR}/src/CLI/*h") # FFTW requires a libm (math) link find_library(LIB_M m REQUIRED) @@ -286,8 +279,6 @@ find_library(LIB_RT rt REQUIRED) # Required for shmem functions target_link_libraries(lofudpman PUBLIC ${LIB_RT}) #target_link_libraries(lofudpman PUBLIC yaml) -target_link_libraries(lofudpman_cli PUBLIC lofudpman) - # Set a few extra compiler options # Overwrite pre-installed libraries that we re-compile set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") @@ -296,20 +287,17 @@ set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") set_property(TARGET lofudpman PROPERTY LINKER_LANGUAGE CXX) set_property(TARGET lofudpman PROPERTY LINK_WHAT_YOU_USE ON) -set_property(TARGET lofudpman_cli PROPERTY LINKER_LANGUAGE CXX) -set_property(TARGET lofudpman_cli PROPERTY LINK_WHAT_YOU_USE ON) #set_property(TARGET lofudpman PROPERTY INTERPROCEDURAL_OPTIMIZATION ON) # Static + IPO -> build failures? # Link OpenMP target_link_libraries(lofudpman PUBLIC OpenMP::OpenMP_CXX OpenMP::OpenMP_C) -target_link_libraries(lofudpman_cli PUBLIC OpenMP::OpenMP_CXX OpenMP::OpenMP_C) # Setup the CLIs add_executable(lofar_udp_extractor ${CMAKE_CURRENT_SOURCE_DIR}/src/CLI/lofar_cli_extractor.c) add_executable(lofar_stokes_extractor ${CMAKE_CURRENT_SOURCE_DIR}/src/CLI/lofar_cli_stokes.c) -target_link_libraries(lofar_udp_extractor PUBLIC lofudpman_cli) -target_link_libraries(lofar_stokes_extractor PUBLIC lofudpman_cli) +target_link_libraries(lofar_udp_extractor PUBLIC lofudpman lofudpman) +target_link_libraries(lofar_stokes_extractor PUBLIC lofudpman lofudpman) include(CMakePackageConfigHelpers)