Skip to content

Commit

Permalink
Attempt 2 of fixing CLI headers
Browse files Browse the repository at this point in the history
  • Loading branch information
David-McKenna committed Oct 6, 2024
1 parent 8b8b976 commit 5d9f764
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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 "")
Expand All @@ -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)
Expand Down

0 comments on commit 5d9f764

Please sign in to comment.