diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bc524337b..101b1b0d16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,9 +169,6 @@ option(TA_TRACE_GLOBAL_COMM_STATS "Enable tracing of communication stats of glob add_feature_info(TASK_TRACE_DEBUG TA_TRACE_GLOBAL_COMM_STATS "Debug communication stats of global objects (DistEval's and DIstributedStorage) TiledArray") set(TILEDARRAY_ENABLE_GLOBAL_COMM_STATS_TRACE ${TA_TRACE_GLOBAL_COMM_STATS}) -option(TA_RANGEV3 "Enable Range-V3 library" OFF) -add_feature_info(TA_RANGEV3 TA_RANGEV3 "Range-V3 ranges library") - option(TA_TTG "Enable search/build of TTG library" OFF) add_feature_info(TA_TTG TA_TTG "TTG library") @@ -310,6 +307,7 @@ endif() if(ENABLE_HIP) include(external/hip.cmake) endif() +include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchRangeV3.cmake) include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchMADWorld.cmake) if (TA_TTG) include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchTTG.cmake) @@ -347,11 +345,7 @@ if(CCACHE) set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE}" CACHE STRING "Compiler launcher to use for compiling C++") set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE}" CACHE STRING "Compiler launcher to use for compiling C") endif(CCACHE) -# 2. range-v3 -if (TA_RANGEV3) - include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchRangeV3.cmake) -endif(TA_RANGEV3) -# 3. TTG +# 2. TTG # N.B. make sure TA configures MADNESS correctly #if (TA_TTG) # include(${PROJECT_SOURCE_DIR}/cmake/modules/FindOrFetchTTG.cmake) diff --git a/INSTALL.md b/INSTALL.md index 3f669073f0..d18ee99025 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -40,6 +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* +- [Range-V3](https://github.com/ericniebler/range-v3.git) -- a Ranges library that served as the basis for Ranges component of C++20 and later. - [BTAS](http://github.com/ValeevGroup/BTAS), tag 4e8f5233aa7881dccdfcc37ce07128833926d3c2 . 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 8788aea9758bfe6479cc23d39e6c77b7528009db . @@ -74,7 +75,6 @@ Optional prerequisites: - [scalapackpp](https://github.com/wavefunction91/scalapackpp.git) -- a modern C++ (C++17) wrapper for ScaLAPACK (tag 6397f52cf11c0dfd82a79698ee198a2fce515d81); 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. - [TTG](https://github.com/TESSEorg/ttg.git) -- C++ implementation of the Template Task Graph programming model for fine-grained flow-graph composition of distributed memory programs (tag 3fe4a06dbf4b05091269488aab38223da1f8cb8e). Many of these dependencies can be installed with a package manager, @@ -416,7 +416,6 @@ support may be added. * `TA_ASSERT_POLICY` -- Set to `TA_ASSERT_IGNORE` to disable `TA_ASSERT` assertions, `TA_ASSERT_THROW` to cause `TA_ASSERT` assertions to throw, `TA_ASSERT_ABORT` to cause `TA_ASSERT` assertions to abort. The default is `TA_ASSERT_IGNORE` if CMake uses a single-configuration generator and`CMAKE_BUILD_TYPE` is set to `Release` or `MinSizeRel`, else the default is `TA_ASSERT_THROW`. * `BUILD_TESTING` -- Set of `OFF` to disable building unit tests. The default is `ON`. * `TA_TRACE_TASKS` -- Set to `ON` to enable tracing of MADNESS tasks using custom task tracer. Note that standard profilers/tracers are generally useless (except in the trivial cases) with MADWorld-based programs since the submission context of tasks is not captured by standard tracing tools; this makes it impossible in a nontrivial program to attribute tasks to source code. WARNING: task tracing his will greatly increase the memory requirements. [Default=OFF]. -* `TA_RANGEV3` -- Set to `ON` to find or fetch the Range-V3 library and enable additional tests of TA components with constructs anticipated to be supported in the future. [Default=OFF]. * `TA_TTG` -- Set to `ON` to find or fetch the TTG library. [Default=OFF]. * `TA_SIGNED_1INDEX_TYPE` -- Set to `OFF` to use unsigned 1-index coordinate type (default for TiledArray 1.0.0-alpha.2 and older). The default is `ON`, which enables the use of negative indices in coordinates. * `TA_MAX_SOO_RANK_METADATA` -- Specifies the maximum rank for which to use Small Object Optimization (hence, avoid the use of the heap) for metadata. The default is `8`. diff --git a/cmake/tiledarray-config.cmake.in b/cmake/tiledarray-config.cmake.in index 3d1484013b..c6d0a49822 100644 --- a/cmake/tiledarray-config.cmake.in +++ b/cmake/tiledarray-config.cmake.in @@ -18,6 +18,11 @@ include(CMakeFindDependencyMacro) @Boost_CONFIG_FILE_CONTENTS@ +if (NOT TARGET range-v3::range-v3) + get_filename_component(range-v3_DIR "@range-v3_CONFIG@" DIRECTORY) + find_dependency(range-v3 QUIET REQUIRED HINTS "${range-v3_DIR}") +endif(NOT TARGET range-v3::range-v3) + if (NOT TARGET BTAS::BTAS) get_filename_component(BTAS_DIR "@BTAS_CONFIG@" DIRECTORY) find_dependency(BTAS 1.0.0 QUIET CONFIG REQUIRED HINTS "${BTAS_DIR}") diff --git a/external/versions.cmake b/external/versions.cmake index e04b066573..e6656d7c24 100644 --- a/external/versions.cmake +++ b/external/versions.cmake @@ -28,8 +28,8 @@ set(TA_TRACKED_UMPIRE_PREVIOUS_TAG v2023.06.0) set(TA_TRACKED_SCALAPACKPP_TAG 6397f52cf11c0dfd82a79698ee198a2fce515d81) set(TA_TRACKED_SCALAPACKPP_PREVIOUS_TAG 711ef363479a90c88788036f9c6c8adb70736cbf ) -set(TA_TRACKED_RANGEV3_TAG 2e0591c57fce2aca6073ad6e4fdc50d841827864) -set(TA_TRACKED_RANGEV3_PREVIOUS_TAG dbdaa247a25a0daa24c68f1286a5693c72ea0006) +set(TA_TRACKED_RANGEV3_TAG 0.12.0) +set(TA_TRACKED_RANGEV3_PREVIOUS_TAG 2e0591c57fce2aca6073ad6e4fdc50d841827864) set(TA_TRACKED_TTG_URL https://github.com/TESSEorg/ttg) set(TA_TRACKED_TTG_TAG 3fe4a06dbf4b05091269488aab38223da1f8cb8e) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 76bb14e4b1..afb1e1c6a6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -148,11 +148,8 @@ target_include_directories(${executable} PRIVATE # is too late to do this here; must set TA_ERROR=throw if want to run unit tests target_compile_definitions(${executable} PRIVATE TILEDARRAY_NO_USER_ERROR_MESSAGES=1 MADNESS_DISPLAY_EXCEPTION_BREAK_MESSAGE=0) -# optional dependencies -if (TARGET range-v3::range-v3) - target_link_libraries(${executable} PRIVATE range-v3::range-v3) - target_compile_definitions(${executable} PRIVATE TILEDARRAY_HAS_RANGEV3=1) -endif (TARGET range-v3::range-v3) +# always test range-v3 +target_link_libraries(${executable} PRIVATE range-v3::range-v3) # Add targets add_test(tiledarray/unit/build "${CMAKE_COMMAND}" --build ${PROJECT_BINARY_DIR} --target ${executable}) diff --git a/tests/block_range.cpp b/tests/block_range.cpp index 5d8431fa41..47f9d88e8f 100644 --- a/tests/block_range.cpp +++ b/tests/block_range.cpp @@ -25,9 +25,7 @@ #include #include -#ifdef TILEDARRAY_HAS_RANGEV3 #include -#endif #include "TiledArray/block_range.h" #include "range_fixture.h" @@ -229,14 +227,12 @@ BOOST_AUTO_TEST_CASE(block) { BlockRange br2(r, boost::combine(lobounds, upbounds)); BOOST_CHECK_EQUAL(br2, bref); -#ifdef TILEDARRAY_HAS_RANGEV3 // using zipped ranges of bounds (using Ranges-V3) // need to #include BOOST_CHECK_NO_THROW( BlockRange br3(r, ranges::views::zip(lobounds, upbounds))); BlockRange br3(r, ranges::views::zip(lobounds, upbounds)); BOOST_CHECK_EQUAL(br3, bref); -#endif // using nested initializer_list BOOST_CHECK_NO_THROW(BlockRange br4(r, {{0, 4}, {1, 6}, {2, 8}})); diff --git a/tests/expressions_fixture.h b/tests/expressions_fixture.h index 8e527465d1..94c09a7449 100644 --- a/tests/expressions_fixture.h +++ b/tests/expressions_fixture.h @@ -28,9 +28,7 @@ #include #include -#ifdef TILEDARRAY_HAS_RANGEV3 #include -#endif #include diff --git a/tests/range.cpp b/tests/range.cpp index a20f185d44..71f20aeb3f 100644 --- a/tests/range.cpp +++ b/tests/range.cpp @@ -19,9 +19,7 @@ #include #include -#ifdef TILEDARRAY_HAS_RANGEV3 #include -#endif #include #include @@ -169,10 +167,8 @@ BOOST_AUTO_TEST_CASE(constructors) { BOOST_REQUIRE_NO_THROW(Range r2(p2, f2)); // uses index containers BOOST_REQUIRE_NO_THROW( Range r(boost::combine(p2, f2))); // uses zipped range of p2 and f2 -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_REQUIRE_NO_THROW( Range r(ranges::views::zip(p2, f2))); // uses zipped range of p2 and f2 -#endif BOOST_CHECK_THROW(Range r2(f2, p2), Exception); // lobound > upbound Range r2(p2, f2); @@ -190,11 +186,9 @@ BOOST_AUTO_TEST_CASE(constructors) { Range should_be_copy_of_r2( boost::combine(p2, f2)); // uses zipped range of p2 and f2 BOOST_CHECK_EQUAL(r2, should_be_copy_of_r2); -#ifdef TILEDARRAY_HAS_RANGEV3 Range should_be_another_copy_of_r2( ranges::views::zip(p2, f2)); // uses zipped range of p2 and f2 BOOST_CHECK_EQUAL(r2, should_be_another_copy_of_r2); -#endif // test the rest of bound-based ctors { @@ -243,10 +237,8 @@ BOOST_AUTO_TEST_CASE(constructors) { // uses zipped bounds Range r7(boost::combine(std::vector{0, 1, 2}, std::array{4, 6, 8})); BOOST_CHECK_EQUAL(ref, r7); -#ifdef TILEDARRAY_HAS_RANGEV3 -// Range r8(ranges::views::zip(std::array{0, 1, 2}, std::vector{4, 6, 8})); -// BOOST_CHECK_EQUAL(ref, r8); -#endif + // Range r8(ranges::views::zip(std::array{0, 1, 2}, std::vector{4, 6, + // 8})); BOOST_CHECK_EQUAL(ref, r8); // zipped bounds with Eigen vectors { @@ -278,11 +270,9 @@ BOOST_AUTO_TEST_CASE(constructors) { Range r14(boost::combine(iv({0, 1, 2}), iv(iv({0, 1, 2}) + iv(4, 5, 6)))); BOOST_CHECK_EQUAL(ref, r14); -#ifdef TILEDARRAY_HAS_RANGEV3 -// this requires Eigen ~3.4 (3.3.90 docs suggest it should be sufficient) -// Range r15(ranges::views::zip(iv(0, 1, 2), iv(4, 6, 8))); -// BOOST_CHECK_EQUAL(ref, r15); -#endif + // this requires Eigen ~3.4 (3.3.90 docs suggest it should be sufficient) + // Range r15(ranges::views::zip(iv(0, 1, 2), iv(4, 6, 8))); + // BOOST_CHECK_EQUAL(ref, r15); } // container::svector as bounds diff --git a/tests/sparse_shape.cpp b/tests/sparse_shape.cpp index a79d7ceb8e..8bf1c4ae3b 100644 --- a/tests/sparse_shape.cpp +++ b/tests/sparse_shape.cpp @@ -24,9 +24,7 @@ */ #include -#ifdef TILEDARRAY_HAS_RANGEV3 #include -#endif #include "TiledArray/sparse_shape.h" #include "sparse_shape_fixture.h" @@ -350,12 +348,10 @@ BOOST_AUTO_TEST_CASE(block) { sparse_shape.block(boost::combine(lower, upper))); auto result3 = sparse_shape.block(boost::combine(lower, upper)); BOOST_CHECK_EQUAL(result, result3); -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_REQUIRE_NO_THROW( sparse_shape.block(ranges::views::zip(lower, upper))); auto result4 = sparse_shape.block(ranges::views::zip(lower, upper)); BOOST_CHECK_EQUAL(result, result4); -#endif } else { // Check that block throws an exception with a bad block range BOOST_CHECK_TA_ASSERT(sparse_shape.block(lower, upper), @@ -447,13 +443,11 @@ BOOST_AUTO_TEST_CASE(block_scale) { sparse_shape.block(boost::combine(lower, upper), factor)); auto result3 = sparse_shape.block(boost::combine(lower, upper), factor); BOOST_CHECK_EQUAL(result, result3); -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_REQUIRE_NO_THROW( sparse_shape.block(ranges::views::zip(lower, upper), factor)); auto result4 = sparse_shape.block(ranges::views::zip(lower, upper), factor); BOOST_CHECK_EQUAL(result, result4); -#endif } else { // Check that block throws an exception with a bad block range @@ -548,13 +542,11 @@ BOOST_AUTO_TEST_CASE(block_perm) { sparse_shape.block(boost::combine(lower, upper), perm)); auto result3 = sparse_shape.block(boost::combine(lower, upper), perm); BOOST_CHECK_EQUAL(result, result3); -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_REQUIRE_NO_THROW( sparse_shape.block(ranges::views::zip(lower, upper), perm)); auto result4 = sparse_shape.block(ranges::views::zip(lower, upper), perm); BOOST_CHECK_EQUAL(result, result4); -#endif } else { // Check that block throws an exception with a bad block range @@ -653,13 +645,11 @@ BOOST_AUTO_TEST_CASE(block_scale_perm) { auto result3 = sparse_shape.block(boost::combine(lower, upper), factor, perm); BOOST_CHECK_EQUAL(result, result3); -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_REQUIRE_NO_THROW( sparse_shape.block(ranges::views::zip(lower, upper), factor, perm)); auto result4 = sparse_shape.block(ranges::views::zip(lower, upper), factor, perm); BOOST_CHECK_EQUAL(result, result4); -#endif } else { // Check that block throws an exception with a bad block range diff --git a/tests/tensor.cpp b/tests/tensor.cpp index be214ef841..99b10fc7b7 100644 --- a/tests/tensor.cpp +++ b/tests/tensor.cpp @@ -18,9 +18,7 @@ */ #include -#ifdef TILEDARRAY_HAS_RANGEV3 #include -#endif #include #include "TiledArray/math/gemm_helper.h" @@ -709,9 +707,7 @@ BOOST_AUTO_TEST_CASE(block) { // need to #include BOOST_CHECK_NO_THROW(s.block(boost::combine(lobound, upbound))); -#ifdef TILEDARRAY_HAS_RANGEV3 BOOST_CHECK_NO_THROW(s.block(ranges::views::zip(lobound, upbound))); -#endif auto sview0 = s.block(lobound, upbound); BOOST_CHECK(sview0.range().includes(lobound));