Skip to content

Commit

Permalink
Find system packages
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 10, 2024
1 parent 59f298f commit 3c1e132
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions Option.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ if (NOT CUSTOM_OPENBLAS STREQUAL "")
link_directories(${CUSTOM_OPENBLAS})
endif ()

if (NOT USE_SYS_LIB)
if (USE_SYS_LIB)
find_package(OpenBLAS REQUIRED)
else()
link_directories(Libs/${SP_EXTERNAL_LIB_PATH})
endif ()

Expand Down Expand Up @@ -226,12 +228,18 @@ if (USE_HDF5)
message(STATUS "Found HDF5 header: ${HDF5_HEADER}")
endif ()
else ()
include_directories(Include/hdf5)
include_directories(Include/hdf5-${SP_EXTERNAL_LIB_PATH})
if (COMPILER_IDENTIFIER MATCHES "vs")
link_libraries(libhdf5_hl libhdf5 shlwapi)
if (USE_SYS_LIB)
find_package(HDF5 REQUIRED)
include_directories(${HDF5_INCLUDE_DIRS})
link_libraries(${HDF5_LIBRARIES})
else ()
link_libraries(hdf5_hl hdf5)
include_directories(Include/hdf5)
include_directories(Include/hdf5-${SP_EXTERNAL_LIB_PATH})
if (COMPILER_IDENTIFIER MATCHES "vs")
link_libraries(libhdf5_hl libhdf5 shlwapi)
else ()
link_libraries(hdf5_hl hdf5)
endif ()
endif ()
endif ()
else ()
Expand All @@ -250,17 +258,23 @@ endif ()
if (BUILD_MULTITHREAD)
message(STATUS "USING TBB LIBRARY")
add_compile_definitions(SUANPAN_MT)
if (COMPILER_IDENTIFIER MATCHES "gcc-win")
link_libraries(tbb12)
if (USE_SYS_LIB)
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})
link_libraries(${TBB_LIBRARIES})
else ()
link_libraries(tbb)
endif ()
option(USE_TBB_ALLOC "Use tbb memory allocator. Enable if no other allocators will be used." OFF)
if (USE_TBB_ALLOC)
# for armadillo to use tbb allocator
add_compile_definitions(ARMA_USE_TBB_ALLOC)
include_directories(Include/oneapi) # because armadillo assumes oneapi be in the include path
link_libraries(tbbmalloc tbbmalloc_proxy)
if (COMPILER_IDENTIFIER MATCHES "gcc-win")
link_libraries(tbb12)
else ()
link_libraries(tbb)
endif ()
option(USE_TBB_ALLOC "Use tbb memory allocator. Enable if no other allocators will be used." OFF)
if (USE_TBB_ALLOC)
# for armadillo to use tbb allocator
add_compile_definitions(ARMA_USE_TBB_ALLOC)
include_directories(Include/oneapi) # because armadillo assumes oneapi be in the include path
link_libraries(tbbmalloc tbbmalloc_proxy)
endif ()
endif ()
endif ()

Expand Down

0 comments on commit 3c1e132

Please sign in to comment.