Debian Codegraph @

configure.ac

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 # ------------------------------------------------------------
2
3 # Antoine Le Hyaric - LJLL Paris 6 - [email protected] - 13/5/04
4 # $Id: configure.ac,v 1.338 2010/05/10 21:35:07 hecht Exp $
5
6 # Version numbering: x.xx-pp where "pp" is the package version (when
7 # the same FreeFEM version is packaged several times). For
8 # coherency, this should have the same value as the top-most package
9 # number in debian/changelog.
10
11
12 AC_INIT([FreeFEM],[4.17],[[email protected]],[FreeFEM])
13 dnl : ${CFLAGS=""}
14 dnl : ${CXXFLAGS=""}
15 dnl : ${FCFLAGS=""}
16 dnl : ${FFLAGS=""}
17
18 AC_CONFIG_MACRO_DIR([etc/config/m4])
19
20 # progg test exec for windows
21 ff_TEST_FFPP="../../src/nw/FreeFem++"
22 ff_TEST_FFPP_MPI="../../src/mpi/FreeFem++-mpi"
23 ff_uncompile_plugin=""
24 ff_unlib_plugin=""
25 ff_download_lib=""
26 AC_PREREQ([2.69]) dnl for AC_LANG_CASE and check stuff (bug avec 2.71)
27 dnl AC_CONFIG_SRCDIR(src/FreeFem++-CoCoa)
28
29 # Automake 1.11 is too old for check ...
30
31 # ALH - 10/9/13 - FFCS needs to skip this automake version requirement when compiling on older platforms (eg cygwin or
32 # last Ubuntu LTS). So we fix a low hardcoded requirement and test for higher versions when not in FFCS.
33
34 AM_INIT_AUTOMAKE(1.11 dist-zip foreign subdir-objects)
35
36 if test "$enable_ffcs" != yes
37 then
38 if test "$am__api_version" \< 1.13 ; then
39 AC_MSG_ERROR([Automake version $am__api_version needs to be 1.13 or later to enable "make check"])
40 fi
41 fi
42
43 AC_CONFIG_HEADERS(config.h)
44 AX_PREFIX_CONFIG_H()
45 AC_PROG_MAKE_SET
46 dnl AM_COLOR_TESTS=always
47 AC_PROG_RANLIB
48 inc_usr_include=""
49 ff_where_lib_conf=plugin/seq/WHERE_LIBRARY-config
50 dnl search of associad software
51 m4_define([AC_FF_ADDWHERELIB],
52 [
53 if test -z "$ff_where_lib_conf_$1" ; then
54 echo "$1 LD $2" >>$ff_where_lib_conf
55 test -n "$3" && echo "$1 INCLUDE $3 " >>$ff_where_lib_conf
56 ff_where_lib_conf_$1=1
57 ff_where_lib_$1="$2"
58 ff_where_inc_$1="$3"
59 AC_MSG_NOTICE([ ++ add $1 : $2 ; $3 in $ff_where_lib_conf "])
60 else
61 AC_MSG_NOTICE([ -- do not add $1 : $2 $3 in $ff_where_lib_conf "])
62 fi
63 ]) dnl
64 m4_define([AC_FF_WHERELIB],
65 [ if test -z "$ff_where_lib_conf_$1" -a "$enable_download_$1" != "yes" ; then
66 AC_MSG_CHECKING(check $1)
67 ff_save_libs=$LIBS
68 LIBS="$LIBS $2 $4"
69 AC_LINK_IFELSE([AC_LANG_PROGRAM([m4_if($3,,,[#include <$3>])],[])], [ff_WHERE=yes],[ff_WHERE=no])
70 if test "$ff_WHERE" = "yes" ; then
71 echo "$1 LD $2" >>$ff_where_lib_conf
72 ff_WHERE_INC=`AS_DIRNAME(["$3"])`
73 case "$ff_WHERE_INC" in
74 /*) echo "$1 INCLUDE -I$ff_WHERE_INC" >>$ff_where_lib_conf ;;
75 esac
76 ff_where_lib_conf_$1=1
77 fi
78 AC_MSG_RESULT($ff_WHERE)
79 ff_$1_ok=$ff_WHERE;
80 LIBS=$ff_save_libs
81 fi
82 ])dnl end m4_define AC_FF_WHERELIB
83 define([AC_FF_PETSC_AWK],[awk -F'=' '"$1 "==[$]1 {print [$]2}' $2])
84 m4_define([AC_FF_PETSC_WHERELIB],
85 [
86 ff_$2=`AC_FF_PETSC_AWK($2,$4)`
87 ff_$3=`AC_FF_PETSC_AWK($3,$4)`
88 if test -n "[$]ff_$2"; then
89 ff_$1_ok=yes;
90 m4_ifval($5,ff_$2="$ff_$2 $5";
91 echo " **** add $5 to ff_$2 ******", )
92 AC_FF_ADDWHERELIB($1,[$]ff_$2,[$]ff_$3)
93 AC_SUBST([TOOL_COMPILE_$1],"")
94 fi
95 ]
96 )dnl end m4_defineAC_FF_PETSC_WHERELIB
97 m4_define([AC_FF_PETSC_WHERELIB_BASIC],# PETSC_WITH_EXTERNAL_LIB,PETSC_CC_INCLUDES
98 [
99 ff_PETSC_EXTERNAL_LIB_BASIC=`AC_FF_PETSC_AWK(PETSC_EXTERNAL_LIB_BASIC,$2)`
100 ff_PETSC_LIB_BASIC=`AC_FF_PETSC_AWK(PETSC_LIB_BASIC,$2)`
101 ff_PETSC_PREFIXDIR=`awk -F' ' '"PREFIXDIR"==[$]1 {print [$]3}' $2`
102 ff_PETSC_WITH_EXTERNAL_LIB="-Wl,-rpath,[$]ff_PETSC_PREFIXDIR/lib -L[$]ff_PETSC_PREFIXDIR/lib [$]ff_PETSC_LIB_BASIC [$]ff_PETSC_EXTERNAL_LIB_BASIC"
103 ff_PETSC_CC_INCLUDES=`AC_FF_PETSC_AWK(PETSC_CC_INCLUDES,$2)`
104 if test -n "[$]ff_PETSC_WITH_EXTERNAL_LIB"; then
105 ff_$1_ok=yes;
106 AC_FF_ADDWHERELIB($1,[$]ff_PETSC_WITH_EXTERNAL_LIB,[$]ff_PETSC_CC_INCLUDES)
107 AC_SUBST([TOOL_COMPILE_$1],"")
108 fi
109 ]
110 )dnl end m4_defineAC_FF_PETSC_WHERELIB_BASIC
111
112 # ALH - this is required by FFCS that needs to deactivate some tools that do not work on all platforms. Some FF users
113 # may also find interesting to specify a local version of a tool instead of downloading it.
114
115 # m4 macro parameters: $1 = tool name, $2 = dynamic library name, $3 = download directory name if different from $1
116
117 m4_define([TOOL_PARAMETERS],
118 [
119 AC_ARG_WITH($1_include,AS_HELP_STRING([--with-$1-include=],[Include directives for $1 instead of automatic download]))
120 AC_ARG_WITH($1_ldflags,AS_HELP_STRING([--with-$1-ldflags=],[Link-time directives for $1 instead of automatic download]))
121 AC_ARG_ENABLE(download-$1,AS_HELP_STRING([--enable-download_$1],[force the download of $1]))
122
123 if test "$with_$1_include" != "" || test "$with_$1_ldflags" != ""
124 then
125
126 # some directives have been specified, use them instead of downloading
127
128 AC_FF_ADDWHERELIB($1,$with_$1_ldflags,$with_$1_include)
129 AC_SUBST([TOOL_COMPILE_$1],"")
130 enable_$1_download=no
131 fi
132 ])
133
134 m4_define([TOOL_DISABLE],
135 [AC_ARG_ENABLE($1,AS_HELP_STRING([--disable-$1],[Do not use $1]))
136 if test "$enable_$1" = "no"
137 then
138 AC_SUBST([TOOL_COMPILE_$1],"")
139 AC_SUBST([TOOL_DYLIB_$1],"")
140 ff_uncompile_plugin+=" "$2
141 ff_unlib_plugin+=" $1"
142 elif test "$ff_$1_ok" = "yes" ; then
143 AC_SUBST([TOOL_DYLIB_$1],$2)
144 enable_$1_download=no
145 else
146 if test "$enable_download" != "yes" -a "$enable_download_$1" != "yes" ; then
147 AC_SUBST([TOOL_COMPILE_$1],"")
148 ff_uncompile_plugin+=" "$2
149 ff_unlib_plugin+=" $1"
150 AC_SUBST([TOOL_DYLIB_$1],"")
151 else
152 if test "$ff_wget" = yes -a "$enable_download_$1" = "yes" -a "$DOWNLOADCOMPILE" = "" ; then
153 DOWNLOADCOMPILE="compile-pkg install-other"
154 fi
155 AC_SUBST([TOOL_COMPILE_$1],ifelse($3,,$1,$3))
156 AC_SUBST([TOOL_DYLIB_$1],$2)
157 ifelse($4,,[ff_download_lib="$1 $ff_download_lib"])
158 ifelse($4,,[enable_$1_download=yes])
159 fi
160 fi
161
162 # Also allow to disable the download of one tool if it is already locally installed
163
164 TOOL_PARAMETERS($1,$2,$3)
165 ])
166 m4_define([TOOL_DISABLE_NO],
167 [
168 AC_ARG_ENABLE($1,AS_HELP_STRING([--disable-$1],[Do not use $1]))
169 if test "$enable_$1" = "no" -o "$enable_$1" = ""
170 then
171 enable_$1=no
172 AC_SUBST([TOOL_COMPILE_$1],"")
173 AC_SUBST([TOOL_DYLIB_$1],"")
174 elif test "$ff_$1_ok" = "yes" ; then
175 AC_SUBST([TOOL_DYLIB_$1],$2)
176 enable_$1_download=no
177 else
178 AC_SUBST([TOOL_COMPILE_$1],ifelse($3,,$1,$3))
179 AC_SUBST([TOOL_DYLIB_$1],$2)
180 ifelse($4,,[ff_download_lib="$1 $ff_download_lib"])
181 ifelse($4,,[enable_$1_download=yes])
182 fi
183
184 # Also allow to disable the download of one tool if it is already locally installed
185
186 TOOL_PARAMETERS($1,$2,$3)
187 ])
188
189 BUILD_DATE="$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)"
190
191 echo "# Build with FreeFEM with ./configure $BUILD_DATE" >$ff_where_lib_conf
192 # To allow anonymous CVS version to contain a "./configure" and
193 # Makefiles
194
195 AM_MAINTAINER_MODE
196
197 echo >config_LIB_INFO
198
199 # Necessary compilers
200 # remove the flag -sdt=gnu++11 in the compileur CXX (FH jan 2024)
201 ac_cv_prog_cxx_cxx11=no
202 AC_PROG_CXX
203 # echo " #### $CXX"
204 AC_LANG(C++)
205 if test `uname` != Darwin; then
206 ff_ldeg="-Wl,--end-group"
207 ff_ldbg="-Wl,--start-group"
208 fi
209
210 # suffix of dynamic lib ..
211 # ---------------------------
212 ff_uname=`uname`
213 # flag to build window 32 version ff_mingw = yes
214 # bof bof F. Hecht
215 case $ff_uname in
216 CYGWIN*|MINGW*|MSYS_NT*)
217 ff_suffix_dylib="dll"
218 ff_suffix_dylib_a="dll.a";;
219 Darwin)
220 ff_suffix_dylib="dylib"
221 ff_suffix_dylib_a="dylib";;
222 *)
223 ff_suffix_dylib="so";
224 ff_suffix_dylib_a="so";
225 esac
226 # end suffix ...
227
228
229
230 AC_CHECK_PROG(ff_unzip,unzip,yes,no)
231 AC_CHECK_PROG(ff_m4,m4,yes,no)
232 AC_CHECK_PROG(ff_bison,bison,yes,no)
233 AC_CHECK_PROG(ff_flex,flex,yes,no)
234 AC_CHECK_PROG(ff_cmake,cmake,yes,no)
235 AC_CHECK_PROG(ff_patch,patch,yes,no)
236 case "$ff_m4 $ff_bison $ff_patch $ff_flex $ff_unzip" in
237 *no*)
238 AC_MSG_NOTICE([ to install missing package under debian or ubuntu, try ])
239 test "$ff_unzip" = no && AC_MSG_NOTICE([ sudo apt-get install unzip])
240 test "$ff_m4" = no && AC_MSG_NOTICE([ sudo apt-get install m4])
241 test "$ff_bison" = no && AC_MSG_NOTICE([ sudo apt-get install bison])
242 test "$ff_flex" = no && AC_MSG_NOTICE([ sudo apt-get install flex])
243 test "$ff_patch" = no && AC_MSG_NOTICE([ sudo apt-get install patch])
244 AC_MSG_ERROR([ Sorry missing unzip,m4,bison,flex,patch command !]);;
245 esac
246
247
248 if test -z "$CXX"; then
249 AC_MSG_NOTICE( [ fatal error : c++ compiler ! ] );
250 AC_MSG_ERROR([ Sorry no c++ compiler !])
251 fi
252
253 AC_COMPUTE_INT(ff_size_long,[sizeof(long)])
254 AC_COMPUTE_INT(ff_size_int,[sizeof(int)])
255 AC_COMPUTE_INT(ff_size_ptr,[sizeof(int*)])
256
257 AC_SUBST(SIZEOF_LONG,$ff_size_long)
258 AC_SUBST(SIZEOF_INT,$ff_size_int)
259 AC_SUBST(SIZEOF_PTR,$ff_size_ptr)
260 if test "0$ff_size_ptr" -eq 4 ;then
261 AC_SUBST(SIZEOF_PTRINBIT,32)
262 ff_ptrbit=32
263 elif test "0$ff_size_ptr" -eq 8 ;then
264 AC_SUBST(SIZEOF_PTRINBIT,64)
265 ff_ptrbit=64
266 else
267 AC_MSG_NOTICE( [ fatal error : sizeof pointer $ff_size_ptr ! or no c++ compiler: $CXX] );
268 AC_MSG_ERROR([ Sorry sizeof c++ pointer $ff_size_ptr are not 4 or 8 ])
269 fi
270
271 # FFCS - build the code for FreeFem++-cs
272 AC_ARG_ENABLE(ffcs,AS_HELP_STRING([--enable-ffcs],[build FreeFEM for use by FreeFem++-cs]))
273 if test "$enable_ffcs" = yes
274 then
275 AC_DEFINE_UNQUOTED(ENABLE_FFCS,$enable_ffcs,[build FreeFEM for use by FreeFem++-cs])
276 else
277 enable_ffcs=no
278 fi
279 AC_SUBST(ENABLE_FFCS,"$enable_ffcs")
280 AM_CONDITIONAL([ENABLE_FFCS],[test $enable_ffcs = yes])
281
282 # dur dur car sous MacOsX le fortran n'est pas standard.
283 ff_AR="ar"
284 ff_ARFLAGS="rv"
285 ff_RANLIB="ranlib"
286 AC_ARG_ENABLE(fortran,AS_HELP_STRING([--disable-fortran],[No Fortran compiler available ( ARPACK need it)]))
287
288 ff_g2c_lib="";
289 if test "$enable_fortran" != no
290 then
291
292 # ALH-FFCS-2/3/10: add gfortran-mp-4.4 for MacPorts on MacOS 10.6
293 # FH add iforr
294 AC_PROG_FC(gfortran f90 xlf90 g95 ifort gfortran-mp-4.4)
295 AC_PROG_F77(gfortran f90 xlf xlf90 g95 f77 fort77 "$FC" ifort gfortran-mp-4.4)
296
297 # if test -n "$F77"
298 # then
299 ff_flibs=""
300 # modif FH
301 AC_F77_LIBRARY_LDFLAGS
302 dnl AC_F77_WRAPPERS
303 # correct pb of double def under macos
304 case $F77 in
305 *fort77)
306 if test -z "$FLIBS" ; then
307 # FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print $(NF-2),$(NF-1)}'`
308 # FH to remove " "
309 FLIBS=`fort77 -v a.out 2>&1|awk '/a.out/ && /fort77/ { print "echo",$(NF-2),$(NF-1)}'|sh`
310
311 AC_MSG_WARN([ fort77 FLIBS : $FLIBS ])
312 fi
313 ;;
314 *g77)
315 for i in $FLIBS; do
316 case $i in
317 # save last directory of the list
318 -L*)
319 d=`expr $i : '-L\(.*\)'`;
320 echo " try $d "
321 if test -e "$d/libg2c.so" ; then
322 ff_flibs="$d/libg2c.so"
323 elif test -e "$d/libg2c.dylib" ; then
324 ff_flibs="$d/libg2c.dylib"
325 elif test -e "$d/libg2c.a" ; then
326 ff_flibs="$d/libg2c.a"
327 elif test -e $d/libg2c.so -o -e $d/libg2c.a ; then
328 ff_flibs="$i"
329 fi;;
330 esac
331 done
332 if test -e "$ff_flibs" ;then
333 FLIBS="$ff_flibs"
334 else
335 FLIBS="$ff_flibs -lg2c"
336 fi
337 AC_MSG_WARN([ get dir of -lg2c FLIBS : $FLIBS ])
338 ;;
339 # add FH sep 2006 / modif 2009
340 # remove FH jan 2021 (Idea of P. Jolivet)
341 *gfortran-obsolete)
342 ff_okkk=0
343 for i in $FLIBS; do
344 case $i in
345 -L*)
346 d=`expr $i : '-L\(.*\)'`;
347 if test -e "$d/libgfortran.$ff_suffix_dylib_a" -a -e "$d/libquadmath.$ff_suffix_dylib_a" ; then
348 ff_flibs="$d/libgfortran.$ff_suffix_dylib_a $d/libquadmath.$ff_suffix_dylib_a"
349 ff_okkk=1
350 elif test -e "$d/libgfortran.a" -a -e "$d/libquadmath.a" ; then
351 ff_flibs="$d/libgfortran.a $d/libquadmath.a"
352 ff_okkk=1
353 elif test -e "$d/libgfortran.$ff_suffix_dylib_a" ; then
354 ff_flibs="$d/libgfortran.$ff_suffix_dylib_a"
355 ff_okkk=2
356 elif test -e "$d/libgfortran.a" ; then
357 ff_flibs="$d/libgfortran.a"
358 ff_okkk=2
359 fi;;
360 esac
361 done
362 if test "$ff_okkk" -ge 1 ;then
363 FLIBS="$ff_flibs"
364 else
365 FLIBS="$ff_flibs -lgfortran"
366 fi
367 AC_MSG_WARN([ get dir of -lgfortran FLIBS : $FLIBS ])
368 ;;
369 esac
370 AC_ARG_WITH(flib,[ --with-flib= the fortran library ])
371 # correct FH sep 2006 -o -> -a
372 if test "$with_flib" != no -a -n "$with_flib"
373 then
374 ff_g2c_lib="$with_flib"
375 FLIBS="$with_flib"
376 fi
377 # add FH oct 2007 for download f2c
378 if test -z "$F77" ; then
379 ff_f77=`pwd`/3rdparty/bin/fort77
380 ff_flibs=`pwd`/3rdparty/lib/libf2c.a
381 if test -x $ff_f77 -a -f $ff_flibs ; then
382 AC_MSG_WARN([ no fortran, but find download f2c/fort]);
383 F77=$ff_f77
384 FLIBS=$ff_flibs
385 else
386 AC_MSG_NOTICE( [ fatal error : no fortran ] );
387 AC_MSG_NOTICE( [add --disable-fortran ] );
388 AC_MSG_NOTICE( [or try to compile f2c in directory 3rdparty/f2c ] );
389 AC_MSG_NOTICE( [ just do: make install ] );
390 AC_MSG_ERROR([ Fatal error No Fortran compiler . ],1);
391 fi
392 fi
393 # check if the FLIBS is correct
394 ff_libs="$LIBS"
395 LIBS="$ff_libs $FLIBS"
396 AC_TRY_LINK_FUNC(exit,ff_err=,ff_err=ok);
397 if test "$ff_err" = "ok" ; then AC_MSG_ERROR([ Fatal FLIBS: $FLIBS is incorrect. ],1); fi
398 LIBS="$ff_libs"
399 echo "F77 LD $ff_libs" >config_LIB_INFO
400 AC_LANG_PUSH([Fortran 77])
401
402
403 AC_MSG_CHECKING([ Size of fortran 77 integer ])
404
405
406
407 AC_RUN_IFELSE([AC_LANG_SOURCE([[
408 program test
409 integer p,i
410 p=1024*1024
411 i= p*p
412 open(7,file="conftest.out")
413 if (i>0) then
414 write(7,*) 8
415 else
416 write(7,*) 4
417 endif
418 close(7)
419 end
420 ]])] ,ff_f77intsize=`cat conftest.out`,ff_f77intsize=4,ff_f77intsize=4)
421 ## AC_LANG(C++)
422 AC_LANG_POP([Fortran 77])
423 AC_MSG_RESULT($ff_f77intsize)
424 AC_F77_WRAPPERS
425
426 ff_cfagsf77=""
427 case $ac_cv_f77_mangling in
428 # "lower case, no underscore, no extra underscore")
429 # "lower case, no underscore, extra underscore")
430 # ;;
431 "lower case, underscore, no extra underscore") ff_cfagsf77="-DAdd_";;
432 "lower case, underscore, extra underscore") ff_cfagsf77="-DAdd__ -Df77IsF2C";;
433 "upper case, no underscore, no extra underscore") ff_cfagsf77="-DUPPER";;
434 "upper case, no underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";;
435 "upper case, underscore, no extra underscore") ff_cfagsf77="-DUPPER -DAdd_";;
436 "upper case, underscore, extra underscore") ff_cfagsf77="-DUPPER -DAdd__";;
437 *) ;;
438 esac
439 ff_cfagsf77="$ff_cfagsf77 $ff_allow_mismatch"
440 AC_SUBST(CFLAGSF77,$ff_cfagsf77)
441 if test $ff_f77intsize -ne 4
442 then
443 AC_MSG_ERROR([ Fatal Error: Your fortran 77 compiler have by not 4 bytes integer ( $ff_f77intsize bytes) ],1);
444 fi
445 test -f /mingw/bin/libpthread-2.dll && ff_pthread_dll=/mingw/bin/libpthread-2.dll ; \
446 AC_FF_ADDWHERELIB(f77,$FLIBS,$ff_cfagsf77 $ff_pthread_dll)
447 AC_FF_ADDWHERELIB(fc,$FLIBS,$ff_cfagsf77 $ff_pthread_dll)
448 fi
449
450 # fin test FORTRAN ..........
451 # ----------------------------
452
453 AC_ARG_ENABLE(c,AS_HELP_STRING([--disable-c],[No C compiler available (C BLAS need it)]))
454 if test "$enable_c" != no
455 then
456 AC_PROG_CC
457 case "$CC" in
458 *-std=*)
459 AC_MSG_NOTICE([Moving -std flag from CC to CFLAGS])
460 cc_std=
461 cc_keep=
462 for cc_flag in $CC
463 do
464 case "$cc_flag" in
465 -std=*)
466 cc_std="$cc_std $cc_flag"
467 ;;
468 *)
469 cc_keep="$cc_keep $cc_flag"
470 ;;
471 esac
472 done
473 CC=${cc_keep# }
474 CFLAGS="${cc_std# } $CFLAGS"
475 ;;
476 esac
477 AM_PROG_CC_C_O
478 else
479
480 # We need to define this otherwise ./configure crashes with
481 # the message "configure: error: conditional "am__fastdepCC"
482 # was never defined".
483
484 am__fastdepCC_TRUE=
485 am__fastdepCC_FALSE='#'
486 fi
487
488 AM_PROG_LEX
489 AC_PROG_YACC
490 AC_LANG(C++)
491
492
493 # Some useful libraries
494 AC_CHECK_LIB(z,deflate,ff_zlib="-lz",ff_zlib="")
495 AC_ARG_WITH(zlib,[--with-zlib= the z library ])
496 if test "$with_zlib" != no -a -n "$with_glut" ; then
497 ff_zlib="$with_zlib";
498 elif test "$with_zlib" = no ; then
499 ff_zlib=""
500 fi
501
502 AC_CHECK_LIB(pthread,pthread_create,ff_pthread="-lpthread",ff_pthread="")
503 AC_CHECK_LIB(iomp5,omp_get_wtime,ff_iomp5="-liomp5",ff_iomp5="")
504 AC_CHECK_LIB([rt],[clock_gettime])
505 AC_CHECK_HEADERS(zlib.h,
506 ff_zlib_ok=yes
507 ,
508 ff_zlib_ok=no
509 )
510
511 if test -n "$ff_pthread" ; then
512 AC_FF_ADDWHERELIB(pthread,$ff_pthread,)
513 fi
514
515 # Necessary absolute pathname for local directory when some libraries
516 # are used from several different locations (for instance locally in
517 # configure.ac and in a subdir).
518 curdir=`pwd`
519
520 # Configure options
521 # -----------------
522
523 echo "$PATH" > config.path
524 eval for i in $ac_configure_args\; do echo \$i\; done | sed -e "s/$/'/" -e "s/^/'/" > config.param
525
526 # by default the suffix of the .so lib file is .so
527 # it is .dll under windows
528 # it is .dylib under macos X
529
530 # suffix of dynamic lib
531 # Checking wether we can produce a MacIntosh-specific version
532 # -----------------------------------------------------------
533 AC_MSG_CHECKING(wether we are on a MacIntosh)
534 ff_mac=no
535 if test `uname` = Darwin;
536 then
537 ff_suffix_dylib="dylib"
538 ff_suffix_dylib_a="dylib"
539 ff_mac=yes
540 AC_DEFINE_UNQUOTED(FF_PREFIX_DIR_APPLE,"/Applications/FreeFem++.app/Contents/",FreeFem prefix dir)
541 fi
542 AC_MSG_RESULT($ff_mac)
543
544 AC_MSG_CHECKING(wether we are on SunOS)
545 ff_sunos=no
546 if test `uname -s` = SunOS;
547 then
548 ff_sunos=yes
549 fi
550 AC_MSG_RESULT($ff_sunos)
551
552 # glut ------------
553 # ----------------
554 ff_glut=""
555 ff_glut_ok=""
556 AC_ARG_WITH(glut,[ --with-glut glutlib and include ])
557 if test "$with_glut" != no -a -n "$with_glut" ; then
558 ff_libs_save="$LIBS"
559 LIBS="$LIBS"
560 dnl not works .... so no check .... FH
561 ff_glut="$with_glut";ff_glut_ok=yes
562 dnl AC_SEARCH_LIBS(abort,[$with_glut],[ff_glut="$with_glut";ff_glut_ok=yes],[ff_glut="";ff_glut_ok="no"])
563 LIBS="$ff_libs_save"
564 dnl AC_MSG_ERROR([ Sorry bad --with-glut : $with_glut !])
565 elif test "$with_glut" = no ; then
566 ff_glut_ok="no"
567 fi
568
569 # Checking wether we can produce a Microsoft Windows-specific version
570 # -------------------------------------------------------------------
571
572 AC_ARG_ENABLE(cygwindll,[ --enable-cygwindll Forces the use of the Cygwin DLL (not recommended)])
573 AC_ARG_ENABLE(mingw64,[ --enable-mingw64 Uses mingw64 compilers on Cygwin])
574 AC_MSG_CHECKING(wether we are on Microsoft Windows)
575 ff_uname=`uname`
576 # flag to build window 32 version ff_mingw = yes
577 ff_mingw=no
578 ff_fpic=yes
579 case $ff_uname in
580 CYGWIN*)
581 ff_fpic=no
582 # ff_nocygwin=-mno-cygwin
583 AC_SUBST(GCCNOCYGWIN,$ff_nocygwin);;
584 MINGW*|MSYS_NT*)
585 enable_cygwindll=no;;
586
587
588 esac
589 ff_PURE_WIN32=0
590 case $ff_uname in
591 CYGWIN*|MINGW*|MSYS_NT*)
592 ff_fpic=no
593 ff_suffix_dylib="dll";
594 ff_suffix_dylib_a="dll.a";
595 ff_win32=yes;
596 # echo "ff win 32 --------------------------------------------"
597 # FFCS - 8/3/12 - remove -D_MSC_VER under MinGW64 because it forces system calls to be compiled into any object
598 # (which creates thousands of duplicate definitions for sytem calls like time()).
599
600
601 # We need Mingw to avoid Cygwin's extra DLLs
602 if test "$enable_cygwindll" != yes
603 then
604 # CHECK_COMPILE_FLAG(C++,-mwindows,CXXFLAGS)
605
606 # FFCS: on Windows, FF crashes when compiling GL/glut.h and the option "--disable-opengl" is not
607 # operational because ff_glut_ok is forced to yes here.
608 if test $enable_ffcs = yes
609 then
610 ff_glut_ok=no
611 ff_glut=""
612 enable_opengl=no
613 fi
614
615 ff_mingw=yes
616 enable_cygwindll=no;
617 ff_pthread="-mthreads"
618
619 # FFCS does not use the Cygwin MinGW compilers any more
620 if test $enable_ffcs = no
621 then
622 CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw"
623 FFLAGS="$FFLAGS $ff_nocygwin"
624 CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw"
625 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a;])],[],
626 [ff_nocygwin="";
627 AC_MSG_NOTICE([Sorry $ff_nocygwin optio is wrong try whitout , but try with gcc-3.3])
628 ])
629 CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw"
630 FFLAGS="$FFLAGS $ff_nocygwin"
631 CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw"
632 CNOFLAGS="$CNOFLAGS $ff_nocygwin -I/usr/include/mingw"
633 fi
634
635 LIBS="$LIBS $ff_nocygwin -mthreads -lws2_32 -lcomdlg32"
636 LIBSNOCONSOLE="-mwindows"
637
638 # FFCS uses a specific compiler, so we specify its libraries explicitely
639 if test $enable_ffcs = no
640 then
641 export PATH="$PATH:`cygpath $MSMPI_BIN`"
642 test -z "$MPIRUN" && MPIRUN=`which mpiexec.exe`
643 if test "$enable_fortran" != no -a "$with_flib" != no ; then
644 case "$F77" in
645 *gfortran) FLIBS="$ff_nocygwin -lgfortran -lquadmath";;
646 *g77) FLIBS="$ff_nocygwin -lg2c";;
647 *) AC_MSG_ERROR([ Sorry no known FLIBS with this $F77 !]) ;;
648 esac
649 fi
650 fi
651
652 if test -z "$ff_glut" -a "$ff_glut_ok" != "no" ; then
653 ff_glutname="glut32"
654 # check abort a existing function just to find in glut32.dll exist in the path
655 # because glutInit is not the real symbol on win32 dur dur FH !!!!!!!!!
656 AC_CHECK_LIB(glut32,abort,ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32",ff_glut="")
657 if test -z "$ff_glut" ; then
658 ff_glutname="freeglut"
659 if test -x /usr/bin/pkg-config.exe ; then
660 ff_glut="-lglu32 "`/usr/bin/pkg-config.exe --libs --static freeglut`
661 else
662 ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32"
663 fi
664 AC_CHECK_LIB(freeglut,abort,ff_glut_ok=yes,ff_glut="")
665 fi
666 fi
667 # Resources for FreeFem++-cs in Microsoft Windows format
668 AC_SUBST(FFGLUTNAME,$ff_glutname)
669 AC_SUBST(WINDRESOBJ,windres.o)
670 AC_SUBST(LIBSNOCONSOLE,$LIBSNOCONSOLE)
671 AC_SUBST(WIN32DLLTARGET,win32-dll-target)
672 ff_TEST_FFPP="../../src/bin-win32/FreeFem++.exe"
673 ff_TEST_FFPP_MPI="../../src/bin-win32/FreeFem++-mpi.exe"
674
675 AC_DEFINE(PURE_WIN32,1,A pure windows applications no cygwin dll)
676 ff_PURE_WIN32=1
677 ff_dynload=yes
678 fi
679
680
681 ;;
682 *) ff_win32=no;;
683 esac
684 AC_MSG_RESULT($ff_win32)
685
686 if test "$ff_win32" = no
687 then
688 enable_cygwindll=no
689 fi
690
691 # FreeFem++-specific version information
692 # --------------------------------------
693
694 # Version numbering, converted to a floating point value
695 ff_numver="`echo $VERSION|sed 's/-\(.*\)/+\1.0*0.000001/'`"
696 AC_DEFINE_UNQUOTED(VersionFreeFem,$ff_numver,FreeFEM version as a float)
697
698 # Since src/fflib/strversionnumber.cpp is recreated at each build, this
699 # date is only useful for config-version.h
700
701 test "$prefix" = NONE && prefix="$ac_default_prefix"
702 ff_prefix_dir="${prefix}/lib/ff++/$VERSION"
703 AC_MSG_CHECKING(prefix dir freefem++ )
704 AC_MSG_RESULT($ff_prefix_dir)
705
706 FF_DATE="$BUILD_DATE"
707 AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFEM build date)
708 AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix dir)
709 AC_SUBST(ff_prefix_dir,$ff_prefix_dir)
710 AC_SUBST(ff_prefix,${prefix})
711
712 ff_prefix_dir_lib="$ff_prefix_dir/lib"
713 ff_prefix_dir_data="$datadir/$PACKAGE_NAME"
714
715 ff_prefix_dir_include="$ff_prefix_dir/include"
716 ff_prefix_dir_etc="$ff_prefix_dir/etc"
717 ff_prefix_dir_lib_mpi="$ff_prefix_dir/lib/mpi"
718 ff_prefix_dir_example="$ff_prefix_dir_data/$PACKAGE_VERSION"
719 AC_SUBST(ff_prefix_dir_lib,$ff_prefix_dir_lib)
720 AC_SUBST(ff_prefix_dir_include,$ff_prefix_dir_include)
721 AC_SUBST(ff_prefix_dir_etc,$ff_prefix_dir_etc)
722 AC_SUBST(ff_prefix_dir_lib_mpi,$ff_prefix_dir_lib_mpi)
723 AC_SUBST(ff_prefix_dir_example,$ff_prefix_dir_example)
724
725 # Separate configuration header file for version information, included
726 # in config-macos9.h
727
728 cat << EOF > config-version.h
729 /* FreeFEM version information for MacOS 9 configuration */
730 /* File generated by configure.ac */
731
732 /* Define to the full name and version of this package. */
733 #define PACKAGE_STRING "$PACKAGE_STRING"
734
735 /* Define to the one symbol short name of this package. */
736 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
737
738 /* Define to the version of this package. */
739 #define PACKAGE_VERSION "$PACKAGE_VERSION"
740
741 /* Version number of package */
742 #define VERSION "$VERSION"
743
744 /* FreeFEM build date */
745 #define VersionFreeFemDate "$FF_DATE"
746
747 /* FreeFEM version as a float */
748 #define VersionFreeFem ($ff_numver)
749 EOF
750
751 # Checking wether to produce a debug version
752 # ------------------------------------------
753
754 # Generic or hardware-dependant optimization
755 m4_include(etc/config/m4/acmacros.m4)
756 m4_include(etc/config/m4/acoptim.m4)
757
758 # [[file:ax_lib_hdf5.m4]]
759 m4_include(etc/config/m4/ax_lib_hdf5.m4)
760
761 # [[file:ax_lib_gsl.m4]]
762 m4_include(etc/config/m4/ax_lib_gsl.m4)
763
764 # Checking c++11 for HashMatix (Madatory now)
765 # F.Hecht:
766 # do not compile all with c++11 version to much
767 # probleme to day (frev 2015) with g++ 4.8.1
768 ff_cxx_save=$CXXFLAGS
769 ## for bem.cpp need c++14 for intel compiler
770 CHECK_COMPILE_FLAG(C++,[-std=gnu++14],CXXFLAGS,ff_cxx11)
771 if test "$ff_cxx11" = yes ; then
772 CXX11FLAGS="-std=gnu++14";
773 AC_FF_ADDWHERELIB(cxx11,$CXX11FLAGS,$CXX11FLAGS)
774 else
775 CHECK_COMPILE_FLAG(C++,[-std=c++14],CXXFLAGS,ff_cxx11)
776 if test "$ff_cxx11" = yes ; then
777 CXX11FLAGS="-std=c++14";
778 AC_FF_ADDWHERELIB(cxx11,$CXX11FLAGS,$CXX11FLAGS)
779 else
780 CHECK_COMPILE_FLAG(C++,[-std=c++11],CXXFLAGS,ff_cxx11)
781 if test "$ff_cxx11" = yes ; then
782 CXX11FLAGS="-std=c++11";
783 AC_FF_ADDWHERELIB(cxx11,$CXX11FLAGS,$CXX11FLAGS)
784 else
785 AC_MSG_NOTICE( [ fatal error : c++ compiler ! ] );
786 AC_MSG_ERROR([ Sorry no c++ compiler !])
787 AC_MSG_ERROR([ Fatal error no c++11 or c++14 ],1);
788 fi
789 fi
790 fi
791 ##CXXFLAGS="$ff_cxx_save"
792 AC_SUBST(WITH_CXX11,$ff_cxx11)
793 AC_SUBST(CXX11FLAGS,$CXX11FLAGS)
794 #end Checking c++11
795 # ------------------------------
796 # compilation flags of FreeFem++
797 # ------------------------------
798 # -DDRAWING bamg active some drawing facility in bamg (inquire mesh)
799 # -DBAMG_LONG_LONG active the use of long long in bamg
800 # -DDEBUG active the checking in bamg
801 # -DNCHECKPTR remove check pointer facility
802 # -DCHECK_KN active subscripting of some array
803 # -DWITHCHECK of the dynamic type ckecking of the langague (very slow)
804 # -DEIGENVALUE to compile the eigen value part
805 # ------------------------------------------------
806
807 # FreeFrem++-specific optimizations -fpascal-strings
808
809
810 if test "$enable_debug" = yes;
811 then
812 CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DCHECK_KN"
813 if test "$ff_mac" = yes;
814 then
815 CXXFLAGS="$CXXFLAGS -fno-inline -fexceptions"
816 fi
817 else
818 CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG -DNCHECKPTR"
819 if test "$ff_mac" = yes;
820 then
821 CXXFLAGS="$CXXFLAGS "
822 fi
823 fi
824
825 #whether or not to add a suffix to the package name
826 #--------------------------------------------------
827
828 AC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix to package name)])
829
830 AC_MSG_CHECKING(suffix to add to package name)
831 ff_suffix=
832 if test "$with_suffix" = yes -o "$with_suffix" = no -o "$with_suffix" = ""
833 then
834 AC_MSG_RESULT(none)
835 else
836 ff_suffix="-$with_suffix"
837 AC_MSG_RESULT($ff_suffix)
838 fi
839 AC_SUBST(ADD_PACKAGE_NAME,$ff_suffix)
840
841
842
843
844 # Checking that OpenGL is accessible
845 # ----------------------------------
846
847 ff_gl_ok=no
848 ff_glx_ok=no
849
850 ff_libs="$LIBS"
851 AC_ARG_WITH(flib,[ --with-flib= the fortran library ])
852 AC_ARG_ENABLE([opengl],AS_HELP_STRING([--enable-opengl],
853 [Enable/disable support for OpenGL]))
854
855 # echo " .... LIBS = $LIBS .... "
856 if test x$enable_opengl != xno; then
857 # GL libraries seem to depend on some dlopen capabilities
858 if test "$enable_static" != yes -a "$ff_glut_ok" != yes
859 then
860 # If we cannot find gl.h, no OpenGL version can be produced
861 AC_CHECK_HEADERS(OpenGL/gl.h,
862 ff_gl_ok=yes
863 ,
864 ff_gl_ok=no
865 )
866
867
868 if test "$ff_gl_ok" = no
869 then
870 AC_CHECK_HEADERS(GL/gl.h,
871 ff_gl_ok=yes
872 ,
873 ff_gl_ok=no
874 )
875 fi
876 AC_CHECK_HEADERS(GLUT/glut.h,
877 ff_glut_ok=yes,
878 ff_glut_ok=no)
879
880 if test "$ff_glut_ok" = no
881 then
882 AC_CHECK_HEADERS(GL/glut.h,
883 ff_glut_ok=yes,
884 ff_glut_ok=no)
885 fi
886
887 # GLUT .....
888 if test "$ff_glut_ok" = yes
889 then
890 for glut in \
891 "-framework GLUT -framework OpenGL -framework Cocoa" \
892 "-lglut -lGLU -lGL"
893 do
894 ff_glut="$glut"
895 ff_libs1="$LIBS"
896 LIBS="$LIBS $ff_glut"
897 AC_TRY_LINK_FUNC(glutInit,
898 ff_glut_ok=yes
899 LIBS="$ff_libs1"
900 break,
901 ff_glut_ok=next);
902 LIBS="$ff_libs1"
903 done
904 fi
905
906
907 fi
908 fi
909 AC_SUBST(LIBSPTHREAD,$ff_pthread)
910 AC_SUBST(FF_ZLIB,$ff_zlib)
911 # ALH - 16/9/13 - at the moment the requirements for medit (glut) are not compatible with FFCS so medit is
912 # only compiled with FF.
913
914 if test $enable_ffcs = no
915 then
916 if test "$ff_glut_ok" = yes
917 then
918 AC_SUBST(LIBSGLUT,$ff_glut)
919 if test -n "$ff_pthread" ; then
920 ff_ffglutprog="ffglut${EXEEXT}"
921 AC_DEFINE_UNQUOTED(PROG_FFGLUT,"$ff_ffglutprog", the ffglut application for the new graphics )
922 fi
923 ff_meditprog="ffmedit${EXEEXT}"
924 fi
925 fi
926
927 AC_ARG_WITH(suffix,[ --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix package name)])
928 if test "$with_suffix" = yes
929 then
930 with_suffix=""
931 elif test "$with_suffix" = no -o -z "$with_suffix"
932 then
933 with_suffix=""
934 else
935 with_suffix="-$with_suffix"
936 fi
937 AC_MSG_CHECKING(add suffix $with_suffix )
938 AC_SUBST(ADD_PACKAGE_NAME,$with_suffix)
939 AC_MSG_RESULT(yes)
940
941
942 # Checking wether we can produce a parallel version
943 # -------------------------------------------------
944
945 if test $enable_ffcs = no
946 then
947 # FF case conf with PETSC or after
948 dnl m4_include(etc/config/m4/acmpi.m4)
949 ff_mpi=no
950 else
951 # FFCS - use the same MPI configuration choices as FFCS
952 if test -z "$MPICXX"
953 then
954 ff_mpi=no
955 else
956 ff_mpi=yes
957 AC_SUBST(MPICXX,$MPICXX)
958 AC_SUBST(MPICC,$MPICC)
959 AC_SUBST(MPIFC,$MPIFC)
960 AC_SUBST(MPIPROG,"FreeFem++-mpi${EXEEXT}")
961 AC_SUBST(MPI_INCLUDE,"-I $MPI_INC_DIR")
962 AC_SUBST(MPI_INC_DIR,$MPI_INC_DIR)
963 AC_SUBST(MPI_LIB_DIRS,"")
964 AC_SUBST(MPI_LIB,$MPI_LIB)
965 AC_SUBST(MPI_LIBC,"")
966 AC_SUBST(MPI_LIBFC,"")
967
968 # these values should not be empty otherwise
969 # plugin/seq/ff-get-dep will think that they are not
970 # defined
971 AC_FF_ADDWHERELIB(mpi,-DDUMMY,-I$MPI_INC_DIR)
972
973 # mpifc and mpif77 libraries should always be specified
974 # because FF never calls the Fortran MPI compiler. It always
975 # uses mpicxx in [[file:plugin/seq/ff-c++]]. The
976 # resulting Fortran libraries (eg Mumps) would compile even
977 # without the proper Fortran libs, but they would not load
978 # properly.
979
980 # under Win32, libmpi_f77.a is not the right name and FFCS
981 # mingw/mpicxx adds the right libraries by itself
982
983 # With mpich2 Debian wheezy 32 bits, libmpi_f77.a is not available (request from Cico, 14/10/13)
984
985 if test -f /usr/lib/openmpi/lib/libmpi_f77.a
986 then
987 AC_FF_ADDWHERELIB(mpifc,-lmpi_f77,)
988 AC_FF_ADDWHERELIB(mpif77,-lmpi_f77,)
989 else
990 AC_FF_ADDWHERELIB(mpifc,-DDUMMY,)
991 AC_FF_ADDWHERELIB(mpif77,-DDUMMY,)
992 fi
993
994 # FFCS - MPI_DOUBLE_COMPLEX kept from original FF configure script
995 AC_MSG_CHECKING( MPI_DOUBLE_COMPLEX)
996 AC_COMPILE_IFELSE(
997 [AC_LANG_SOURCE([
998 #include <mpi.h>
999 MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX;
1000 ])],
1001 ff_mpi_double_complex=yes,
1002 ff_mpi_double_complex=no)
1003 AC_MSG_RESULT($ff_mpi_double_complex)
1004 if test "$ff_mpi_double_complex" = yes ; then
1005 AC_DEFINE(HAVE_MPI_DOUBLE_COMPLEX,1, mpi_double_complex)
1006 fi
1007 fi
1008 fi
1009
1010 # Looking for useful configuration utilities
1011 # ------------------------------------------
1012
1013 AC_ARG_ENABLE(summary,AS_HELP_STRING([--enable-summary],[Display activated libraries list at the end of the configure process]))
1014
1015 AC_ARG_ENABLE(download,AS_HELP_STRING([--enable-download],[Download missing libraries (BLAS,ARPACK,UMFPACK,...)]))
1016 ## PETSc
1017 AC_ARG_WITH(petsc,[ --with-petsc=/usr/local/petsc/conf/petscvariables --without-petsc])
1018 AC_ARG_WITH(prefix_petsc,[ --prefix_petsc=directory where all PETSc/SLEPc will be installed if you download ])
1019 if test -z "${prefix_petsc}"; then prefix_petsc="${prefix}/ff-petsc"; fi
1020 AC_SUBST([FF_prefix_petsc],"$prefix_petsc")
1021 if test "ff_win32" = yes ; then
1022 prefix_petsc_win32=`cygpath -w "$prefix_petsc"`
1023 AC_SUBST([FF_prefix_petsc_win32],"$prefix_petsc")
1024
1025 fi
1026 AC_SUBST([FF_prefix_petsc_real],"$prefix_petsc_real")
1027 AC_SUBST([FF_prefix_petsc_complex],"$prefix_petsc_complex")
1028 AC_SUBST([FF_generic_petsc],"$enable_generic")
1029 # /usr/local/petsc/conf/petscvariables
1030 #/usr/local/ff++/petsc/lib/petsc/conf/petscvariables
1031 ff_petsc_ok=no
1032 ff_slepc_ok=no
1033 if test "$with_petsc" != no; then
1034 for d in "$with_petsc" "${prefix_petsc}/r/lib" /usr/local/ff++/petsc/lib /usr /usr/local /opt/usr /opt/local /usr/lib/petsc ;do
1035 for dd in "" "/petsc/conf/petscvariables" "/lib/petsc/conf/petscvariables" ; do
1036 ffconfpetsc="$d$dd"
1037 ffconfslepc="$d/slepc/conf/slepcvariables"
1038
1039 # echo " petsc ... $ffconfpetsc"
1040 if test -f "$ffconfpetsc" ; then
1041 if test "$ff_petsc_ok" = no ; then
1042 PETSC_PREFIXDIR=`awk -F' *= *' '"PREFIXDIR"==$1 {print $2}' "$ffconfpetsc"`
1043 PETSC_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetsc"`
1044 PETSC_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetsc"`
1045 PETSC_MPIRUN=`echo "$PETSC_MPIRUN" | awk '{gsub(" --oversubscribe", ""); print}'` #remove --oversubscribe
1046 AC_MSG_NOTICE([ find real ( $PETSC_SCALAR ) petsc in $ffconfpetsc]);
1047 if test "$ff_mpi" != yes; then
1048 AC_MSG_NOTICE([ choose MPI from petsc : $PETSC_MPIRUN ]);
1049 MPIRUN=`echo $PETSC_MPIRUN`
1050 MPICC=`awk -F' *= *' '"CC"==$1 {print $2}' "$ffconfpetsc"`
1051 MPICXX=`awk -F' *= *' '"CXX"==$1 {print $2}' "$ffconfpetsc"`
1052 MPIFC=`awk -F' *= *' '"FC"==$1 {print $2}' "$ffconfpetsc"`
1053 case $ff_uname in
1054 CYGWIN*|MINGW*|MSYS_NT*)
1055 MPICC=$MPICC" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetsc"`
1056 MPICXX=$MPICXX" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetsc"`
1057 MPIFC=$MPIFC" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetsc"`
1058 esac
1059 m4_include(etc/config/m4/acmpi.m4)
1060 fi
1061 if test "$ff_mpi" = yes; then
1062 WPETSC_MPIRUN=`which "$PETSC_MPIRUN"`
1063 WMPIRUN=`which "$MPIRUN"`
1064 test "$PETSC_SCALAR" = "real" && test "$ff_win32" = yes -o "$PETSC_MPIRUN" = "$MPIRUN" || cmp -s "$WPETSC_MPIRUN" "$WMPIRUN"
1065 if test "$?" -eq 0 ; then
1066 AC_SUBST([FF_conf_petsc_real],"$ffconfpetsc")
1067 AC_SUBST([FF_prefix_petsc_real],"$PETSC_PREFIXDIR")
1068 AC_FF_PETSC_WHERELIB_BASIC(petsc,$ffconfpetsc)
1069 AC_FF_PETSC_WHERELIB(parmetis,PARMETIS_LIB,PARMETIS_INCLUDE,$ffconfpetsc)
1070 AC_FF_PETSC_WHERELIB(metis,METIS_LIB,METIS_INCLUDE,$ffconfpetsc)
1071 AC_FF_PETSC_WHERELIB(ptscotch,PTSCOTCH_LIB,PTSCOTCH_INCLUDE,$ffconfpetsc)
1072 ff_SCOTCH_INCLUDE=$ff_PTSCOTCH_INCLUDE
1073 ff_SCOTCH_LIB=`echo $ff_PTSCOTCH_LIB | sed -e 's/@<:@^ @:>@*ptscotch@<:@^ @:>@*//g' | sed -e 's/@<:@^ @:>@*ptes@<:@^ @:>@*//g'`
1074 if test -n "$ff_SCOTCH_LIB"; then
1075 ff_scotch_ok=yes;
1076 AC_FF_ADDWHERELIB(scotch,$ff_SCOTCH_LIB,$ff_SCOTCH_INCLUDE)
1077 AC_SUBST([TOOL_COMPILE_scotch],"")
1078 fi
1079 AC_FF_PETSC_WHERELIB(mumps,MUMPS_LIB,MUMPS_INCLUDE,$ffconfpetsc)
1080 if test -n "$ff_MUMPS_LIB"; then
1081 sed -E 's/mumps LD(.*)-lzmumps /mumps LD\1/g;s/mumps LD(.*)ldmumps/mumps LD\1ldmumps -lzmumps/g' $ff_where_lib_conf > plugin/seq/WHERE_LIBRARY-download
1082 mv plugin/seq/WHERE_LIBRARY-download $ff_where_lib_conf
1083 sed -E 's/mumps LD(.*)-lcmumps /mumps LD\1/g;s/mumps LD(.*)lsmumps/mumps LD\1lsmumps -lcmumps/g' $ff_where_lib_conf > plugin/seq/WHERE_LIBRARY-download
1084 mv plugin/seq/WHERE_LIBRARY-download $ff_where_lib_conf
1085 fi
1086 AC_FF_PETSC_WHERELIB(tetgen,TETGEN_LIB,TETGEN_INCLUDE,$ffconfpetsc)
1087 AC_FF_PETSC_WHERELIB(hpddm,HPDDM_LIB,HPDDM_INCLUDE,$ffconfpetsc)
1088 AC_FF_PETSC_WHERELIB(superlu,SUPERLU_LIB,SUPERLU_INCLUDE,$ffconfpetsc)
1089 AC_FF_PETSC_WHERELIB(mmg,MMG_LIB,MMG_INCLUDE,$ffconfpetsc)
1090 AC_FF_PETSC_WHERELIB(parmmg,PARMMG_LIB,PARMMG_INCLUDE,$ffconfpetsc)
1091 AC_FF_PETSC_WHERELIB(scalapack,SCALAPACK_LIB,SCALAPACK_INCLUDE,$ffconfpetsc)
1092 AC_FF_PETSC_WHERELIB(gsl,GSL_LIB,GSL_INCLUDE,$ffconfpetsc)
1093 if test -z "$with_gsl_prefix"; then
1094 if test -n "$ff_GSL_INCLUDE"; then
1095 gsl_prefix=`echo $ff_GSL_INCLUDE | sed -e 's/-I//g'`
1096 with_gsl_prefix=`dirname $gsl_prefix`
1097 fi
1098 fi
1099 AC_FF_PETSC_WHERELIB(suitesparse,SUITESPARSE_LIB,SUITESPARSE_INCLUDE,$ffconfpetsc,$ff_METIS_LIB)
1100 dnl if test -n "$ff_SUITESPARSE_LIB" -a -n "$ff_METIS_LIB"; then
1101 dnl ff_where_lib_suitesparse="$ff_METIS_LIB $ff_SUITESPARSE_LIB"
1102 dnl fi
1103 AC_FF_PETSC_WHERELIB(blaslapack,BLASLAPACK_LIB,BLASLAPACK_INCLUDE,$ffconfpetsc)
1104 if test -n "$ff_BLASLAPACK_LIB"; then
1105 ff_where_lib_blaslapack="`echo $ff_BLASLAPACK_LIB | sed -e 's/@<:@^ @:>@*scalapack@<:@^ @:>@*//g' | sed -e 's/@<:@^ @:>@*blacs@<:@^ @:>@*//g'`"
1106 fi
1107 if test -f $d/libslepc.$ff_suffix_dylib -o -f $d/libslepc.a ; then
1108 ff_slepc_ok=yes
1109 ff_SLEPC_LIB="-Wl,-rpath,$d -L$d -lslepc"
1110 AC_FF_ADDWHERELIB(slepc,$ff_SLEPC_LIB,$ff_where_inc_petsc)
1111 if test -f $d/libarpack.$ff_suffix_dylib -o -f $d/libarpack.a ; then
1112 ff_arpack_ok=yes
1113 ff_arpack_libs="-Wl,-rpath,$d -L$d -larpack"
1114 AC_FF_ADDWHERELIB(arpack,$ff_arpack_libs,)
1115 fi
1116 fi
1117 if test "$ff_slepc_ok" != yes ; then
1118 AC_ARG_WITH(slepc_include,AS_HELP_STRING([--with-slepc-include=],[Include directives for slepc instead of automatic download]))
1119 AC_ARG_WITH(slepc_ldflags,AS_HELP_STRING([--with-slepc-ldflags=],[Link-time directives for slepc instead of automatic download]))
1120 if test "$with_slepc_include" != "" || test "$with_slepc_ldflags" != ""
1121 then
1122 # some directives have been specified, use them instead of downloading
1123 AC_FF_ADDWHERELIB(slepc,$with_slepc_ldflags,$with_slepc_include)
1124 ff_slepc_ok=yes
1125 fi
1126 fi
1127 else
1128 AC_MSG_NOTICE([" Warning PETSC MPI and FF++ MPI not the same: $PETSC_MPIRUN != $MPIRUN or $PETSC_SCALAR != real ." ]);
1129 fi
1130 fi
1131 fi
1132 else
1133 ffconfpetsc="";
1134 fi
1135 done
1136 done
1137 fi
1138
1139 if test "$ff_petsc_ok" != no ; then
1140 AC_MSG_NOTICE([ with petsc $ff_petsc_ok, with slepc $ff_slepc_ok ])
1141 else
1142 AC_MSG_NOTICE([ without petsc, slepc ***** ])
1143 fi
1144
1145 ## PETSc complex
1146 AC_ARG_WITH(petsc_complex,[ --with-petsc_complex=/usr/local/petsc/conf/petscvariables --without-petsc_complex ])
1147 ff_petsccomplex_ok=no
1148 ff_slepccomplex_ok=no
1149 if test "$with_petsc_complex" != no; then
1150 for d in "$with_petsc_complex" "${prefix_petsc}/c/lib" /usr/local/ff++/petsc/c/lib /usr/lib/petsc ;do
1151 for dd in "" "/petsc/conf/petscvariables" "/lib/petsc/conf/petscvariables" ; do
1152 ffconfpetscc="$d$dd"
1153 if test -f "$ffconfpetscc" -a "$ff_petsccomplex_ok" = no ; then
1154 PETSC_COMPLEX_SCALAR=`awk -F' *= *' '"PETSC_SCALAR"==$1 {print $2}' "$ffconfpetscc"`
1155 PETSC_COMPLEX_MPIRUN=`awk -F' *= *' '"MPIEXEC"==$1 {print $2}' "$ffconfpetscc"`
1156 PETSC_COMPLEX_PREFIXDIR=`awk -F' *= *' '"PREFIXDIR"==$1 {print $2}' "$ffconfpetscc"`
1157
1158 PETSC_COMPLEX_MPIRUN=`echo "$PETSC_COMPLEX_MPIRUN" | awk '{print $1}'` #remove --oversubscribe
1159 AC_MSG_NOTICE([ find complex ($PETSC_COMPLEX_SCALAR) petsc in $ffconfpetscc]);
1160 if test "$ff_mpi" != yes; then
1161 MPIRUN=`echo $PETSC_COMPLEX_MPIRUN`
1162 MPICC=`awk -F' *= *' '"CC"==$1 {print $2}' "$ffconfpetscc"`
1163 MPICXX=`awk -F' *= *' '"CXX"==$1 {print $2}' "$ffconfpetscc"`
1164 MPIFC=`awk -F' *= *' '"FC"==$1 {print $2}' "$ffconfpetscc"`
1165 case $ff_uname in
1166 CYGWIN*|MINGW*|MSYS_NT*)
1167 MPICC=$MPICC" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetscc"`
1168 MPICXX=$MPICXX" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetscc"`
1169 MPIFC=$MPIFC" "`awk -F' *= *' '"MPI_INCLUDE"==$1 {print $2}' "$ffconfpetscc"`
1170 esac
1171 m4_include(etc/config/m4/acmpi.m4)
1172 fi
1173 if test "$ff_mpi" = yes; then
1174 test "$PETSC_COMPLEX_SCALAR" = "complex" && test "$ff_win32" = yes -o "$PETSC_COMPLEX_MPIRUN" = "$MPIRUN" || cmp -s `which "$PETSC_COMPLEX_MPIRUN"` `which "$MPIRUN"`
1175 if test "$?" -eq 0 ; then
1176 AC_SUBST([FF_prefix_petsc_complex],"$PETSC_COMPLEX_PREFIXDIR")
1177 AC_SUBST([FF_conf_petsc_complex],"$ffconfpetscc")
1178
1179 AC_FF_PETSC_WHERELIB_BASIC(petsccomplex,$ffconfpetscc)
1180 AC_FF_PETSC_WHERELIB(parmetis,PARMETIS_LIB,PARMETIS_INCLUDE,$ffconfpetscc)
1181 AC_FF_PETSC_WHERELIB(metis,METIS_LIB,METIS_INCLUDE,$ffconfpetscc)
1182 AC_FF_PETSC_WHERELIB(ptscotch,PTSCOTCH_LIB,PTSCOTCH_INCLUDE,$ffconfpetscc)
1183 ff_SCOTCH_INCLUDE=$ff_PTSCOTCH_INCLUDE
1184 ff_SCOTCH_LIB=`echo $ff_PTSCOTCH_LIB | sed -e 's/@<:@^ @:>@*ptscotch@<:@^ @:>@*//g' | sed -e 's/@<:@^ @:>@*ptes@<:@^ @:>@*//g'`
1185 if test -n "$ff_SCOTCH_LIB"; then
1186 ff_scotch_ok=yes;
1187 AC_FF_ADDWHERELIB(scotch,$ff_SCOTCH_LIB,$ff_SCOTCH_INCLUDE)
1188 AC_SUBST([TOOL_COMPILE_scotch],"")
1189 fi
1190 AC_FF_PETSC_WHERELIB(mumps,MUMPS_LIB,MUMPS_INCLUDE,$ffconfpetscc)
1191 if test -n "$ff_MUMPS_LIB"; then
1192 sed -E 's/mumps LD(.*)-lzmumps /mumps LD\1/g;s/mumps LD(.*)ldmumps/mumps LD\1ldmumps -lzmumps/g' $ff_where_lib_conf > plugin/seq/WHERE_LIBRARY-download
1193 mv plugin/seq/WHERE_LIBRARY-download $ff_where_lib_conf
1194 sed -E 's/mumps LD(.*)-lcmumps /mumps LD\1/g;s/mumps LD(.*)lsmumps/mumps LD\1lsmumps -lcmumps/g' $ff_where_lib_conf > plugin/seq/WHERE_LIBRARY-download
1195 mv plugin/seq/WHERE_LIBRARY-download $ff_where_lib_conf
1196 fi
1197 AC_FF_PETSC_WHERELIB(tetgen,TETGEN_LIB,TETGEN_INCLUDE,$ffconfpetscc)
1198 AC_FF_PETSC_WHERELIB(hpddm,HPDDM_LIB,HPDDM_INCLUDE,$ffconfpetscc)
1199 AC_FF_PETSC_WHERELIB(htool,HTOOL_LIB,HTOOL_INCLUDE,$ffconfpetscc)
1200 AC_FF_PETSC_WHERELIB(superlu,SUPERLU_LIB,SUPERLU_INCLUDE,$ffconfpetscc)
1201 AC_FF_PETSC_WHERELIB(mmg,MMG_LIB,MMG_INCLUDE,$ffconfpetscc)
1202 AC_FF_PETSC_WHERELIB(parmmg,PARMMG_LIB,PARMMG_INCLUDE,$ffconfpetscc)
1203 AC_FF_PETSC_WHERELIB(scalapack,SCALAPACK_LIB,SCALAPACK_INCLUDE,$ffconfpetscc)
1204 AC_FF_PETSC_WHERELIB(gsl,GSL_LIB,GSL_INCLUDE,$ffconfpetscc)
1205 if test -z "$with_gsl_prefix"; then
1206 if test -n "$ff_GSL_INCLUDE"; then
1207 gsl_prefix=`echo $ff_GSL_INCLUDE | sed -e 's/-I//g'`
1208 with_gsl_prefix=`dirname $gsl_prefix`
1209 fi
1210 fi
1211 AC_FF_PETSC_WHERELIB(suitesparse,SUITESPARSE_LIB,SUITESPARSE_INCLUDE,$ffconfpetscc)
1212 if test -z "$ff_BLASLAPACK_LIB"; then
1213 AC_FF_PETSC_WHERELIB(blaslapack,BLASLAPACK_LIB,BLASLAPACK_INCLUDE,$ffconfpetscc)
1214 if test -n "$ff_BLASLAPACK_LIB"; then
1215 ff_where_lib_blaslapack="`echo $ff_BLASLAPACK_LIB | sed -e 's/@<:@^ @:>@*scalapack@<:@^ @:>@*//g' | sed -e 's/@<:@^ @:>@*blacs@<:@^ @:>@*//g'`"
1216 fi
1217 fi
1218 if test -f $d/libslepc.$ff_suffix_dylib -o -f $d/libslepc.a ; then
1219 ff_slepccomplex_ok=yes
1220 ff_SLEPCCOMPLEX_LIB="-Wl,-rpath,$d -L$d -lslepc"
1221 AC_FF_ADDWHERELIB(slepccomplex,$ff_SLEPCCOMPLEX_LIB,$ff_where_inc_petsccomplex)
1222 if test -z "$ff_arpack_ok"; then
1223 if test -f $d/libarpack.$ff_suffix_dylib -o -f $d/libarpack.a ; then
1224 ff_arpack_ok=yes
1225 ff_arpack_libs="-Wl,-rpath,$d -L$d -larpack"
1226 AC_FF_ADDWHERELIB(arpack,$ff_arpack_libs,)
1227 fi
1228 fi
1229 fi
1230 if test "$ff_slepccomplex_ok" != yes ; then
1231 AC_ARG_WITH(slepccomplex_include,AS_HELP_STRING([--with-slepccomplex-include=],[Include directives for slepccomplex instead of automatic download]))
1232 AC_ARG_WITH(slepccomplex_ldflags,AS_HELP_STRING([--with-slepccomplex-ldflags=],[Link-time directives for slepccomplex instead of automatic download]))
1233 if test "$with_slepccomplex_include" != "" || test "$with_slepccomplex_ldflags" != ""
1234 then
1235 # some directives have been specified, use them instead of downloading
1236 AC_FF_ADDWHERELIB(slepccomplex,$with_slepccomplex_ldflags,$with_slepccomplex_include)
1237 ff_slepccomplex_ok=yes
1238 fi
1239 fi
1240 else
1241 AC_MSG_NOTICE([" Warning PETSC complex MPI and FF++ MPI not the same: $PETSC_COMPLEX_MPIRUN != $MPIRUN or $PETSC_COMPLEX_SCALAR != complex ." ]);
1242 fi
1243 fi
1244 fi
1245 done
1246 done
1247 fi
1248
1249
1250 if test "$ff_petsccomplex_ok" != no ; then
1251 AC_MSG_NOTICE([ with petsc complex $ff_petsccomplex_ok, with slepc complex $ff_slepccomplex_ok ])
1252 else
1253 AC_MSG_NOTICE([ without petsc complex ***** ])
1254 fi
1255 ## slepc
1256
1257 ### end petsc ....
1258 # chech MPI after petsc ...
1259 if test "$ff_mpi" != yes; then
1260 m4_include(etc/config/m4/acmpi.m4)
1261 fi
1262
1263 # FFCS needs to change some of the FF makefiles to compile without MPI
1264 AM_CONDITIONAL([FFCS_MPIOK],[test $ff_mpi = yes])
1265
1266 #replacing wget with another command
1267 ff_wget_command="wget --no-check-certificate"
1268 ff_wget=no
1269
1270 AC_ARG_WITH(wget,
1271 [ --with-wget=command Replace "wget" with another command. Implies --enable-download],
1272 enable_download=yes
1273 ff_wget=yes
1274 ff_wget_command="${withval}")
1275
1276 ff_MKL_libpath=yes
1277 AC_ARG_WITH(mkl,
1278 [ --with-mkl= the MKL LIBPATH : (ie. /opt/intel/mkl/RR.r.y.xxx/lib/<arch>)],
1279 ff_mkl_libpath="${withval}")
1280
1281 # if enabling downloads find wget or curl to do download
1282 # ------------------------------------------------------
1283
1284 if test "$ff_wget" = no
1285 then
1286 ff_wget=""
1287 AC_CHECK_PROG(ff_wget,wget --no-check-certificate,yes,no)
1288 fi
1289 if test "$ff_wget" = no
1290 then
1291 ff_wget_command="curl --fail -O "
1292 ff_curl=""
1293 AC_CHECK_PROG(ff_curl,curl -O,yes,no)
1294 ff_wget="$ff_curl"
1295 fi
1296
1297 # for automatique compilation of
1298 # lib in download
1299 if test "$ff_wget" != yes -a "$enable_download" = "yes" ; then
1300 enable_download=no
1301 AC_MSG_ERROR([ enable-download and no wget or curl. ],1);
1302 fi
1303 if test "$enable_download" = "yes" ; then
1304 DOWNLOADCOMPILE="compile-pkg install-other"
1305 else
1306 DOWNLOADCOMPILE=
1307 enable_download=no
1308 fi
1309 if test "$enable_download" = "yes" ; then
1310 AC_CHECK_PROG(ff_git,git,yes,no)
1311 case "$ff_git" in
1312 *no*)
1313 AC_MSG_NOTICE([ to install missing package under debian or ubuntu, try ])
1314 test "$ff_git" = no && AC_MSG_NOTICE([ sudo apt-get install git])
1315 AC_MSG_ERROR([ Sorry missing git command !]);;
1316 esac
1317 fi
1318
1319 AC_SUBST(WGET,$ff_wget_command)
1320
1321 # modif FH -----
1322 # -- looking for cadna
1323 # the round-off error propagation
1324 # the web site http://www-anp.lip6.fr/cadna/
1325 # --------------------
1326 AC_ARG_WITH(cadna,[ --with-cadna= cadna library --without-cadna ])
1327 if test "$with_cadna" != no -o -n "$with_cadna"
1328 then
1329 ff_cadna="$with_cadna"
1330 fi
1331 ff_cadna_ok=no
1332 if test "$with_cadna" != no
1333 then
1334 ff_libs_old="$LIBS"
1335 ff_ldflags_old="$LDFLAGS"
1336 ff_cadna_dir="${curdir}/3rdparty/cadna"
1337 LDFLAGS="$LDFLAGS -L$ff_cadna_dir"
1338 AC_CHECK_LIB(cadnafree,arit_zero,
1339 ff_cadna_ok=yes)
1340 AC_CHECK_HEADERS([${ff_cadna_dir}/cadnafree.h],
1341 ff_cadna_h=yes, ff_cadna_h=no)
1342
1343 LIBS="$ff_libs_old"
1344 LDFLAGS="$ff_ldflags_old"
1345
1346 if test "$ff_cadna_ok" = yes -a "$ff_cadna_h" = yes
1347 then
1348 AC_DEFINE(HAVE_CADNA,1, freecadna is use to evalute the round-off error propagation )
1349 CPPFLAGS="$CPPFLAGS -I$ff_cadna_dir"
1350 LIBS=" -L$ff_cadna_dir -lcadnafree $ff_libs_old"
1351 else
1352 AC_MSG_NOTICE([ without cadna ***** ])
1353 fi
1354 else
1355 AC_MSG_NOTICE([ without cadna ***** ])
1356 fi
1357
1358 # Looking for FFTW
1359 # ----------------
1360
1361 # ALH - 18/9/13 - deactivates FFTW detection for testing purposes
1362 AC_ARG_ENABLE(system_fftw,AS_HELP_STRING([--disable-system-fftw],[Disable the automatic detection of FFTW]))
1363 if test "$enable_system_fftw" != no
1364 then
1365
1366 # ALH - 4/9/13 - avoid recompiling FFTW if a copy was found on the system (request from Helmut Jarausch, 1/8/13)
1367
1368 AC_CHECK_LIB(fftw3,fftw_execute,ff_fftw_ok=yes)
1369 AC_CHECK_HEADERS(fftw3.h,ff_fftw_h=yes, ff_fftw_h=no)
1370 fi
1371
1372 if test "$ff_fftw_ok" = yes -a "$ff_fftw_h" = yes
1373 then
1374 AC_FF_ADDWHERELIB(fftw3,-lfftw3,)
1375 else
1376 AC_ARG_ENABLE(download-fftw,AS_HELP_STRING([--enable-download_fftw],[force the download of fftw]))
1377 if test "$enable_download_fftw" != no -a "$enable_download" = yes
1378 then
1379 ff_DOWNLOAD_FFTW=fftw
1380 fi
1381 fi
1382
1383 # used in [[file:3rdparty/fftw/Makefile.am::DOWNLOAD_FFTW]]
1384
1385 AC_SUBST(DOWNLOAD_FFTW,$ff_DOWNLOAD_FFTW)
1386
1387
1388 dnl ---------------------------
1389 dnl Looking for the tetgen
1390 dnl --------------------------
1391 dnl AC_CHECK_LIB(tet,tetrahedralize,ff_fftet_ok=yes)
1392 dnl AC_CHECK_HEADERS(tetgen.h,ff_tet_h=yes, ff_tet_h=no)
1393 dnl if test "$ff_tet_ok" = yes -a "$ff_tet_h" = yes
1394 dnl then
1395 dnl AC_SUBST([TOOL_COMPILE_tetgen],"")
1396 dnl AC_FF_ADDWHERELIB(tetgen,-ltet,)
1397 dnl AC_DEFINE(HAVE_TETGEN,1, tetgen is compute tetrahedralize volume of an enclosed surface)
1398 dnl fi
1399
1400 # Looking for the BLAS
1401 # --------------------
1402
1403 ff_blas_ok=no
1404 ff_blas_inc=""
1405
1406 # ALH - 18/9/13 - give the option to deactivate system blas for testing purposes
1407 AC_ARG_ENABLE(system-blas,AS_HELP_STRING([--disable-system-blas],[Disable the search for a system-wide BLAS library]))
1408 if test "$ff_where_lib_conf_blaslapack" = 1 ; then
1409 echo " use BLAS/Lapack of petsc "
1410 # echo " lib: $ff_where_lib_blaslapack inc: $ff_where_inc_blaslapack"
1411 ff_blas_ok=yes
1412 ff_lapack_ok=yes
1413 ff_blas_libs="$ff_where_lib_blaslapack"
1414 ff_lapack_lib=
1415 ff_blas_inc="$ff_where_inc_blaslapack"
1416 AC_FF_ADDWHERELIB(lapack,$ff_mkl_lapack,$ff_blas_inc)
1417 AC_FF_ADDWHERELIB(blas,$ff_blas_libs,$ff_blas_inc)
1418 AC_MSG_NOTICE([ BLAS and LAPACK from petsc ***** ])
1419 if echo "$ff_where_lib_blaslapack"| grep -q " -lmkl" ; then
1420 AC_MSG_NOTICE([ MKL from petsc ***** ])
1421 AC_FF_ADDWHERELIB(mkl,$ff_blas_libs,$ff_blas_inc)
1422 ff_mkl_ok=yes
1423 ff_mkl=yes
1424 dnl AC_DEFINE(HAVE_MKL,1, the MKL intel lib is present for BLAS and LAPACK )
1425 fi
1426
1427 fi
1428
1429 if test "$enable_system_blas" != no -a "$ff_blas_ok" = no
1430 then
1431
1432 # User-specified location
1433 # add MKL seach dec 2010 FH ....
1434
1435 ff_mkl_flags=""
1436 if test "$ff_mkl_libpath" != "not" ; then
1437 ff_CFLAGS="$CFLAGS"
1438 CHECK_COMPILE_FLAG(C,-mkl,CFLAGS)
1439 if test "$ff_CFLAGS" != "$CFLAGS" ; then
1440 ff_ff_mkl_flags="-mkl"
1441 fi
1442 CFLAGS="$ff_CFLAGS"
1443 fi
1444
1445 AC_MSG_CHECKING(for MKL)
1446 ff_mkl_root=""
1447 if test "$ff_mkl_libpath" != "not" -a -z "$ff_mkl_flags" ; then
1448
1449 if test "$ff_mkl_libpath" = "yes" ; then
1450 ff_IFS="$IFS"
1451 IFS=":"
1452 for i in $LD_LIBRARY_PATH:$LIBRARY_PATH ; do
1453 case $i in
1454 */mkl/*) ff_mkl_libpath=$i;;
1455 esac ;
1456 done;
1457 IFS="$ff_IFS"
1458 # else
1459 # ff_mkl_libpath=no
1460 fi
1461
1462 if test "$ff_mkl_libpath" != "no" -a -d "$ff_mkl_libpath" ; then
1463 ff_mkl_root=`expr "//$ff_mkl_libpath" : '//\(.*\)/lib.*'`
1464 ff_mkl_arch=`expr "//$ff_mkl_libpath" : '//.*/lib/\(.*\)'`
1465 ff_mkl_lp=_lp64
1466 case "$ff_mkl_arch" in
1467 *64*) ff_mkl_lp=_lp64
1468 esac
1469 case $F77 in
1470 *ifort*) ff_mkl_cc=intel;;
1471 *) ff_mkl_cc=gf;;
1472 esac
1473 # bof bof ....
1474 case "$MPIRUN" in
1475 */sgi/*) ff_mkl_mpi=_sgimpt;;
1476 */intel/*) ff_mkl_mpi=_intelmpi;;
1477 *) ff_mkl_mpi=_openmpi;;
1478 esac
1479 # echo ................ ff_mkl_root = $ff_mkl_root .. $ff_mkl_arch
1480 if test ! -d "$ff_mkl_libpath" ; then
1481 ff_mkl_libpath="$ff_mkl_root/lib/$ff_mkl_arch"
1482 fi
1483 mkl_l="-Wl,-rpath,$ff_mkl_libpath -L$ff_mkl_libpath"
1484 mkl_piomp5=$(realpath $ff_mkl_libpath/../../compiler/lib/)
1485 ff_mkl_inc=$(realpath $ff_mkl_libpath/../include)
1486 ff_blas_inc="-I$ff_mkl_inc"
1487
1488 if test -d "$mkl_piomp5" ; then mkl_l="$mkl_l -Wl,-rpath,$mkl_piomp5 -L$mkl_piomp5" ; fi
1489 # echo " ################### $mkl_l $ff_blas_inc "
1490 if test -f "$ff_mkl_libpath/libmkl_rt.$ff_suffix_dylib" ; then
1491 mkl_blas=rt
1492 mkl_lapack=rt
1493 ff_mkl_mlt="$mkl_l -lmkl_rt -lmkl_intel_thread -lmkl_core $ff_iomp5 $ff_pthread"
1494 ff_mkl_blas="$mkl_l -lmkl_rt -lmkl_sequential -lmkl_core $ff_pthread"
1495 ff_mkl_lapack="$ff_mkl_blas"
1496 elif test -f "$ff_mkl_libpath/libmkl_lapack.$ff_suffix_dylib" ; then
1497 ff_mkl_mlt="$mkl_l -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lguide -lm -lpthread"
1498 ff_mkl_blas="$mkl_l -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lguide -lm -lpthread"
1499 ff_mkl_lapack="$mkl_l -lmkl_lapack"
1500 else
1501 ff_mkl_mlt="$ff_ldbg $mkl_l -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread -lmkl_core -lmkl_intel_thread $ff_iomp5 $ff_ldeg -lm $ff_pthread"
1502 ff_mkl_blas="$ff_ldbg $mkl_l -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lmkl_sequential $ff_ldeg -lm $ff_pthread"
1503 ff_mkl_lapack="$ff_mkl_blas"
1504 fi
1505 if test -f "-L$ff_mkl_libpathmkl_scalapack${ff_mkl_lp}" ; then
1506 ff_mkl_scalapack="$mkl_l -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp} "
1507 ff_mkl_blacs="$mkl_l -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp}"
1508 fi
1509 ff_blas_ok=yes
1510 ff_lapack_ok=yes
1511
1512 # <<enable_mkl_mlt>> ALH - 6/11/13 - request from Atsushi Suzuki - the default MKL library must be able to
1513 # handle threads when FF is connected to AS' solver. So we need an option to configure FF with the
1514 # multithreaded MKL by default.
1515
1516 AC_ARG_ENABLE(mkl_mlt,AS_HELP_STRING([--enable-mkl-mlt],[Link with the multithreaded instead of the monothreaded version of the MKL]))
1517
1518 if test "$enable_mkl_mlt" = yes
1519 then
1520 ff_blas_libs="$ff_mkl_mlt"
1521 else
1522 ff_blas_libs="$ff_mkl_blas"
1523 fi
1524
1525 ff_blas_inc="-I$ff_mkl_root/include"
1526 dnl scalapack, and blacs do not not work with mlk and sgi
1527 if test "$ff_mkl_mpi" = "_intelmpi" ; then
1528 AC_FF_ADDWHERELIB(scalapack,$ff_mkl_scalapack,$ff_blas_inc)
1529 AC_FF_ADDWHERELIB(blacs,$ff_mkl_blacs,$ff_blas_inc)
1530 else
1531 ff_warm=" (We do not use MKL scalapack and blacs with sgi MPI), "
1532 fi
1533 AC_FF_ADDWHERELIB(lapack,$ff_mkl_lapack,$ff_blas_inc)
1534 AC_FF_ADDWHERELIB(mkl,$ff_mkl_mlt,$ff_blas_inc)
1535 ff_mkl_ok=yes
1536 ff_mkl=yes
1537 dnl AC_DEFINE(HAVE_MKL,1, the MKL intel lib is present for BLAS and LAPACK )
1538
1539 else
1540 ff_mkl_libpath=no
1541 fi
1542 fi
1543
1544
1545 AC_MSG_RESULT( [ $ff_warm root: $ff_mkl_root , arch: $ff_mkl_arch , $ff_mkl_lp ... ])
1546
1547 AC_ARG_WITH(blas,
1548 AS_HELP_STRING([--with-blas=library],[Use a specific version of the Blas]),
1549 ff_blas_ok=yes
1550 ff_blas_libs="${withval}")
1551
1552 # Specific BLAS library location for FreeBSD
1553 ff_freebsd_blas="-lf2c -lf77blas -latlas -lgslcblas"
1554 ff_dll_blas=`which libopenblas.dll`
1555 if test -z "$ff_dll_blas" ; then ff_dll_blas="no"; fi
1556 # zmach is in lapack
1557 # Trying blas library
1558 # echo "LIBS = $LIBS blas --- $ff_blas_ok"
1559 for iblas in "$ff_dll_blas" \
1560 "-framework Accelerate" "$ff_mkl_blas" "-lblas" "-L/usr/lib/atlas -lblas" \
1561 $ff_freebsd_blas
1562 do
1563 if test "$ff_blas_ok" = no -a "$iblas" != "no"
1564 then
1565 AC_MSG_CHECKING(for daxpy_ in $iblas)
1566 ff_save_libs="$LIBS"
1567 LIBS="$LIBS $iblas"
1568 AC_LINK_IFELSE(
1569 [AC_LANG_CALL(,daxpy_)],
1570 ff_blas_ok=yes
1571 ff_blas_libs="$iblas",)
1572 LIBS="$ff_save_libs"
1573 AC_MSG_RESULT($ff_blas_ok)
1574 fi
1575 done
1576
1577 #cblas_zdotu_sub
1578 #echo "LIBS = " $LIBS
1579 ff_cblas_libs=no
1580 if test "$ff_blas_ok" = yes
1581 then
1582 AC_MSG_CHECKING(for blas_zdotu_sub in $ff_blas_libs)
1583 ff_save_libs="$LIBS"
1584 LIBS="$LIBS $ff_blas_libs $FLIBS"
1585 AC_LINK_IFELSE(
1586 [AC_LANG_CALL(,cblas_zdotu_sub)],
1587 ff_cblas_libs=yes)
1588 AC_MSG_RESULT($ff_cblas_libs)
1589 LIBS="$ff_save_libs"
1590 fi
1591 fi
1592
1593 # <<OpenBLAS>> ALH - 18/9/13 - option to compile the OpenBLAS moved from the FFCS tree to FF tree
1594
1595 AC_ARG_ENABLE(openblas,AS_HELP_STRING([--disable-openblas],[Disable the automatic download of OpenBLAS]))
1596 if test "$ff_blas_ok" = no && test "$enable_openblas" != no && test "$enable_download" = yes
1597 then
1598 AC_CHECK_PROG(ff_git,git,yes,no)
1599 AC_MSG_CHECKING([Activating the OpenBLAS (deactivate with --disable-openblas)])
1600 if test $ff_git = no
1601 then
1602 AC_MSG_RESULT([git not found])
1603 else
1604 ff_download_blas=openblas
1605
1606 # it is necessary to split the library path into -L and -l otherwise ff/upstream/plugin/seq/ff-c++ will place -lgfortran in
1607 # LIBS, .../libgoto___.lib in OTHER, and call the compiler with $LIBS before $OTHER, which will fail. But libopenblas.a is placed in
1608 # the standard directory 3rdparty/lib so the -L option is not required anymore.
1609
1610 ff_blas_libs="-L${curdir}/3rdparty/lib -lopenblas $LIBS $ff_pthread"
1611 ff_blas_inc="-I${curdir}/3rdparty/include"
1612
1613 # skip generic blas compilation and activate OpenBLAS (see [[file:3rdparty/blas/Makefile.am::OpenBLAS]])
1614 AC_SUBST(DOWNLOADED_BLAS,"")
1615 AC_SUBST(COMPILE_OPENBLAS,openblas)
1616
1617 ff_blas_ok=yes
1618 ff_cblas_h=yes
1619 ff_cblas_libs=yes
1620
1621 AC_MSG_RESULT([ok])
1622 fi
1623 fi
1624
1625 # If all else fails, download a generic version
1626
1627 if test "$ff_blas_ok" = no -a "$enable_download" = yes -a "$enable_fortran" != no -a "$enable_c" != no
1628 then
1629 AC_CHECK_PROG(ff_unzip,unzip,yes,no)
1630
1631 AC_MSG_CHECKING(for BLAS version to download)
1632
1633 # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make
1634 # the following tests fail.
1635
1636 # When compiling a generic version, we do not need an optimized version of the BLAS.
1637
1638 ff_download_blas=generic
1639 ff_blas_libs="-L${curdir}/3rdparty/blas -lcblas -lf77blas"
1640 ff_blas_inc="-I${curdir}/3rdparty/blas/CBLAS/src"
1641
1642 AC_SUBST(DOWNLOADED_BLAS,"libf77blas.a libcblas.a")
1643 AC_SUBST(DOWNLOADED_BLAS_BUILT_SOURCES,'BLAS CBLAS $(F77BLAS_SRC) $(CBLAS_SRC)')
1644
1645 AC_MSG_RESULT($ff_download_blas)
1646 ff_blas_ok=yes
1647 ff_cblas_h=yes
1648 ff_cblas_libs=yes
1649 fi
1650
1651 if test -n "$ff_BLASLAPACK_LIB"; then
1652 AC_SUBST(BLACSLIBS,"$ff_SCALAPACK_LIB $ff_BLASLAPACK_LIB")
1653 else
1654 AC_SUBST(BLACSLIBS,$ff_blas_libs)
1655 fi
1656 AC_SUBST(BLASLIBS,$ff_blas_libs)
1657 AC_SUBST(BLASINC,$ff_blas_inc)
1658
1659 #looking for cblas.h FH
1660
1661 if test "$ff_blas_ok" = yes -a -z "$ff_download_blas" -a "$ff_mkl_ok" != yes; then
1662 AC_CHECK_HEADERS(cblas.h,
1663 ff_cblas_h=yes,
1664 ff_cblas_h=no)
1665 AC_CHECK_HEADERS(Accelerate/cblas.h,
1666 ff_cblas_h=yes,
1667 ff_cblas_h=no)
1668 AC_CHECK_HEADERS(atlas/cblas.h,
1669 ff_cblas_h=yes,
1670 ff_cblas_h=no)
1671 AC_CHECK_LIB([cblas], [cblas_zdotu_sub], [LIBS+=-lcblas])
1672 fi
1673
1674 # ALH - 18/9/13 - [[file:3rdparty/blas/Makefile.am]] does not update the WHERE mechanism so it always needs to be set up
1675 # here even in the case of a downloaded blas library.
1676
1677 AC_FF_ADDWHERELIB(blas,$ff_blas_libs,)
1678
1679 # end of BLAS -------------------
1680
1681 # Looking for ARPACK
1682 # ------------------
1683
1684 # We need the following g77 libraries to connect to the Fortran 77
1685 # Arpack.
1686
1687 if test "$ff_blas_ok" = yes;
1688 then
1689 ff_g2c_lib="$FLIBS"
1690 if test -n "$ff_g2c_lib"
1691 then
1692 LIBS="$LIBS $ff_g2c_lib"
1693 else
1694 ff_g2c_ok=no
1695 AC_CHECK_LIB(g2c,G77_second_0,
1696 LIBS="$LIBS -lg2c"
1697 ff_g2c_lib="-lg2c"
1698 ff_g2c_ok=yes)
1699
1700 if test "$ff_g2c_ok" = no;
1701 then
1702 AC_MSG_CHECKING(for G77_second_0 in /sw/lib/libg2c.a)
1703 ff_save_libs="$LIBS"
1704 LIBS="$LIBS -L/sw/lib -lg2c"
1705 AC_LINK_IFELSE(
1706 [AC_LANG_CALL(,G77_second_0)],
1707 ff_g2c_lib="-L/sw/lib -lg2c"
1708 ff_g2c_ok=yes,
1709 LIBS="$ff_save_libs")
1710 AC_MSG_RESULT($ff_g2c_ok)
1711 fi
1712 fi
1713 fi
1714
1715 # Copy the result of g2c investigations into a separate variable
1716 # because BLAS compilation will need it.
1717
1718 AC_SUBST(G2CLIB,$ff_g2c_lib)
1719 #looking of lapack if no compile the arpack lapack
1720 # warning $$ because the make eat one
1721 ff_lapack_ok=no;
1722 ff_lapack_lib=
1723 AC_MSG_CHECKING([for lapack in $LIBS, $ff_blas_libs and -llapack] )
1724 if test "$ff_blas_ok" = yes ; then
1725 AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], ff_lapack_ok=yes)
1726 if test "$ff_lapack_ok" = no ; then
1727 ff_save_libs=$LIBS
1728 LIBS="$ff_save_libs $ff_blas_libs"
1729 AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], [ff_lapack_ok=yes;ff_lapack_lib="$ff_blas_libs"])
1730 if test "$ff_lapack_ok" = no ; then
1731 LIBS="$ff_save_libs -llapack $ff_blas_libs"
1732 AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], [ff_lapack_ok=yes
1733 ff_lapack_lib="-llapack"] )
1734 fi
1735 LIBS="$ff_save_libs"
1736 fi
1737 fi
1738
1739 if test "$ff_lapack_ok" = no; then
1740 AC_ARG_WITH(lapack,
1741 AS_HELP_STRING([--with-lapack=library],[Use a specific version of Lapack]),
1742 ff_lapack_ok=yes
1743 ff_lapack_lib="${withval}"
1744 LIBS="$ff_lapack_lib $LIBS")
1745 fi
1746 AC_MSG_RESULT($ff_lapack_ok)
1747 if test "$ff_lapack_ok" != no ; then
1748 AC_SUBST(LAPACKLIBS,$ff_lapack_lib)
1749 fi
1750
1751 # Lapack configuration for Arpack
1752
1753 ff_lapackdir='$$(LAPACKdir)'
1754 if test "$ff_lapack_ok" = yes
1755 then
1756 # no compilation of lapack in arpack
1757 ff_lapackdir=
1758 else
1759 ff_lapack_lib="-L${curdir}/3rdparty/lib -llapack"
1760 fi
1761
1762 # Arpack itself
1763 AC_ARG_ENABLE(download-arpack,AS_HELP_STRING([--enable-download_arpack],[force the use download of arpack]))
1764 #echo "****** enable_download_arpack=$enable_download_arpack"
1765
1766 if test -z "$ff_arpack_ok"; then
1767 ff_arpack_ok=no
1768 ff_save_libs="$LIBS"
1769 ff_arpack_libs=
1770 if test "$ff_blas_ok" = yes ;
1771 then
1772 if test "$enable_download_arpack" != yes ; then
1773 # User-specified location
1774 AC_ARG_WITH(arpack,
1775 [ --with-arpack=library Use a specific version of Arpack],
1776 ff_arpack_ok=yes
1777 ff_arpack_libs="${withval}")
1778
1779 # Default locations
1780 if test "$ff_arpack_ok" = no;
1781 then
1782 AC_CHECK_LIB(arpack,dsaupd_,
1783 ff_arpack_libs="-larpack -llapack"
1784 ff_arpack_ok=yes,,
1785 -llapack)
1786 fi
1787
1788 # Trying to "locate" Arpack
1789 if test "$ff_arpack_ok" = no -a "$enable_download" != yes ;
1790 then
1791 AC_MSG_CHECKING(for libarpack with locate)
1792 ff_lib_arpack=`locate libarpack|grep 'libarpack.*.a$'|head -1`
1793 LIBS="$ff_lib_arpack $LIBS"
1794 AC_LINK_IFELSE(
1795 [AC_LANG_CALL(,dsaupd_)],
1796 ff_arpack_ok=yes
1797 ff_arpack_libs="$ff_lib_arpack")
1798 AC_MSG_RESULT($ff_arpack_ok)
1799 fi
1800 if test "$ff_arpack_ok" = yes
1801 then
1802 AC_FF_ADDWHERELIB(arpack,$ff_arpack_libs,)
1803 fi
1804 fi
1805 # If all else fails, download!
1806 if test "$enable_fortran" != no -o -z "$enable_fortran"
1807 then
1808 if test "$ff_arpack_ok" = no -a "$enable_download" = yes -o "$enable_download_arpack" = yes
1809 then
1810 ff_arpack_download=yes
1811 AC_MSG_NOTICE(using downloaded Arpack)
1812
1813 # ALH - 6/11/13 - this install goal is the standard goal for all downloaded packages in
1814 # [[file:3rdparty/common.mak::install]]
1815
1816 AC_SUBST(DOWNLOAD_ARPACK,install)
1817
1818 AC_SUBST(FF_LAPACKdir,$ff_lapackdir)
1819 AC_SUBST(ARPACKLIB,${curdir}/3rdparty/lib/libarpack.a)
1820 AC_SUBST(LAPACK_arpack_LIB,${curdir}/3rdparty/lib/liblapack.a)
1821
1822 # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this
1823 # could make the following tests fail.
1824
1825 # ALH - 30/9/13 - do not use the "-L ${curdir}/3rdparty/lib" directive because it would allow other
1826 # following -l directives (eg -lumfpack) to pick an old locally compiled library instead of the system
1827 # ones.
1828
1829 ff_arpack_libs="${curdir}/3rdparty/lib/libarpack.a $ff_lapack_lib"
1830 ff_arpack_ok=yes
1831 fi
1832 fi
1833 fi
1834 fi
1835 if test "$ff_arpack_ok" != yes
1836 then
1837 AC_MSG_NOTICE([-- NO ARPACK -- enable_download : $enable_download , wget: $ff_wget ])
1838 fi
1839
1840 # Do not insert ARPACK libs in $LIBS yet, because they may not exist
1841 # yet, and this could make the following tests fail.
1842
1843 LIBS="$ff_save_libs"
1844
1845 if test "$ff_arpack_ok" = yes;
1846 then
1847 AC_SUBST(ARPACKLIBS,$ff_arpack_libs)
1848 EIGENOBJ='eigenvalue.$(OBJEXT)'
1849 AC_DEFINE(HAVE_LIBARPACK,1,Arpack is used for eigenvalue computation)
1850
1851 # Determines whether to run the eigenvalue tests
1852 else
1853 # all eigen test fails
1854 AC_SUBST([SKIP_TESTS_EIGEN],[yes])
1855 fi
1856 AM_CONDITIONAL([ENABLE_EIGEN], [test "$ff_arpack_ok" = "yes"])
1857
1858 AC_SUBST([EIGENOBJ])
1859
1860 # ALH - 25/9/13 - <<WHERE_lapack>> always run the WHERE LD statement for lapack because some libraries in
1861 # plugin/seq require it (eg [[file:plugin/seq/Element_Mixte.cpp::lapack]]). Request from Fred.
1862
1863 AC_FF_ADDWHERELIB(lapack,$ff_lapack_lib,)
1864
1865 # Looking for UMFPACK
1866 # -------------------
1867 UMFPACK_CPPFLAGS="";
1868 ff_umfpack_incs=""
1869 ff_amd_ok=no
1870 ff_umfpack_ok=no
1871 # echo @@@@@@@@@ ff_where_lib_conf_suitesparse == $ff_where_lib_conf_suitesparse @@@@
1872 if test "$ff_where_lib_conf_suitesparse" = "1" ; then
1873 echo "amd/umfpack/suitesparse of petsc"
1874 echo " lib: $ff_where_lib_suitesparse inc: $ff_where_inc_suitesparse"
1875 ff_amd_ok=yes
1876 ff_umfpack_ok=yes
1877 enable_system_umfpack=no
1878 ff_umfpack_libs="$ff_where_lib_suitesparse"
1879 ff_umfpack_incs="$ff_where_inc_suitesparse"
1880 AC_DEFINE(HAVE_LIBUMFPACK,1,Umfpack is used for sparse matrices computations)
1881 AC_DEFINE(HAVE_LIBCHOLMOD,1,Cholmod is used for sparse matrices computations)
1882 UMFPACK_CPPFLAGS="$ff_where_inc_suitesparse"
1883 dnl AC_SUBST([UMFPACK_CPPFLAGS],[$ff_where_inc_suitesparse])
1884 AC_DEFINE(HAVE_UMFPACK_H,1,If umfpack.h is located in UMFPACK subdir)
1885 fi
1886 #echo "@@@@@@@"
1887 ff_save_libs="$LIBS"
1888 AC_ARG_ENABLE(system_umfpack,AS_HELP_STRING([--disable-system-umfpack],[Disable the automatic detection of umfpack, colmod, amd, ....]))
1889 if test "$ff_umfpack_ok" = no -a "$enable_system_umfpack" != no -a "$ff_blas_ok" = yes;
1890 then
1891 # echo "@@@@@@@qqqq"
1892 # User-specified location
1893 AC_ARG_WITH(amd,
1894 AS_HELP_STRING([--with-amd=library],[Use a specific version of AMD]),
1895 ff_amd_ok=yes
1896 ff_umfpack_libs="${withval}")
1897
1898 AC_ARG_WITH(umfpack,
1899 AS_HELP_STRING([--with-umfpack=library],[Use a specific version of Umfpack]),
1900 ff_umfpack_ok=yes
1901 ff_umfpack_libs="${withval} $ff_umfpack_libs")
1902
1903 if test "${with_umfpack_include+set}" = set; then
1904 CPPFLAGS="$CPPFLAGS $with_umfpack_include"
1905 fi
1906
1907 AC_CHECK_HEADERS(umfpack.h umfpack/umfpack.h ufsparse/umfpack.h suitesparse/umfpack.h,
1908 [ff_umfpack_header=yes
1909 ff_umfpack_dir=`dirname $ac_header`
1910 break])
1911
1912 # Somes systems like FreeBSD hide umfpack.h in a directory called UMFPACK (all capitals). This breaks the
1913 # standard #define produced by autoconf in config.h.in.
1914
1915 LIBS="$ff_blas_libs $LIBS"
1916 if test "$ff_umfpack_header" != yes;
1917 then
1918 AC_CHECK_HEADER(UMFPACK/umfpack.h,
1919 ff_umfpack_header=yes
1920 ff_umfpack_dir=UMFPACK
1921 AC_DEFINE(HAVE_BIG_UMFPACK_UMFPACK_H,1,If umfpack.h is located in UMFPACK subdir))
1922 fi
1923
1924 if test "$ff_amd_ok" = no;
1925 then
1926 AC_CHECK_LIB(amd,amd_info,
1927 ff_umfpack_libs="$ff_umfpack_libs -lamd"
1928 ff_amd_ok=yes)
1929 fi
1930
1931 if test "$ff_umfpack_ok" = no -a "$ff_amd_ok" = yes;
1932 then
1933
1934 # ALH - 30/9/13 - other libraries required by Umfpack
1935
1936 AC_CHECK_LIB(cholmod,cholmod_add,ff_umfpack_libs="$ff_umfpack_libs -lcholmod")
1937 AC_CHECK_LIB(colamd,colamd_set_defaults,ff_umfpack_libs="$ff_umfpack_libs -lcolamd")
1938
1939 AC_CHECK_LIB(umfpack,umf_i_malloc,
1940 ff_umfpack_libs="-lumfpack $ff_umfpack_libs"
1941 ff_umfpack_ok=yes,,$ff_umfpack_libs)
1942 fi
1943
1944 if test "$ff_umfpack_header" != yes -o "$ff_umfpack_ok" != yes; then
1945 ff_umfpack_ok=no
1946 AC_MSG_WARN([Sorry, we could not find the UMFPACK lib or the UMFPACK headers])
1947 ff_umfpack_incs=""
1948 UMFPACK_CPPFLAGS=""
1949 fi
1950
1951 if test "$ff_umfpack_ok" = yes -a "$ff_amd_ok" = yes; then
1952 if test -n "$ff_umfpack_incs" ; then
1953 UMFPACK_CPPFLAGS="$ff_umfpack_incs"
1954 fi
1955 dnl AC_SUBST([UMFPACK_CPPFLAGS],[$ff_umfpack_incs])
1956 AC_DEFINE(HAVE_LIBUMFPACK,1,Umfpack is used for sparse matrices computations)
1957 fi
1958 fi
1959
1960 LIBS="$ff_save_libs"
1961 #echo "@@@@22@@@"
1962 # If all else fails, download!
1963 # attention no /usr/include in WHERE
1964 if test "$ff_umfpack_ok" = yes -a -n "$ff_umfpack_dir" -a -z "$ff_umfpack_incs"
1965 then
1966 ff_umfpack_incs="-I/usr/include/$ff_umfpack_dir"
1967 UMFPACK_CPPFLAGS="$ff_umfpack_incs"
1968 fi
1969 if test "$ff_umfpack_ok" = no -a "$enable_download" = yes -a "$enable_umfpack" != no
1970 then
1971 AC_MSG_NOTICE(using downloaded UMFPACK)
1972 AC_SUBST(DOWNLOAD_UMFPACK,"umfpack")
1973 ff_umfpack_download=yes
1974
1975 # Do not update $LIBS, but create an extra LIB variable, because this lib does not exist yet, and this could make
1976 # the following tests fail.
1977
1978 ff_umfpack_libs="-L${curdir}/3rdparty/lib -lumfpack -lcholmod -lcolamd -lamd -lsuitesparseconfig"
1979 ff_umfpack_incs="-I${curdir}/3rdparty/include"
1980 UMFPACK_CPPFLAGS="$ff_umfpack_incs"
1981 AC_DEFINE(HAVE_LIBUMFPACK,1,UMFPACK)
1982 if test "$ff_win32" = yes; then
1983 AC_SUBST(FF_UMFPACK_CONFIG,-DCBLAS)
1984 fi
1985 ff_umfpack_ok=yes
1986 fi
1987 AC_SUBST([UMFPACK_CPPFLAGS],[$UMFPACK_CPPFLAGS])
1988
1989 # ALH - 17/9/13 - moved UMFPACK configuration settings in wherelib to _after_ configuring the download version because
1990 # [[file:3rdparty/umfpack/Makefile.am]] does not set the WHERE mechanism. Also removed -I/usr/include/$ff_umfpack_dir
1991 # from include options for FFCS because it breaks the MingW64 compilation process.
1992
1993 if test "$ff_umfpack_ok" = yes
1994 then
1995 if test $enable_ffcs = no
1996 then
1997 AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,$ff_umfpack_incs)
1998 AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,$ff_umfpack_incs)
1999 else
2000 AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,)
2001 AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,)
2002 fi
2003
2004 else
2005 #echo "@@@@33@@@@"
2006 AC_MSG_NOTICE([ -- NO UMFPACK (ff_wget = $ff_wget)])
2007 fi
2008
2009 AC_SUBST(UMFPACKLIBS,$ff_umfpack_libs)
2010
2011 # If times() and sysconf() are not here, UMFPACK should know
2012
2013 if test "$ff_umfpack_ok" = yes
2014 then
2015 AC_CHECK_FUNCS(times sysconf,
2016 ff_umfpack_posix_ok=yes,
2017 ff_umfpack_posix_ok=no)
2018
2019 if test "$ff_umfpack_posix_ok" = no
2020 then
2021 AC_SUBST(FF_UMFPACK_CONFIG,"-DCBLAS -DNPOSIX")
2022 fi
2023 fi
2024
2025 # Checking for some functions that may not appear everywhere
2026 # for libff-mmap-semaphore.c plugin and test ...
2027 # ----------------------------------------------------------
2028 AC_CHECK_HEADERS(cstddef)
2029 AC_CHECK_HEADERS(stddef.h)
2030 AC_CHECK_HEADERS(semaphore.h,ff_sem=1,ff_sem=0)
2031 AC_CHECK_HEADERS(sys/mman.h,ff_mmap=1,ff_mmap=0)
2032
2033
2034 if test "$ff_sem" -eq 1 -a "$ff_mmap" -eq 1 ; then
2035 BIN_ffmaster=ffmaster
2036 else
2037 enable_MMAP=no
2038 BIN_ffmaster=
2039 fi
2040
2041 AC_CHECK_HEADERS(regex.h,ff_regex_h=1, ff_regex_h=0)
2042 AC_SUBST(FF_HAVE_REGEX_H,$ff_regex_h)
2043
2044 AC_CHECK_HEADERS([unistd.h])
2045 # asinh acosh atanh are not in Mingw yet gettimeofday
2046 ff_malloc_h=""
2047 m4_warn([obsolete],
2048 [Update your code to rely only on HAVE_SYS_TIME_H,
2049 then remove this warning and the obsolete code below it.
2050 All current systems provide time.h; it need not be checked for.
2051 Not all systems provide sys/time.h, but those that do, all allow
2052 you to include it and time.h simultaneously.])dnl
2053 AC_CHECK_HEADERS_ONCE([sys/time.h])
2054 # Obsolete code to be removed.
2055 if test $ac_cv_header_sys_time_h = yes; then
2056 AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
2057 and <time.h>. This macro is obsolete.])
2058 fi
2059 # End of obsolete code.
2060
2061 AC_CHECK_HEADERS(malloc.h,ff_malloc_h=1)
2062 AC_SUBST(FF_MALLOC_H,$ff_malloc_h)
2063
2064 AC_CHECK_FUNCS(asinh acosh atanh getenv jn erfc tgamma gettimeofday mallinfo2 mallinfo mstats)
2065 AC_CHECK_FUNCS(srandomdev)
2066
2067
2068 AC_CHECK_FUNCS(second_,ff_second="",ff_second=second.o)
2069 AC_SUBST(FF_SECOND,"$ff_second")
2070
2071 # Enable static linking (no shared libraries)
2072 # -------------------------------------------
2073 AC_CHECK_PROG(ff_libtool,libtool,yes,no)
2074 if test "$ff_mac" = "yes" -a "$ff_libtool" = yes ; then
2075 ff_AR="libtool"
2076 ff_ARFLAGS="-static -o"
2077 ff_RANLIB="echo"
2078 fi
2079
2080 AC_ARG_ENABLE(static,
2081 [ --enable-static Build binaries with no shared library dependencies])
2082 if test "$enable_static" = yes
2083 then
2084 AC_CHECK_PROG(ff_libtool,libtool,yes,no)
2085 if test "$ff_libtool" = yes
2086 then
2087 LDFLAGS="$LDFLAGS -all-static"
2088 AC_SUBST(STATICTOOL,libtool)
2089 else
2090 AC_MSG_ERROR(libtool not found)
2091 fi
2092 fi
2093 # for compiation of arpack use libtool to bluid universal library on MacOs.
2094 AC_SUBST(AR,$ff_AR)
2095 AC_SUBST(ARFLAGS,$ff_ARFLAGS)
2096 AC_SUBST(RANLIN,$ff_RANLIB)
2097
2098
2099 # Dynamic loading of compiled functions
2100 # -------------------------------------
2101
2102 # Not if we don't want shared libraries (non FH modif FH juin 2005)
2103 if test "$ff_PURE_WIN32" -ne 1 ; then
2104 ff_dynload=no
2105 if test "$enable_static" != yes
2106 then
2107
2108 # Availability of dlopen(). Use AC_COMPILE rather than
2109 # AC_CHECK_HEADERS because the latter has problems seeing it (in
2110 # Cygwin) when it does not compile (in Mingw).
2111
2112 AC_MSG_CHECKING(for dlfcn.h)
2113 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <dlfcn.h>]])],
2114 ff_dynload=yes,
2115 ff_dynload=no)
2116 AC_MSG_RESULT($ff_dynload)
2117 fi
2118
2119 # FFCS - -lm missing for ffmedit link stage on Debian Testing
2120 AC_CHECK_LIB(m,sin)
2121
2122 # Checks that we also have the corresponding library
2123 if test "$ff_dynload" = yes
2124 then
2125 AC_CHECK_LIB(dl,dlinfo)
2126
2127 # Checks that everythings works ok
2128 AC_MSG_CHECKING(whether dlopen links ok)
2129 AC_LINK_IFELSE(
2130 [AC_LANG_SOURCE([[#include <dlfcn.h>
2131 int main(int argc,char **argv){
2132 dlopen("",RTLD_LAZY);
2133 return 0;
2134 }]])],
2135 ff_dynload=yes,
2136 ff_dynload=no)
2137 AC_MSG_RESULT($ff_dynload)
2138 fi
2139 if test "$ff_dynload" = yes
2140 then
2141 AC_DEFINE(HAVE_DLFCN_H,1,Dynamic loading - not mandatory)
2142 fi
2143 fi # endif ff_PURE_WIN32 != 1
2144 # the -rdynamic don't exist on macos and sunOS
2145 if test "$ff_dynload" = yes
2146 then
2147 # Activate dynamic loading tests (see plugin/seq/Makefile.am)
2148 AC_SUBST(LOAD_TESTS,../regtests.sh)
2149 AC_SUBST(LOAD_COMPILE,load_compile)
2150
2151 # gcc on MacOS does not produce an error with "-rdynamic" but
2152 # still complains about it.
2153 if test "$ff_mac" = "no" -a "$ff_win32" = "no" -a "$ff_sunos" = "no" ;
2154 then
2155 CHECK_COMPILE_FLAG(C++,-rdynamic,LDFLAGS)
2156 dnl CHECK_COMPILE_FLAG(C,-rdynamic,CNOFLAGS)
2157 dnl CHECK_COMPILE_FLAG(C,-rdynamic,CFLAGS)
2158 fi
2159 if test "$ff_fpic" != "no" ; then
2160 CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS)
2161 CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS)
2162 CHECK_COMPILE_FLAG(C,-fPIC,CNOFLAGS)
2163 fi
2164 if test "$enable_fortran" != no ; then
2165 if test "$ff_fpic" != "no" ; then
2166 CHECK_COMPILE_FLAG(Fortran,-fPIC,FFLAGS)
2167 CHECK_COMPILE_FLAG(Fortran,-fPIC,FNOFLAGS)
2168 CHECK_COMPILE_FLAG(Fortran,-fPIC,FCFLAGS)
2169 CHECK_COMPILE_FLAG(Fortran,-fPIC,FCNOFLAGS)
2170 fi
2171 dnl CHECK_COMPILE_FLAG(Fortran,-rdynamic,FNOFLAGS)
2172 dnl CHECK_COMPILE_FLAG(Fortran,-rdynamic,FFLAGS)
2173
2174 fi
2175 fi
2176 AC_SUBST(DYLIB_SUFFIX,$ff_suffix_dylib)
2177 # the doc is now in https://github.com/FreeFem/FreeFem-doc-pdf/blob/master/freefem%2B%2Bdoc.pdf
2178 # Checking wether we can generate some documentation
2179 # --------------------------------------------------
2180 case "$F77" in
2181 *gfortran*)
2182 CHECK_COMPILE_FLAG(Fortran 77,[-fallow-argument-mismatch],FFLAGS)
2183 CHECK_COMPILE_FLAG(Fortran,[-fallow-argument-mismatch],FCFLAGS)
2184 # -fallow-invalid-boz
2185 CHECK_COMPILE_FLAG(Fortran 77,[-fallow-invalid-boz],FFLAGS)
2186 CHECK_COMPILE_FLAG(Fortran,[-fallow-invalid-boz],FCFLAGS)
2187 ;;
2188 esac
2189
2190 dnl
2191 dnl AC_CHECK_PROG(ff_latex,latex,yes,no)
2192 dnl AC_CHECK_PROG(ff_makeindex,makeindex,yes,no)
2193 dnl AC_CHECK_PROG(ff_dvips,dvips,yes,no)
2194 dnl # to translate the figure
2195 dnl AC_CHECK_PROG(ff_pdf2ps,pdf2ps,yes,no)
2196 dnl AC_CHECK_PROGS(EPSTOPDF,[epstopdf pstopdf],[false])
2197 dnl AC_CHECK_PROG(ff_convert,convert,yes,no)
2198 dnl if test "$ff_latex" = yes -a "$ff_makeindex" = yes -a "$ff_dvips" = yes -a $ff_pdf2ps = yes -a $ff_convert = yes;
2199 dnl then
2200 dnl AC_SUBST(DOCPS,"freefem++doc.ps")
2201 dnl
2202 dnl AC_CHECK_PROG(ff_gzip,gzip,yes,no)
2203 dnl if test "$ff_gzip" = yes;
2204 dnl then
2205 dnl AC_SUBST(DOCPSGZ,"freefem++doc.ps.gz")
2206 dnl fi
2207 dnl fi
2208
2209 # PDF documentation building sometimes poses problems because of pdfsync.sty. So we need to be able to disable it.
2210 # FFCS - 9/4/14 - need to disable PDF also during FFCS build (which does not use the resulting PDF).
2211
2212 dnl AC_ARG_ENABLE(pdf,[ --disable-pdf Disable PDF documentation building])
2213 dnl if test "$enable_pdf" != no
2214 dnl then
2215 dnl AC_CHECK_PROG(ff_pdflatex,pdflatex,yes,no)
2216 dnl if test "$ff_pdflatex" = yes -a $EPSTOPDF != false -a $ff_convert = yes;
2217 dnl then
2218 dnl AC_SUBST(DOCPDF,"freefem++doc.pdf")
2219 dnl fi
2220 dnl fi
2221
2222 # Choosing compilation options for the standard version (in src/std)
2223 # ------------------------------------------------------------------
2224
2225 # The "standard" configured version can use win32 (mingw)
2226
2227 if test "$ff_mingw" = yes
2228 then
2229
2230 # FFCS does not use FreeFem++-std, and Pcrgraph.cpp does not compile under mingwin64
2231 if test $enable_ffcs = no
2232 then
2233 ff_stdprog="FreeFem++-std${EXEEXT}"
2234 ff_std_graph_obj=Pcrgraph.$OBJEXT
2235 fi
2236
2237 # ALH - FFCS - 30/11/8 - I need to get the output from FF for FFCS regression tests
2238 if test $enable_ffcs = yes
2239 then
2240 ff_std_ldflags="-mconsole -mwindows"
2241 else
2242 ff_std_ldflags=-mwindows
2243 fi
2244
2245 ff_std_libs=
2246 fi
2247 AC_SUBST(STD_GRAPH_OBJ,$ff_std_graph_obj)
2248 AC_SUBST(STD_LDFLAGS,$ff_std_ldflags)
2249
2250 AC_SUBST(STD_LIBS,$ff_std_libs)
2251
2252 # Allow some downloaded tools not to be compiled
2253 # ----------------------------------------------
2254
2255
2256 ## try to see pakage is hon computer if the FH ZZZZ
2257 ## FH to find gsl ...
2258 AX_PATH_GSL(1.15, ff_with_gsl=yes, ff_with_gsl=no)
2259 if test "$ff_with_gsl" = "yes"; then
2260 AC_FF_ADDWHERELIB(gsl,$GSL_LIBS,$GSL_CFLAGS)
2261 fi
2262
2263 m4_map([AC_FF_WHERELIB],[
2264 [[mumps],[-ldmumps -lzmumps -lmumps_common -lpord],[dmumps_c.h],[]],
2265 [[mumps_seq],[-ldmumps_seq -lzmumps_seq -lmumps_common_seq -lpord_seq -lmpiseq_seq],[dmumps_c.h],[]],
2266 [[libseq],[-lmpiseq_seq],[${inc_usr_include}mumps_seq/mpi.h]],
2267 [[mumps_ptscotch],[-lpord_ptscotch -lmumps_common_ptscotch -ldmumps_ptscotch -lzmumps_ptscotch -lpord_ptscotch],[dmumps_c.h]],
2268 [[mumps_scotch],[-lpord_scotch -lmumps_common_scotch -ldmumps_scotch -lzmumps_scotch -lpord_scotch],[dmumps_c.h]],
2269 [[fftw3],[-lfftw3],[${inc_usr_include}fftw3.h],[]],
2270 [[superlu],[-lsuperlu],[${inc_usr_include}superlu/superlu_enum_consts.h],[]],
2271 [[blacs],[ -lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi],[]],
2272 [[scalapack],[-lscalapack$ff_with_mpi],[]],
2273 [[scotch],[-lscotch -lscotcherr],[scotch.h]],
2274 [[ptscotch],[-lptscotch -lptscotcherr],[ptscotch.h]],
2275 [[metis],[-lmetis],[${inc_usr_include}metis/metis.h],[]],
2276 [[metis],[-lmetis],[metis.h],[]],
2277 [[parmetis],[-lparmetis -lmetis],[],[]],
2278 [[freeyams],[-lfreeyams],[freeyamslib.h],[]],
2279 [[mmg3d],[-lmmg3d-v4],[libmmg3d.h],[]],
2280 [[mmg],[-lmmg],[libmmg.h],[]],
2281 [[zlib],[-lz],[zlib.h],[]],
2282 [[parmmg],[-lparmmg],[libparmmg.h],[]],
2283 [[mshmet],[-lmshmet],[mshmetlib.h],[]],
2284 dnl [[gsl],[-lgsl -lgslcblas -lm],[gsl/gsl_sf.h],[]],
2285 [[tetgen],[-ltet],[tetgen.h],[]],
2286 [[ipopt],[ -lipopt],[${inc_usr_include}coin/IpTNLP.hpp],[]],
2287 [[nlopt],[ -lnlopt],[nlopt.hpp],[]]
2288 ]
2289 )
2290 ## before try
2291
2292 TOOL_DISABLE(tetgen,tetgen.$DYLIB_SUFFIX)
2293 TOOL_DISABLE(lapack,lapack.$DYLIB_SUFFIX)
2294 TOOL_DISABLE(metis,metis.$DYLIB_SUFFIX)
2295 TOOL_DISABLE(parmetis,parmetis.$DYLIB_SUFFIX)
2296 TOOL_DISABLE(mmg3d,mmg3d-v4.0.$DYLIB_SUFFIX)
2297 if test "$ff_cmake" = yes -o \( "$ff_mmg_ok" = yes -a -z "$TOOL_COMPILE_mmg" \); then
2298 TOOL_DISABLE(mmg,mmg.$DYLIB_SUFFIX)
2299 fi
2300 if test "$ff_cmake" = yes -o \( "$ff_parmmg_ok" = yes -a -z "$TOOL_COMPILE_parmmg" \); then
2301 TOOL_DISABLE(parmmg,parmmg.$DYLIB_SUFFIX)
2302 fi
2303 TOOL_DISABLE(mshmet,"mshmet.$DYLIB_SUFFIX aniso.$DYLIB_SUFFIX")
2304 TOOL_DISABLE(gmm,ilut.$DYLIB_SUFFIX,,enable_gmm=no)
2305 if test "$enable_fortran" != no -o -z "$enable_fortran"; then
2306 TOOL_DISABLE(ipopt,ff-Ipopt.$DYLIB_SUFFIX)
2307 TOOL_DISABLE(scalapack,"MUMPS.$DYLIB_SUFFIX MUMPS_mpi.$DYLIB_SUFFIX")
2308 TOOL_DISABLE(mumps,"MUMPS.$DYLIB_SUFFIX MUMPS_mpi.$DYLIB_SUFFIX")
2309 TOOL_DISABLE(mumps_seq,"MUMPS_seq.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX",mumps-seq)
2310 AC_SUBST([TOOL_DYLIB_ffnewuoa],ffnewuoa.$DYLIB_SUFFIX)
2311 else
2312 TOOL_DISABLE_NO(ipopt,ff-Ipopt.$DYLIB_SUFFIX)
2313 TOOL_DISABLE_NO(scalapack,"MUMPS.$DYLIB_SUFFIX MUMPS_mpi.$DYLIB_SUFFIX")
2314 TOOL_DISABLE_NO(mumps,"MUMPS.$DYLIB_SUFFIX MUMPS_mpi.$DYLIB_SUFFIX")
2315 TOOL_DISABLE_NO(mumps_seq,"MUMPS_seq.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX",mumps-seq)
2316 AC_SUBST([TOOL_DYLIB_ffnewuoa],"")
2317 ff_uncompile_plugin+=" ffnewuoa"
2318 fi
2319 TOOL_DISABLE(nlopt,ff-NLopt.$DYLIB_SUFFIX)
2320
2321 TOOL_DISABLE(scotch,scotch.$DYLIB_SUFFIX)
2322 TOOL_DISABLE(superlu,SuperLu.$DYLIB_SUFFIX)
2323 TOOL_DISABLE(umfpack,UMFPACK64.$DYLIB_SUFFIX)
2324 TOOL_DISABLE(yams,freeyams.$DYLIB_SUFFIX)
2325 TOOL_DISABLE(pipe,pipe.$DYLIB_SUFFIX,,nodownload)
2326 AC_SUBST([BIN_ffmaster],"$BIN_ffmaster")
2327
2328 if test "$ff_win32" = "yes" ; then
2329 TOOL_DISABLE(libpthread_google,ff-mmap-semaphore.$DYLIB_SUFFIX,libpthread-google)
2330 else
2331 TOOL_DISABLE(MMAP,ff-mmap-semaphore.$DYLIB_SUFFIX,,nodownload)
2332 fi
2333
2334 ff_pthread_google=$ff_pthread
2335 if test "$enable_libpthread_google_download" = "yes" ; then
2336 ff_pthread_google="-I${curdir}/3rdparty/include -L${curdir}/3rdparty/lib -lpthread-google"
2337 fi
2338 AC_SUBST(LIB_PTHREAD_GOOGLE,$ff_pthread_google)
2339
2340 # FFCS - MUMPS_seq has a different Win32 compiler setup from FFCS, so we need to add some extra parameters
2341
2342 if test "$OS" = Windows_NT
2343 then
2344 CFLAGS="$CFLAGS -DWITHOUT_PTHREAD -DAdd_"
2345
2346 # we also need to satisfy ff-c++ that the pthread are not a blocking point
2347 if test -n "$ff_pthread" ; then
2348 AC_FF_ADDWHERELIB(pthread,"",)
2349 fi
2350 # ALH MPI "-fno-range-check" on Windows, but this options fails on MacOS 10.8. Add no-range-check for Windows
2351 # for hexadecimal parameter constants like:
2352 # [[file:c:/cygwin/home/alh/ffcs/rel/mingw/mpif.h::PARAMETER MPI_SHORT_INT z 8c000003]]
2353 #
2354 AC_SUBST(NO_RANGE_CHECK,-fno-range-check)
2355 fi
2356
2357
2358 # ALH - 4/9/13 - request from Helmut Jarausch - allow to change Scotch include path
2359 if test "$with_scotch_include" = ""
2360 then
2361 with_scotch_include=$ac_pwd/3rdparty/include/scotch
2362 fi
2363 AC_SUBST(SCOTCH_INCLUDE,$with_scotch_include)
2364
2365 # Find out kernel and libc versions
2366 # ---------------------------------
2367
2368 if test "$ff_win32" != yes -a "$ff_mac" != yes
2369 then
2370 AC_MSG_CHECKING(kernel version)
2371 ff_kernel_version=`cat /proc/version|perl -e '<STDIN>=~/(\d+\.\d+\.\d+)/;print $1;'`
2372 AC_MSG_RESULT($ff_kernel_version)
2373 AC_SUBST(KERNEL_VERSION,$ff_kernel_version)
2374
2375 AC_MSG_CHECKING(libc version)
2376 ff_libc_version=`ldd /bin/sh | awk '/libc/{print $3}' | xargs readlink | sed -e 's/\.so$//'`
2377 AC_MSG_RESULT($ff_libc_version)
2378 AC_SUBST(LIBC_VERSION,$ff_libc_version)
2379 fi
2380 # def variable pour les makefiles
2381
2382 # creating all makefiles
2383 # ----------------------
2384
2385 ff_bamgprog="bamg${EXEEXT} cvmsh2${EXEEXT}"
2386
2387 AC_SUBST(CNOFLAGS,$CNOFLAGS) dnl for superludist CFLAGS without optim ...
2388 AC_SUBST(FNOFLAGS,$FNOFLAGS) dnl for blacs CFLAGS without optim ...
2389
2390 # The final list of executable programs
2391
2392 AC_SUBST(MEDITPROG,$ff_meditprog)
2393 AC_SUBST(FFGLUTPROG,$ff_ffglutprog)
2394 AC_SUBST(BAMGPROG,$ff_bamgprog)
2395 AC_SUBST(STDPROG,$ff_stdprog)
2396 ff_progs="FreeFem++-nw $ff_bamgprog $ff_mpiprog $ff_meditprog $ff_ffglutprog"
2397
2398 AC_SUBST(TEST_FFPP,$ff_TEST_FFPP)
2399 AC_SUBST(TEST_FFPP_MPI,$ff_TEST_FFPP_MPI)
2400 AC_SUBST(TEST_FFPPMPI,"../../src/mpi/ff-mpirun")
2401
2402 ff_with_mpi=-openmpi;
2403
2404 ff_blacs="-lblacsCinit$ff_with_mpi -lblacsF77init$ff_with_mpi -lblacs$ff_with_mpi"
2405 ff_scalapack=-lscalapack
2406
2407 # change MKL interface ...
2408 test -n "$ff_mkl_blacs" && ff_blacs="$ff_mkl_blacs"
2409 test -n "$ff_mkl_scalapack" && ff_scalapack="$ff_mkl_scalapack"
2410 test -n "$ff_mkl_root" && ff_winc="$ff_mkl_root/include/mkl_blas.h"
2411
2412 # FFCS - 27/10/11 - Some extra conditionals for things that do not work on certain systems (eg MPI libraries under
2413 # Windows)
2414
2415 ## search of HDF5 ....
2416 AX_LIB_HDF5()
2417 if test "$with_hdf5" = "yes"; then
2418 ff_save_cppflags="$CPPFLAGS";
2419 CPPFLAGS="$CPPFLAGS $HDF5_CPPFLAGS"
2420 AC_CHECK_HEADER([H5Cpp.h],[],[with_hdf5=no])
2421 CPPFLAGS="$ff_save_cppflags"
2422 if test "$with_hdf5" = "yes"; then
2423 AC_FF_ADDWHERELIB(hdf5,$HDF5_LDFLAGS $HDF5_LIBS,$HDF5_CPPFLAGS)
2424 LIBS="$LIBS $HDF5_LDFLAGS $HDF5_LIBS"
2425 # hack, if enable_download=no
2426 AC_SUBST([TOOL_COMPILE_iohdf5],ifelse(,,iohdf5,))
2427 AC_SUBST([TOOL_DYLIB_iohdf5],iohdf5.$DYLIB_SUFFIX)
2428 ifelse(nodownload,,[ff_download_lib="iohdf5 $ff_download_lib"])
2429 ifelse(nodownload,,[enable_iohdf5_download=yes])
2430 fi
2431 else
2432 enable_iohdf5=no
2433 fi
2434 #TOOL_DISABLE(iohdf5,iohdf5.$DYLIB_SUFFIX,,nodownload)
2435
2436
2437 AM_CONDITIONAL([FFCS_WINDOWS],[test "$OS" = Windows_NT])
2438
2439 # remove gsl if not find ... FH
2440 # correction FH .. 18/12/2013.
2441 # ALH - 7/1/14 - not able to compile gsl with FFCS on Windows
2442 if test "$enable_ffcs" != yes
2443 then
2444 if test "$ff_where_lib_conf_gsl" = 1 -a "$enable_gsl" != "no" ; then enable_gsl=yes; fi;
2445 fi
2446
2447 # hack, if enable_download=no
2448 if test "$ff_with_gsl" = "yes"; then
2449 AC_SUBST([TOOL_COMPILE_gsl],ifelse(,,gsl,))
2450 AC_SUBST([TOOL_DYLIB_gsl],gsl.$DYLIB_SUFFIX)
2451 ifelse(nodownload,,[ff_download_lib="gsl $ff_download_lib"])
2452 ifelse(nodownload,,[enable_gsl_download=yes])
2453 else
2454 enable_gsl=no
2455 fi
2456
2457 TOOL_DISABLE(NewSolver,"NewSolver.$DYLIB_SUFFIX",,nodownload)
2458 TOOL_DISABLE(mkl,"PARDISO.$DYLIB_SUFFIX",,nodownload)
2459
2460 AC_SUBST([FF_LIBS],$LIBS)
2461 LIBS=
2462 # echo "debug cxxx11: $ff_cxx11 mpi: $ff_mpi petsc: $ff_petsc_ok "
2463 test "$enable_download" != "yes" -a "$enable_download_hpddm" != "yes" -a \( "$enable_hpddm" != "yes" -o "$ff_hpddm_ok" != "yes" \) && enable_hpddm=no
2464 test "$enable_download" != "yes" -a "$enable_download_htool" != "yes" -a \( "$enable_htool" != "yes" -o "$ff_htool_ok" != "yes" \) && enable_htool=no
2465
2466 test "$enable_download" != "yes" -a "$enable_bemtool" != yes && enable_bemtool=no
2467 test "$enable_download" != "yes" -a "$enable_boost" != yes && enable_boost=no
2468
2469 test \( \( "$enable_download" = "yes" -o "$enable_download_hpddm" = "yes" \) -a "$enable_hpddm" != "no" \) -o "$ff_hpddm_ok" = "yes" && enable_hpddm=yes
2470 test \( \( "$enable_download" = "yes" -o "$enable_download_htool" = "yes" \) -a "$enable_htool" != "no" \) -o "$ff_htool_ok" = "yes" && enable_htool=yes
2471
2472 test "$enable_download" = yes -a "$enable_bemtool" != no && enable_bemtool=yes
2473 test "$enable_download" = yes -a "$enable_boost" != no && enable_boost=yes
2474
2475 test "$ff_cxx11" != yes -o "$ff_mpi" != yes -o \( "$ff_umfpack_ok" != "yes" -a "$ff_mumps_ok" != "yes" \) && enable_hpddm=no
2476 test "$ff_cxx11" != yes -o "$ff_mpi" != yes && enable_htool=no
2477 test "$ff_cxx11" != yes -o "$ff_mpi" != yes -o \( "$enable_bemtool" != "yes" -a "$enable_boost" != "yes" \) && enable_bemtool=no
2478
2479 FF_PETSC_DYLIB=""
2480 if test "$ff_petsc_ok" != no ; then
2481 FF_PETSC_DYLIB="PETSc.$DYLIB_SUFFIX function-PETSc.$DYLIB_SUFFIX"
2482 fi
2483 if test "$ff_petsccomplex_ok" != no ; then
2484 FF_PETSC_DYLIB="$FF_PETSC_DYLIB PETSc-complex.$DYLIB_SUFFIX"
2485 fi
2486 if test "$ff_slepccomplex_ok" != no ; then
2487 FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc-complex.$DYLIB_SUFFIX"
2488 fi
2489 if test "$ff_slepc_ok" != no ; then
2490 FF_PETSC_DYLIB="$FF_PETSC_DYLIB SLEPc.$DYLIB_SUFFIX"
2491 fi
2492
2493 ##echo @@@@@@@@@@@@ $ff_petsc_ok @@ "hpddm.$DYLIB_SUFFIX $FF_PETCS_DYLIB"
2494 TOOL_DISABLE(hpddm,["hpddm.$DYLIB_SUFFIX hpddm_substructuring.$DYLIB_SUFFIX $FF_PETSC_DYLIB"])
2495 TOOL_DISABLE(bemtool,["bem.$DYLIB_SUFFIX RadiativeTransfer_htool.$DYLIB_SUFFIX"])
2496 if test -n "$TOOL_COMPILE_bemtool" -a -z "$ff_HTOOL_INCLUDE"; then
2497 TOOL_COMPILE_htool="htool"
2498 fi
2499 ff_inc_htool=$ff_HTOOL_INCLUDE
2500 if test -n "$TOOL_COMPILE_htool"; then
2501 # install htool
2502 ff_inc_htool='-I$(abs_top_builddir)/3rdparty/include/htool/include'
2503 fi
2504 if test -n "$ff_inc_htool"; then
2505 ff_inc_htool="$ff_inc_htool -DWITH_bemtool -DWITH_htool"
2506 fi
2507 if test -z "$TOOL_COMPILE_bemtool"; then
2508 enable_bemtool=no
2509 ff_inc_htool=""
2510 fi
2511 AC_SUBST(HTOOL_INCLUDE_DIR,$ff_inc_htool)
2512
2513 ##
2514 if test "$ff_mkl_ok" = yes ; then
2515 AC_DEFINE(HAVE_MKL,1, the MKL intel lib is present for BLAS and LAPACK )
2516 fi
2517
2518 ## Conditional for check
2519 test "$ff_fftw_ok" = yes -o -n "$ff_DOWNLOAD_FFTW" && ff_fftw_=yes || ff_fftw_=no
2520 test "$ff_ipopt_ok" = yes -o -n "$TOOL_COMPILE_ipopt" && ff_ipopt_=yes || ff_ipopt_=no
2521 test "$ff_metis_ok" = yes -o -n "$TOOL_COMPILE_metis" && ff_metis_=yes || ff_metis_=no
2522 test "$ff_mmg_ok" = yes -o -n "$TOOL_COMPILE_mmg" && ff_mmg_=yes || ff_mmg_=no
2523 test "$ff_mshmet_ok" = yes -o -n "$TOOL_COMPILE_mshmet" && ff_mshmet_=yes || ff_mshmet_=no
2524 test "$ff_mumps_ok" = yes -o -n "$TOOL_COMPILE_mumps" && ff_mumps_=yes || ff_mumps_=no
2525 test "$ff_mumps_seq_ok" = yes -o -n "$TOOL_COMPILE_mumps_seq" && ff_mumps_seq_=yes || ff_mumps_seq_=no
2526 test "$ff_parmetis_ok" = yes -o -n "$TOOL_COMPILE_parmetis" && ff_parmetis_=yes || ff_parmetis_=no
2527 test "$ff_scotch_ok" = yes -o -n "$TOOL_COMPILE_scotch" && ff_scotch_=yes || ff_scotch_=no
2528 test "$ff_tetgen_ok" = yes -o -n "$TOOL_COMPILE_tetgen" && ff_tetgen_=yes || ff_tetgen_=no
2529 test "$ff_umfpack_ok" = yes -o -n "$TOOL_COMPILE_umfpack" && ff_umfpack_=yes || ff_umfpack_=no
2530 test "$ff_parmmg_ok" = yes -o -n "$TOOL_COMPILE_parmmg" && ff_parmmg_=yes || ff_parmmg_=no
2531
2532 AC_SUBST(DOWNLOADCOMPILE,$DOWNLOADCOMPILE)
2533 AM_CONDITIONAL([DOWNLOAD], [test "$enable_download" = yes])
2534 AM_CONDITIONAL([ARPACK], [test "$ff_arpack_ok" = yes])
2535 AM_CONDITIONAL([BLACS], [test "$ff_blacs_ok" = yes])
2536 AM_CONDITIONAL([BEMTOOL], [test "$enable_bemtool" = yes])
2537 AM_CONDITIONAL([BOOST], [test "$enable_boost" = yes])
2538 AM_CONDITIONAL([FFTW3], [test "$ff_fftw_" = yes])
2539 AM_CONDITIONAL([FORTRAN], [test "$enable_fortran" != no ])
2540 AM_CONDITIONAL([FREEYAMS], [test "$ff_freeyams_ok" = yes -o -n "$TOOL_COMPILE_yams"])
2541 AM_CONDITIONAL([GMM], [test "$enable_gmm" = yes -o -n "$TOOL_COMPILE_gmm"])
2542 AM_CONDITIONAL([GSL], [test "$ff_with_gsl" = yes])
2543 AM_CONDITIONAL([HDF5], [test "$with_hdf5" = yes])
2544 AM_CONDITIONAL([HTOOL], [test "$enable_htool" = yes])
2545 AM_CONDITIONAL([HPDDM], [test "$enable_hpddm" = yes])
2546 AM_CONDITIONAL([IPOPT], [test "$ff_ipopt_" = yes])
2547 AM_CONDITIONAL([LIBSEQ], [test "$ff_libseq_ok" = yes])
2548 AM_CONDITIONAL([METIS], [test "$ff_metis_" = yes])
2549 AM_CONDITIONAL([MKL], [test "$ff_mkl" = yes])
2550 AM_CONDITIONAL([MMG3D], [test "$ff_mmg3d_ok" = yes -o -n "$TOOL_COMPILE_mmg3d"])
2551 AM_CONDITIONAL([MMG], [test "$ff_mmg_" = yes])
2552 AM_CONDITIONAL([PARMMG], [test "$ff_parmmg_" = yes])
2553 AM_CONDITIONAL([MPI], [test "$ff_mpi" = yes])
2554 AM_CONDITIONAL([MSHMET], [test "$ff_mshmet_" = yes])
2555 AM_CONDITIONAL([MUMPS], [test "$ff_mumps_" = yes])
2556 AM_CONDITIONAL([MUMPS_ptscotch], [test "$ff_mumps_ptscotch_ok" = yes])
2557 AM_CONDITIONAL([MUMPS_scotch], [test "$ff_mumps_scotch_ok" = yes])
2558 AM_CONDITIONAL([MUMPS_seq], [test "$ff_mumps_seq_" = yes])
2559 AM_CONDITIONAL([NLOPT], [test "$ff_nlopt_ok" = yes -o -n "$TOOL_COMPILE_nlopt"])
2560 AM_CONDITIONAL([PARMETIS], [test "$ff_parmetis_" = yes])
2561 AM_CONDITIONAL([PETSC], [test "$ff_petsc_ok" = yes])
2562 AM_CONDITIONAL([PETSCCOMPLEX], [test "$ff_petsccomplex_ok" = yes])
2563 AM_CONDITIONAL([PIPE], [test -n "$TOOL_COMPILE_pipe"])
2564 AM_CONDITIONAL([PTHREAD], [test -n "$ff_pthread"])
2565 AM_CONDITIONAL([PTSCOTCH], [test "$ff_ptscotch_ok" = yes])
2566 AM_CONDITIONAL([SCALAPACK], [test "$ff_scalapack_ok" = yes])
2567 AM_CONDITIONAL([SCOTCH], [test "$ff_scotch_" = yes])
2568 AM_CONDITIONAL([SLEPC], [test "$ff_slepc_ok" = yes])
2569 AM_CONDITIONAL([SLEPCCOMPLEX], [test "$ff_slepccomplex_ok" = yes])
2570 AM_CONDITIONAL([SUPERLU], [test "$ff_superlu_ok" = yes])
2571 AM_CONDITIONAL([TETGEN], [test "$ff_tetgen_" = yes])
2572 AM_CONDITIONAL([UMFPACK], [test "$ff_umfpack_" = yes])
2573
2574
2575 ##
2576 # All makefiles
2577 AC_CONFIG_FILES([Makefile
2578 3rdparty/Makefile
2579 3rdparty/blas/Makefile
2580 3rdparty/arpack/Makefile
2581 3rdparty/umfpack/Makefile
2582 3rdparty/fftw/Makefile
2583 src/Makefile
2584 src/bamglib/Makefile
2585 src/Graphics/Makefile
2586 src/femlib/Makefile
2587 src/Algo/Makefile
2588 src/lglib/Makefile
2589 src/ffgraphics/Makefile
2590 src/ffgraphics/server/Makefile
2591 src/ffgraphics/client/Makefile
2592 src/fflib/Makefile
2593 src/nw/Makefile
2594 src/mpi/Makefile
2595 src/bamg/Makefile
2596 src/libMesh/Makefile
2597 src/medit/Makefile
2598 src/bin-win32/Makefile
2599 plugin/Makefile
2600 plugin/seq/Makefile
2601 plugin/mpi/Makefile
2602 examples/Makefile
2603 examples/plugin/Makefile
2604 examples/tutorial/Makefile
2605 examples/misc/Makefile
2606 examples/mpi/Makefile
2607 examples/bem/Makefile
2608 examples/hpddm/Makefile
2609 examples/ffddm/Makefile
2610 examples/eigen/Makefile
2611 examples/examples/Makefile
2612 examples/bug/Makefile
2613 examples/3d/Makefile
2614 examples/3dSurf/Makefile
2615 examples/3dCurve/Makefile
2616 ])
2617 AC_OUTPUT
2618
2619 AC_MSG_NOTICE([ FreeFEM used download: $enable_download ])
2620 AC_MSG_NOTICE([ -- Dynamic load facility: $ff_dynload ])
2621 AC_MSG_NOTICE([ -- ARPACK (eigen value): $ff_arpack_ok ])
2622 AC_MSG_NOTICE([ -- UMFPACK (sparse solver): $ff_umfpack_ok ])
2623 AC_MSG_NOTICE([ -- BLAS: $ff_blas_ok ])
2624 AC_MSG_NOTICE([ -- with MPI: $ff_mpi])
2625 AC_MSG_NOTICE([ -- with PETSc: $ff_petsc_ok / PETSc complex: $ff_petsccomplex_ok ]);
2626 AC_MSG_NOTICE([ -- with SLEPc: $ff_slepc_ok / SLEPc complex: $ff_slepccomplex_ok ]);
2627 AC_MSG_NOTICE([ -- with hpddm: $enable_hpddm ]);
2628 AC_MSG_NOTICE([ -- with htool: $enable_htool ]);
2629 AC_MSG_NOTICE([ -- with bemtool: $enable_bemtool (need boost: $enable_boost and htool: $enable_htool) ]);
2630 AC_MSG_NOTICE([ -- without libs: $ff_unlib_plugin ]);
2631 AC_MSG_NOTICE([ -- without plugins: $ff_uncompile_plugin ]);
2632
2633
2634 AC_MSG_NOTICE([ progs: $ff_progs ])
2635 if test "$ff_umfpack_download" = yes -a -n "$TOOL_COMPILE_umfpack" ;then
2636 AC_MSG_NOTICE([ use of download UMFPACK see 3rdparty/umfpack/SuiteSparse/UMFPACK/README.txt for the License])
2637 fi
2638 if test "$ff_arpack_download" = yes -a -n "$TOOL_COMPILE_arpack" ; then
2639 AC_MSG_NOTICE([ use of download ARPACK see 3rdparty/arpack/ARPACK/README no License ])
2640 fi
2641
2642 if test "$enable_download" = yes; then
2643 if test -n "$ff_DOWNLOAD_FFTW"; then
2644 AC_MSG_NOTICE([ use of download fftw see 3rdparty/fftw/fftw-3.2/COPYRIGHT ])
2645 fi
2646 if test -n "$TOOL_COMPILE_tetgen"; then
2647 AC_MSG_NOTICE([ use of download tetgen see 3rdparty/tetgen/tetgen1.5.1-beta/LICENSE ])
2648 fi
2649 if test -n "$TOOL_COMPILE_yams"; then
2650 AC_MSG_NOTICE([ use of download freeyams see 3rdparty/yams/freeyams.2011.02.22 (suface mesh adaptation) ])
2651 fi
2652 if test -n "$TOOL_COMPILE_mmg3d"; then
2653 AC_MSG_NOTICE([ use of download mmg3d (v4) see 3rdparty/mmg3d/mmg3d4/LICENCE.txt ])
2654 fi
2655 if test -n "$TOOL_COMPILE_mmg"; then
2656 AC_MSG_NOTICE([ use of download mmg see 3rdparty/mmg/mmg-sources/LICENSE ])
2657 fi
2658 if test -n "$TOOL_COMPILE_parmmg"; then
2659 AC_MSG_NOTICE([ use of download parmmg see 3rdparty/parmmg/parmmg-sources/LICENSE ])
2660 fi
2661 if test -n "$TOOL_COMPILE_parmetis"; then
2662 AC_MSG_NOTICE([ use of download parmetis])
2663 fi
2664
2665 # ALH - some tools may be activated but not downloaded if a local version is specified (see
2666 # [[TOOL_PARAMETERS]])
2667
2668 if test "$enable_superlu_download" = yes; then
2669 AC_MSG_NOTICE([ use of download superlu])
2670 fi
2671
2672 if test -n "$MPICC"; then
2673 AC_MSG_NOTICE([ try to download: $ff_download_lib])
2674 fi
2675
2676 if test "$enable_boost" = yes; then
2677 AC_MSG_NOTICE([ use of download boost see 3rdparty/boost/LICENSE_1_0.txt ])
2678 fi
2679
2680 if test "$ff_download_blas" = "generic"; then
2681 AC_MSG_NOTICE([ use of download generic blas and cblas freefem may be slow ])
2682 AC_MSG_NOTICE([ you can try to use the Kazushige Goto s BLAS at http://www.cs.utexas.edu/users/flame/goto/ ])
2683 AC_MSG_NOTICE([ or at http://www.tacc.utexas.edu/~kgoto/ for the best BLAS .])
2684 AC_MSG_NOTICE([ or try to 3rdparty/compile the altas blas .])
2685 fi
2686
2687 # ALH - 30/10/13 - (request from FH) all downloads are now part of a separate script ([[file:3rdparty/getall]])
2688 # which needs to be run before make for the user to specify whether he is ok with each of the package licences.
2689
2690 AC_MSG_NOTICE([ Please run "3rdparty/getall" to download all necessary packages before running make])
2691 fi
2692
2693 # FFCS does not use glut, so remove this message because it could make the user think that something is broken
2694
2695 if test $enable_ffcs = no
2696 then
2697 if test "$ff_glut_ok" != yes ; then
2698 AC_MSG_NOTICE([ *********************************************** ])
2699 AC_MSG_NOTICE([ WARNING: you do not have the new grachics tools ])
2700 AC_MSG_NOTICE([ because the configure do not find OpenGL, GLUT or pthread developer stuff ])
2701 AC_MSG_NOTICE([ read the README to find missing package ])
2702 AC_MSG_NOTICE([ F. Hecht ])
2703 AC_MSG_NOTICE([ to install missing package under debian or ubuntu, try: sudo apt-get install freeglut3-dev ])
2704 AC_MSG_NOTICE([ *********************************************** ])
2705 fi
2706 fi
2707
2708 if test "$enable_summary" = yes; then
2709 if test "$enable_fortran" != yes; then
2710 enable_fortran=no
2711 fi
2712 if test "$enable_gmm" != yes; then
2713 enable_gmm=no
2714 fi
2715 if test "$ff_mkl" != yes; then
2716 ff_mkl=no
2717 fi
2718 if test -n "$ff_pthread"; then
2719 ff_pthread_ok=yes
2720 else
2721 ff_pthread_ok=no
2722 fi
2723
2724
2725 AC_MSG_NOTICE([ Activated libraries ])
2726 AC_MSG_NOTICE([ - ARPACK: $ff_arpack_ok])
2727 AC_MSG_NOTICE([ - BLACS: $ff_blacs_ok])
2728 AC_MSG_NOTICE([ - BEMTOOL: $enable_bemtool])
2729 AC_MSG_NOTICE([ - BOOST: $enable_boost])
2730 AC_MSG_NOTICE([ - FFTW3: $ff_fftw_])
2731 AC_MSG_NOTICE([ - FORTRAN: $enable_fortran])
2732 AC_MSG_NOTICE([ - FREEYAMS: $ff_freeyams_ok])
2733 AC_MSG_NOTICE([ - GMM: $enable_gmm])
2734 AC_MSG_NOTICE([ - GSL: $ff_with_gsl])
2735 AC_MSG_NOTICE([ - HDF5: $with_hdf5])
2736 AC_MSG_NOTICE([ - HTOOL: $enable_htool])
2737 AC_MSG_NOTICE([ - HPDDM: $enable_hpddm])
2738 AC_MSG_NOTICE([ - IPOPT: $ff_ipopt_])
2739 AC_MSG_NOTICE([ - LIBSEQ: $ff_libseq_ok])
2740 AC_MSG_NOTICE([ - METIS: $ff_metis_])
2741 AC_MSG_NOTICE([ - MKL: $ff_mkl])
2742 AC_MSG_NOTICE([ - MMG3D: $ff_mmg3d_ok])
2743 AC_MSG_NOTICE([ - MMG: $ff_mmg_])
2744 AC_MSG_NOTICE([ - PARMMG: $ff_parmmg_])
2745 AC_MSG_NOTICE([ - MPI: $ff_mpi])
2746 AC_MSG_NOTICE([ - MSHMET: $ff_mshmet_])
2747 AC_MSG_NOTICE([ - MUMPS: $ff_mumps_])
2748 AC_MSG_NOTICE([ - MUMPS_ptscotch: $ff_mumps_ptscotch_ok])
2749 AC_MSG_NOTICE([ - MUMPS_scotch: $ff_mumps_scotch_ok])
2750 AC_MSG_NOTICE([ - MUMPS_seq: $ff_mumps_seq_])
2751 AC_MSG_NOTICE([ - NLOPT: $ff_nlopt_ok])
2752 AC_MSG_NOTICE([ - PARMETIS: $ff_parmetis_])
2753 AC_MSG_NOTICE([ - PETSC: $ff_petsc_ok])
2754 AC_MSG_NOTICE([ - PETSCCOMPLEX: $ff_petsccomplex_ok])
2755 AC_MSG_NOTICE([ - PTHREAD: $ff_pthread_ok])
2756 AC_MSG_NOTICE([ - PTSCOTCH: $ff_ptscotch_ok])
2757 AC_MSG_NOTICE([ - SCALAPACK: $ff_scalapack_ok])
2758 AC_MSG_NOTICE([ - SCOTCH: $ff_scotch_])
2759 AC_MSG_NOTICE([ - SLEPC: $ff_slepc_ok])
2760 AC_MSG_NOTICE([ - SLEPCCOMPLEX: $ff_slepccomplex_ok])
2761 AC_MSG_NOTICE([ - SUPERLU: $ff_superlu_ok])
2762 AC_MSG_NOTICE([ - TETGEN: $ff_tetgen_])
2763 AC_MSG_NOTICE([ - UMFPACK: $ff_umfpack_])
2764 fi
2765 if test "${prefix_petsc}" != no -a ! \( -d "${prefix_petsc}/real/lib" -o -d "${prefix_petsc}/r/lib" \) ; then
2766 AC_MSG_NOTICE([ PETSc directories do not exist, to build do:])
2767 AC_MSG_NOTICE([cd 3rdparty/ff-petsc && make])
2768 fi