Skip to content

Commit e11f0c4

Browse files
author
slopqueue
committed
Link SuiteSparse closure for libneo sparse test
The standalone libneo CMake project links build-tree archives via link_directories rather than the exported LIBNEO::sparse target, so the bare sparse archive link omitted UMFPACK/SuiteSparse and failed to link on hosts where the optional sparse library is built. Supply the complete UMFPACK dependency closure (umfpack, amd, colamd, suitesparseconfig, BLAS, LAPACK) explicitly.
1 parent d94b0c2 commit e11f0c4

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎tests/libneo/src/sparse/CMakeLists.txt‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/sparse)
22

3+
# libneo's static sparse archive wraps UMFPACK/SuiteSparse but, because this
4+
# standalone project links libneo's build-tree archives directly via
5+
# link_directories rather than the exported LIBNEO::sparse target, the
6+
# transitive UMFPACK/SuiteSparse dependencies are not pulled in automatically.
7+
# Provide the complete dependency closure explicitly so the test links on
8+
# hosts where libneo ships the optional sparse library.
9+
find_package(BLAS REQUIRED)
10+
find_package(LAPACK REQUIRED)
11+
find_library(UMFPACK_LIBRARY umfpack)
12+
find_library(AMD_LIBRARY amd)
13+
find_library(COLAMD_LIBRARY colamd)
14+
find_library(SUITESPARSE_CONFIG_LIBRARY suitesparseconfig)
15+
316
add_executable(test_sparse_mod.x test_sparse_mod.f90)
417
target_link_libraries(test_sparse_mod.x PRIVATE neo
518
sparse
19+
${UMFPACK_LIBRARY}
20+
${AMD_LIBRARY}
21+
${COLAMD_LIBRARY}
22+
${SUITESPARSE_CONFIG_LIBRARY}
23+
BLAS::BLAS
24+
LAPACK::LAPACK
625
util_for_test)
726
add_test(NAME test_sparse_mod COMMAND test_sparse_mod.x)
827

0 commit comments

Comments
 (0)