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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
--- configure.in.orig 2006-03-22 19:04:54.000000000 +0100
+++ configure.in 2010-10-28 00:09:59.000000000 +0200
@@ -349,6 +349,31 @@
ac_default_prefix="/usr/local/mpqc/$SC_VERSION"
+AC_ARG_WITH(blas,
+[ --with-blas Gives BLAS name you use(e.g., -lblas).],
+BLASNAME=$withval
+)
+
+AC_ARG_WITH(lapack,
+[ --with-lapack Gives LAPACK name you use(e.g., -llapack).],
+LAPACKNAME=$withval
+)
+
+AC_ARG_WITH(cxxoptflags,
+[ --with-cxxoptflags Gives the C++ compiler optimization flags to use.],
+CXXOPTFLAGS=$withval
+)
+
+AC_ARG_WITH(ccoptflags,
+[ --with-ccoptflags Gives the C compiler optimization flags to use.],
+CCOPTFLAGS=$withval
+)
+
+AC_ARG_WITH(f77optflags,
+[ --with-f77optflags Gives the FORTRAN 77 optimization compiler flags to use.],
+F77OPTFLAGS=$withval
+)
+
AC_ARG_WITH(cc,
[ --with-cc Gives the name of the C compiler to use.],
CC=$withval
@@ -488,7 +513,7 @@
CCA_CHEM_CONFIG=$withval
echo Using cca-chem-config: $withval
],[
- if test "$components" == "yes"; then
+ if test "$components" = "yes"; then
AC_PATH_PROG(CCA_CHEM_CONFIG,cca-chem-config,"not-found")
fi
]
@@ -736,6 +761,23 @@
;;
esac
+if test "$CCOPTFLAGS" = NONE; then
+else
+ echo "overrides the cc optimization flag with $CCOPTFLAGS"
+ COPTIONS_OPT="$CCOPTFLAGS"
+fi
+if test "$CXXOPTFLAGS" = NONE; then
+else
+ echo "overrides the c++ optimization flag with $CXXOPTFLAGS"
+ CXXOPTIONS_OPT="$CXXOPTFLAGS"
+fi
+
+if test "$F77OPTFLAGS" = NONE; then
+else
+ echo "overrides the Fortran 77 optimization flag with $F77OPTFLAGS"
+ F77OPTIONS_OPT="$F77OPTFLAGS"
+fi
+
dnl -- special architecture options --
case $target_cpu in
@@ -747,7 +789,7 @@
;;
esac
-if test X$GXX == Xyes; then
+if test X$GXX = Xyes; then
AC_MSG_CHECKING([for C++ cpu tuning flag])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -759,7 +801,7 @@
AC_MSG_RESULT($cxx_tuneflag)
fi
-if test X$GCC == Xyes; then
+if test X$GCC = Xyes; then
AC_MSG_CHECKING([for C cpu tuning flag])
CFLAGS_SAV=$CFLAGS
CFLAGS="-mtune=$opt_target_cpu $CFLAGS_SAV"
@@ -969,6 +1011,7 @@
elif test $DEBUG = opt; then
CFLAGS="$COPTIONS_DBG $COPTIONS_OPT $COPTIONS_MISC"
CXXFLAGS="$CXXOPTIONS_DBG $CXXOPTIONS_OPT $CXXOPTIONS_MISC"
+ FFLAGS="$F77OPTIONS_OPT"
LDFLAGS="$LDFLAGS -g"
else
CFLAGS="$COPTIONS_OPT $COPTIONS_MISC"
@@ -1055,7 +1098,7 @@
char c[sizeof (long)];
} u;
u.l = 1;
- exit (u.c[sizeof (long) - 1] == 1);
+ exit (u.c[sizeof (long) - 1] = 1);
}], sc_cv_c_bigendian=no, sc_cv_c_bigendian=yes,
AC_MSG_ERROR([Could not determine endianness and cross compiling])
)
@@ -1073,47 +1116,28 @@
dnl -- seems to be in libc on IRIX and we must generate a -lpthread in LIBS.
if test "(" X$PARALLEL = Xyes -a X$THREADS != Xno ")" -o X$THREADS = Xyes; then
-AC_MSG_CHECKING([pthreads])
-dnl see if posix threads are automatically linked ...
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-LIBSSAV="$LIBS"
-AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
-HAVE_PTHREAD=yes],[
-HAVE_PTHREAD=no])
-AC_LANG_RESTORE
-
-dnl see if posix threads are in -lpthread
-if test $HAVE_PTHREAD = no; then
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-LIBSSAV="$LIBS"
-LIBS="$LIBS -lpthread"
-AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
-HAVE_PTHREAD=yes],[
-HAVE_PTHREAD=no
-LIBS="$LIBSSAV"])
-AC_LANG_RESTORE
-fi
-
-dnl see if posix threads are in -lpthreads
-if test $HAVE_PTHREAD = no; then
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-LIBSSAV="$LIBS"
-LIBS="$LIBS -lpthreads"
-AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
-HAVE_PTHREAD=yes],[
-HAVE_PTHREAD=no
-LIBS="$LIBSSAV"])
-AC_LANG_RESTORE
-fi
-
+for flag in -pthread -lpthreads -lpthread; do
+AC_MSG_CHECKING([for pthread_create using $flag])
+ SAVELIBS="$LIBS"
+ LIBS="$flag $LIBS"
+ AC_TRY_LINK([#include <pthread.h>],[pthread_join(0,0);],[
+ HAVE_PTHREAD=yes],[
+ HAVE_PTHREAD=no])
+ AC_MSG_RESULT([$have_pthread])
+ if test X$HAVE_PTHREAD = Xyes; then
+ break
+ fi
+done
+
AC_MSG_RESULT($HAVE_PTHREAD)
fi
if test X$HAVE_PTHREAD = Xyes; then
AC_DEFINE(HAVE_PTHREAD)
EXTRADEFINES="-D_REENTRANT $EXTRADEFINES"
+ # Solaris requires -D_POSIX_PTHREAD_SEMANTICS
+ if test x$uname = xSunOS; then
+ PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
+ fi
AC_CHECK_FUNC(pthread_attr_getstacksize)
AC_CHECK_FUNC(pthread_attr_setstacksize)
AC_CHECK_FUNC(pthread_attr_setscope)
@@ -1165,7 +1189,8 @@
AC_CHECK_LIB(mpi,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpi $LIBS"])
fi
if test "$HAVE_MPI" = no; then
- AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich $LIBS"])
+ LIBS="-lmpl $PTHREAD_LIBS $LIBS"
+ AC_CHECK_LIB(mpich,MPI_Init,[HAVE_MPI=yes;LIBS="-lmpich -lmpl $PTHREAD_LIBS $LIBS"])
fi
fi
if test X$HAVE_MPI = Xyes; then
@@ -1769,10 +1794,10 @@
dnl --------- CCA component configuration ---------
-if test $components == "yes"; then
+if test $components = "yes"; then
- if test $HAVE_MPI == "yes" &&
- test $HAVE_MPIPP == "no"; then
+ if test $HAVE_MPI = "yes" &&
+ test $HAVE_MPIPP = "no"; then
AC_MSG_ERROR([libmpi++ needed for mpi cca components])
fi
|