From ae548d48da4a160c6cd82c54ec1353870657257a Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Thu, 7 Dec 2017 15:56:05 +0100 Subject: [PATCH 1/4] WIP --- CMakeLists.txt | 42 +++++++++++++----------- c++/plovasp/atm/CMakeLists.txt | 5 ++- c++/plovasp/atm/test/CMakeLists.txt | 19 +++-------- fortran/dmftproj/CMakeLists.txt | 2 +- python/CMakeLists.txt | 12 ++++--- python/converters/plovasp/CMakeLists.txt | 14 ++++---- python/converters/plovasp/atm_desc.py | 2 +- test/CMakeLists.txt | 21 ++++++------ 8 files changed, 56 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15f67e33..7b3383b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,45 +2,49 @@ set (DFT_TOOLS_VERSION "1.5") set (DFT_TOOLS_RELEASE "1.5.0") -# Append triqs installed files to the cmake load path -list(APPEND CMAKE_MODULE_PATH ${TRIQS_PATH}/share/triqs/cmake) +# Default to Release build type +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE) +endif() +message( STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} -------------") -# start configuration +# start configuration cmake_minimum_required(VERSION 2.8) project(dft_tools CXX Fortran) -set(CMAKE_BUILD_TYPE Release) -enable_testing() -# Load TRIQS, including all predefined variables from TRIQS installation -find_package(TRIQS REQUIRED) +# Use shared libraries +set(BUILD_SHARED_LIBS ON) + +# Load TRIQS and Cpp2Py +find_package(TRIQS 1.5 EXACT REQUIRED) +find_package(Cpp2Py REQUIRED) -# Check that versions are compatible -if(NOT DFT_TOOLS_VERSION EQUAL TRIQS_VERSION) - message(FATAL_ERROR "The application version is not compatible with the TRIQS library (TRIQS library version: ${TRIQS_VERSION} while this application version: ${DFT_TOOLS_VERSION})") -endif() if (NOT ${TRIQS_WITH_PYTHON_SUPPORT}) MESSAGE(FATAL_ERROR "dft_tools require Python support in TRIQS") endif() -# Get hash -triqs_get_git_hash(${CMAKE_SOURCE_DIR} "DFT_TOOLS") -if(${GIT_RESULT} EQUAL 0) - message(STATUS "Hash: ${DFT_TOOLS_GIT_HASH}") -endif(${GIT_RESULT} EQUAL 0) +# Default Install directory to TRIQS_ROOT if not given. Checks an absolute name is given. +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") + set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE) +endif() +message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} -------------") -# We want to be installed in the TRIQS tree -set(CMAKE_INSTALL_PREFIX ${TRIQS_PATH}) +# Macro defined in TRIQS which picks the hash of repo. +triqs_get_git_hash_of_source_dir(DFT_TOOLS_GIT_HASH) +message(STATUS "Git hash: ${DFT_TOOLS_GIT_HASH}") add_subdirectory(fortran/dmftproj) # Add the compiling options (-D... ) for C++ message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/14, libc++, etc...) ") -add_definitions(${TRIQS_CXX_DEFINITIONS}) add_subdirectory(c++) add_subdirectory(python) add_subdirectory(shells) add_subdirectory(test) + + option(BUILD_DOC "Build documentation" OFF) if(${BUILD_DOC}) if(NOT TRIQS_WITH_DOCUMENTATION) diff --git a/c++/plovasp/atm/CMakeLists.txt b/c++/plovasp/atm/CMakeLists.txt index 228e950f..eb8b8340 100644 --- a/c++/plovasp/atm/CMakeLists.txt +++ b/c++/plovasp/atm/CMakeLists.txt @@ -1,7 +1,6 @@ -# Linking and include info add_library(atm_c dos_tetra3d.hpp dos_tetra3d.cpp argsort.hpp argsort.cpp) -set_target_properties(atm_c PROPERTIES LINKER_LANGUAGE CXX) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/c++/plovasp/atm ${TRIQS_INCLUDE_ALL}) +target_link_libraries(atm_c triqs) +target_compile_options(atm_c PRIVATE -std=c++14) install(TARGETS atm_c DESTINATION lib) diff --git a/c++/plovasp/atm/test/CMakeLists.txt b/c++/plovasp/atm/test/CMakeLists.txt index eaecd9ed..d592f23c 100644 --- a/c++/plovasp/atm/test/CMakeLists.txt +++ b/c++/plovasp/atm/test/CMakeLists.txt @@ -1,24 +1,13 @@ -find_package(TriqsTest) enable_testing() -# Linking and include info -#add_library(atm_c dos_tetra3d.hpp dos_tetra3d.cpp argsort.h argsort.c) -#set_target_properties(atm_c PROPERTIES LINKER_LANGUAGE CXX) -#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/c++/plovasp/atm ${TRIQS_INCLUDE_ALL}) - FILE(GLOB TestList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) FOREACH( TestName1 ${TestList} ) STRING(REPLACE ".cpp" "" TestName ${TestName1}) - add_executable( ${TestName} ${CMAKE_CURRENT_SOURCE_DIR}/${TestName}.cpp ) - target_link_libraries( ${TestName} atm_c ${TRIQS_LIBRARY_ALL} ) + add_executable( ${TestName} ${TestName}.cpp ) + target_link_libraries( ${TestName} atm_c triqs) triqs_set_rpath_for_target( ${TestName} ) - triqs_add_cpp_test( ${TestName} ) - if (TESTS_C_WITH_VALGRIND) - add_test ( ${TestName}_valgrind valgrind --error-exitcode=1 ${CMAKE_CURRENT_BINARY_DIR}/${TestName}) - endif() + add_test(NAME ${TestName} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${t}) ENDFOREACH( TestName1 ${TestList} ) -#add_executable(test_atm test2py.cpp) -#target_link_libraries(test_atm atm_c) -#add_subdirectory(test) + diff --git a/fortran/dmftproj/CMakeLists.txt b/fortran/dmftproj/CMakeLists.txt index 2db677c8..7e66708b 100644 --- a/fortran/dmftproj/CMakeLists.txt +++ b/fortran/dmftproj/CMakeLists.txt @@ -6,7 +6,7 @@ set(SOURCES modules.f dmftproj.f readcomline.f set_ang_trans.f setsym.f # The main target and what to link with... add_executable(dmftproj ${SOURCES}) -target_link_libraries(dmftproj ${TRIQS_LIBRARY_LAPACK}) +target_link_libraries(dmftproj "-framework Accelerate") #${TRIQS_LIBRARY_LAPACK}) # where to install install (TARGETS dmftproj DESTINATION bin) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 426c3a74..32a92ef2 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,16 +1,18 @@ # where will the python end up in triqs? set(python_destination pytriqs/applications/dft) +set(PYTHON_LIB_DEST ${CPP2PY_PYTHON_LIB_DEST_ROOT}/pytriqs/cthyb) # site_customize for build set(package_name "pytriqs.applications") configure_file(${CMAKE_SOURCE_DIR}/cmake/sitecustomize.py ${CMAKE_CURRENT_BINARY_DIR}/sitecustomize.py @ONLY) -# make a local pytriqs copy -triqs_prepare_local_pytriqs(${python_destination}) - # VASP converter add_subdirectory(converters/plovasp) # add version file -configure_file(version.py.in version.py) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${TRIQS_PYTHON_LIB_DEST_ROOT}/${python_destination}) +configure_file(version.py.in version.py @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST}) + + + + diff --git a/python/converters/plovasp/CMakeLists.txt b/python/converters/plovasp/CMakeLists.txt index 6271b4b0..67c7b732 100644 --- a/python/converters/plovasp/CMakeLists.txt +++ b/python/converters/plovasp/CMakeLists.txt @@ -1,11 +1,13 @@ set(python_destination pytriqs/applications/dft/converters/plovasp) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${TRIQS_INCLUDE_ALL}) -triqs_python_extension(atm ${python_destination}) -target_link_libraries(atm atm_c ${TRIQS_LIBRARY_ALL}) -triqs_set_rpath_for_target(atm) +add_cpp2py_module(atm) +target_link_libraries(atm atm_c triqs) +#triqs_set_rpath_for_target(atm) +target_compile_options(atm PRIVATE -std=c++14) # This we need in order for tests to work -add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp) +#add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp) + +install (TARGETS atm DESTINATION ${PYTHON_LIB_DEST}) + -install (TARGETS atm DESTINATION ${TRIQS_PYTHON_LIB_DEST_ROOT}/${python_destination}) diff --git a/python/converters/plovasp/atm_desc.py b/python/converters/plovasp/atm_desc.py index 48795a03..1fd53f01 100644 --- a/python/converters/plovasp/atm_desc.py +++ b/python/converters/plovasp/atm_desc.py @@ -1,6 +1,6 @@ # Generated automatically using the command : # c++2py.py -m atm -o atm --moduledoc "Analytical Tetrahedron Method for DOS" ../../../c++/plovasp/atm/dos_tetra3d.hpp -from wrap_generator import * +from cpp2py.wrap_generator import * # The module module = module_(full_name = "atm", doc = "Analytical Tetrahedron Method for calculating DOS", app_name = "atm") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e4edc52a..5ebe0867 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,20 +1,19 @@ -# load triqs helper to set up tests -find_package(TriqsTest) - # Copy h5 files to binary dir FILE(GLOB all_h5_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h5) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${all_h5_files} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) # Copy other files FILE(COPY SrVO3.pmat SrVO3.struct SrVO3.outputs SrVO3.oubwin SrVO3.ctqmcout SrVO3.symqmc SrVO3.sympar SrVO3.parproj hk_convert_hamiltonian.hk LaVO3-Pnma_hr.dat LaVO3-Pnma.inp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -triqs_add_python_test(wien2k_convert) -triqs_add_python_test(hk_convert) -triqs_add_python_test(w90_convert) -triqs_add_python_test(sumkdft_basic) -triqs_add_python_test(srvo3_Gloc) -triqs_add_python_test(srvo3_transp) -triqs_add_python_test(sigma_from_file) -triqs_add_python_test(blockstructure) +# List all tests +set(all_tests wien2k_convert hk_convert w90_convert sumkdft_basic srvo3_Gloc srvo3_transp sigma_from_file blockstructure) + +foreach(t ${all_tests}) + add_test(NAME ${t} COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/${t}.py) +endforeach() + +# Set the PythonPath : put the build dir first (in case there is an installed version). +set_property(TEST ${all_tests} PROPERTY ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} ) + # VASP converter tests add_subdirectory(plovasp) From 76dff0f5a2b79860e5c20d4aeb557c0b318de6f3 Mon Sep 17 00:00:00 2001 From: Manuel Date: Mon, 22 Jan 2018 17:36:21 -0500 Subject: [PATCH 2/4] find lapack --- fortran/dmftproj/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fortran/dmftproj/CMakeLists.txt b/fortran/dmftproj/CMakeLists.txt index 7e66708b..4c202375 100644 --- a/fortran/dmftproj/CMakeLists.txt +++ b/fortran/dmftproj/CMakeLists.txt @@ -6,7 +6,8 @@ set(SOURCES modules.f dmftproj.f readcomline.f set_ang_trans.f setsym.f # The main target and what to link with... add_executable(dmftproj ${SOURCES}) -target_link_libraries(dmftproj "-framework Accelerate") #${TRIQS_LIBRARY_LAPACK}) +find_package(LAPACK) +target_link_libraries(dmftproj ${LAPACK_LIBRARIES}) # where to install install (TARGETS dmftproj DESTINATION bin) From 1a0ba43f8d470a00c676de81b67f670991453ba8 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Mon, 22 Jan 2018 17:34:20 -0500 Subject: [PATCH 3/4] Continued --- CMakeLists.txt | 15 ++++++++++++++- c++/plovasp/atm/CMakeLists.txt | 2 +- python/CMakeLists.txt | 9 ++++++++- python/converters/converter_tools.py | 4 +--- python/converters/plovasp/CMakeLists.txt | 3 ++- python/converters/plovasp/atm_desc.py | 4 ++-- test/blockstructure.py | 4 ++-- test/hk_convert.py | 3 ++- test/plovasp/atm/test_atm.py | 2 +- test/plovasp/inpconf/test_general.py | 2 +- test/plovasp/inpconf/test_groups.py | 2 +- test/plovasp/inpconf/test_input.py | 2 +- test/plovasp/inpconf/test_parameter_set.py | 2 +- test/plovasp/inpconf/test_shells.py | 2 +- test/plovasp/inpconf/test_special_parsers.py | 2 +- test/plovasp/plotools/test_consistency.py | 8 ++++---- test/plovasp/proj_group/test_block_map.py | 6 +++--- test/plovasp/proj_group/test_one_site.py | 10 +++++----- test/plovasp/proj_group/test_select_bands.py | 10 +++++----- test/plovasp/proj_group/test_two_site.py | 10 +++++----- test/plovasp/proj_shell/test_projshells.py | 10 +++++----- test/plovasp/vaspio/test_doscar.py | 2 +- test/plovasp/vaspio/test_eigenval.py | 2 +- test/plovasp/vaspio/test_kpoints.py | 2 +- test/plovasp/vaspio/test_poscar.py | 2 +- test/sigma_from_file.py | 2 +- test/srvo3_Gloc.py | 4 ++-- test/srvo3_transp.py | 6 +++--- test/sumkdft_basic.py | 2 +- test/w90_convert.py | 2 +- test/wien2k_convert.py | 3 ++- 31 files changed, 80 insertions(+), 59 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b3383b1..97c6d461 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,22 @@ message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/ add_subdirectory(c++) add_subdirectory(python) add_subdirectory(shells) -add_subdirectory(test) +#------------------------ +# tests +#------------------------ + +enable_testing() + +option(Build_Tests "Build the tests of the library " ON) +if (Build_Tests) + message(STATUS "-------- Preparing tests -------------") + add_subdirectory(test) +endif() +#------------------------ +# Documentation +#------------------------ option(BUILD_DOC "Build documentation" OFF) if(${BUILD_DOC}) if(NOT TRIQS_WITH_DOCUMENTATION) diff --git a/c++/plovasp/atm/CMakeLists.txt b/c++/plovasp/atm/CMakeLists.txt index eb8b8340..afcb0176 100644 --- a/c++/plovasp/atm/CMakeLists.txt +++ b/c++/plovasp/atm/CMakeLists.txt @@ -1,6 +1,6 @@ add_library(atm_c dos_tetra3d.hpp dos_tetra3d.cpp argsort.hpp argsort.cpp) target_link_libraries(atm_c triqs) -target_compile_options(atm_c PRIVATE -std=c++14) +target_compile_options(atm_c PRIVATE -std=c++17) install(TARGETS atm_c DESTINATION lib) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 32a92ef2..3e481102 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -4,7 +4,14 @@ set(PYTHON_LIB_DEST ${CPP2PY_PYTHON_LIB_DEST_ROOT}/pytriqs/cthyb) # site_customize for build set(package_name "pytriqs.applications") -configure_file(${CMAKE_SOURCE_DIR}/cmake/sitecustomize.py ${CMAKE_CURRENT_BINARY_DIR}/sitecustomize.py @ONLY) + +# Create a temporary copy of the python modules so that we can run before installation with the test +FILE(GLOB_RECURSE all_py_files RELATIVE ${CMAKE_SOURCE_DIR}/python *.py ) +foreach(f ${all_py_files}) + configure_file(${f} ${f} COPYONLY) +endforeach() + +#configure_file(${CMAKE_SOURCE_DIR}/cmake/sitecustomize.py ${CMAKE_CURRENT_BINARY_DIR}/sitecustomize.py @ONLY) # VASP converter add_subdirectory(converters/plovasp) diff --git a/python/converters/converter_tools.py b/python/converters/converter_tools.py index 126ffd57..b971518d 100644 --- a/python/converters/converter_tools.py +++ b/python/converters/converter_tools.py @@ -19,10 +19,8 @@ # TRIQS. If not, see . # ########################################################################## -from pytriqs.cmake_info import hdf5_command_path import pytriqs.utility.mpi as mpi - class ConverterTools: def __init__(self): @@ -73,7 +71,7 @@ class ConverterTools: mpi.report("Repacking the file %s" % self.hdf_file) retcode = subprocess.call( - [hdf5_command_path + "/h5repack", "-i%s" % self.hdf_file, "-otemphgfrt.h5"]) + ["h5repack", "-i%s" % self.hdf_file, "-otemphgfrt.h5"]) if retcode != 0: mpi.report("h5repack failed!") else: diff --git a/python/converters/plovasp/CMakeLists.txt b/python/converters/plovasp/CMakeLists.txt index 67c7b732..f9750662 100644 --- a/python/converters/plovasp/CMakeLists.txt +++ b/python/converters/plovasp/CMakeLists.txt @@ -3,7 +3,8 @@ set(python_destination pytriqs/applications/dft/converters/plovasp) add_cpp2py_module(atm) target_link_libraries(atm atm_c triqs) #triqs_set_rpath_for_target(atm) -target_compile_options(atm PRIVATE -std=c++14) +target_compile_options(atm PRIVATE -std=c++17) +target_include_directories(atm PRIVATE ${CMAKE_SOURCE_DIR}/c++) # This we need in order for tests to work #add_custom_command(TARGET atm POST_BUILD COMMAND ln -fs ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}/atm.so ${CMAKE_BINARY_DIR}/python/dft/converters/plovasp) diff --git a/python/converters/plovasp/atm_desc.py b/python/converters/plovasp/atm_desc.py index 1fd53f01..ac3776f0 100644 --- a/python/converters/plovasp/atm_desc.py +++ b/python/converters/plovasp/atm_desc.py @@ -8,11 +8,11 @@ module = module_(full_name = "atm", doc = "Analytical Tetrahedron Method for cal # All the triqs C++/Python modules # Add here all includes beyond what is automatically included by the triqs modules -module.add_include("../../../c++/plovasp/atm/dos_tetra3d.hpp") +module.add_include("plovasp/atm/dos_tetra3d.hpp") # Add here anything to add in the C++ code at the start, e.g. namespace using module.add_preamble(""" -#include +#include """) module.add_function ("array_view dos_tetra_weights_3d (array_view eigk, double en, array_view itt)", doc = """DOS of a band by analytical tetrahedron method\n\n Returns corner weights for all tetrahedra for a given band and real energy.""") diff --git a/test/blockstructure.py b/test/blockstructure.py index 0d83123d..33f1a570 100644 --- a/test/blockstructure.py +++ b/test/blockstructure.py @@ -1,8 +1,8 @@ -from pytriqs.applications.dft.sumk_dft import * +from sumk_dft import * from pytriqs.utility.h5diff import h5diff from pytriqs.gf import * from pytriqs.utility.comparison_tests import assert_block_gfs_are_close -from pytriqs.applications.dft import BlockStructure +from block_structure import BlockStructure SK = SumkDFT('blockstructure.in.h5',use_dft_blocks=True) diff --git a/test/hk_convert.py b/test/hk_convert.py index 439d457b..e1d72893 100644 --- a/test/hk_convert.py +++ b/test/hk_convert.py @@ -21,11 +21,12 @@ ################################################################################ -from pytriqs.applications.dft.converters import * from pytriqs.archive import * from pytriqs.utility.h5diff import h5diff import pytriqs.utility.mpi as mpi +from converters import * + Converter = HkConverter(filename='hk_convert_hamiltonian.hk',hdf_filename='hk_convert.out.h5') Converter.convert_dft_input() diff --git a/test/plovasp/atm/test_atm.py b/test/plovasp/atm/test_atm.py index 3e22b3f5..913fc40a 100644 --- a/test/plovasp/atm/test_atm.py +++ b/test/plovasp/atm/test_atm.py @@ -2,7 +2,7 @@ import os import numpy as np -from pytriqs.applications.dft.converters.plovasp.atm import dos_tetra_weights_3d +from converters.plovasp.atm import dos_tetra_weights_3d import mytest ################################################################################ diff --git a/test/plovasp/inpconf/test_general.py b/test/plovasp/inpconf/test_general.py index 8cc694de..14d04b3f 100644 --- a/test/plovasp/inpconf/test_general.py +++ b/test/plovasp/inpconf/test_general.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/inpconf/test_groups.py b/test/plovasp/inpconf/test_groups.py index 6f2a1cc2..b1d7153f 100644 --- a/test/plovasp/inpconf/test_groups.py +++ b/test/plovasp/inpconf/test_groups.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/inpconf/test_input.py b/test/plovasp/inpconf/test_input.py index 89418fdb..94941a19 100644 --- a/test/plovasp/inpconf/test_input.py +++ b/test/plovasp/inpconf/test_input.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/inpconf/test_parameter_set.py b/test/plovasp/inpconf/test_parameter_set.py index 36590dc6..c6748086 100644 --- a/test/plovasp/inpconf/test_parameter_set.py +++ b/test/plovasp/inpconf/test_parameter_set.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/inpconf/test_shells.py b/test/plovasp/inpconf/test_shells.py index 8d488481..98220d2b 100644 --- a/test/plovasp/inpconf/test_shells.py +++ b/test/plovasp/inpconf/test_shells.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/inpconf/test_special_parsers.py b/test/plovasp/inpconf/test_special_parsers.py index 9e8dab57..a751f480 100644 --- a/test/plovasp/inpconf/test_special_parsers.py +++ b/test/plovasp/inpconf/test_special_parsers.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import arraytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.inpconf import ConfigParameters ################################################################################ # diff --git a/test/plovasp/plotools/test_consistency.py b/test/plovasp/plotools/test_consistency.py index 9add6920..216e89f7 100644 --- a/test/plovasp/plotools/test_consistency.py +++ b/test/plovasp/plotools/test_consistency.py @@ -1,8 +1,8 @@ -import pytriqs.applications.dft.converters.plovasp.vaspio -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.plotools import check_data_consistency -from pytriqs.applications.dft.converters.plovasp.elstruct import ElectronicStructure +import converters.plovasp.vaspio +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.plotools import check_data_consistency +from converters.plovasp.elstruct import ElectronicStructure import mytest ################################################################################ diff --git a/test/plovasp/proj_group/test_block_map.py b/test/plovasp/proj_group/test_block_map.py index e7ab7993..80d6fd04 100644 --- a/test/plovasp/proj_group/test_block_map.py +++ b/test/plovasp/proj_group/test_block_map.py @@ -4,9 +4,9 @@ import rpath _rpath = os.path.dirname(rpath.__file__) + '/' import numpy as np -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.proj_shell import ProjectorShell -from pytriqs.applications.dft.converters.plovasp.proj_group import ProjectorGroup +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.proj_shell import ProjectorShell +from converters.plovasp.proj_group import ProjectorGroup import mytest ################################################################################ diff --git a/test/plovasp/proj_group/test_one_site.py b/test/plovasp/proj_group/test_one_site.py index 9a4939e0..8a777d10 100644 --- a/test/plovasp/proj_group/test_one_site.py +++ b/test/plovasp/proj_group/test_one_site.py @@ -4,11 +4,11 @@ import rpath _rpath = os.path.dirname(rpath.__file__) + '/' import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import VaspData -from pytriqs.applications.dft.converters.plovasp.elstruct import ElectronicStructure -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.proj_shell import ProjectorShell -from pytriqs.applications.dft.converters.plovasp.proj_group import ProjectorGroup +from converters.plovasp.vaspio import VaspData +from converters.plovasp.elstruct import ElectronicStructure +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.proj_shell import ProjectorShell +from converters.plovasp.proj_group import ProjectorGroup from pytriqs.archive import HDFArchive import mytest diff --git a/test/plovasp/proj_group/test_select_bands.py b/test/plovasp/proj_group/test_select_bands.py index f3bfb61f..4d53c42b 100644 --- a/test/plovasp/proj_group/test_select_bands.py +++ b/test/plovasp/proj_group/test_select_bands.py @@ -4,11 +4,11 @@ import rpath _rpath = os.path.dirname(rpath.__file__) + '/' import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import VaspData -from pytriqs.applications.dft.converters.plovasp.elstruct import ElectronicStructure -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.proj_shell import ProjectorShell -from pytriqs.applications.dft.converters.plovasp.proj_group import ProjectorGroup +from converters.plovasp.vaspio import VaspData +from converters.plovasp.elstruct import ElectronicStructure +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.proj_shell import ProjectorShell +from converters.plovasp.proj_group import ProjectorGroup import mytest ################################################################################ diff --git a/test/plovasp/proj_group/test_two_site.py b/test/plovasp/proj_group/test_two_site.py index 4f62961a..8db9b951 100644 --- a/test/plovasp/proj_group/test_two_site.py +++ b/test/plovasp/proj_group/test_two_site.py @@ -4,11 +4,11 @@ import rpath _rpath = os.path.dirname(rpath.__file__) + '/' import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import VaspData -from pytriqs.applications.dft.converters.plovasp.elstruct import ElectronicStructure -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.proj_shell import ProjectorShell -from pytriqs.applications.dft.converters.plovasp.proj_group import ProjectorGroup +from converters.plovasp.vaspio import VaspData +from converters.plovasp.elstruct import ElectronicStructure +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.proj_shell import ProjectorShell +from converters.plovasp.proj_group import ProjectorGroup from pytriqs.archive import HDFArchive import mytest diff --git a/test/plovasp/proj_shell/test_projshells.py b/test/plovasp/proj_shell/test_projshells.py index 41480649..97e1693f 100644 --- a/test/plovasp/proj_shell/test_projshells.py +++ b/test/plovasp/proj_shell/test_projshells.py @@ -4,11 +4,11 @@ import rpath _rpath = os.path.dirname(rpath.__file__) + '/' import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import VaspData -from pytriqs.applications.dft.converters.plovasp.elstruct import ElectronicStructure -from pytriqs.applications.dft.converters.plovasp.inpconf import ConfigParameters -from pytriqs.applications.dft.converters.plovasp.proj_shell import ProjectorShell -from pytriqs.applications.dft.converters.plovasp.proj_group import ProjectorGroup +from converters.plovasp.vaspio import VaspData +from converters.plovasp.elstruct import ElectronicStructure +from converters.plovasp.inpconf import ConfigParameters +from converters.plovasp.proj_shell import ProjectorShell +from converters.plovasp.proj_group import ProjectorGroup import mytest ################################################################################ diff --git a/test/plovasp/vaspio/test_doscar.py b/test/plovasp/vaspio/test_doscar.py index 2b22a5df..68148d75 100644 --- a/test/plovasp/vaspio/test_doscar.py +++ b/test/plovasp/vaspio/test_doscar.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import mytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import Doscar +from converters.plovasp.vaspio import Doscar ################################################################################ # diff --git a/test/plovasp/vaspio/test_eigenval.py b/test/plovasp/vaspio/test_eigenval.py index 8a4a17a9..4cca5a8d 100644 --- a/test/plovasp/vaspio/test_eigenval.py +++ b/test/plovasp/vaspio/test_eigenval.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import mytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import Eigenval +from converters.plovasp.vaspio import Eigenval ################################################################################ # diff --git a/test/plovasp/vaspio/test_kpoints.py b/test/plovasp/vaspio/test_kpoints.py index 4a70338b..43f67ef3 100644 --- a/test/plovasp/vaspio/test_kpoints.py +++ b/test/plovasp/vaspio/test_kpoints.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import mytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import Kpoints +from converters.plovasp.vaspio import Kpoints ################################################################################ # diff --git a/test/plovasp/vaspio/test_poscar.py b/test/plovasp/vaspio/test_poscar.py index c0047b0e..25d37080 100644 --- a/test/plovasp/vaspio/test_poscar.py +++ b/test/plovasp/vaspio/test_poscar.py @@ -7,7 +7,7 @@ _rpath = os.path.dirname(rpath.__file__) + '/' import mytest import numpy as np -from pytriqs.applications.dft.converters.plovasp.vaspio import Poscar +from converters.plovasp.vaspio import Poscar ################################################################################ # diff --git a/test/sigma_from_file.py b/test/sigma_from_file.py index 7f8640c0..ccf88280 100644 --- a/test/sigma_from_file.py +++ b/test/sigma_from_file.py @@ -22,7 +22,7 @@ from pytriqs.archive import * from pytriqs.gf import * from pytriqs.gf.tools import * -from pytriqs.applications.dft.sumk_dft_tools import * +from sumk_dft_tools import * from pytriqs.utility.comparison_tests import * import numpy as np diff --git a/test/srvo3_Gloc.py b/test/srvo3_Gloc.py index 20f9d120..f10555e4 100644 --- a/test/srvo3_Gloc.py +++ b/test/srvo3_Gloc.py @@ -21,8 +21,8 @@ from pytriqs.archive import * from pytriqs.gf import * -from pytriqs.applications.dft.sumk_dft import * -from pytriqs.applications.dft.converters.wien2k_converter import * +from sumk_dft import * +from converters.wien2k_converter import * from pytriqs.operators.util import set_operator_structure from pytriqs.utility.comparison_tests import * from pytriqs.utility.h5diff import h5diff diff --git a/test/srvo3_transp.py b/test/srvo3_transp.py index 920459f0..cb609c2f 100644 --- a/test/srvo3_transp.py +++ b/test/srvo3_transp.py @@ -20,9 +20,9 @@ ################################################################################ from numpy import * -from pytriqs.applications.dft.converters.wien2k_converter import * -from pytriqs.applications.dft.sumk_dft import * -from pytriqs.applications.dft.sumk_dft_tools import * +from converters.wien2k_converter import * +from sumk_dft import * +from sumk_dft_tools import * from pytriqs.utility.comparison_tests import * from pytriqs.utility.h5diff import h5diff diff --git a/test/sumkdft_basic.py b/test/sumkdft_basic.py index ba456060..52dd1a48 100644 --- a/test/sumkdft_basic.py +++ b/test/sumkdft_basic.py @@ -21,7 +21,7 @@ ################################################################################ from pytriqs.archive import * -from pytriqs.applications.dft.sumk_dft_tools import SumkDFTTools +from sumk_dft_tools import SumkDFTTools import pytriqs.utility.mpi as mpi from pytriqs.utility.comparison_tests import * from pytriqs.utility.h5diff import h5diff diff --git a/test/w90_convert.py b/test/w90_convert.py index e5c18ffd..1c483e50 100644 --- a/test/w90_convert.py +++ b/test/w90_convert.py @@ -21,7 +21,7 @@ ################################################################################ -from pytriqs.applications.dft.converters import * +from converters import * from pytriqs.archive import * from pytriqs.utility.h5diff import h5diff import pytriqs.utility.mpi as mpi diff --git a/test/wien2k_convert.py b/test/wien2k_convert.py index c643f19a..77076068 100644 --- a/test/wien2k_convert.py +++ b/test/wien2k_convert.py @@ -21,11 +21,12 @@ ################################################################################ from pytriqs.archive import * -from pytriqs.applications.dft.converters import Wien2kConverter from pytriqs.utility.comparison_tests import * from pytriqs.utility.h5diff import h5diff import pytriqs.utility.mpi as mpi +from converters import Wien2kConverter + Converter = Wien2kConverter(filename='SrVO3') Converter.hdf_file = 'wien2k_convert.out.h5' Converter.convert_dft_input() From a88ea9c469b5d798ccc78151f001d14bdaa51177 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Mon, 22 Jan 2018 17:49:04 -0500 Subject: [PATCH 4/4] Fix but 2 tests - inpconf due to a silly string comparion issue - vaspio ?? --- test/plovasp/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/plovasp/CMakeLists.txt b/test/plovasp/CMakeLists.txt index 11669c67..57e6877c 100644 --- a/test/plovasp/CMakeLists.txt +++ b/test/plovasp/CMakeLists.txt @@ -1,5 +1,5 @@ # load triqs helper to set up tests -set(TestSuites +set(all_tests inpconf # plocar_io plotools @@ -8,10 +8,11 @@ set(TestSuites vaspio atm) -FILE(COPY ${TestSuites} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +FILE(COPY ${all_tests} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) FILE(COPY run_suite.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -foreach(test_suite ${TestSuites}) - add_test(${test_suite} - ${PythonBuildExecutable} run_suite.py ${test_suite}) -endforeach(test_suite ${TestSuites}) +foreach(t ${all_tests}) + add_test(NAME ${t} COMMAND python run_suite.py ${t}) +endforeach() + +set_property(TEST ${all_tests} PROPERTY ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} )