diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b62cca20..b66fbdcf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: run: > sudo apt-get update && sudo apt-get install lsb-release wget software-properties-common && - wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 13 && + wget -O /tmp/llvm.sh https://apt.llvm.org/llvm.sh && sudo chmod +x /tmp/llvm.sh && sudo /tmp/llvm.sh 15 && sudo apt-get install clang-15 g++-12 @@ -67,6 +67,11 @@ jobs: pip3 install mako numpy scipy mpi4py pip3 install -r requirements.txt + - name: add clang cxxflags + if: ${{ contains(matrix.cxx, 'clang') }} + run: + echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV + - name: Build & Install TRIQS env: CC: ${{ matrix.cc }} diff --git a/.gitignore b/.gitignore index 226118b4..d38f325c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ compile_commands.json +doc/_autosummary doc/cpp2rst_generated diff --git a/CMakeLists.txt b/CMakeLists.txt index a5d9bd95..36513568 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ endif() # Documentation option(Build_Documentation "Build documentation" OFF) -if(Build_Documentation AND NOT PythonSupport) +if(NOT IS_SUBPROJECT AND (Build_Documentation AND NOT PythonSupport)) message(FATAL_ERROR "Build_Documentation=ON requires PythonSupport to be enabled") endif() @@ -111,16 +111,18 @@ target_compile_options(${PROJECT_NAME}_warnings $<$:-Wno-comma-subscript> $<$:-Wshadow=local> $<$:-Wno-attributes> - $<$:-Wno-deprecated-comma-subscript> - $<$:-Wno-unknown-warning-option> - $<$:-Wshadow> - $<$:-Wno-gcc-compat> - $<$:-Wno-c++20-extensions> + $<$:-Wno-deprecated-comma-subscript> + $<$:-Wno-unknown-warning-option> + $<$:-Wshadow> + $<$:-Wno-gcc-compat> + $<$:-Wno-c++20-extensions> + $<$:-Wno-c++20-compat> $<$:-Wno-deprecated-comma-subscript> $<$:-Wno-unknown-warning-option> $<$:-Wshadow> $<$:-Wno-gcc-compat> $<$:-Wno-c++20-extensions> + $<$:-Wno-c++20-compat> ) # ############# @@ -148,7 +150,7 @@ if(PythonSupport) endif() # Docs -if(Build_Documentation) +if(NOT IS_SUBPROJECT AND Build_Documentation) add_subdirectory(doc) endif() diff --git a/c++/triqs_dft_tools/CMakeLists.txt b/c++/triqs_dft_tools/CMakeLists.txt index d25ce2dd..5cc3b22f 100644 --- a/c++/triqs_dft_tools/CMakeLists.txt +++ b/c++/triqs_dft_tools/CMakeLists.txt @@ -49,7 +49,7 @@ if(ANALYZE_SOURCES) TARGET ${PROJECT_NAME}_c COMMAND ${CPPCHECK_EXECUTABLE} --enable=warning,style,performance,portability - --std=c++20 + --std=c++23 --template=gcc --verbose --force @@ -64,21 +64,36 @@ if(ANALYZE_SOURCES) endif() - # ========= Dynamic Analyzer Checks ========== option(ASAN OFF "Compile library and executables with LLVM Address Sanitizer") -option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior Sanitizer") - if(ASAN) if(NOT TARGET asan) - find_package(sanitizer REQUIRED "asan") + find_package(sanitizer REQUIRED COMPONENTS asan) endif() target_link_libraries(${PROJECT_NAME}_c PUBLIC $) endif() + +option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior Sanitizer") if(UBSAN) if(NOT TARGET ubsan) - find_package(sanitizer REQUIRED "ubsan") + find_package(sanitizer REQUIRED COMPONENTS ubsan) endif() target_link_libraries(${PROJECT_NAME}_c PUBLIC $) endif() + +option(MSAN OFF "Compile library and executables with LLVM Memory Sanitizer") +if(MSAN) + if(NOT TARGET msan) + find_package(sanitizer REQUIRED COMPONENTS msan) + endif() + target_link_libraries(${PROJECT_NAME}_c PUBLIC $) +endif() + +option(TSAN OFF "Compile library and executables with LLVM Thread Sanitizer") +if(TSAN) + if(NOT TARGET tsan) + find_package(sanitizer REQUIRED COMPONENTS tsan) + endif() + target_link_libraries(${PROJECT_NAME}_c PUBLIC $) +endif() diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 8281e7fb..f6a3b895 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -48,7 +48,7 @@ else() endif() # -- Cpp2Py -- -if(PythonSupport OR Build_Documentation) +if(PythonSupport OR (NOT IS_SUBPROJECT AND Build_Documentation)) external_dependency(Cpp2Py GIT_REPO https://github.com/TRIQS/cpp2py VERSION 2.0 diff --git a/packaging/TRIQS-dft_tools-3.0.0-foss-2019a-Python-3.7.2.eb b/packaging/TRIQS-dft_tools-3.0.0-foss-2019a-Python-3.7.2.eb deleted file mode 100644 index e96843db..00000000 --- a/packaging/TRIQS-dft_tools-3.0.0-foss-2019a-Python-3.7.2.eb +++ /dev/null @@ -1,70 +0,0 @@ -easyblock = 'CMakeMake' - -name = 'TRIQS-dft_tools' -version = '3.0.0' -versionsuffix = '-Python-%(pyver)s' - -homepage = 'https://triqs.github.io/dft_tools/' -description = """ - TRIQS (Toolbox for Research on Interacting Quantum Systems) is a - scientific project providing a set of C++ and Python libraries to - develop new tools for the study of interacting quantum systems. - - This TRIQS-based-based application is aimed at ab-initio calculations - for correlated materials, combining realistic DFT band-structure calculation - with the dynamical mean-field theory. Together with the necessary tools to - perform the DMFT self-consistency loop for realistic multi-band problems, - the package provides a full-fledged charge self-consistent interface to the - Wien2K package. In addition, if Wien2k is not available, it provides a generic - interface for one-shot DFT+DMFT calculations, where only the single-particle - Hamiltonian in orbital space has to be provided. -""" - -docurls = ['https://triqs.github.io/dft_tools/%(version_major_minor)s.x/'] -software_license = 'LicenseGPLv3' - -toolchain = {'name': 'foss', 'version': '2019a'} -toolchainopts = {'pic': True, 'usempi': True} - -source_urls = ['https://github.com/TRIQS/dft_tools/releases/download/%(version)s/'] -sources = ['dft_tools-%(version)s.tar.gz'] -checksums = ['PUT HERE THE SHA256 OF THE RELEASE TARBALL'] - -dependencies = [ - ('Python', '3.7.2'), - ('SciPy-bundle', '2019.03'), - ('Boost', '1.70.0'), - ('Clang', '8.0.0'), - ('GMP', '6.1.2'), - ('Mako', '1.0.8'), - ('h5py', '2.9.0'), - ('TRIQS', '3.0.0', versionsuffix), -] - -builddependencies = [ - ('CMake', '3.13.3') -] - -separate_build_dir = True - -runtest = 'test' - -sanity_check_paths = { - 'files': ['bin/dmftproj', 'lib/libtriqs_dft_tools_c.a'], - 'dirs': ['include/triqs_dft_tools', 'bin', 'lib', 'share', - 'lib/python%(pyshortver)s/site-packages/triqs_dft_tools'], -} - -sanity_check_commands = ["python -c 'import triqs_dft_tools'"] - -modextrapaths = { - 'CPLUS_INCLUDE_PATH': 'include', - 'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages', - 'CMAKE_PREFIX_PATH': 'lib/cmake/triqs_dft_tools', -} -modextravars = { - 'TRIQS_DFT_TOOLS_ROOT': '%(installdir)s', - 'TRIQS_DFT_TOOLS_VERSION': '%(version)s', -} - -moduleclass = 'phys' diff --git a/packaging/TRIQS-dft_tools-3.1.0-foss-2021b.eb b/packaging/TRIQS-dft_tools-3.2.0-foss-2021b.eb similarity index 94% rename from packaging/TRIQS-dft_tools-3.1.0-foss-2021b.eb rename to packaging/TRIQS-dft_tools-3.2.0-foss-2021b.eb index abb330f2..cfc03f32 100644 --- a/packaging/TRIQS-dft_tools-3.1.0-foss-2021b.eb +++ b/packaging/TRIQS-dft_tools-3.2.0-foss-2021b.eb @@ -1,7 +1,7 @@ easyblock = 'CMakeMake' name = 'TRIQS-dft_tools' -version = '3.1.0' +version = '3.2.0' homepage = 'https://triqs.github.io/dft_tools/' description = """ @@ -27,7 +27,7 @@ toolchainopts = {'pic': True, 'usempi': True} source_urls = ['https://github.com/TRIQS/dft_tools/releases/download/%(version)s/'] sources = ['dft_tools-%(version)s.tar.gz'] -checksums = ['57b7d0fe5a96c5a42bb684c60ca8e136a33e1385bf6cd7e9d1371fa507dc2ec4'] +checksums = ['PUT HERE THE SHA256 OF THE RELEASE TARBALL'] dependencies = [ ('Python', '3.9.6'), @@ -38,7 +38,7 @@ dependencies = [ ('GMP', '6.2.1'), ('HDF5', '1.10.7'), ('Mako', '1.1.4'), - ('TRIQS', '3.1.0'), + ('TRIQS', '3.2.0'), ] builddependencies = [ diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake index 60e4b453..dd4edffc 100644 --- a/share/cmake/extract_flags.cmake +++ b/share/cmake/extract_flags.cmake @@ -60,7 +60,9 @@ macro(extract_flags) endforeach() get_property_recursive(cxx_features TARGET ${target} PROPERTY INTERFACE_COMPILE_FEATURES) - if(cxx_std_20 IN_LIST cxx_features) + if(cxx_std_23 IN_LIST cxx_features) + set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -std=c++2b") + elseif(cxx_std_20 IN_LIST cxx_features) set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -std=c++20") elseif(cxx_std_17 IN_LIST cxx_features) set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -std=c++17")