aboutsummaryrefslogtreecommitdiff
path: root/science/gamess/files/patch-compddi
blob: 5e683c03de667629325fba19fbfa5b53153a4e4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
--- ddi/compddi.orig	2008-12-04 01:22:29.000000000 +0900
+++ ddi/compddi	2009-05-08 12:15:46.000000000 +0900
@@ -13,9 +13,9 @@
 #      axp64,compaq-sc,cray-pvp,cray-t3e,cray-x1,cray-xd1,cray-xt3,
 #      fuji-pp32,fuji-pp64,hpux32,hpux64,ibm32,ibm64,ibm64-sp,ibm-bg,
 #      linux32,linux64,linux-ia64,mac32,mac64,macG5,necsx,
-#      sgi32,sgi64,sun32,sun64
+#      sgi32,sgi64,sun32,sun64,freebsd-i386,freebsd-amd64
 #
-         set TARGET = ibm64
+         set TARGET = %%ARCH%%
 
 #  2. Choose DDI communication layer, the only legal values are
 #                   sockets,mixed,mpi,shmem,lapi,armci
@@ -639,7 +639,77 @@
      set RANLIB_FLAGS = ' '
 
   endif
+# --------------------------------------- #
+# FreeBSD for x86 PCs                     #
+# --------------------------------------- #
 
+  if($TARGET == freebsd-i386) then
+
+     set FORTRAN=%%FORTRAN%%      # choose from g77, gfortran, ifort, pgf77, f2c
+
+     set CC = %%CC%%
+     set CFLAGS = "-DLINUX -O3 -fstrict-aliasing -I./include"
+
+     switch ($FORTRAN)
+        case g77:
+        case pgf77:
+        case f2c:
+           set NumUS=2
+           breaksw
+        case gfortran:
+           set CFLAGS = "$CFLAGS -Dgetarg_=_gfortran_getarg_i4"
+           set CFLAGS = "$CFLAGS -Diargc_=_gfortran_iargc"
+           set NumUS=1
+           breaksw
+        case ifort:
+           set NumUS=1
+           breaksw
+        default:
+           echo Please spell your ia32 compiler correctly.
+           exit 4
+     endsw
+
+     set CLIBS  = "%%PTHREAD_LIBS%%"
+     set F77_OPTS = "-DINT_SIZE=int -D_UNDERSCORES=$NumUS"
+     set AR_FLAGS     = 'cr'
+     set RANLIB_FLAGS = ' '
+
+  endif
+
+# ------------- #
+# FreeBSD amd64 #
+# ------------- #
+  if($TARGET == freebsd-amd64) then
+
+     set CC = %%CC%%
+     set CFLAGS = "-DLINUX -m64 -O3 -fstrict-aliasing -I./include"
+
+     set FORTRAN=%%FORTRAN%%
+     switch ($FORTRAN)
+        case g77:
+        case pgf77:
+        case f2c:
+           set NumUS=2
+           breaksw
+        case gfortran:
+           set CFLAGS = "$CFLAGS -Dgetarg_=_gfortran_getarg_i4"
+           set CFLAGS = "$CFLAGS -Diargc_=_gfortran_iargc"
+           set NumUS=1
+           breaksw
+        case ifort:
+           set NumUS=1
+           breaksw
+        default:
+           echo Please spell your x86_64 compiler correctly.
+           exit 4
+     endsw
+
+     set CLIBS  = "%%PTHREAD_LIBS%%"
+     set F77_OPTS = "-DINT_SIZE=long -D_UNDERSCORES=$NumUS"
+     set AR_FLAGS     = 'cr'
+     set RANLIB_FLAGS = ' '
+
+  endif
 
 # -------- #
 # Mac OS X #