File tree Expand file tree Collapse file tree 4 files changed +50
-12
lines changed
Expand file tree Collapse file tree 4 files changed +50
-12
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,26 @@ find_package(OpenMP)
9696find_package (BLAS REQUIRED)
9797message (STATUS "Blas implementation:" "${BLAS_LIBRARIES} " )
9898
99+ set (BLAS_VENDOR "Unknown" )
100+ foreach (lib ${BLAS_LIBRARIES} )
101+ if (lib MATCHES "mkl" )
102+ set (BLAS_VENDOR "Intel MKL" )
103+ elseif (lib MATCHES "openblas" )
104+ set (BLAS_VENDOR "OpenBLAS" )
105+ elseif (lib MATCHES "atlas" )
106+ set (BLAS_VENDOR "ATLAS" )
107+ elseif (lib MATCHES "vecLib" OR lib MATCHES "Accelerate" )
108+ set (BLAS_VENDOR "Apple Accelerate" )
109+ elseif (lib MATCHES "blas" )
110+ set (BLAS_VENDOR "Netlib BLAS" )
111+ endif ()
112+ endforeach ()
113+ message (STATUS "Detected BLAS vendor: ${BLAS_VENDOR} " )
114+ set (IS_INTEL_MKL FALSE )
115+ if ("${BLAS_VENDOR} " STREQUAL "Intel MKL" )
116+ set (IS_INTEL_MKL TRUE )
117+ endif ()
118+
99119# LAPACK
100120find_package (LAPACK)
101121message (STATUS "Lapack implementation:" "${LAPACK_LIBRARIES} " )
@@ -124,6 +144,10 @@ if("${BLA_VENDOR}" STREQUAL "Intel10_32"
124144 target_compile_definitions (htool INTERFACE "-DHPDDM_MKL -DHTOOL_MKL" )
125145endif ()
126146
147+ if (IS_INTEL_MKL)
148+ target_link_libraries (htool INTERFACE "-ltbb" )
149+ endif ()
150+
127151# For headers to show in IDE
128152if (NOT "${CMAKE_VERSION} " VERSION_LESS 3.1)
129153 target_sources (htool INTERFACE ${htool_include_dir} )
Original file line number Diff line number Diff line change 11@PACKAGE_INIT@
22
3+ include (CMakeFindDependencyMacro)
4+ find_package (BLAS REQUIRED)
5+ find_package (LAPACK)
6+ find_package (OpenMP)
7+ find_package (MPI)
8+
39include ("${CMAKE_CURRENT_LIST_DIR} /@PROJECT_NAME@Targets.cmake" )
410check_required_components("@PROJECT_NAME@" )
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ add_executable(Use_hmatrix use_hmatrix.cpp)
1010target_link_libraries (Use_hmatrix htool)
1111add_dependencies (build -examples Use_hmatrix)
1212
13- add_executable (Use_distributed_operator use_distributed_operator.cpp)
14- target_link_libraries (Use_distributed_operator htool)
15- add_dependencies (build -examples Use_distributed_operator)
13+ if (MPI_FOUND)
14+ add_executable (Use_distributed_operator use_distributed_operator.cpp)
15+ target_link_libraries (Use_distributed_operator htool)
16+ add_dependencies (build -examples Use_distributed_operator)
17+ endif ()
1618
17- add_executable (Use_ddm_solver use_ddm_solver.cpp)
18- target_link_libraries (Use_ddm_solver htool)
19- add_dependencies (build -examples Use_ddm_solver)
19+ if (MPI_FOUND AND HPDDM_FOUND)
20+ add_executable (Use_ddm_solver use_ddm_solver.cpp)
21+ target_link_libraries (Use_ddm_solver htool)
22+ add_dependencies (build -examples Use_ddm_solver)
23+ endif ()
2024
2125add_executable (Compression_comparison compression_comparison.cpp)
2226target_link_libraries (Compression_comparison htool)
Original file line number Diff line number Diff line change @@ -18,10 +18,14 @@ add_custom_target(build-tests-hmatrix)
1818add_dependencies (build -tests build -tests-hmatrix)
1919add_subdirectory (hmatrix)
2020
21- add_custom_target (build -tests-distributed-operator)
22- add_dependencies (build -tests build -tests-distributed-operator)
23- add_subdirectory (distributed_operator)
21+ if (MPI_FOUND)
22+ add_custom_target (build -tests-distributed-operator)
23+ add_dependencies (build -tests build -tests-distributed-operator)
24+ add_subdirectory (distributed_operator)
25+ endif ()
2426
25- add_custom_target (build -tests-solvers)
26- add_dependencies (build -tests build -tests-solvers)
27- add_subdirectory (solvers)
27+ if (MPI_FOUND AND HPDDM_FOUND)
28+ add_custom_target (build -tests-solvers)
29+ add_dependencies (build -tests build -tests-solvers)
30+ add_subdirectory (solvers)
31+ endif ()
You can’t perform that action at this time.
0 commit comments