From 21b97c1e14f5317917090f839160f634e25efaee Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 20 Jan 2022 14:49:47 -0500 Subject: [PATCH 1/2] moved FindOrFetchScaLAPACK to vg cmake kit + bump vg cmake kit and BTAS tags --- CMakeLists.txt | 31 +++---------- INSTALL.md | 6 +-- bin/admin/dependency-versions-update-hook.py | 3 -- cmake/modules/FindOrFetchScaLAPACK.cmake | 46 -------------------- external/scalapackpp.cmake | 20 +++++++++ external/versions.cmake | 9 ++-- 6 files changed, 31 insertions(+), 84 deletions(-) delete mode 100644 cmake/modules/FindOrFetchScaLAPACK.cmake create mode 100644 external/scalapackpp.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ef5b3955e6..0a972c76b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,10 +47,8 @@ FetchContent_Declare( BINARY_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-build SUBBUILD_DIR ${${VG_CMAKE_KIT_PREFIX_DIR}}/cmake/vg-subbuild ) -FetchContent_GetProperties(vg_cmake_kit) -if (NOT vg_cmake_kit_POPULATED) - FetchContent_MakeAvailable(vg_cmake_kit) -endif(NOT vg_cmake_kit_POPULATED) +FetchContent_MakeAvailable(vg_cmake_kit) +list(APPEND CMAKE_MODULE_PATH "${vg_cmake_kit_SOURCE_DIR}/modules") project (TiledArray LANGUAGES) enable_language(CXX) @@ -320,34 +318,15 @@ include(external/umpire.cmake) # - no => BLAS/LAPACK will be discovered by BLAS++/LAPACK++ (loaded by BTAS) which use standard CMake modules or # their custom modules; if needed, ScaLAPACK will be discovered by BLACS++ if (ENABLE_WFN91_LINALG_DISCOVERY_KIT) - include("${vg_cmake_kit_SOURCE_DIR}/modules/FetchWfn91LinAlgModules.cmake") - if(ENABLE_SCALAPACK) - find_package(ScaLAPACK REQUIRED) - # Propagate ScaLAPACK -> BLAS/LAPACK if not set - # (ScaLAPACK necessarily contains a BLAS/LAPACK linker by standard) - # TODO: Tell David to write a macro that hides this verbosity from user space - if( NOT BLAS_LIBRARIES ) - set( BLAS_LIBRARIES "${ScaLAPACK_LIBRARIES}" CACHE STRING "BLAS LIBRARIES" ) - endif() - if( NOT LAPACK_LIBRARIES ) - set( LAPACK_LIBRARIES "${ScaLAPACK_LIBRARIES}" CACHE STRING "LAPACK LIBRARIES" ) - endif() - else(ENABLE_SCALAPACK) - find_package(LAPACK REQUIRED) - # Propagate LAPACK -> BLAS if not set - # (LAPACK necessarily contains a BLAS linker by standard) - # TODO: Tell David to write a macro that hides this verbosity from user space - if( NOT BLAS_LIBRARIES ) - set( BLAS_LIBRARIES "${LAPACK_LIBRARIES}" CACHE STRING "BLAS LIBRARIES" ) - endif() - endif(ENABLE_SCALAPACK) + include(FetchWfn91LinAlgModules) + include(FindLinalg) endif(ENABLE_WFN91_LINALG_DISCOVERY_KIT) # BTAS does a better job of building and checking Boost since it uses Boost::serialization # it also memorized the location of its config for use from install tree include(FindOrFetchBTAS) include(FindOrFetchBoost) if(ENABLE_SCALAPACK) - include(FindOrFetchScaLAPACK) + include(external/scalapackpp.cmake) endif() if (TA_ENABLE_RANGEV3) include(FindOrFetchRangeV3) diff --git a/INSTALL.md b/INSTALL.md index 1dcdfb3383..41b51f1120 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -40,7 +40,7 @@ Both methods are supported. However, for most users we _strongly_ recommend to b - Boost.Container: header-only - Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing* - Boost.Range: header-only, *only used for unit testing* -- [BTAS](https://github.com/ValeevGroup/BTAS), tag 5702259d5d207fe5a8e0c975c3cf1f610dcf381a . If usable BTAS installation is not found, TiledArray will download and compile +- [BTAS](https://github.com/ValeevGroup/BTAS), tag d971de75c492ad049471d9c29685aa8292c63a0f . If usable BTAS installation is not found, TiledArray will download and compile BTAS from source. *This is the recommended way to compile BTAS for all users*. - [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag b8069a25460b696d21cc8b739a91c9249da26575 . Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray. @@ -68,8 +68,8 @@ Optional prerequisites: - [Umpire](github.com/LLNL/Umpire) -- portable memory manager for heterogeneous platforms (tag f9640e0fa4245691cdd434e4f719ac5f7d455f82). - [Doxygen](http://www.doxygen.nl/) -- for building documentation (version 1.8.12 or later). - [ScaLAPACK](http://www.netlib.org/scalapack/) -- a distributed-memory linear algebra package. If detected, the following C++ components will also be sought and downloaded, if missing: - - [blacspp](https://github.com/wavefunction91/blacspp.git) -- a modern C++ (C++17) wrapper for BLACS (tag 88076f1706be083ead882f6ce0bfc6884a72fc03) - - [scalapackpp](https://github.com/wavefunction91/scalapackpp.git) -- a modern C++ (C++17) wrapper for ScaLAPACK (tag 28433942197aee141cd9e96ed1d00f6ec7b902cb) + - [scalapackpp](https://github.com/wavefunction91/scalapackpp.git) -- a modern C++ (C++17) wrapper for ScaLAPACK (tag 28433942197aee141cd9e96ed1d00f6ec7b902cb); pulls and builds the following additional prerequisite + - [blacspp](https://github.com/wavefunction91/blacspp.git) -- a modern C++ (C++17) wrapper for BLACS - Python3 interpreter -- to test (optionally-built) Python bindings - [Range-V3](https://github.com/ericniebler/range-v3.git) -- a Ranges library that served as the basis for Ranges component of C++20; only used for some unit testing of the functionality anticipated to be supported by future C++ standards. diff --git a/bin/admin/dependency-versions-update-hook.py b/bin/admin/dependency-versions-update-hook.py index 99b5eceda8..f7aa4b8345 100755 --- a/bin/admin/dependency-versions-update-hook.py +++ b/bin/admin/dependency-versions-update-hook.py @@ -152,9 +152,6 @@ def replace_dep_id(topsrc, file_ext, dep_name, old_id, new_id, search_prefix = ' # Umpire tag in INSTALL.md any_files_changed |= replace_dep_id(topsrc, 'md', 'Umpire', umpire_old_tag, umpire_new_tag, '', '') -# BLACSPP tag in INSTALL.md -any_files_changed |= replace_dep_id(topsrc, 'md', 'BLACSPP', blacspp_old_tag, blacspp_new_tag, '', '') - # SCALAPACKPP tag in INSTALL.md any_files_changed |= replace_dep_id(topsrc, 'md', 'SCALAPACKPP', scalapackpp_old_tag, scalapackpp_new_tag, '', '') diff --git a/cmake/modules/FindOrFetchScaLAPACK.cmake b/cmake/modules/FindOrFetchScaLAPACK.cmake deleted file mode 100644 index 5820534ab4..0000000000 --- a/cmake/modules/FindOrFetchScaLAPACK.cmake +++ /dev/null @@ -1,46 +0,0 @@ - -# -*- mode: cmake -*- - -################### -# Find dependencies related to ScaLAPACK -################### - -if( NOT TARGET scalapackpp::scalapackpp ) - find_package( scalapackpp CONFIG QUIET HINTS ${SCALAPACKPP_ROOT_DIR} ) -endif() - -if( TARGET scalapackpp::scalapackpp ) - - message( STATUS "Found scalapackpp!" ) - -else() - - message(STATUS "Could not find scalapackpp! Building..." ) - include(FetchContent) - - FetchContent_Declare( scalapackpp - GIT_REPOSITORY https://github.com/wavefunction91/scalapackpp.git - GIT_TAG ${TA_TRACKED_SCALAPACKPP_TAG} - ) - FetchContent_MakeAvailable( scalapackpp ) - - # propagate MPI_CXX_SKIP_MPICXX=ON - target_compile_definitions( blacspp PRIVATE ${MPI_CXX_COMPILE_DEFINITIONS} ) - target_compile_definitions( scalapackpp PRIVATE ${MPI_CXX_COMPILE_DEFINITIONS} ) - - install( TARGETS blacspp scalapackpp EXPORT tiledarray COMPONENT tiledarray ) - # Add these dependencies to External - add_dependencies(External-tiledarray scalapackpp ) - - # set {blacspp,scalapackpp}_CONFIG to the install location so that we know where to find it - set(blacspp_CONFIG ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/blacspp/blacspp-config.cmake) - set(scalapackpp_CONFIG ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/scalapackpp/scalapackpp-config.cmake) - -endif() - -add_library( TiledArray_SCALAPACK INTERFACE ) -target_link_libraries( TiledArray_SCALAPACK INTERFACE scalapackpp::scalapackpp blacspp::blacspp) - -install( TARGETS TiledArray_SCALAPACK EXPORT tiledarray COMPONENT tiledarray ) - -set( TILEDARRAY_HAS_SCALAPACK 1 ) diff --git a/external/scalapackpp.cmake b/external/scalapackpp.cmake new file mode 100644 index 0000000000..2bc43b5d9c --- /dev/null +++ b/external/scalapackpp.cmake @@ -0,0 +1,20 @@ +if (NOT TARGET scalapackpp::scalapackpp) + set(VGCMAKEKIT_TRACKED_SCALAPACKPP_TAG ${TA_TRACKED_SCALAPACKPP_TAG}) + include(FindOrFetchScaLAPACKPP) +endif() + +# built {blacs,scalapack}pp as a subproject? +if (TARGET blacspp AND TARGET scalapackpp) + install( TARGETS blacspp scalapackpp EXPORT tiledarray COMPONENT tiledarray ) + # Add these dependencies to External + add_dependencies(External-tiledarray scalapackpp ) +endif() + +if (TARGET blacspp::blacspp AND TARGET scalapackpp::scalapackpp) + add_library( TiledArray_SCALAPACK INTERFACE ) + target_link_libraries( TiledArray_SCALAPACK INTERFACE scalapackpp::scalapackpp blacspp::blacspp) + + install( TARGETS TiledArray_SCALAPACK EXPORT tiledarray COMPONENT tiledarray ) + + set( TILEDARRAY_HAS_SCALAPACK 1 ) +endif() diff --git a/external/versions.cmake b/external/versions.cmake index 338246146a..57bb1c3e22 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -1,7 +1,7 @@ # for each dependency track both current and previous id (the variable for the latter must contain PREVIOUS) # to be able to auto-update them -set(TA_TRACKED_VGCMAKEKIT_TAG 7d6fc0f790588eba4ea5006eccff86bb3d3903fe) +set(TA_TRACKED_VGCMAKEKIT_TAG d29dc6177884557d13fb87f364eb76350e8ddc9c) # Boost explicitly downgraded to 1.59 from 1.68 set(TA_TRACKED_BOOST_VERSION 1.59) @@ -24,8 +24,8 @@ set(TA_TRACKED_MADNESS_PREVIOUS_TAG f9aa38e4f46c5ea6ca6bbceb945beae5230f9ad0) set(TA_TRACKED_MADNESS_VERSION 0.10.1) set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1) -set(TA_TRACKED_BTAS_TAG 5702259d5d207fe5a8e0c975c3cf1f610dcf381a) -set(TA_TRACKED_BTAS_PREVIOUS_TAG e540f265e1d16cc35b1b6726470160ed0046c530) +set(TA_TRACKED_BTAS_TAG d971de75c492ad049471d9c29685aa8292c63a0f) +set(TA_TRACKED_BTAS_PREVIOUS_TAG 5702259d5d207fe5a8e0c975c3cf1f610dcf381a) set(TA_TRACKED_CUTT_TAG 0e8685bf82910bc7435835f846e88f1b39f47f09) set(TA_TRACKED_CUTT_PREVIOUS_TAG 592198b93c93b7ca79e7900b9a9f2e79f9dafec3) @@ -33,9 +33,6 @@ set(TA_TRACKED_CUTT_PREVIOUS_TAG 592198b93c93b7ca79e7900b9a9f2e79f9dafec3) set(TA_TRACKED_UMPIRE_TAG f9640e0fa4245691cdd434e4f719ac5f7d455f82) set(TA_TRACKED_UMPIRE_PREVIOUS_TAG v6.0.0) -#set(TA_TRACKED_BLACSPP_TAG 20cfd414c5b719be1c958f4a2d57abef06df83b6 ) -#set(TA_TRACKED_BLACSPP_PREVIOUS_TAG da4ada57e578cf944325a7152164306742551596 ) - set(TA_TRACKED_SCALAPACKPP_TAG bf17a7246af38d34523bd0099b01d9961d06d311 ) set(TA_TRACKED_SCALAPACKPP_PREVIOUS_TAG 043f85d7f31ec6009740ab466bcb5008af7b0814 ) From dfa74531cbf0dc4e43ad85b0116fada525383ca2 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 20 Jan 2022 15:42:38 -0500 Subject: [PATCH 2/2] bump MADNESS version --- INSTALL.md | 2 +- external/versions.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 41b51f1120..8d40aea23e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -42,7 +42,7 @@ Both methods are supported. However, for most users we _strongly_ recommend to b - Boost.Range: header-only, *only used for unit testing* - [BTAS](https://github.com/ValeevGroup/BTAS), tag d971de75c492ad049471d9c29685aa8292c63a0f . If usable BTAS installation is not found, TiledArray will download and compile BTAS from source. *This is the recommended way to compile BTAS for all users*. -- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag b8069a25460b696d21cc8b739a91c9249da26575 . +- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 9357dccd0cf91c0857d05ceb5f10b833fcd63308 . Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray. If usable MADNESS installation is not found, TiledArray will download and compile MADNESS from source. *This is the recommended way to compile MADNESS for all users*. diff --git a/external/versions.cmake b/external/versions.cmake index 57bb1c3e22..e39739c3c8 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -19,8 +19,8 @@ set(TA_INSTALL_EIGEN_PREVIOUS_VERSION 3.3.7) set(TA_INSTALL_EIGEN_URL_HASH SHA256=b4c198460eba6f28d34894e3a5710998818515104d6e74e5cc331ce31e46e626) set(TA_INSTALL_EIGEN_PREVIOUS_URL_HASH MD5=b9e98a200d2455f06db9c661c5610496) -set(TA_TRACKED_MADNESS_TAG b8069a25460b696d21cc8b739a91c9249da26575) -set(TA_TRACKED_MADNESS_PREVIOUS_TAG f9aa38e4f46c5ea6ca6bbceb945beae5230f9ad0) +set(TA_TRACKED_MADNESS_TAG 9357dccd0cf91c0857d05ceb5f10b833fcd63308) +set(TA_TRACKED_MADNESS_PREVIOUS_TAG b8069a25460b696d21cc8b739a91c9249da26575) set(TA_TRACKED_MADNESS_VERSION 0.10.1) set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1)