Debian Codegraph @

configure.ac

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