Commit 08f59f4e authored by Matthias Redies's avatar Matthias Redies

merge

parents 41cb66b7 b7d59964
docs/mkdocs/site
init/compileinfo.h init/compileinfo.h
io/xml/inputSchema.h io/xml/inputSchema.h
Testing/* Testing/*
......
...@@ -66,32 +66,32 @@ pages: ...@@ -66,32 +66,32 @@ pages:
- triggers - triggers
- web - web
#build-pgi: build-pgi:
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: build-pgi stage: build-pgi
# cache: cache:
# paths: paths:
# - build.debug - build.pgi
# script: script:
# - cd /builds/fleur/fleur; ./configure.sh -d AUTO ; cd build.debug; make - cd /builds/fleur/fleur; ./configure.sh -l pgi ; cd build.pgi; make
# only: only:
# - schedules - schedules
# - triggers - triggers
# - web - web
#test-pgi: test-pgi:
# image: iffregistry.fz-juelich.de/fleur/fleur:pgi image: iffregistry.fz-juelich.de/fleur/fleur:pgi
# stage: test-pgi stage: test-pgi
# cache: cache:
# paths: paths:
# - build.debug - build.pgi
# script: script:
# - cd /builds/fleur/fleur/build.debug;ctest - cd /builds/fleur/fleur/build.pgi;ctest
# only: only:
# - schedules - schedules
# - web - web
# - triggers - triggers
build-intel-static: build-intel-static:
......
[submodule "external/hdf5-git"]
path = external/hdf5-git
url = https://bitbucket.hdfgroup.org/scm/hdffv/hdf5.git
[submodule "external/libxc-git"]
path = external/libxc-git
url = https://gitlab.com/libxc/libxc.git
...@@ -10,12 +10,17 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${tmp}") ...@@ -10,12 +10,17 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${tmp}")
include("cmake/CompilerConfig.txt") include("cmake/CompilerConfig.txt")
include("cmake/ReportConfig.txt")
include("cmake/Generate_Schema.cmake") include("cmake/Generate_Schema.cmake")
include("cmake/Files_and_Targets.txt") include("cmake/Files_and_Targets.txt")
include("cmake/filespecific.cmake") include("cmake/filespecific.cmake")
include("cmake/ReportConfig.txt")
#install(TARGETS fleur inpgen DESTINATION bin) #install(TARGETS fleur inpgen DESTINATION bin)
install(PROGRAMS ${CMAKE_BINARY_DIR}/fleur install(PROGRAMS ${CMAKE_BINARY_DIR}/fleur
CONFIGURATIONS Debug CONFIGURATIONS Debug
......
...@@ -36,8 +36,8 @@ SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments) ...@@ -36,8 +36,8 @@ SUBROUTINE magMoms(dimension,input,atoms,noco,vTot,moments)
END DO END DO
8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,& 8000 FORMAT (/,/,10x,'spin density at the nucleus:',/,10x,'type',t25,&
'input%total',t42,'valence',t65,'core',t90,& 'total',t42,'valence',t65,'core',t90,&
'majority valence and input%total density',/) 'majority valence and total density',/)
8010 FORMAT (i13,2x,3e20.8,5x,2e20.8) 8010 FORMAT (i13,2x,3e20.8,5x,2e20.8)
WRITE (6,FMT=8020) WRITE (6,FMT=8020)
......
...@@ -12,8 +12,8 @@ include("cmake/tests/test_HDF5.cmake") ...@@ -12,8 +12,8 @@ include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_Wannier90.cmake") include("cmake/tests/test_Wannier90.cmake")
include("cmake/tests/test_Wannier4.cmake") include("cmake/tests/test_Wannier4.cmake")
include("cmake/tests/test_Wannier5.cmake") include("cmake/tests/test_Wannier5.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake") include("cmake/tests/test_GPU.cmake")
include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_LibXC.cmake") include("cmake/tests/test_LibXC.cmake")
include("cmake/tests/test_ELPA_onenode.cmake") include("cmake/tests/test_ELPA_onenode.cmake")
if (FLEUR_USE_MPI) if (FLEUR_USE_MPI)
...@@ -22,4 +22,6 @@ include("cmake/tests/test_ELPA.cmake") ...@@ -22,4 +22,6 @@ include("cmake/tests/test_ELPA.cmake")
include("cmake/tests/test_ChASE.cmake") include("cmake/tests/test_ChASE.cmake")
endif() endif()
include("cmake/tests/test_juDFT.cmake")
include("cmake/compileenv.txt") include("cmake/compileenv.txt")
...@@ -20,7 +20,6 @@ include(xc-pot/CMakeLists.txt) ...@@ -20,7 +20,6 @@ include(xc-pot/CMakeLists.txt)
include(cdn/CMakeLists.txt) include(cdn/CMakeLists.txt)
include(diagonalization/CMakeLists.txt) include(diagonalization/CMakeLists.txt)
include(eigen_soc/CMakeLists.txt) include(eigen_soc/CMakeLists.txt)
include(juDFT/CMakeLists.txt)
include(math/CMakeLists.txt) include(math/CMakeLists.txt)
include(orbdep/CMakeLists.txt) include(orbdep/CMakeLists.txt)
include(cdn_mt/CMakeLists.txt) include(cdn_mt/CMakeLists.txt)
...@@ -55,14 +54,13 @@ io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f ...@@ -55,14 +54,13 @@ io/calculator.f global/ss_sym.f global/soc_sym.f math/inv3.f io/rw_symfile.f
kpoints/kptgen_hybrid.f kpoints/od_kptsgen.f kpoints/bravais.f kpoints/divi.f kpoints/brzone.f kpoints/kptgen_hybrid.f kpoints/od_kptsgen.f kpoints/bravais.f kpoints/divi.f kpoints/brzone.f
kpoints/kptmop.f kpoints/kpttet.f init/bandstr1.F kpoints/ordstar.f kpoints/fulstar.f kpoints/kprep.f kpoints/kptmop.f kpoints/kpttet.f init/bandstr1.F kpoints/ordstar.f kpoints/fulstar.f kpoints/kprep.f
kpoints/tetcon.f kpoints/kvecon.f init/boxdim.f global/radsra.f global/differ.f math/inwint.f kpoints/tetcon.f kpoints/kvecon.f init/boxdim.f global/radsra.f global/differ.f math/inwint.f
math/outint.f math/grule.f math/outint.f math/grule.f )
)
set(inpgen_F90 ${inpgen_F90} global/constants.f90 io/xsf_io.f90 set(inpgen_F90 ${inpgen_F90} global/constants.f90 io/xsf_io.f90
eigen/orthoglo.F90 juDFT/usage_data.F90 math/ylm4.F90 mpi/mpi_bc_tool.F90 eigen/orthoglo.F90 math/ylm4.F90 mpi/mpi_bc_tool.F90
global/sort.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90 global/find_enpara.f90 global/sort.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 global/find_enpara.f90
inpgen/closure.f90 inpgen/inpgen_arguments.F90 math/intgr.F90 inpgen/closure.f90 math/intgr.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 juDFT/string.f90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
init/compile_descr.F90 kpoints/kpoints.f90 io/xmlOutput.F90 kpoints/brzone2.f90 cdn/slab_dim.f90 cdn/slabgeom.f90 dos/nstm3.f90 cdn/int_21.f90 init/compile_descr.F90 kpoints/kpoints.f90 io/xmlOutput.F90 kpoints/brzone2.f90 cdn/slab_dim.f90 cdn/slabgeom.f90 dos/nstm3.f90 cdn/int_21.f90
cdn/int_21lo.f90 cdn_mt/rhomt21.f90 cdn_mt/rhonmt21.f90 force/force_a21.F90 force/force_a21_lo.f90 force/force_a21_U.f90 force/force_a12.f90 cdn/int_21lo.f90 cdn_mt/rhomt21.f90 cdn_mt/rhonmt21.f90 force/force_a21.F90 force/force_a21_lo.f90 force/force_a21_U.f90 force/force_a12.f90
eigen/tlmplm_store.F90 xc-pot/gaunt.f90 kpoints/unfoldBandKPTS.f90) eigen/tlmplm_store.F90 xc-pot/gaunt.f90 kpoints/unfoldBandKPTS.f90)
...@@ -74,17 +72,17 @@ set_source_files_properties(${fleur_F77} PROPERTIES Fortran_FORMAT FIXED) ...@@ -74,17 +72,17 @@ set_source_files_properties(${fleur_F77} PROPERTIES Fortran_FORMAT FIXED)
set_source_files_properties(${inpgen_F90} PROPERTIES Fortran_FORMAT FREE) set_source_files_properties(${inpgen_F90} PROPERTIES Fortran_FORMAT FREE)
set_source_files_properties(${inpgen_F77} PROPERTIES Fortran_FORMAT FIXED) set_source_files_properties(${inpgen_F77} PROPERTIES Fortran_FORMAT FIXED)
string(REPLACE ";" " " CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FLEUR_PRECISION_OPTION}")
message("Flags: ${CMAKE_Fortran_FLAGS}")
if (${FLEUR_USE_SERIAL}) if (${FLEUR_USE_SERIAL})
#Serial executables #Serial executables
add_executable(fleur ${fleur_SRC} ${c_filesFleur}) add_executable(fleur ${fleur_SRC} ${c_filesFleur})
target_compile_definitions(fleur PUBLIC ${FLEUR_DEFINITIONS}) target_compile_definitions(fleur PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(fleur ${FLEUR_LIBRARIES}) target_link_libraries(fleur ${FLEUR_LIBRARIES})
set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY fleur_modules COMPILE_OPTIONS -Ifleur_modules) target_link_libraries(fleur juDFT)
#inpgen executable set_target_properties(fleur PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur COMPILE_OPTIONS -Imodules/fleur)
add_executable(inpgen ${inpgen_F77} ${inpgen_F90} ${juDFT_SRC_F90} ${c_filesInpgen})
target_compile_definitions(inpgen PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(inpgen ${FLEUR_LIBRARIES})
set_target_properties(inpgen PROPERTIES Fortran_MODULE_DIRECTORY inpgen_modules COMPILE_OPTIONS -Iinpgen_modules)
endif() endif()
#parallel executables #parallel executables
if(${FLEUR_USE_MPI}) if(${FLEUR_USE_MPI})
...@@ -92,18 +90,28 @@ if(${FLEUR_USE_MPI}) ...@@ -92,18 +90,28 @@ if(${FLEUR_USE_MPI})
add_executable(fleur_MPI ${juDFT_HDF} ${juDFT_SRC_F90} ${fleur_SRC} ${c_filesFleur} ${fleur_SRC_MPI}) add_executable(fleur_MPI ${juDFT_HDF} ${juDFT_SRC_F90} ${fleur_SRC} ${c_filesFleur} ${fleur_SRC_MPI})
target_compile_definitions(fleur_MPI PUBLIC ${FLEUR_MPI_DEFINITIONS}) target_compile_definitions(fleur_MPI PUBLIC ${FLEUR_MPI_DEFINITIONS})
target_link_libraries(fleur_MPI ${FLEUR_LIBRARIES}) target_link_libraries(fleur_MPI ${FLEUR_LIBRARIES})
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY fleur_MPI_modules COMPILE_OPTIONS -Ifleur_MPI_modules) target_link_libraries(fleur_MPI juDFT)
set_target_properties(fleur_MPI PROPERTIES Fortran_MODULE_DIRECTORY modules/fleur_MPI COMPILE_OPTIONS -Imodules/fleur_MPI)
endif () endif ()
#inpgen executable
add_executable(inpgen ${inpgen_F77} ${inpgen_F90} ${juDFT_SRC_F90} ${c_filesInpgen})
target_compile_definitions(inpgen PUBLIC ${FLEUR_DEFINITIONS})
target_link_libraries(inpgen ${FLEUR_LIBRARIES})
target_link_libraries(inpgen juDFT)
set_target_properties(inpgen PROPERTIES Fortran_MODULE_DIRECTORY modules/inpgen COMPILE_OPTIONS -Imodules/inpgen)
if (${FLEUR_USE_SERIAL}) include(cmake/docker.txt)
install(TARGETS fleur inpgen
CONFIGURATIONS Release
DESTINATION bin) #if (${FLEUR_USE_SERIAL})
endif() #install(TARGETS fleur inpgen
if (${FLEUR_USE_MPI}) # CONFIGURATIONS Release
install(TARGETS fleur_MPI # DESTINATION bin)
CONFIGURATIONS Release #endif()
DESTINATION bin) #if (${FLEUR_USE_MPI})
endif() #install(TARGETS fleur_MPI
# CONFIGURATIONS Release
# DESTINATION bin)
#endif()
#cmake file to set compiler flags for some of the known compilers #cmake file to set compiler flags for some of the known compilers
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
message("Intel Fortran detected") message("Intel Fortran detected")
set(FLEUR_PRECISION_OPTION "-r8")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "13.0.0.0") if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "13.0.0.0")
set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. Most likely FLEUR will not be build sucessfully. Consider to upgrade your compiler.") set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. Most likely FLEUR will not be build sucessfully. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp -assume byterecl") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -openmp -assume byterecl")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_OLDINTEL") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_OLDINTEL")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_OLDINTEL") set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_OLDINTEL")
elseif (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0") elseif (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -openmp -assume byterecl") set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. The execution of the fleur_MPI might fail. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -openmp -assume byterecl")
elseif (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "17.0.0.0")
set(FLEUR_WARN_MESSAGE "You are using an old version of the Intel Fortran Compiler. The execution of the fleur_MPI might fail. Consider to upgrade your compiler.")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -qopenmp -assume byterecl")
else() else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp -assume byterecl") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -qopenmp -assume byterecl")
endif() endif()
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2 -g") set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2 -g")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "19.0.0.0") if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "19.0.0.0")
...@@ -18,20 +23,22 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") ...@@ -18,20 +23,22 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -CB -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -CB -traceback -O0 -g -ftrapuv -check uninit -check pointers -DCPP_DEBUG")
endif() endif()
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI") elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
set(FLEUR_PRECISION_OPTION "-Mr8;-Mr8intrinsics")
message("PGI Fortran detected") message("PGI Fortran detected")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake
#CPU #CPU
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp")
#GPU #GPU
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda=cuda9.0,cc60 -Mcudalib=cublas") #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda=cuda9.0,cc60 -Mcudalib=cublas")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc") #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda:kepler+ -ta:tesla:cuda7.5 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:cuda9.0,cc70 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc") #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mcuda:cuda9.0,cc70 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast -O3") #set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast -O3")
set(CMAKE_Fortran_FLAGS_RELEASE "-O1 ") # to prevent cmake from putting -fast which auses problems with PGI18.4 set(CMAKE_Fortran_FLAGS_RELEASE "-O1 ") # to prevent cmake from putting -fast which auses problems with PGI18.4
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr -Ktrap=fp -DCPP_DEBUG") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr -Ktrap=fp -DCPP_DEBUG")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL") elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
message("IBM/BG Fortran detected") message("IBM/BG Fortran detected")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qrealsize=8 -qfixed -qsuppress=1520-022 -qessl") set(FLEUR_PRECISION_OPTION "-qrealsize=8")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qfixed -qsuppress=1520-022 -qessl")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4 -qsuppress=1500-036") set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4 -qsuppress=1500-036")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g -DCPP_DEBUG") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g -DCPP_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/bgsys/local/libxml2/include/libxml2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/bgsys/local/libxml2/include/libxml2")
...@@ -39,6 +46,7 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL") ...@@ -39,6 +46,7 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_AIX") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_AIX")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
message("gfortran detected") message("gfortran detected")
set(FLEUR_PRECISION_OPTION "-fdefault-real-8")
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "6.1.0") if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "6.1.0")
message(FATAL_ERROR "Only modern versions of gfortran >6.3 will be able to compile FLEUR\nYou need to specify a different compiler.\nSee the docs at www.flapw.de.\n") message(FATAL_ERROR "Only modern versions of gfortran >6.3 will be able to compile FLEUR\nYou need to specify a different compiler.\nSee the docs at www.flapw.de.\n")
endif() endif()
......
find_program(DOCKER docker)
if (DOCKER)
if (FLEUR_USE_MPI)
set(dockername fleur_MPI)
else()
set(dockername fleur)
endif()
message("${DOCKER}->${dockername}")
add_custom_command(OUTPUT docker/Dockerfile
COMMAND "mkdir docker"
COMMAND "cp ${CMAKE_CURRENT_SOURCE_DIR}/docker/Dockerfile_${dockername} docker/Dockerfile"
COMMAND "cd docker;${DOCKER} build -t iffregistery.fz-juelich.de/fleur/fleur:${dockername} ."
COMMAND "${DOCKER} push iffregistery.fz-juelich.de/fleur/fleur:${dockername}"
DEPENDS inpgen ${dockername}
COMMENT "Build docker image")
add_custom_target(docker DEPENDS docker/Dockerfile)
endif()
...@@ -8,7 +8,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") ...@@ -8,7 +8,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
#set_source_files_properties(io/eig66_mpi.F90 PROPERTIES COMPILE_FLAGS -O0) #set_source_files_properties(io/eig66_mpi.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(cdn/pwden.F90 PROPERTIES COMPILE_FLAGS -O0) #set_source_files_properties(cdn/pwden.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(eigen/apws.F90 PROPERTIES COMPILE_FLAGS -O0) #set_source_files_properties(eigen/apws.F90 PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(init/lhcal.f PROPERTIES COMPILE_FLAGS -O0) set_source_files_properties(juDFT/time.F90 PROPERTIES COMPILE_FLAGS -O0)
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0") if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_LESS "14.1.0.0")
set_source_files_properties(vgen/vmtxcg.F90 PROPERTIES COMPILE_FLAGS -no-openmp) set_source_files_properties(vgen/vmtxcg.F90 PROPERTIES COMPILE_FLAGS -no-openmp)
endif() endif()
......
#NOSHOW #NOSHOW
export FC=mpif90 export FC=mpif90
FLEUR_INCLUDEDIR="/opt/include" FLEUR_INCLUDEDIR="/opt/include"
FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-lhdf5_fortran;-lhdf5;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas" FLEUR_LIBRARIES="-L/opt/lib;-lxcf03;-lxc;-ldl;-L/usr/lib;-L/usr/lib/x86_64-linux-gnu;-lxml2;-lscalapack-openmpi;-lblacsF77init-openmpi;-lblacs-openmpi;-llapack;-lblas"
...@@ -22,6 +22,7 @@ do ...@@ -22,6 +22,7 @@ do
-magma) shift; CLI_USE_MAGMA=$1;; -magma) shift; CLI_USE_MAGMA=$1;;
-gpu) shift; CLI_USE_GPU=$1;; -gpu) shift; CLI_USE_GPU=$1;;
-chase) shift; CLI_USE_CHASE=$1;; -chase) shift; CLI_USE_CHASE=$1;;
-libxc) shift; CLI_USE_LIBXC=$1;;
-link) shift; CLI_LIBRARIES=$1;; -link) shift; CLI_LIBRARIES=$1;;
-libdir) shift; CLI_LIBDIR="$CLI_LIBDIR $1";; -libdir) shift; CLI_LIBDIR="$CLI_LIBDIR $1";;
-flags) shift; CLI_FLAGS=$1;; -flags) shift; CLI_FLAGS=$1;;
...@@ -81,10 +82,11 @@ General options: ...@@ -81,10 +82,11 @@ General options:
-cmake_opts # : additional options for cmake can be specified here directly -cmake_opts # : additional options for cmake can be specified here directly
Command line options to switch on/off features. These options overwrite the results of Command line options to switch on/off features. These options overwrite the results of
the test and might lead to the configuration to fail. the test and might lead to the configuration to fail.
-hdf5 [TRUE|FALSE] : use HDF5 library -hdf5 [TRUE|FALSE] : use HDF5 library
-wannier [TRUE|FALSE] : use Wannier90 library -wannier [TRUE|FALSE] : use Wannier90 library
-mpi [TRUE|FALSE] : compile the MPI parallel version -mpi [TRUE|FALSE] : compile the MPI parallel version
-libxc [TRUE|FALSE] : use libxc library
Command line option to compile external libraries: Command line option to compile external libraries:
-external # : download and compile external libraries before building FLEUR -external # : download and compile external libraries before building FLEUR
......
...@@ -101,11 +101,14 @@ then ...@@ -101,11 +101,14 @@ then
echo "set(CLI_FLEUR_USE_GPU $CLI_USE_GPU)" >>config.cmake echo "set(CLI_FLEUR_USE_GPU $CLI_USE_GPU)" >>config.cmake
fi fi
if [ "$CLI_USE_LIBXC" ]
then
echo "set(CLI_FLEUR_USE_LIBXC $CLI_USE_LIBXC)" >>config.cmake
fi
if [ "$CLI_USE_SERIAL" ] if [ "$CLI_USE_SERIAL" ]
then then
echo "set(FLEUR_USE_SERIAL $CLI_USE_SERIAL)" >>config.cmake echo "set(CLI_FLEUR_USE_SERIAL $CLI_USE_SERIAL)" >>config.cmake
else
echo "set(FLEUR_USE_SERIAL TRUE)" >>config.cmake
fi fi
if [ "$CLI_ELPA_OPENMP" ] if [ "$CLI_ELPA_OPENMP" ]
......
...@@ -13,6 +13,10 @@ if (CLI_FLEUR_USE_GPU) ...@@ -13,6 +13,10 @@ if (CLI_FLEUR_USE_GPU)
elseif(${CLI_FLEUR_USE_GPU} MATCHES "nvtx") elseif(${CLI_FLEUR_USE_GPU} MATCHES "nvtx")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60,ptxinfo,lineinfo -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ") #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60,ptxinfo,lineinfo -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt ")
elseif(${CLI_FLEUR_USE_GPU} MATCHES "magma")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.1,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cuda9.2,cc60 -Mcuda=rdc -Mcudalib=cublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=cc60 -Mcuda=rdc -lcublas -lnvToolsExt -lmagma -lmkl_intel_lp64 -lmkl_core")
elseif(${CLI_FLEUR_USE_GPU} MATCHES "emu") elseif(${CLI_FLEUR_USE_GPU} MATCHES "emu")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas -Minfo=accel ") #set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas -Minfo=accel ")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas ") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mcuda=emu -Mcudalib=cublas ")
...@@ -20,15 +24,15 @@ if (CLI_FLEUR_USE_GPU) ...@@ -20,15 +24,15 @@ if (CLI_FLEUR_USE_GPU)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED") set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_GPU" "CPP_MANAGED=,MANAGED")
#Now check for cusolverDN library #Now check for cusolverDN library
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda -ta=tesla,cuda9.1 ") # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Mcuda -ta=tesla,cuda9.1 ")
try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c # try_compile(FLEUR_USE_CUSOLVER ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_cusolver.c
LINK_LIBRARIES "-lcusolver" # LINK_LIBRARIES "-lcusolver"
) # )
if (FLEUR_USE_CUSOLVER) # if (FLEUR_USE_CUSOLVER)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};-lcusolver") # set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};-lcusolver")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_CUSOLVER") # set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_CUSOLVER")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_CUSOLVER") # set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_CUSOLVER")
endif() # endif()
else() else()
set(FLEUR_USE_GPU FALSE) set(FLEUR_USE_GPU FALSE)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MANAGED=") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MANAGED=")
......
...@@ -31,10 +31,39 @@ endif() ...@@ -31,10 +31,39 @@ endif()
message("HDF5 Library found:${FLEUR_USE_HDF5}") message("HDF5 Library found:${FLEUR_USE_HDF5}")
if (DEFINED CLI_FLEUR_USE_HDF5}) if (DEFINED CLI_FLEUR_USE_HDF5)
if (CLI_FLEUR_USE_HDF5}) if (CLI_FLEUR_USE_HDF5)
if (NOT FLEUR_USE_HDF5) if (NOT FLEUR_USE_HDF5)
message(FATAL_ERROR "You asked for HDF5 but cmake couldn't find it. Please set HDF5_ROOT and or give additional compiler/linker flags") message(WARNING "You asked for HDF5 but cmake couldn't find it. We will try to download and compile HDF5 along with FLEUR")
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/hdf5-git/src" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init external/hdf5-git WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/hdf5-git && git submodule update' and resulted in error" )
endif()
endif()
set(HDF5_EXTERNALLY_CONFIGURED 1)
set(HDF5_EXPORTED_TARGETS "hdf5_fortran-static")
set(HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support")
set(HDF5_BUILD_CPP_LIB OFF CACHE BOOL "Build HDF5 C++ Library")
set(HDF5_BUILD_HL_LIB OFF CACHE BOOL "Build HIGH Level HDF5 Library")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libraries")
set(HDF5_BUILD_TOOLS OFF CACHE BOOL "Build HDF5 Tools")
set(HDF5_BUILD_EXAMPLES OFF CACHE BOOL "Build HDF5 Library Examples")
set(BUILD_TESTING OFF CACHE BOOL "Build HDF5 Unit Testing")
if (FLEUR_USE_MPI)
set(HDF5_ENABLE_PARALLEL ON CACHE BOOL "Enable parallel build (requires MPI)")
else()
set(HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)")
endif()
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5")
add_subdirectory (external/hdf5-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_HDF5 TRUE)
set(FLEUR_USE_HDF5MPI FLEUR_USE_MPI)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};hdf5_fortran-static")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/modules/hdf5/static")
endif() endif()
else() else()
if (FLEUR_USE_HDF5) if (FLEUR_USE_HDF5)
......
...@@ -3,6 +3,41 @@ try_compile(FLEUR_USE_LIBXC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/ ...@@ -3,6 +3,41 @@ try_compile(FLEUR_USE_LIBXC ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/
LINK_LIBRARIES ${FLEUR_LIBRARIES} LINK_LIBRARIES ${FLEUR_LIBRARIES}
) )
if (DEFINED CLI_FLEUR_USE_LIBXC)
if (CLI_FLEUR_USE_LIBXC)
if (NOT FLEUR_USE_LIBXC)
message("You asked for LibXC support but cmake couldn't find it. We will try to download and compile along with FLEUR")
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/libxc-git/src" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init external/libxc-git WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/libxc-git && git submodule update' and resulted in error" )
endif()
endif()
#patch libxc
execute_process(COMMAND "sh" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/external/libxc-git" INPUT_FILE "${PROJECT_SOURCE_DIR}/external/patch-libxc.sh")
message("libxc was patched")
set(ENABLE_FORTRAN ON CACHE BOOL "Build Fortran 90 interface")
set(ENABLE_FORTRAN03 ON CACHE BOOL "Build Fortran 2003 interface")
add_subdirectory (external/libxc-git EXCLUDE_FROM_ALL)
set(FLEUR_USE_LIBXC TRUE)
set(FLEUR_LIBRARIES "${FLEUR_LIBRARIES};xcf90;xcf03")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -I${CMAKE_CURRENT_BINARY_DIR}/external/libxc-git")
endif()
else()
if (FLEUR_USE_LIBXC)
message("LibXC found but you explicitely asked not to use it")
set(FLEUR_USE_LIBXC FALSE)
endif()
endif()
endif()
message("Libxc Library found:${FLEUR_USE_LIBXC}") message("Libxc Library found:${FLEUR_USE_LIBXC}")
if (FLEUR_USE_LIBXC) if (FLEUR_USE_LIBXC)
......
...@@ -20,4 +20,11 @@ endif() ...@@ -20,4 +20,11 @@ endif()
if (FLEUR_USE_MPI) if (FLEUR_USE_MPI)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MPI") set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_MPI")
set(FLEUR_USE_SERIAL FALSE)
else()
set(FLEUR_USE_SERIAL TRUE)
endif()
if (DEFINED CLI_FLEUR_USE_SERIAL)
set(FLEUR_USE_SERIAL CLI_FLEUR_USE_SERIAL)
endif() endif()
\ No newline at end of file
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/juDFT/CMakeLists.txt" )
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule init juDFT WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_init OUTPUT_QUIET ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE _res_update OUTPUT_QUIET ERROR_QUIET)
if( ${_res_init} GREATER 0 OR ${_res_update} GREATER 0 )
message(FATAL_ERROR "HDF5 source could not be downloaded.\n"
"We tried: 'git submodule init external/libxc-git && git submodule update' and resulted in error" )
endif()
endif()
set(JUDFT_USE_MPI ${FLEUR_USE_MPI} CACHE BOOL "Compile with MPI, will also work in serial")
set(JUDFT_USE_HDF5 ${FLEUR_USE_HDF5} CACHE BOOL "Compile with HDF5")
if (DEFINED FLEUR_USE_HDF5MPI)
set(JUDFT_USE_HDF5MPI FLEUR_USE_HDF5MPI CACHE BOOL "Is the HDF5 version able to do parallel IO" )
endif()
#In addition you might want to set
set(JUDFT_COMPILEOPTS ${FLEUR_PRECISION_OPTION})
add_subdirectory(juDFT)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/juDFT/modules/juDFT")
...@@ -9,14 +9,47 @@ diagonalization/chase_diag.F90 ...@@ -9,14 +9,47 @@ diagonalization/chase_diag.F90
diagonalization/symmetrize_matrix.f90 diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90 diagonalization/cusolver_diag.F90
diagonalization/elemental.F90 diagonalization/elemental.F90
diagonalization/available_solvers.F90
diagonalization/writeout.F90
diagonalization/elpa_20180525_onenode.F90) diagonalization/elpa_20180525_onenode.F90)
if (FLEUR_USE_ELPA_20180525) if (FLEUR_USE_ELPA_20180525)
set(fleur_F90 ${fleur_F90} set(fleur_F90 ${fleur_F90} diagonalization/elpa_20180525.F90)
diagonalization/elpa_20180525.F90 set(diag_test_files diagonalization/elpa_20180525.F90)
)
else() else()
set(fleur_F90 ${fleur_F90} set(fleur_F90 ${fleur_F90} diagonalization/elpa.F90)
diagonalization/elpa.F90 set(diag_test_files diagonalization/elpa.F90)
endif()
if (FLEUR_USE_HDF5)
set(diag_test_files ${diag_test_files}
diagonalization/diag_test.F90
diagonalization/eigen_diag.F90
diagonalization/lapack_diag.F90
diagonalization/magma.F90
diagonalization/scalapack.F90
#diagonalization/chase_diag.F90
#diagonalization/symmetrize_matrix.f90
diagonalization/cusolver_diag.F90
diagonalization/elemental.F90
diagonalization/available_solvers.F90
diagonalization/writeout.F90
diagonalization/elpa_20180525_onenode.F90
types/types_mat.F90
types/types_mpimat.F90
types/types_gpumat.F90
types/types_setup.F90
io/io_matrix.F90
io/iomatrix_hdf.F90
) )
add_executable(diag_test EXCLUDE_FROM_ALL ${diag_test_files} )
target_link_libraries(diag_test ${FLEUR_LIBRARIES})
target_link_libraries(diag_test juDFT)
if (FLEUR_USE_MPI)
target_compile_definitions(diag_test PUBLIC ${FLEUR_MPI_DEFINITIONS})
else()
target_compile_definitions(diag_test PUBLIC ${FLEUR_DEFINITIONS})
endif() endif()
set_target_properties(diag_test PROPERTIES Fortran_MODULE_DIRECTORY modules/diag_test COMPILE_OPTIONS -Imodules/diag_test RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/tools")
endif()
!--------------------------------------------------------------------------------