diff --git a/CMakeLists.txt b/CMakeLists.txt index ce3ea9609..71eb64d50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,14 +48,16 @@ FetchContent_Declare( linalg_cmake_modules ) FetchContent_MakeAvailable( linalg_cmake_modules ) set(CMAKE_MODULE_PATH "${linalg_cmake_modules_SOURCE_DIR}" ${CMAKE_MODULE_PATH}) +message("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}") ################################################################################ # bilke cmake modules FetchContent_Declare( bilke_cmake_modules GIT_REPOSITORY https://github.com/bilke/cmake-modules.git - GIT_TAG main + GIT_TAG master ) FetchContent_MakeAvailable( bilke_cmake_modules ) set(CMAKE_MODULE_PATH "${bilke_cmake_modules_SOURCE_DIR}" ${CMAKE_MODULE_PATH}) +message("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}") ################################################################################ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${POLYQUANT_BINARY_DIR}/lib CACHE PATH "Single output directory for building all libraries.") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${POLYQUANT_BINARY_DIR}/bin CACHE PATH "Single output directory for building all executables.") @@ -146,6 +148,12 @@ endif(POLYQUANT_DOC) # OpenMP for parallelization find_package(OpenMP REQUIRED) ######################################## +# LinAlg +# set this list to prioritize a BLAS type +set( BLAS_PREFERENCE_LIST "BLIS" "IntelMKL" "IBMESSL" "OpenBLAS" "ReferenceBLAS" ) +find_package( BLAS REQUIRED ) +find_package( LAPACK REQUIRED ) +######################################## # json parsing FetchContent_Declare( nlohmann_json @@ -188,11 +196,6 @@ if (NOT TARGET Eigen3::Eigen) FetchContent_MakeAvailable(Eigen) endif (NOT TARGET Eigen3::Eigen) ######################################## -# LinAlg -# set this list to prioritize a BLAS type -set( LinAlg_BLAS_PREFERENCE_LIST "BLIS" "IntelMKL" "IBMESSL" "OpenBLAS" "ReferenceBLAS" ) -find_package(LinAlg REQUIRED) -######################################## # Spectra for sparse math FetchContent_Declare( spectra diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f9e4d6f4..2b243448c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,8 @@ add_subdirectory(scf) add_subdirectory(ci) # include_directories(${MKL_INCLUDE_DIR}) -target_link_libraries(polyquant_lib PUBLIC LinAlg::linalg) +target_link_libraries(polyquant_lib PUBLIC BLAS::BLAS) +target_link_libraries(polyquant_lib PUBLIC LAPACK::LAPACK) target_link_libraries(polyquant_lib PUBLIC cxxopts) target_link_libraries(polyquant_lib PUBLIC OpenMP::OpenMP_CXX) if(Eigen3_FOUND) diff --git a/src/calculation/calculation.cpp b/src/calculation/calculation.cpp index f29434d30..f30a7269a 100644 --- a/src/calculation/calculation.cpp +++ b/src/calculation/calculation.cpp @@ -634,7 +634,7 @@ void POLYQUANT_CALCULATION::dump_post_mf_for_qmcpack(std::string &filename) { dets[idx_part][idx_spin].resize(this->ci_calc->detset.N_dets, std::vector(N_bits, 0ul)); } } -#pragma omp parallel +#pragma omp parallel for for (auto i = 0; i < this->ci_calc->detset.N_dets; i++) { auto i_unfold = this->ci_calc->detset.det_idx_unfold(i); for (int idx_part = 0; idx_part < this->input_molecule->quantum_particles.size(); idx_part++) {