Commit 597e7658 authored by Daniel Wortmann's avatar Daniel Wortmann

Finished merge

parent a8cdfbb1
build-gfortran:
image: ubuntu:16.10
stage: build
cache:
paths:
- build
script:
- apt-get update -qq && apt-get install -y -qq build-essential gfortran gfortran-6 g++-6 gcc-6 binutils-gold git cmake libxml2-dev liblapack-dev libblas-dev doxygen
- cd /builds/fleur/fleur; ./configure.sh AUTO; cd build; make
test-gfortran:
image: ubuntu:16.10
stage: test
cache:
paths:
- build
script:
- apt-get update -qq && apt-get install -y -qq build-essential gfortran gfortran-6 g++-6 gcc-6 binutils-gold git cmake libxml2-dev liblapack-dev libblas-dev doxygen
- ulimit -s unlimited ;cd /builds/fleur/fleur/build;ctest
#build-pgi:
# image: hopobcn/pgi-ce
# stage: build
# cache:
# paths:
# - build.debug
# script:
# - apt-get update -qq && apt-get install -y -qq cmake libxml2-dev
# - cd /builds/fleur/fleur; ./configure.sh AUTO debug; cd build.debug; make
#test-pgi:
# image: hopobcn/pgi-ce
# stage: test
# cache:
# paths:
# - build.debug
# script:
# - apt-get update -qq && apt-get install -y -qq cmake libxml2-dev
# - cd /builds/fleur/fleur/build.debug;ctest
...@@ -3,7 +3,7 @@ MODULE m_cdnval ...@@ -3,7 +3,7 @@ MODULE m_cdnval
CONTAINS CONTAINS
SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,sliceplot,noco, input,banddos,cell,atoms,enpara,stars,& SUBROUTINE cdnval(eig_id, mpi,kpts,jspin,sliceplot,noco, input,banddos,cell,atoms,enpara,stars,&
vacuum,dimension, sphhar, sym,obsolete, igq_fft,vr, vz, oneD, n_mmp,results, qpw,rhtxy,& vacuum,dimension, sphhar, sym,obsolete, igq_fft,vr, vz, oneD, n_mmp,results, qpw,rhtxy,&
rho,rht,cdom,cdomvz,cdomvxy,qa21, chmom,clmom) rho,rht,cdom,cdomvz,cdomvxy,qvac,qvlay,qa21, chmom,clmom)
! !
! *********************************************************** ! ***********************************************************
! this subroutin is a modified version of cdnval.F. ! this subroutin is a modified version of cdnval.F.
...@@ -123,6 +123,8 @@ CONTAINS ...@@ -123,6 +123,8 @@ CONTAINS
REAL, INTENT (OUT) :: chmom(atoms%ntype,dimension%jspd),clmom(3,atoms%ntype,dimension%jspd) REAL, INTENT (OUT) :: chmom(atoms%ntype,dimension%jspd),clmom(3,atoms%ntype,dimension%jspd)
REAL, INTENT (INOUT) :: rho(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,dimension%jspd) REAL, INTENT (INOUT) :: rho(atoms%jmtd,0:sphhar%nlhd,atoms%ntype,dimension%jspd)
REAL, INTENT (INOUT) :: rht(vacuum%nmzd,2,dimension%jspd) REAL, INTENT (INOUT) :: rht(vacuum%nmzd,2,dimension%jspd)
REAL, INTENT (INOUT) :: qvac(dimension%neigd,2,kpts%nkpt,dimension%jspd)
REAL, INTENT (INOUT) :: qvlay(dimension%neigd,vacuum%layerd,2,kpts%nkpt,dimension%jspd)
COMPLEX, INTENT(INOUT) :: n_mmp(-3:3,-3:3,atoms%n_u) COMPLEX, INTENT(INOUT) :: n_mmp(-3:3,-3:3,atoms%n_u)
#ifdef CPP_MPI #ifdef CPP_MPI
...@@ -158,7 +160,7 @@ CONTAINS ...@@ -158,7 +160,7 @@ CONTAINS
REAL, ALLOCATABLE :: volintsl(:) REAL, ALLOCATABLE :: volintsl(:)
REAL, ALLOCATABLE :: qintsl(:,:),qmtsl(:,:) REAL, ALLOCATABLE :: qintsl(:,:),qmtsl(:,:)
REAL, ALLOCATABLE :: orbcomp(:,:,:),qmtp(:,:) REAL, ALLOCATABLE :: orbcomp(:,:,:),qmtp(:,:)
REAL, ALLOCATABLE :: qis(:,:,:),qvac(:,:,:,:),qvlay(:,:,:,:,:) REAL, ALLOCATABLE :: qis(:,:,:)
!-new_sl !-new_sl
!-dw !-dw
INTEGER, ALLOCATABLE :: gvac1d(:),gvac2d(:) ,kveclo(:) INTEGER, ALLOCATABLE :: gvac1d(:),gvac2d(:) ,kveclo(:)
...@@ -349,10 +351,7 @@ CONTAINS ...@@ -349,10 +351,7 @@ CONTAINS
aclo(:,:,:) = 0.0 ; bclo(:,:,:) = 0.0 ; ccnmt(:,:,:,:,:) = 0.0 aclo(:,:,:) = 0.0 ; bclo(:,:,:) = 0.0 ; ccnmt(:,:,:,:,:) = 0.0
acnmt(:,:,:,:,:)=0.0 ; bcnmt(:,:,:,:,:)=0.0 ; cclo(:,:,:,:)=0.0 acnmt(:,:,:,:,:)=0.0 ; bcnmt(:,:,:,:,:)=0.0 ; cclo(:,:,:,:)=0.0
ALLOCATE ( qis(dimension%neigd,kpts%nkpt,dimension%jspd), & ALLOCATE ( qis(dimension%neigd,kpts%nkpt,dimension%jspd))
qvac(dimension%neigd,2,kpts%nkpt,dimension%jspd), &
qvlay(dimension%neigd,vacuum%layerd,2,kpts%nkpt,dimension%jspd) )
qvac(:,:,:,:)=0.0 ; qvlay(:,:,:,:,:)=0.0
skip_tt = dot_product(enpara%skiplo(:atoms%ntype,jspin),atoms%neq(:atoms%ntype)) skip_tt = dot_product(enpara%skiplo(:atoms%ntype,jspin),atoms%neq(:atoms%ntype))
IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt IF (noco%l_soc.OR.noco%l_noco) skip_tt = 2 * skip_tt
...@@ -919,6 +918,7 @@ CONTAINS ...@@ -919,6 +918,7 @@ CONTAINS
ener(0,1,ispin),sqal(0,1,ispin),& ener(0,1,ispin),sqal(0,1,ispin),&
enerlo(1,1,ispin),& enerlo(1,1,ispin),&
sqlo(1,1,ispin)) sqlo(1,1,ispin))
CALL w_enpara(& CALL w_enpara(&
atoms,jspin,input%film,& atoms,jspin,input%film,&
enpara,16) enpara,16)
......
...@@ -78,6 +78,7 @@ CONTAINS ...@@ -78,6 +78,7 @@ CONTAINS
USE m_rfft USE m_rfft
USE m_cfft USE m_cfft
USE m_types USE m_types
USE m_fft_interface
IMPLICIT NONE IMPLICIT NONE
TYPE(t_lapw),INTENT(IN) :: lapw TYPE(t_lapw),INTENT(IN) :: lapw
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
...@@ -135,6 +136,10 @@ CONTAINS ...@@ -135,6 +136,10 @@ CONTAINS
COMPLEX CPP_BLAS_cdotc COMPLEX CPP_BLAS_cdotc
EXTERNAL CPP_BLAS_cdotc EXTERNAL CPP_BLAS_cdotc
LOGICAL forw
INTEGER length_zfft(3)
COMPLEX, ALLOCATABLE :: zfft(:)
!-------> ABBREVIATIONS !-------> ABBREVIATIONS
! !
...@@ -196,6 +201,7 @@ CONTAINS ...@@ -196,6 +201,7 @@ CONTAINS
ELSE ELSE
ALLOCATE ( psir(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),& ALLOCATE ( psir(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),&
psii(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),& psii(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),&
zfft(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),&
rhon(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1) ) rhon(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1) )
IF (input%l_f) ALLOCATE ( kpsir(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),& IF (input%l_f) ALLOCATE ( kpsir(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),&
kpsii(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),& kpsii(0:stars%kq1_fft*stars%kq2_fft*stars%kq3_fft-1),&
...@@ -396,9 +402,21 @@ CONTAINS ...@@ -396,9 +402,21 @@ CONTAINS
ENDDO ENDDO
ENDIF ENDIF
ELSE ELSE
CALL cfft(psir,psii,ifftq3,stars%kq1_fft,ifftq1,isn) !--------------------------------
CALL cfft(psir,psii,ifftq3,stars%kq2_fft,ifftq2,isn) ! FFT transform
CALL cfft(psir,psii,ifftq3,stars%kq3_fft,ifftq3,isn) zfft = cmplx(psir,psii)
if (isn == -1) then
forw = .true.
else
forw = .false.
end if
length_zfft(1) = stars%kq1_fft
length_zfft(2) = stars%kq2_fft
length_zfft(3) = stars%kq3_fft
call fft_interface(3,length_zfft,zfft,forw)
psir = real(zfft)
psii = aimag(zfft)
!--------------------------------
! GM forces part ! GM forces part
IF (input%l_f) THEN IF (input%l_f) THEN
DO ir = 0,ifftq3d-1 DO ir = 0,ifftq3d-1
...@@ -420,9 +438,21 @@ CONTAINS ...@@ -420,9 +438,21 @@ CONTAINS
kpsii( iv1d(iv,jspin) ) = s * AIMAG(zMat%z_c(iv,nu)) kpsii( iv1d(iv,jspin) ) = s * AIMAG(zMat%z_c(iv,nu))
ENDDO ENDDO
CALL cfft(kpsir,kpsii,ifftq3,stars%kq1_fft,ifftq1,isn) !--------------------------------
CALL cfft(kpsir,kpsii,ifftq3,stars%kq2_fft,ifftq2,isn) ! FFT transform
CALL cfft(kpsir,kpsii,ifftq3,stars%kq3_fft,ifftq3,isn) zfft = cmplx(kpsir,kpsii)
if (isn == -1) then
forw = .true.
else
forw = .false.
end if
length_zfft(1) = stars%kq1_fft
length_zfft(2) = stars%kq2_fft
length_zfft(3) = stars%kq3_fft
call fft_interface(3,length_zfft,zfft,forw)
kpsir = real(zfft)
kpsii = aimag(zfft)
!--------------------------------
DO ir = 0,ifftq3d-1 DO ir = 0,ifftq3d-1
ekin(ir) = ekin(ir) + wtf(nu) * 0.5 * (kpsir(ir)**2+kpsii(ir)**2) ekin(ir) = ekin(ir) + wtf(nu) * 0.5 * (kpsir(ir)**2+kpsii(ir)**2)
...@@ -543,14 +573,38 @@ CONTAINS ...@@ -543,14 +573,38 @@ CONTAINS
IF (input%l_f) CALL rfft(isn,stars%kq1_fft,stars%kq2_fft,stars%kq3_fft+1,stars%kq1_fft,stars%kq2_fft,stars%kq3_fft,& IF (input%l_f) CALL rfft(isn,stars%kq1_fft,stars%kq2_fft,stars%kq3_fft+1,stars%kq1_fft,stars%kq2_fft,stars%kq3_fft,&
stars%kq1_fft,stars%kq2_fft,stars%kq3_fft,wsave,kpsir(ifftq3d), ekin(-ifftq2)) stars%kq1_fft,stars%kq2_fft,stars%kq3_fft,wsave,kpsir(ifftq3d), ekin(-ifftq2))
ELSE ELSE
CALL cfft(rhon,psir,ifftq3,stars%kq1_fft,ifftq1,isn) !--------------------------------
CALL cfft(rhon,psir,ifftq3,stars%kq2_fft,ifftq2,isn) ! FFT transform
CALL cfft(rhon,psir,ifftq3,stars%kq3_fft,ifftq3,isn) zfft = cmplx(rhon,psir)
if (isn == -1) then
forw = .true.
else
forw = .false.
end if
length_zfft(1) = stars%kq1_fft
length_zfft(2) = stars%kq2_fft
length_zfft(3) = stars%kq3_fft
call fft_interface(3,length_zfft,zfft,forw)
rhon = real(zfft)
psir = aimag(zfft)
!--------------------------------
!+apw !+apw
IF (input%l_f) THEN IF (input%l_f) THEN
CALL cfft(ekin,psii,ifftq3,stars%kq1_fft,ifftq1,isn) !--------------------------------
CALL cfft(ekin,psii,ifftq3,stars%kq2_fft,ifftq2,isn) ! FFT transform
CALL cfft(ekin,psii,ifftq3,stars%kq3_fft,ifftq3,isn) zfft = cmplx(ekin,psii)
if (isn == -1) then
forw = .true.
else
forw = .false.
end if
length_zfft(1) = stars%kq1_fft
length_zfft(2) = stars%kq2_fft
length_zfft(3) = stars%kq3_fft
call fft_interface(3,length_zfft,zfft,forw)
ekin = real(zfft)
psii = aimag(zfft)
!--------------------------------
ENDIF ENDIF
ENDIF ENDIF
ENDIF ENDIF
......
...@@ -47,16 +47,16 @@ CONTAINS ...@@ -47,16 +47,16 @@ CONTAINS
nz = 1 nz = 1
na = 0 na = 0
DO i=1,atoms%ntype DO i=1,atoms%ntype
DO j=1,atoms%neq(i) equivAtomsLoop: DO j=1,atoms%neq(i)
na = na + 1 na = na + 1
zs = atoms%pos(3,na) zs = atoms%pos(3,na)
DO iz=1,nz DO iz=1,nz
IF(ABS(zs-znz(iz)).LT.epsz) CYCLE IF(ABS(zs-znz(iz)).LT.epsz) CYCLE equivAtomsLoop
ENDDO END DO
nz = nz+1 nz = nz+1
znz(nz) = zs znz(nz) = zs
ENDDO END DO equivAtomsLoop
ENDDO END DO
nsld = nz nsld = nz
IF(nsld>atoms%nat) CALL juDFT_error("nsld.GT.atoms%nat ",calledby="slab_dim") IF(nsld>atoms%nat) CALL juDFT_error("nsld.GT.atoms%nat ",calledby="slab_dim")
! !
......
...@@ -7,6 +7,7 @@ include("cmake/compilerflags.cmake") ...@@ -7,6 +7,7 @@ include("cmake/compilerflags.cmake")
include("cmake/tests/test_XML.cmake") include("cmake/tests/test_XML.cmake")
include("cmake/tests/test_LAPACK.cmake") include("cmake/tests/test_LAPACK.cmake")
include("cmake/tests/test_MPI.cmake") include("cmake/tests/test_MPI.cmake")
include("cmake/tests/test_FFTMKL.cmake")
include("cmake/tests/test_HDF5.cmake") include("cmake/tests/test_HDF5.cmake")
include("cmake/tests/test_MAGMA.cmake") include("cmake/tests/test_MAGMA.cmake")
include("cmake/tests/test_GPU.cmake") include("cmake/tests/test_GPU.cmake")
......
...@@ -18,6 +18,7 @@ message("\n${Red}These Libraries are required:${CReset}") ...@@ -18,6 +18,7 @@ message("\n${Red}These Libraries are required:${CReset}")
message("${Green} XML Library found :${CReset} ${FLEUR_USE_XML}") message("${Green} XML Library found :${CReset} ${FLEUR_USE_XML}")
message("${Green} LAPACK Library found:${CReset} ${FLEUR_USE_LAPACK}") message("${Green} LAPACK Library found:${CReset} ${FLEUR_USE_LAPACK}")
message("${Red}These Libraries are optional:${CReset}") message("${Red}These Libraries are optional:${CReset}")
message("${Green} FFT from MKL found :${CReset} ${FLEUR_USE_FFTMKL}")
message("${Green} HDF5 Library found :${CReset} ${FLEUR_USE_HDF5}") message("${Green} HDF5 Library found :${CReset} ${FLEUR_USE_HDF5}")
message("${Green} MAGMA Library found:${CReset} ${FLEUR_USE_MAGMA}") message("${Green} MAGMA Library found:${CReset} ${FLEUR_USE_MAGMA}")
message("${Green} MPI Library found :${CReset} ${FLEUR_USE_MPI}") message("${Green} MPI Library found :${CReset} ${FLEUR_USE_MPI}")
......
...@@ -10,6 +10,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") ...@@ -10,6 +10,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB ") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB ")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI") elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
message("PGI Fortran detected") message("PGI Fortran detected")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake
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 -Mr8 -Mr8intrinsics -Mcuda:kepler+ -ta:tesla:cuda7.5 -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_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr")
...@@ -27,6 +28,6 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") ...@@ -27,6 +28,6 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
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()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp -fdefault-real-8 ") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp -fdefault-real-8 ")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4") set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O1")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g") set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g")
endif() endif()
...@@ -4,4 +4,4 @@ set(CMAKE_Fortran_COMPILER mpiifort) ...@@ -4,4 +4,4 @@ set(CMAKE_Fortran_COMPILER mpiifort)
#Add include pathes #Add include pathes
#set(FLEUR_Fortran_FLAGS "") #set(FLEUR_Fortran_FLAGS "")
#Add linker stuff #Add linker stuff
set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} "-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64") set(FLEUR_LIBRARIES ${FLEUR_LIBRARIES} "-lxml2;-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64;-mt_mpi")
#First check if we can compile with FFT from MKL
try_compile(FLEUR_USE_FFTMKL ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_FFTMKL.f90
LINK_LIBRARIES ${FLEUR_LIBRARIES}
)
message("FFT from MKL found:${FLEUR_USE_FFTMKL}")
if (FLEUR_USE_FFTMKL)
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_FFT_MKL")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_FFT_MKL")
endif()
MODULE MKL_DFT_TYPE
TYPE, PUBLIC :: DFTI_DESCRIPTOR
PRIVATE
INTEGER :: dontuse
! Structure of this type is not used in Fortran code
! the pointer to this type is used only
END TYPE DFTI_DESCRIPTOR
END MODULE MKL_DFT_TYPE
MODULE MKL_TEST
INTERFACE DftiCommitDescriptor
FUNCTION dfti_commit_descriptor_external(desc)
USE MKL_DFT_TYPE
!DEC$ ATTRIBUTES C :: dfti_commit_descriptor_external
!DEC$ ATTRIBUTES REFERENCE :: dfti_commit_descriptor_external
INTEGER dfti_commit_descriptor_external
TYPE(DFTI_DESCRIPTOR), POINTER :: desc
END FUNCTION dfti_commit_descriptor_external
END INTERFACE
END MODULE
program test
use MKL_DFT_TYPE
use MKL_test
type(dfti_descriptor),pointer :: dfti_handle
integer :: dfti_status
dfti_status = DftiCommitDescriptor(dfti_handle)
end program test
...@@ -21,12 +21,12 @@ message("XML Library found for linking:${FLEUR_USE_XML}") ...@@ -21,12 +21,12 @@ message("XML Library found for linking:${FLEUR_USE_XML}")
if (FLEUR_USE_XML) if (FLEUR_USE_XML)
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c
LINK_LIBRARIES ${FLEUR_LIBRARIES}) LINK_LIBRARIES "-lxml2")
if (NOT FLEUR_USE_XML) if (NOT FLEUR_USE_XML)
find_package(LibXml2) find_package(LibXml2)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}") set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c
LINK_LIBRARIES ${FLEUR_LIBRARIES}) LINK_LIBRARIES ${LIBXML2_LIBRARIES})
endif() endif()
endif() endif()
......
#!/usr/bin/env bash #!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#process arguments
help=0
all_tests=0
machine=""
label=""
backup=0
gitupdate=0
debug=0
error=""
while [ $# -gt 0 ]
do
case "$1" in
-h) help=1;;
-help) help=1;;
-b) backup=1;;
-backup) backup=1;;
-g) gitupdate=1;;
-gitupdate) gitupdate=1;;
-t) all_tests=1;;
-all_tests) all_tests=1;;
-l) shift;label=$1;;
-m) shift;machine=$1;;
-d) debug=1;;
-*) error="Unkown argument";;
*) break;; # terminate while loop
esac
shift
done
if [ $# -gt 0 ]
then
if [ "$machine" = "" ]
then
machine=$1;shift
else
error="You specified the -m switch and gave an additional MACHINE argument"
fi
fi
if [ $# -gt 0 ]
then
if [ "$label" = "" ]
then
label=$1;shift
else
error="You specified the -l switch and gave an additional LABEL argument"
fi
fi
if [ $# -gt 0 ]
then
error="Extra unkown arguments"
fi
echo "------------ Welcome to the FLEUR configuration script -------------" echo "------------ Welcome to the FLEUR configuration script -------------"
if [ "$error" != "" ]
then
echo $error
echo "ERROR in calling configure. Please use -h for help on usage"
exit 1
fi
. $DIR/cmake/machines.sh . $DIR/cmake/machines.sh
#check if -h or --help was given as argument
if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] #check if -h or -help was given as argument
if [ $help -gt 0 ]
then then
echo "USAGE: configure.sh [MACHINE] [label]" echo "USAGE: configure.sh [options] [MACHINE] [label]"
echo " echo "
The following command line options are supported:
-h : print this help-page
-m # : specify the machine to build on (see below for possible options)
This can also be specified without -m as a first argument
-l # : label for the build. It will be attached to the name of the build directory.
This option can also be specified as second argument without -l
-d : build a debugging version of FLEUR (adds .debug to label)
-g : do a git pull first if this is a git version
-t : generate all tests including those that run longer
-b : backup an old build directory if present
To help the script finding a proper configuration you should To help the script finding a proper configuration you should
provide the name of a specific machine to compile on. provide the name of a specific machine to compile on.
Currently known machine configurations are: Currently known machine configurations are:
" "
echo " $known_machines" echo " $known_machines"
echo " echo "
If you do not find a proper choice you might try If you do not specify the machine the AUTO option will be used in which some
'configure.sh AUTO' defaults are tested. It might work if your machine is not one of those known.
You might also want to add your configuration to the file You might also want to add your configuration to the file
cmake/machines.sh in this case :-) cmake/machines.sh in this case :-)
...@@ -25,9 +98,9 @@ then ...@@ -25,9 +98,9 @@ then
FLEUR_LIBRARIES -- list of linker arguments i.e. '-L/lib;-lbla' FLEUR_LIBRARIES -- list of linker arguments i.e. '-L/lib;-lbla'
CMAKE_Fortran_FLAGS -- list of compiler options i.e. '-r8'" CMAKE_Fortran_FLAGS -- list of compiler options i.e. '-r8'"
echo " echo "
By specifying a label which contains 'debug' in addition to your By specifying a label you can have different build directories.
machine configuration you will build a debugging version. Otherwise The label will be added to the 'build' directory name."
the label will be added to the build directory name." exit 1
fi fi
#Check if we are using the git version and update if pull was used as an argument #Check if we are using the git version and update if pull was used as an argument
...@@ -41,12 +114,11 @@ if test -d $DIR/.git ...@@ -41,12 +114,11 @@ if test -d $DIR/.git
echo "Git version found, hook installed" echo "Git version found, hook installed"
fi fi
then then
if [[ $1 =~ .*pull.* ]] || [[ $2 =~ .*pull.* ]] || [[ $3 =~ .*pull.* ]] if [ $gitupdate -gt 0 ]
then then
cd $DIR cd $DIR
git pull git pull
cd - cd -
exit
fi fi
fi fi
...@@ -58,7 +130,6 @@ then ...@@ -58,7 +130,6 @@ then
fi fi
#Name of the build directory #Name of the build directory
label=$2
if [ -n "$label" ] if [ -n "$label" ]
then then
buildname="build.$label" buildname="build.$label"
...@@ -66,35 +137,53 @@ else ...@@ -66,35 +137,53 @@ else
buildname="build" buildname="build"
fi fi
if [ $debug -gt 0 ]
then
echo "Debug version will be build"
BUILD=Debug
buildname="$buildname.debug"
else
BUILD=Release
fi
#check if there is a build directory #check if there is a build directory
if test -d $buildname if test -d $buildname
then then
echo "OLD build directory found, saved in build.$$" if [ $backup -gt 0 ]
mv $buildname $buildname.$$ then
echo "OLD build directory found, saved in build.$$"
mv $buildname $buildname.$$
else
echo "Overwriting old build"
rm -r $buildname
fi
fi fi
mkdir $buildname mkdir $buildname
cd $buildname cd $buildname
#Now check the machine and set some defaults #Now check the machine and set some defaults
machine=$1
if [[ $machine =~ FLEUR_CONFIG_MACHINE ]] if [[ $machine =~ FLEUR_CONFIG_MACHINE ]]
then then
machine=$FLEUR_CONFIG_MACHINE machine=$FLEUR_CONFIG_MACHINE
fi fi
if [ "$machine" = "" ]
then
machine=AUTO
fi
echo "Machine config:$machine" echo "Machine config:$machine"
configure_machine configure_machine
#run cmake #run cmake
if [[ $buildname =~ .*debug.* ]]
cmake -Dall_tests=$all_tests -DCMAKE_BUILD_TYPE=$BUILD $DIR 2>&1 |tee configure.out
if [ -r $buildname/Makefile ]
then then
echo "Debug version will be build" echo "Your configuration failed"
BUILD=Debug echo "Perhaps you have to specify compiler options or give a machine dependent configuration."
echo "You might want to call the configure.sh script with -h"
else else
BUILD=Release echo "Configuration finished"
echo "You should change into directory $buildname "
echo "run 'make' or 'make -j'"
fi fi
cmake -DCMAKE_BUILD_TYPE=$BUILD $DIR
echo "Configuration finished"
echo "If no errors occured you should change into directory $buildname "
echo "run 'make' or 'make -j4'"
...@@ -73,20 +73,16 @@ ...@@ -73,20 +73,16 @@
DATA spin12/'.1' , '.2'/ DATA spin12/'.1' , '.2'/
DATA ch_mcd/'.+' , '.-' , '.0'/ DATA ch_mcd/'.+' , '.-' , '.0'/
! !
l_orbcomp = .false. qdim = lmax*atoms%ntype+3
IF (banddos%ndir.NE.-3) THEN l_orbcomp = banddos%l_orb
qdim = lmax*atoms%ntype+3 IF (banddos%ndir.EQ.-3) THEN
ELSE
qdim = 2*nsld qdim = 2*nsld
n_orb = 0 n_orb = 0
INQUIRE(file='orbcomp',exist=l_orbcomp) IF (banddos%l_orb) THEN
IF (l_orbcomp) THEN n_orb = banddos%orbCompAtom
OPEN (1,file='orbcomp',form='formatted') WRITE (*,*) 'DOS: orbcomp',n_orb
READ (1,*) n_orb qdim = 23
WRITE (*,*) 'DOS: orbcomp',n_orb END IF
CLOSE (1)
qdim = 23
ENDIF
ENDIF ENDIF
ALLOCATE( qal(qdim,dimension%neigd,kpts%nkpt),& ALLOCATE( qal(qdim,dimension%neigd,kpts%nkpt),&
& qval(vacuum%nstars*vacuum%layers*vacuum%nvac,dimension%neigd,kpts%nkpt),& & qval(vacuum%nstars*vacuum%layers*vacuum%nvac,dimension%neigd,kpts%nkpt),&
...@@ -170,12 +166,12 @@ ...@@ -170,12 +166,12 @@
ALLOCATE( qis(dimension%neigd),qvlay(dimension%neigd,vacuum%layerd,2)) ALLOCATE( qis(dimension%neigd),qvlay(dimension%neigd,vacuum%layerd,2))
CALL read_eig(eig_id,k,jspin,bk=vk(:,k),wk=wt(k),neig=nevk(k),eig=ev(:,k)) CALL read_eig(eig_id,k,jspin,bk=vk(:,k),wk=wt(k),neig=nevk(k),eig=ev(:,k))
CALL read_dos(eig_id,k,jspin,qal_tmp,qvac,qis,qvlay,qstars,ksym,jsym,mcd,qintsl,qmtsl,qmtp,orbcomp) <