Skip to content

Commit 6dbda9f

Browse files
committed
Make PGI compiler work and make.arch more generic.
1 parent d1152a9 commit 6dbda9f

File tree

3 files changed

+44
-46
lines changed

3 files changed

+44
-46
lines changed

README.rst

+11-8
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,25 @@ split into two parts:
2121
Compilation
2222
===========
2323

24-
Edit the file `make.arch` to reflect your compiler and linker. Then issue
25-
``make``. This will build the following components:
24+
Edit the file `make.arch` to reflect your compiler and linker. Then you can
25+
issue one of the following commands:
2626

27-
* The library `libdftd3.a` and necessery module files (`*.mod`) in the directory
28-
`lib/`.
27+
* ``make lib``: to build the library `libdftd3.a` and the necessary
28+
module files (`*.mod`) in the directory `lib/`.
2929

30-
* The command line tool `dftd3` in the directory `prg/`.
30+
* ``make dftd3``: to build the executable `dftd3` in the directory `prg/`.
3131

32-
* A simple tester for the library (`testapi`( in the directory `test/`. The
33-
source code of this tester demonstrates how the library can be used.
32+
* ``make testapi``: to build a simple tester for the library (`testapi`) in the
33+
directory `test/`. The source code of this tester demonstrates how the library
34+
can be used by third party codes.
35+
36+
If you just issue ``make``, all three targets will be compiled.
3437

3538

3639
Credits
3740
=======
3841

39-
When using the library or the DFTD3 tool, please cite:
42+
When using the library or the dftd3 tool, please cite:
4043

4144
S. Grimme, J. Antony, S. Ehrlich and H. Krieg
4245
J. Chem. Phys, 132 (2010), 154104.

make.arch

+21-32
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
1-
#--------------------------------------------------------------------------
2-
OSTYPE=LINUXL
3-
# source /usr/qc/lf95/csh_setup nicht vergessen (Lahey compiler)
4-
# source /usr/qc/intel/compiler70/ia32/bin/ifcvars.csh (Intel compiler)
5-
#--------------------------------------------------------------------------
1+
# Make your choice
2+
ARCH = x86_64-linux-gcc
63

7-
#--------------------------------------------------------------------------
8-
9-
ifeq ($(OSTYPE),LINUXL)
10-
#FC = lf95
11-
FC = ifort
12-
#FC = gfortran
13-
#LN = lf95
14-
LN = ifort -static
15-
#LN = gfortran
16-
FCFLAGS= -O -C -traceback -g
17-
#FCFLAGS = -O -openmp -I$(MKLROOT)/include -mkl=parallel
18-
#LNFLAGS = -openmp -I$(MKLROOT)/include -mkl=parallel
19-
#FCFLAGS = -O --chk a,e,s,u
20-
#FCFLAGS = -O0 -g
21-
#LNFLAGS = -O0 -g
4+
ifeq ($(ARCH),x86_64-linux-gcc)
5+
FC = gfortran
6+
LN = gfortran
7+
FCFLAGS =
8+
LNFLAGS =
229
endif
2310

24-
ifeq ($(OSTYPE),LINUXI)
25-
FC = ifort
26-
LN = ifort
27-
FCFLAGS = -w90 -O
28-
#LNFLAGS =
11+
ifeq ($(ARCH),x86_64-linux-intel)
12+
FC = ifort
13+
LN = ifort
14+
FCFLAGS =
15+
LNFLAGS =
2916
endif
3017

31-
ifeq ($(COMP),nagfor)
18+
ifeq ($(ARCH),x86_64-linux-nag)
19+
# NOTE: you'll have to uncomment the function "system" at the end
20+
# of prg/extras.f90 when you want to build also the dftd3 standalone program
3221
FC = nagfor
3322
LN = nagfor
34-
FCFLAGS = -nan -C #-ieee=full
23+
FCFLAGS =
3524
LNFLAGS =
3625
endif
3726

38-
ifeq ($(COMP),ifort)
39-
FC = ifort
40-
LN = ifort
41-
FCFLAGS = -C
42-
LNFLAGS =
27+
ifeq ($(ARCH),x86_64-linux-pgi)
28+
FC = pgfortran
29+
LN = pgfortran
30+
FCFLAGS =
31+
LNFLAGS =
4332
endif

prg/extras.f90

+12-6
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ subroutine rdpar(dtmp,version,s6,s18,rs6,rs18,alp)
9797
return
9898
end if
9999
! read parameter file from home directory
100-
!call system('hostname > .tmpx')
101-
call execute_command_line('hostname > .tmpx')
100+
call system('hostname > .tmpx')
102101
open(unit=43,file='.tmpx')
103102
read(43,'(a)')ftmp
104103
close(43,status='delete')
@@ -802,8 +801,7 @@ subroutine wregrad(nat,xyz,iat,edisp,g)
802801
close(42)
803802
close(43)
804803

805-
!call system('mv gradient.tmp gradient')
806-
call execute_command_line('mv gradient.tmp gradient')
804+
call system('mv gradient.tmp gradient')
807805

808806
! write file energy
809807
j=1
@@ -836,8 +834,7 @@ subroutine wregrad(nat,xyz,iat,edisp,g)
836834
close(42)
837835
close(43)
838836

839-
!call system('mv energy.tmp energy')
840-
call execute_command_line('mv energy.tmp energy')
837+
call system('mv energy.tmp energy')
841838

842839
end subroutine wregrad
843840

@@ -2081,4 +2078,13 @@ subroutine removebksl(str)
20812078
end subroutine removebksl
20822079

20832080

2081+
! Uncomment this, if you work with the nagfor compiler
2082+
!subroutine system(command)
2083+
! character(*), intent(in) :: command
2084+
!
2085+
! call execute_command_line(command)
2086+
!
2087+
!end subroutine system
2088+
2089+
20842090
end module dftd3_extras

0 commit comments

Comments
 (0)