From cd650884d337081ffa3a14e9701670e7d13bcc4e Mon Sep 17 00:00:00 2001 From: Michel Ferrero Date: Wed, 7 Aug 2013 16:30:09 +0200 Subject: [PATCH] Clean CMakeLists.txt --- CMakeLists.txt | 2 +- fortran/dmftproj/CMakeLists.txt | 26 +++++++++----------------- fortran/{F90 => vertex}/CMakeLists.txt | 1 - fortran/{F90 => vertex}/vertex.f90 | 0 fortran/{F90 => vertex}/vertex.pyf | 0 python/CMakeLists.txt | 25 ++++++------------------- python/converters/CMakeLists.txt | 6 ------ python/solver_multiband.py | 7 ++----- test/CMakeLists.txt | 1 - test/U_mat.py | 3 +-- test/srvo3_Gloc.py | 9 +++------ test/sumklda_basic.py | 3 +-- test/wien2k_convert.py | 4 +--- 13 files changed, 24 insertions(+), 63 deletions(-) rename fortran/{F90 => vertex}/CMakeLists.txt (98%) rename fortran/{F90 => vertex}/vertex.f90 (100%) rename fortran/{F90 => vertex}/vertex.pyf (100%) delete mode 100644 python/converters/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 31bf97c4..6eba2d1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,6 @@ endif() set(CMAKE_INSTALL_PREFIX ${TRIQS_PATH}) add_subdirectory(fortran/dmftproj) -add_subdirectory(fortran/F90) +add_subdirectory(fortran/vertex) add_subdirectory(python) add_subdirectory(test) diff --git a/fortran/dmftproj/CMakeLists.txt b/fortran/dmftproj/CMakeLists.txt index 663b10b6..2db677c8 100644 --- a/fortran/dmftproj/CMakeLists.txt +++ b/fortran/dmftproj/CMakeLists.txt @@ -1,27 +1,19 @@ # List the sources -set (SOURCES modules dmftproj readcomline set_ang_trans setsym - set_rotloc timeinv read_k_list set_projections orthogonal - rot_projectmat density symmetrize_mat rot_dens - orthogonal_wannier outputqmc outbwin outband) +set(SOURCES modules.f dmftproj.f readcomline.f set_ang_trans.f setsym.f + set_rotloc.f timeinv.f read_k_list.f set_projections.f orthogonal.f + rot_projectmat.f density.f symmetrize_mat.f rot_dens.f + orthogonal_wannier.f outputqmc.f outbwin.f outband.f) -# add the extension and the path -FOREACH(f ${SOURCES} ) - set(S "${CMAKE_CURRENT_SOURCE_DIR}/${f}.f;${S}") -ENDFOREACH(f) - # The main target and what to link with... -add_executable(dmftproj ${S}) -target_link_libraries(dmftproj ${TRIQS_LIBRARY_LAPACK} ) +add_executable(dmftproj ${SOURCES}) +target_link_libraries(dmftproj ${TRIQS_LIBRARY_LAPACK}) # where to install -install (TARGETS dmftproj DESTINATION bin ) +install (TARGETS dmftproj DESTINATION bin) -# that is it ! - -SET( D ${CMAKE_CURRENT_SOURCE_DIR}/SRC_templates/) +# install wien2k files +SET(D ${CMAKE_CURRENT_SOURCE_DIR}/SRC_templates/) SET(WIEN_SRC_TEMPL_FILES ${D}/case.cf_f_mm2 ${D}/case.cf_p_cubic ${D}/case.indmftpr ${D}/run_triqs ${D}/runsp_triqs) - -# build the fortran stuff... message(STATUS "-----------------------------------------------------------------------------") message(STATUS " ******** WARNING ******** ") message(STATUS " Wien2k users : after installation of TRIQS, copy the files from ") diff --git a/fortran/F90/CMakeLists.txt b/fortran/vertex/CMakeLists.txt similarity index 98% rename from fortran/F90/CMakeLists.txt rename to fortran/vertex/CMakeLists.txt index 137559c2..4c34f646 100644 --- a/fortran/F90/CMakeLists.txt +++ b/fortran/vertex/CMakeLists.txt @@ -1,3 +1,2 @@ - triqs_build_f2py_module( triqs_DFT vertex vertex.pyf vertex.f90) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/vertex.so DESTINATION ${TRIQS_PYTHON_LIB_DEST}/applications/dft) diff --git a/fortran/F90/vertex.f90 b/fortran/vertex/vertex.f90 similarity index 100% rename from fortran/F90/vertex.f90 rename to fortran/vertex/vertex.f90 diff --git a/fortran/F90/vertex.pyf b/fortran/vertex/vertex.pyf similarity index 100% rename from fortran/F90/vertex.pyf rename to fortran/vertex/vertex.pyf diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 3517eab4..9289c44a 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,22 +1,9 @@ -triqs_make_target_to_copy_all_py_files_from_python_dir_to_build_dir() +# where will the python end up in triqs? +set(python_destination applications/dft) -execute_process(COMMAND ln -fs ${CMAKE_BINARY_DIR}/fortran/F90/vertex.so ${CMAKE_CURRENT_BINARY_DIR} ) - -add_subdirectory(converters) - -#installation -SET(PYTHON_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py - ${CMAKE_CURRENT_SOURCE_DIR}/solver_multiband.py - ${CMAKE_CURRENT_SOURCE_DIR}/sumk_lda.py - ${CMAKE_CURRENT_SOURCE_DIR}/sumk_lda_tools.py - ${CMAKE_CURRENT_SOURCE_DIR}/symmetry.py - ${CMAKE_CURRENT_SOURCE_DIR}/U_matrix.py - ) -install (FILES ${PYTHON_SOURCES} DESTINATION ${TRIQS_PYTHON_LIB_DEST}/applications/dft) - -#make sure that the __init__.py empty files are present ... -file (WRITE __init__.py.all_empty "__all__=[]") -install (FILES __init__.py.all_empty DESTINATION ${TRIQS_PYTHON_LIB_DEST}/applications/ RENAME __init__.py) +# make a local pytriqs copy +triqs_prepare_local_pytriqs_merged_with_my_python(${python_destination}) +# to be able to run from toplevel +execute_process(COMMAND ln -fs ${CMAKE_BINARY_DIR}/fortran/vertex/vertex.so ${CMAKE_BINARY_DIR}/pytriqs/${python_destination}) diff --git a/python/converters/CMakeLists.txt b/python/converters/CMakeLists.txt deleted file mode 100644 index 96aeb02f..00000000 --- a/python/converters/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -SET(PYTHON_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py - ${CMAKE_CURRENT_SOURCE_DIR}/wien2k_converter.py - ) - -install (FILES ${PYTHON_SOURCES} DESTINATION ${TRIQS_PYTHON_LIB_DEST}/applications/dft/converters) diff --git a/python/solver_multiband.py b/python/solver_multiband.py index 0defd985..ac4562e7 100644 --- a/python/solver_multiband.py +++ b/python/solver_multiband.py @@ -21,12 +21,9 @@ ################################################################################ -#from pytriqs.applications.dft.U_matrix import * -from U_matrix import * -#from pytriqs.applications.impurity_solvers.operators import * from pytriqs.operators import * -#from pytriqs.applications.impurity_solvers.ctqmc_hyb import Solver -from pytriqs.applications.impurity_solvers.ctqmc_hyb_matrix import Solver +from pytriqs.applications.impurity_solvers.cthyb_matrix import Solver +from pytriqs.applications.dft.U_matrix import * import pytriqs.utility.mpi as mpi from types import * diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cfdb6f13..5ffbf999 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,4 +7,3 @@ triqs_add_test_hdf(sumklda_basic " -d 1.e-6" ) triqs_add_test_hdf(srvo3_Gloc " -d 1.e-6" ) triqs_add_test_hdf(U_mat " -d 1.e-6" ) - diff --git a/test/U_mat.py b/test/U_mat.py index 7b017dcf..c1f81a0d 100644 --- a/test/U_mat.py +++ b/test/U_mat.py @@ -22,8 +22,7 @@ from pytriqs.archive import * import numpy -#from pytriqs.applications.dft.U_matrix import Umatrix -from U_matrix import Umatrix +from pytriqs.applications.dft.U_matrix import Umatrix U = Umatrix(U_interact = 2.0, J_hund = 0.5, l=2) diff --git a/test/srvo3_Gloc.py b/test/srvo3_Gloc.py index 3edab603..adf3b03b 100644 --- a/test/srvo3_Gloc.py +++ b/test/srvo3_Gloc.py @@ -21,11 +21,9 @@ # ################################################################################ -#from pytriqs.applications.dft.sumk_lda import * -#from pytriqs.applications.dft.converters.wien2k_converter import * -from sumk_lda import * -from converters.wien2k_converter import * from pytriqs.archive import * +from pytriqs.applications.dft.sumk_lda import * +from pytriqs.applications.dft.converters.wien2k_converter import * #===================================================== #Basic input parameters: @@ -51,8 +49,7 @@ Norb = SK.corr_shells[0][3] l = SK.corr_shells[0][2] -from solver_multiband import * -#from pytriqs.applications.dft.solver_multiband import * +from pytriqs.applications.dft.solver_multiband import * S=SolverMultiBand(beta=Beta,n_orb=Norb,gf_struct=SK.gf_struct_solver[0],map=SK.map[0]) diff --git a/test/sumklda_basic.py b/test/sumklda_basic.py index 5bad3371..339a8a56 100644 --- a/test/sumklda_basic.py +++ b/test/sumklda_basic.py @@ -21,8 +21,7 @@ ################################################################################ from pytriqs.archive import * -#from pytriqs.applications.dft.sumk_lda_tools import SumkLDATools -from sumk_lda_tools import SumkLDATools +from pytriqs.applications.dft.sumk_lda_tools import SumkLDATools SK = SumkLDATools(hdf_file = 'SrVO3.h5') diff --git a/test/wien2k_convert.py b/test/wien2k_convert.py index fa8cfce3..12922a78 100644 --- a/test/wien2k_convert.py +++ b/test/wien2k_convert.py @@ -21,9 +21,7 @@ ################################################################################ from pytriqs.archive import * -#from pytriqs.applications.dft.converters import Wien2kConverter -from converters import Wien2kConverter - +from pytriqs.applications.dft.converters import Wien2kConverter Converter = Wien2kConverter(filename='SrVO3')