-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synchronize dfttools with app4triqs structure
* moved the plovasp C++ code to c++/triqs_dft_tools/converters/vasp * added global header triqs_dft_tools/triqs_dft_tools.hpp * python dir based on single cmakelist file * registered C++ tests for plovasp * corrected imports for py3 tests for plovasp * corrected block order in sigma_from_file and srvo3_Gloc * exchanged ref files for sigma_from_file, srvo3_Gloc, SrVO3.ref.h5 * moved vasp converter bash scripts from dir shells to bin dir
- Loading branch information
1 parent
97c5cad
commit 11d394f
Showing
299 changed files
with
4,797 additions
and
2,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Checks: '-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type' | ||
HeaderFilterRegex: 'triqs_dft_tools' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.travis.yml | ||
Dockerfile | ||
Jenkinsfile | ||
.git/objects/pack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
compile_commands.json | ||
doc/cpp2rst_generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,34 @@ | ||
|
||
language: cpp | ||
sudo: required | ||
dist: trusty | ||
dist: bionic | ||
|
||
compiler: | ||
- gcc | ||
# - clang | ||
- clang | ||
|
||
before_install: | ||
- sudo add-apt-repository 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main' -y | ||
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | ||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | ||
- sudo apt-get update | ||
- sudo apt-get install -y --allow-unauthenticated g++-7 clang-5.0 | ||
- export LIBRARY_PATH=/usr/lib/llvm-5.0/lib:$LIBRARY_PATH | ||
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7 | ||
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 60 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 | ||
- sudo apt-get install -y --allow-unauthenticated libboost-all-dev cmake git libgfortran3 gfortran openmpi-bin openmpi-common openmpi-doc libopenmpi-dev libblas-dev liblapack-dev libfftw3-dev libgmp-dev hdf5-tools libhdf5-serial-dev python-h5py python-dev python-numpy python-scipy python-jinja2 python-virtualenv python-matplotlib python-tornado python-zmq python-mpi4py python-mako clang-format-5.0 libclang-5.0-dev python-clang-5.0 python-sphinx libjs-mathjax valgrind libnfft3-dev | ||
- sudo apt-get install -y --allow-unauthenticated libblas-dev libboost-all-dev libfftw3-dev libgfortran3 libhdf5-serial-dev libgmp-dev liblapack-dev libopenmpi-dev libclang-dev python-clang-6.0 python-dev python-h5py python-mako python-matplotlib python-mpi4py python-numpy python-scipy python-sphinx libjs-mathjax libnfft3-dev | ||
|
||
install: true | ||
|
||
script: | ||
# ===== Set up Cpp2Py | ||
- git clone https://github.com/triqs/cpp2py | ||
- mkdir cpp2py/build && cd cpp2py/build | ||
- git checkout master | ||
- cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DPYTHON_INTERPRETER=/usr/bin/python -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/root_install | ||
- make -j8 install | ||
- cd $TRAVIS_BUILD_DIR | ||
- source root_install/share/cpp2pyvars.sh | ||
- export INSTALL_DIR=$HOME/root_install # We install outside the repository | ||
# ===== Set up TRIQS | ||
- git clone https://github.com/TRIQS/triqs --branch $TRAVIS_BRANCH | ||
- cd $TRAVIS_BUILD_DIR | ||
- git clone https://github.com/TRIQS/triqs --branch unstable | ||
- mkdir triqs/build && cd triqs/build | ||
- cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/root_install -DCMAKE_BUILD_TYPE=Debug | ||
- make -j8 install | ||
- cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR | ||
- make -j2 install | ||
- source $INSTALL_DIR/share/triqsvars.sh | ||
# ===== Set up triqs_dft_tools and test | ||
- cd $TRAVIS_BUILD_DIR | ||
- source root_install/share/triqsvars.sh | ||
# ===== Set up dft_tools and Test using fsanitize=address | ||
- mkdir build && cd build | ||
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=/usr/bin/${CXX} -DCMAKE_CXX_FLAGS='-fsanitize=address -fno-omit-frame-pointer -fuse-ld=gold' | ||
- make -j8 | ||
- export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-5.0/bin/llvm-symbolizer | ||
- cmake .. -DASAN=ON -DUBSAN=ON | ||
- export UBSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) | ||
- export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) | ||
- export UBSAN_OPTIONS=symbolize=1:print_stacktrace=1 | ||
- export ASAN_OPTIONS=symbolize=1:detect_leaks=0 | ||
- export CTEST_OUTPUT_ON_FAILURE=1 | ||
- if [ "$CXX" = g++ ]; then export LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/7/libasan.so; elif [ "$CXX" = clang++ ]; then export LD_PRELOAD=/usr/lib/llvm-5.0/lib/clang/5.0.1/lib/linux/libclang_rt.asan-x86_64.so; fi | ||
- cd test && ctest | ||
- make -j2 && make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,105 +1,167 @@ | ||
# Start configuration | ||
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) | ||
project(triqs_dft_tools C CXX Fortran) | ||
# ############################################################################## | ||
# | ||
# triqs_dft_tools - An example application using triqs and cpp2py | ||
# | ||
# Copyright (C) ... | ||
# | ||
# triqs_dft_tools is free software: you can redistribute it and/or modify it under the | ||
# terms of the GNU General Public License as published by the Free Software | ||
# Foundation, either version 3 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# triqs_dft_tools is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# triqs_dft_tools (in the file COPYING.txt in this directory). If not, see | ||
# <http://www.gnu.org/licenses/>. | ||
# | ||
# ############################################################################## | ||
|
||
cmake_minimum_required(VERSION 3.3.2 FATAL_ERROR) | ||
cmake_policy(VERSION 3.3.2) | ||
if(POLICY CMP0074) | ||
cmake_policy(SET CMP0074 NEW) | ||
endif() | ||
|
||
# Default to Release build type | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE) | ||
if(POLICY CMP0077) | ||
cmake_policy(SET CMP0077 NEW) | ||
endif() | ||
message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------") | ||
|
||
# Use shared libraries | ||
set(BUILD_SHARED_LIBS ON) | ||
# ############ | ||
# Define Project | ||
project(triqs_dft_tools VERSION 3.0.0 LANGUAGES C CXX Fortran) | ||
get_directory_property(IS_SUBPROJECT PARENT_DIRECTORY) | ||
|
||
# Load TRIQS and Cpp2Py | ||
find_package(TRIQS 2.2 REQUIRED) | ||
find_package(Cpp2Py 1.6 REQUIRED) | ||
# ############ | ||
# Load TRIQS and CPP2PY | ||
find_package(TRIQS 3.0 REQUIRED) | ||
|
||
if (NOT ${TRIQS_WITH_PYTHON_SUPPORT}) | ||
MESSAGE(FATAL_ERROR "dft_tools require Python support in TRIQS") | ||
# Get the git hash & print status | ||
triqs_get_git_hash_of_source_dir(PROJECT_GIT_HASH) | ||
message(STATUS "${PROJECT_NAME} version : ${PROJECT_VERSION}") | ||
message(STATUS "${PROJECT_NAME} Git hash: ${PROJECT_GIT_HASH}") | ||
|
||
# Enforce Consistent Versioning | ||
if(NOT ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} VERSION_EQUAL ${TRIQS_VERSION_MAJOR}.${TRIQS_VERSION_MINOR}) | ||
message(FATAL_ERROR "The ${PROJECT_NAME} version ${PROJECT_VERSION} is not compatible with TRIQS version ${TRIQS_VERSION}.") | ||
endif() | ||
|
||
# Default Install directory to TRIQS_ROOT if not given. Checks an absolute name is given. | ||
# Default Install directory to TRIQS_ROOT if not given or invalid. | ||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX})) | ||
message(STATUS " No install prefix given (or invalid). Defaulting to TRIQS_ROOT") | ||
message(STATUS "No install prefix given (or invalid). Defaulting to TRIQS_ROOT") | ||
set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE) | ||
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE) | ||
endif() | ||
if(NOT IS_SUBPROJECT) | ||
message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} --------") | ||
endif() | ||
message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} -------------") | ||
set(${PROJECT_NAME}_BINARY_DIR ${PROJECT_BINARY_DIR} CACHE STRING "Binary directory of the ${PROJECT_NAME} Project") | ||
|
||
# Define the dft_tools version numbers and get the git hash | ||
set(DFT_TOOLS_VERSION_MAJOR 2) | ||
set(DFT_TOOLS_VERSION_MINOR 2) | ||
set(DFT_TOOLS_VERSION_PATCH 0) | ||
set(DFT_TOOLS_VERSION ${DFT_TOOLS_VERSION_MAJOR}.${DFT_TOOLS_VERSION_MINOR}.${DFT_TOOLS_VERSION_PATCH}) | ||
triqs_get_git_hash_of_source_dir(DFT_TOOLS_GIT_HASH) | ||
message(STATUS "Dft_tools version : ${DFT_TOOLS_VERSION}") | ||
message(STATUS "Git hash: ${DFT_TOOLS_GIT_HASH}") | ||
|
||
add_subdirectory(fortran/dmftproj) | ||
# ############ | ||
# Options | ||
|
||
# Add the compiling options (-D... ) for C++ | ||
message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/14, libc++, etc...) ") | ||
# Make additional Find Modules available | ||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/share/cmake/Modules) | ||
|
||
add_subdirectory(c++) | ||
add_subdirectory(python python/triqs_dft_tools) | ||
add_subdirectory(shells) | ||
|
||
#------------------------ | ||
# tests | ||
#------------------------ | ||
# Default to Release build type | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE) | ||
endif() | ||
if(NOT IS_SUBPROJECT) | ||
message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------") | ||
endif() | ||
|
||
option(TEST_COVERAGE "Analyze the coverage of tests" OFF) | ||
# Python Support | ||
option(PythonSupport "Build with Python support" ON) | ||
if(PythonSupport AND NOT TRIQS_WITH_PYTHON_SUPPORT) | ||
message(FATAL_ERROR "TRIQS was installed without Python support. Cannot build the Python Interface. Disable the build with -DPythonSupport=OFF") | ||
endif() | ||
|
||
# perform tests with coverage info | ||
if (${TEST_COVERAGE}) | ||
# we try to locate the coverage program | ||
find_program(PYTHON_COVERAGE python-coverage) | ||
find_program(PYTHON_COVERAGE coverage) | ||
if(NOT PYTHON_COVERAGE) | ||
message(FATAL_ERROR "Program coverage (or python-coverage) not found.\nEither set PYTHON_COVERAGE explicitly or disable TEST_COVERAGE!\nYou need to install the python package coverage, e.g. with\n pip install coverage\nor with\n apt install python-coverage") | ||
endif() | ||
# Documentation | ||
option(Build_Documentation "Build documentation" OFF) | ||
|
||
message(STATUS "Setting up test coverage") | ||
add_custom_target(coverage ${PYTHON_COVERAGE} combine --append .coverage plovasp/.coverage || true COMMAND ${PYTHON_COVERAGE} html COMMAND echo "Open ${CMAKE_BINARY_DIR}/test/htmlcov/index.html in browser!" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test) | ||
# Testing | ||
option(Build_Tests "Build tests" ON) | ||
if(Build_Tests) | ||
enable_testing() | ||
endif() | ||
|
||
enable_testing() | ||
# Export the list of compile-commands into compile_commands.json | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
# Global compiler options | ||
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF) | ||
add_compile_options( | ||
$<$<CONFIG:Debug>:-Og> | ||
$<$<CONFIG:Debug>:-ggdb3> | ||
) | ||
|
||
# Create an Interface target for compiler warnings | ||
add_library(${PROJECT_NAME}_warnings INTERFACE) | ||
target_compile_options(${PROJECT_NAME}_warnings | ||
INTERFACE | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
-Wno-sign-compare | ||
$<$<CXX_COMPILER_ID:GNU>:-Wshadow=local> | ||
$<$<CXX_COMPILER_ID:GNU>:-Wno-attributes> | ||
$<$<CXX_COMPILER_ID:Clang>:-Wshadow> | ||
$<$<CXX_COMPILER_ID:Clang>:-Wno-gcc-compat> | ||
$<$<CXX_COMPILER_ID:AppleClang>:-Wshadow> | ||
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-gcc-compat> | ||
) | ||
|
||
# ############# | ||
# Build Project | ||
|
||
# Find / Build dependencies | ||
add_subdirectory(deps) | ||
|
||
# Build and install the library | ||
add_subdirectory(c++/${PROJECT_NAME}) | ||
|
||
# add here stuff for the Fortran part in DFTTools | ||
add_subdirectory(fortran/dmftproj) | ||
|
||
option(Build_Tests "Build the tests of the library " ON) | ||
if (Build_Tests) | ||
message(STATUS "-------- Preparing tests -------------") | ||
add_subdirectory(test) | ||
# Tests | ||
if(Build_Tests) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
#------------------------ | ||
# Documentation | ||
#------------------------ | ||
option(Build_Documentation "Build documentation" OFF) | ||
if(${Build_Documentation}) | ||
if(NOT ${TRIQS_WITH_DOCUMENTATION}) | ||
message("Error: TRIQS library has not been compiled with its documentation") | ||
endif() | ||
# Python | ||
if(PythonSupport) | ||
add_subdirectory(python/${PROJECT_NAME}) | ||
endif() | ||
|
||
# Docs | ||
if(Build_Documentation) | ||
add_subdirectory(doc) | ||
endif() | ||
|
||
#-------------------------------------------------------- | ||
# Packaging | ||
#-------------------------------------------------------- | ||
# dfttols vasp interface bash scripts | ||
add_subdirectory(bin) | ||
|
||
# Additional configuration files | ||
add_subdirectory(share) | ||
|
||
# ############# | ||
# Debian Package | ||
|
||
option(BUILD_DEBIAN_PACKAGE "Build a deb package" OFF) | ||
if(BUILD_DEBIAN_PACKAGE) | ||
if(BUILD_DEBIAN_PACKAGE AND NOT IS_SUBPROJECT) | ||
if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr") | ||
message(FATAL_ERROR "CMAKE_INSTALL_PREFIX must be /usr for packaging") | ||
endif() | ||
SET(CPACK_GENERATOR "DEB") | ||
SET(CPACK_PACKAGE_VERSION ${DFT_TOOLS_VERSION}) | ||
SET(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/dft_tools") | ||
EXECUTE_PROCESS(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 2.2)") | ||
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "dft_tools") | ||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) | ||
INCLUDE(CPack) | ||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) | ||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) | ||
set(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/${PROJECT_NAME}") | ||
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 3.0)") | ||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) | ||
include(CPack) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
doc/ChangeLog.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
# See ../triqs/packaging for other options | ||
FROM flatironinstitute/triqs:master-ubuntu-clang | ||
FROM flatironinstitute/triqs:unstable-ubuntu-clang | ||
ARG APPNAME=triqs_dft_tools | ||
|
||
ARG APPNAME | ||
COPY . $SRC/$APPNAME | ||
COPY requirements.txt /src/$APPNAME/requirements.txt | ||
RUN pip3 install -r /src/$APPNAME/requirements.txt | ||
|
||
COPY --chown=build . $SRC/$APPNAME | ||
WORKDIR $BUILD/$APPNAME | ||
RUN chown build . | ||
USER build | ||
ARG BUILD_DOC=0 | ||
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} && make -j2 && make test CTEST_OUTPUT_ON_FAILURE=1 | ||
RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} && make -j2 | ||
USER root | ||
RUN make install |
Oops, something went wrong.