From fed93276081684f5535c295ae92cc94e8110d6a3 Mon Sep 17 00:00:00 2001 From: Maik Nijhuis <maik.nijhuis@triopsys.nl> Date: Thu, 29 Jun 2023 15:04:49 +0200 Subject: [PATCH] Use xtensor-blas and xtensor-fftw via FetchXTensor.cmake --- .gitmodules | 6 ------ CMakeLists.txt | 1 + cpp/aterms/CMakeLists.txt | 9 ++------- cpp/test/CMakeLists.txt | 14 ++++++++------ demo/CMakeLists.txt | 2 +- external/aocommon | 2 +- external/xtensor-blas | 1 - external/xtensor-fftw | 1 - 8 files changed, 13 insertions(+), 23 deletions(-) delete mode 160000 external/xtensor-blas delete mode 160000 external/xtensor-fftw diff --git a/.gitmodules b/.gitmodules index 6a228dff..746b20b3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,9 +16,3 @@ [submodule "external/oskar"] path = external/oskar url = https://gitlab.com/ska-telescope/sim/oskar.git -[submodule "external/xtensor-blas"] - path = external/xtensor-blas - url = https://github.com/xtensor-stack/xtensor-blas.git -[submodule "external/xtensor-fftw"] - path = external/xtensor-fftw - url = https://github.com/xtensor-stack/xtensor-fftw.git diff --git a/CMakeLists.txt b/CMakeLists.txt index e94f96f3..89114c6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,7 @@ find_package(Casacore REQUIRED COMPONENTS casa ms tables measures fits) include_directories(SYSTEM ${CASACORE_INCLUDE_DIRS}) # Fetch XTensor and related libraries. +set(XTENSOR_LIBRARIES xtl xtensor xtensor-blas xtensor-fftw) include(external/aocommon/CMake/FetchXTensor.cmake) # Find and include Boost headers (boost::math required for MWA beam) diff --git a/cpp/aterms/CMakeLists.txt b/cpp/aterms/CMakeLists.txt index 001d50b7..5afd5fb8 100644 --- a/cpp/aterms/CMakeLists.txt +++ b/cpp/aterms/CMakeLists.txt @@ -22,13 +22,8 @@ add_library( # Compilation must therefore generate relocatable code set_property(TARGET aterms PROPERTY POSITION_INDEPENDENT_CODE ON) -# Link to XTensor, which is loaded using FetchXTensor.cmake. -target_link_libraries(aterms xtensor) - -# Add the XTensor dependencies that use submodules. -target_include_directories( - aterms SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/external/xtensor-blas/include - ${CMAKE_SOURCE_DIR}/external/xtensor-fftw/include) +# Link to XTensor libraries, which are loaded using FetchXTensor.cmake. +target_link_libraries(aterms xtensor xtl xtensor-blas xtensor-fftw) install( FILES atermconfig.h diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index 9635adce..14a9bfe1 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -104,16 +104,18 @@ add_test(NAME download_mocks set_tests_properties(download_mocks PROPERTIES FIXTURES_SETUP mocks) add_executable(unittests ${TEST_FILENAMES}) -target_link_libraries(unittests everybeam ${Boost_LIBRARIES} schaapcommon - xtensor) +target_link_libraries( + unittests + everybeam + ${Boost_LIBRARIES} + schaapcommon + xtensor + xtl + xtensor-fftw) # Required to get the config.h header target_include_directories(unittests PRIVATE ${CMAKE_BINARY_DIR}) -# Add the XTensor dependencies that use submodules. -target_include_directories( - unittests SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/external/xtensor-fftw/include) - # Add test for automatically (re)building unittests if needed. add_test(NAME buildunittests COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target unittests) diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index d36841f0..357cc92a 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -46,7 +46,7 @@ if(CFITSIO_FOUND) tElementBeamOSKARDipole tElementBeamOSKARSphericalWave) foreach(TEST ${CFITSIO_TESTS}) add_executable(${TEST} ${TEST}.cc) - target_link_libraries(${TEST} PUBLIC beamhelper xtensor) + target_link_libraries(${TEST} PUBLIC beamhelper xtensor xtl) target_include_directories(${TEST} PUBLIC ${CMAKE_BINARY_DIR}) # These are not "tests" in the strict sense of the word, so don't add them to test stack diff --git a/external/aocommon b/external/aocommon index 8e328a11..96a67599 160000 --- a/external/aocommon +++ b/external/aocommon @@ -1 +1 @@ -Subproject commit 8e328a112239ad57200db62b450f9c05fc13f390 +Subproject commit 96a6759920f72e43d086e309d8d291fd8f5546b5 diff --git a/external/xtensor-blas b/external/xtensor-blas deleted file mode 160000 index 66ab0fa7..00000000 --- a/external/xtensor-blas +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 66ab0fa7cd53d0b914f89d4d451576a9240ea457 diff --git a/external/xtensor-fftw b/external/xtensor-fftw deleted file mode 160000 index e6be85a3..00000000 --- a/external/xtensor-fftw +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e6be85a376624da10629b6525c81759e02020308 -- GitLab