diff --git a/INSTALL b/INSTALL index ef3cacd..618070e 100644 --- a/INSTALL +++ b/INSTALL @@ -1,6 +1,7 @@ REQUIREMENTS: - Fortran 2008 compiler: gfortran (4.8,4.9, 6.3 tested) or ifort (V.15 tested) - BLAS+LAPACK library +- gcc >=4.6 needed modify the user settings for the Makefile. Best support is for gfortran. diff --git a/Makefile b/Makefile index e80735a..6081e6e 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,7 @@ PROG = ~/bin/xopt USE_GNU=yes #USE_PGI=no #USE_INTEL=yes +#USE_CLANG=yes # static/dynamic DO_STATIC=yes @@ -32,18 +33,17 @@ DO_STATIC=yes FFLAGS= -O2 ## set BLAS/LAPCK paths for optimized libraries - OPENBLAS = /usr/qc/OpenBLAS/ - BLASLIB = -L$(OPENBLAS) -lopenblas -lpthread + OPENBLAS = /usr/qc/OpenBLAS.0.3_AVX/lib + MKLROOT = ${HOME}/miniconda3/ -# MKLROOT = ${HOME}/miniconda3/ -# BLASLIB = -L${MKLROOT}/lib/ -Wl,--no-as-needed -lmkl_rt -lpthread -lm -ldl # for 'new' single-dynamic MKL -# BLASLIB = -mkl=parallel # for ifort ### examples ### +# BLASLIB = -L${MKLROOT}/lib/ -Wl,--no-as-needed -lmkl_rt -lpthread -lm -ldl # for 'new' single-dynamic MKL # BLASLIB = -L/local/intel_mkl - # MKL explicit -# BLASLIB = /local/openblas_lib/lib/ -lopenblas # OpenBLAS (may need -lpthread) + BLASLIB = -L${OPENBLAS}/ -lopenblas -lpthread # OpenBLAS (may need -lpthread) # BLASLIB = -L/usr/lib64 -llapack -lblas # native blas # BLASLIB = -mkl=parallel # for ifort +# BLASLIB = -L$(OPENBLAS) -lopenblas -lpthread -lm -ldl -lgfortran # clang+openblas may need explicit linking ### EXTRALIBS (dftd3,gcp,lbfgs) # set to "yes" after building them. @@ -132,7 +132,7 @@ endif ##### GFORTRAN ######### ifeq ($(USE_GNU),yes) -FC = gfortran +FC = gfortran DFLAGS+= -DGNU FFLAGS+= -J$(MOD) -ffree-line-length-none LIBS+= $(BLASLIB) @@ -141,6 +141,16 @@ LIBS+= $(BLASLIB) endif endif +##### CLANG ######### +ifeq ($(USE_CLANG),yes) +FC = clang +DFLAGS+= -DCLANG +FFLAGS+= -J$(MOD) -ffree-line-length-none +LIBS+= $(BLASLIB) + ifeq ($(DO_STATIC),yes) + FC+= -static + endif +endif ##### PGI FORTRAN ############# # PLEASE ADAPT THIS YOURSELF diff --git a/src/modules.F90 b/src/modules.F90 index 5814a0d..73960dc 100644 --- a/src/modules.F90 +++ b/src/modules.F90 @@ -3,7 +3,6 @@ module fiso #ifdef GNU use, intrinsic :: iso_fortran_env, only : & stdin=> input_unit, stdout=>output_unit,stderr=>error_unit, & ! I/O units, replaces non-def 0,5,6 -! r8=> REAL64, r4=>REAL32 i8=>INT64,i4=>INT32 , & compiler_version ! nerdy info ! IEEE 754 @@ -12,6 +11,21 @@ module fiso integer, parameter :: qp = SELECTED_REAL_KIND(33,4931) integer, parameter :: io_debug=1111 +#elif GNU_LEGACY # 4.5 + integer, parameter :: r4 = SELECTED_REAL_KIND(6,37) + integer, parameter :: r8 = SELECTED_REAL_KIND(15,307) + integer, parameter :: qp = SELECTED_REAL_KIND(33,4931) + integer, parameter :: io_debug=1111 + integer, parameter :: i4 = selected_int_kind(4) + integer, parameter :: i8 = selected_int_kind(8) + integer, parameter :: stdin =0 + integer, parameter :: stdout =6 + integer, parameter :: stderr= 5 + contains + character(7) function compiler_version() + implicit none + compiler_version='legacy gnu' + end function #else ! for cases that do not have yet compiler_version like ifort 15 use, intrinsic :: iso_fortran_env, only : &