~ubuntu-branches/ubuntu/wily/freefem++/wily

« back to all changes in this revision

Viewing changes to .pc/configure.patch/configure.ac

  • Committer: Package Import Robot
  • Author(s): Dimitrios Eftaxiopoulos, Dimitrios Eftaxiopoulos, Christophe Trophime
  • Date: 2013-09-12 00:02:58 UTC
  • mfrom: (1.2.1) (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130912000258-aclq2zfa1svt0p3x
Tags: 3.25-1
[ Dimitrios Eftaxiopoulos ]
* Imported Upstream version 3.25 (Closes: #701161 #706714)
* Change installation directory of header-like *.idp files
  from /usr/lib/freefem++ to /usr/include/freefem++, in order
  to fix a lintian warning
* Update patch to examples++-load/Makefile.am in order to enable
  functioning of load *.so and include *.idp commands in *.edp
  scripts
* Delete patches to src/Graphics/sansgraph.cpp and
  src/Graphics/xglrgraph.cpp because they are not needed any more
* Fix lintian warning about missing LDFLAGS
* Override dh_auto_test in debian/rules, such that in case it is 
  used, it completes executing all *.edp example files, regardless
  of aborting on some of them
* Add libmetis-dev to build-deps in d/control
* Remove libparmetis-dev from build deps
* Add --parallel option to dh $@ in debian/rules
* Add hardening compilation flags to mpic++
* Allow testing of compiling and running the example files after build

[ Christophe Trophime ]
* update C. Trophime email
* add support for nlopt, ipopt - simplify debian/rules
* upload CT changes to 3.20
* add patch for configure
* add patch for examples++-mpi
* fix bamg install
* add corrected scripts to build plugins
* add patch for properly build examples++-load
* add lintian overrides for libfreefem++
* add some missing files
* update patches
* update rules
* reorder BuildDepends - comment out unsupported libs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Configuration script using Automake + Autoconf for FreeFem++
 
2
# ------------------------------------------------------------
 
3
 
 
4
# Antoine Le Hyaric - LJLL Paris 6 - lehyaric@ann.jussieu.fr - 13/5/04
 
5
# $Id: configure.ac,v 1.338 2010/05/10 21:35:07 hecht Exp $
 
6
 
 
7
# Version numbering: x.xx-pp where "pp" is the package version (when
 
8
# the same FreeFem++ version is packaged several times). For
 
9
# coherency, this should have the same value as the top-most package
 
10
# number in debian/changelog.
 
11
 
 
12
 
 
13
AC_INIT(FreeFem++,3.25,hecht@ann.jussieu.fr,freefem++)
 
14
dnl : ${CFLAGS=""}
 
15
dnl : ${CXXFLAGS=""}
 
16
dnl : ${FCFLAGS=""}
 
17
dnl : ${FFLAGS=""}
 
18
 
 
19
 
 
20
AC_PREREQ(2.50) dnl for AC_LANG_CASE
 
21
dnl AC_CONFIG_SRCDIR(src/FreeFem++-CoCoa)
 
22
# Automake 1.11 is too old for check ... 
 
23
AM_INIT_AUTOMAKE(1.13 dist-zip)
 
24
 
 
25
AC_CONFIG_HEADERS(config.h)
 
26
AC_PROG_MAKE_SET
 
27
dnl AM_COLOR_TESTS=always
 
28
AC_PROG_RANLIB
 
29
 
 
30
# FFCS - parallel make options (see [[file:../../configure/ac::FFCS_MAKEFLAGS]])
 
31
 
 
32
AC_SUBST(FFCS_MAKEFLAGS,$FFCS_MAKEFLAGS)
 
33
 
 
34
ff_where_lib_conf=examples++-load/WHERE_LIBRARY-config
 
35
dnl search of associad software 
 
36
m4_define([AC_FF_ADDWHERELIB],
 
37
  [     if test -z "$ff_where_lib_conf_$1" ; then
 
38
            echo "$1 LD $2"  >>$ff_where_lib_conf 
 
39
            test -n "$3" && echo "$1 INCLUDE $3 "  >>$ff_where_lib_conf
 
40
            ff_where_lib_conf_$1=1
 
41
            AC_MSG_NOTICE([    ++ add $1 : $2 $3 in  $ff_where_lib_conf "])
 
42
        else
 
43
            AC_MSG_NOTICE([    -- do not add $1 : $2 $3 in  $ff_where_lib_conf "])
 
44
        fi
 
45
]) dnl 
 
46
m4_define([AC_FF_WHERELIB],
 
47
    [   if test -z "$ff_where_lib_conf_$1" ; then
 
48
        AC_MSG_CHECKING(check $1)
 
49
        ff_save_libs=$LIBS
 
50
        LIBS="$LIBS $2 $4"
 
51
        AC_LINK_IFELSE([AC_LANG_PROGRAM([m4_if($3,,,[#include <$3>])],[])], [ff_WHERE=yes],[ff_WHERE=no]) 
 
52
        if test "$ff_WHERE" = "yes" ; then
 
53
            echo "$1 LD $2"  >>$ff_where_lib_conf
 
54
            ff_WHERE_INC=`AS_DIRNAME(["$3"])`
 
55
            if test -n "$ff_WHERE_INC" -a  "$ff_WHERE_INC" != '.'   ; then
 
56
                echo "$1 INCLUDE -I$ff_WHERE_INC"  >>$ff_where_lib_conf
 
57
            fi 
 
58
        fi
 
59
        AC_MSG_RESULT($ff_WHERE)
 
60
 
 
61
        ff_where_lib_conf_$1=1
 
62
        LIBS=$ff_save_libs
 
63
        fi      
 
64
    ])dnl end m4_define AC_FF_WHERELIB
 
65
 
 
66
 
 
67
ff_HOSTARCH_pastix=
 
68
echo "#  Build with freefem++ with ./configure " `date`  >$ff_where_lib_conf
 
69
# To allow anonymous CVS version to contain a "./configure" and
 
70
# Makefiles
 
71
 
 
72
AM_MAINTAINER_MODE
 
73
 
 
74
echo >config_LIB_INFO
 
75
 
 
76
# Necessary compilers
 
77
 
 
78
AC_PROG_CC
 
79
AC_PROG_CXX
 
80
AC_LANG(C++)
 
81
 
 
82
AC_CHECK_PROG(ff_m4,m4,yes,no)
 
83
AC_CHECK_PROG(ff_bison,bison,yes,no)
 
84
dnl AC_CHECK_PROG(ff_cmake,cmake,yes,no)
 
85
AC_CHECK_PROG(ff_patch,patch,yes,no)
 
86
case "$ff_m4 $ff_bison $ff_patch "  in 
 
87
*no*)
 
88
    AC_MSG_NOTICE([ to install missing package  under debian or ubuntu, try: sudo apt-get install m4 bison patch cmake ])       
 
89
    AC_MSG_ERROR([ Sorry missing  m4,bison,patch command !]);;
 
90
esac
 
91
 
 
92
 
 
93
if test -z "$CXX"; then
 
94
  AC_MSG_NOTICE( [ fatal error : c++ compiler ! ] );
 
95
  AC_MSG_ERROR([ Sorry no c++ compiler !])
 
96
fi
 
97
 
 
98
AC_COMPUTE_INT(ff_size_long,[sizeof(long)])
 
99
AC_COMPUTE_INT(ff_size_int,[sizeof(int)])
 
100
AC_COMPUTE_INT(ff_size_ptr,[sizeof(int*)])
 
101
 
 
102
AC_SUBST(SIZEOF_LONG,$ff_size_long)
 
103
AC_SUBST(SIZEOF_INT,$ff_size_int)
 
104
AC_SUBST(SIZEOF_PTR,$ff_size_ptr)
 
105
if test "$ff_size_ptr" -eq 4  ;then
 
106
 AC_SUBST(SIZEOF_PTRINBIT,32)
 
107
elif test  "$ff_size_ptr" -eq 8  ;then
 
108
 AC_SUBST(SIZEOF_PTRINBIT,64)
 
109
else
 
110
  AC_MSG_NOTICE( [ fatal error : sizeof pointer $ff_size_ptr !  or no c++ compiler: $CXX] ); 
 
111
  AC_MSG_ERROR([ Sorry  sizeof c++ pointer $ff_size_ptr are not  4 or 8 ])
 
112
fi
 
113
 
 
114
# FFCS - build the code for FreeFem++-cs
 
115
AC_ARG_ENABLE(fortran,[  --enable-ffcs  build FreeFem++ for use by FreeFem++-cs])
 
116
if test "$enable_ffcs" = yes
 
117
then
 
118
        AC_DEFINE_UNQUOTED(ENABLE_FFCS,$enable_ffcs,[build FreeFem++ for use by FreeFem++-cs])
 
119
else
 
120
        enable_ffcs=no
 
121
fi
 
122
AC_SUBST(ENABLE_FFCS,"$enable_ffcs")
 
123
AM_CONDITIONAL([ENABLE_FFCS],[test $enable_ffcs = yes])
 
124
 
 
125
# dur dur car sous MacOsX le fortran n'est pas standard. 
 
126
ff_AR="ar"
 
127
ff_ARFLAGS="rv"
 
128
ff_RANLIB="ranlib" 
 
129
 
 
130
AC_ARG_ENABLE(fortran,[  --disable-fortran      No Fortran compiler available ( ARPACK need it)])
 
131
ff_g2c_lib="";   
 
132
if test "$enable_fortran" != no
 
133
then
 
134
 
 
135
    # ALH-FFCS-2/3/10: add gfortran-mp-4.4 for MacPorts on MacOS 10.6
 
136
    AC_PROG_FC(gfortran  f90  xlf90 g95 gfortran-mp-4.4)
 
137
    AC_PROG_F77(gfortran f90 xlf xlf90 g95 f77 fort77 "$FC" gfortran-mp-4.4)
 
138
 
 
139
#       if test -n "$F77" 
 
140
#       then
 
141
    ff_flibs=""
 
142
        # modif FH              
 
143
    AC_F77_LIBRARY_LDFLAGS  
 
144
    dnl AC_F77_WRAPPERS
 
145
        # correct pb of double def under macos 
 
146
    case $F77 in
 
147
         *fort77)
 
148
            if test -z "$FLIBS" ; then
 
149
#             FLIBS=`fort77 -v  a.out  2>&1|awk '/a.out/ && /fort77/  { print $(NF-2),$(NF-1)}'`
 
150
#  FH to remove " "  
 
151
                FLIBS=`fort77 -v  a.out  2>&1|awk '/a.out/ && /fort77/  { print "echo",$(NF-2),$(NF-1)}'|sh`
 
152
                
 
153
                AC_MSG_WARN([  fort77   FLIBS :  $FLIBS ])           
 
154
            fi
 
155
            ;;
 
156
        *g77)  
 
157
            for i in $FLIBS; do
 
158
                case $i in        
 
159
# save last directory of the list 
 
160
                    -L*) 
 
161
                        d=`expr $i : '-L\(.*\)'`; 
 
162
                        echo " try $d "
 
163
                        if test -e "$d/libg2c.so" ; then
 
164
                            ff_flibs="$d/libg2c.so"
 
165
                        elif test -e "$d/libg2c.dylib" ; then
 
166
                            ff_flibs="$d/libg2c.dylib"
 
167
                        elif test -e "$d/libg2c.a" ; then
 
168
                            ff_flibs="$d/libg2c.a"
 
169
                        elif test  -e $d/libg2c.so -o   -e $d/libg2c.a ; then   
 
170
                            ff_flibs="$i" 
 
171
                        fi;;
 
172
                esac
 
173
            done 
 
174
            if test -e "$ff_flibs"  ;then
 
175
                FLIBS="$ff_flibs"
 
176
            else         
 
177
                FLIBS="$ff_flibs -lg2c"
 
178
            fi
 
179
            AC_MSG_WARN([  get dir of -lg2c  FLIBS :  $FLIBS ])
 
180
            ;;
 
181
# add FH sep 2006 / modif  2009  
 
182
        *gfortran)
 
183
            for i in $FLIBS; do
 
184
                case $i in
 
185
                    -L*)  
 
186
                        d=`expr $i : '-L\(.*\)'`;
 
187
                        if test -e "$d/libgfortran.so" ; then
 
188
                            ff_flibs="$d/libgfortran.so"
 
189
                        elif test -e "$d/libgfortran.dylib" ; then
 
190
                            ff_flibs="$d/libgfortran.dylib"
 
191
                        elif test -e "$d/libgfortran.a" ; then
 
192
                            ff_flibs="$d/libgfortran.a"
 
193
                        elif test -e $d/libgfortran.so -o -e $d/libgfortran.a -o -e $d/libgfortran.dylib ; then   
 
194
                            ff_flibs="$i" 
 
195
                        fi;;
 
196
                esac
 
197
            done
 
198
            if test -e "$ff_flibs"  ;then
 
199
                FLIBS="$ff_flibs"
 
200
            else 
 
201
                FLIBS="$ff_flibs -lgfortran"
 
202
            fi
 
203
            AC_MSG_WARN([  get dir of -lgfortran  FLIBS :  $FLIBS ])
 
204
            ;;
 
205
    esac
 
206
    AC_ARG_WITH(flib,[  --with-flib= the fortran library ])
 
207
#  correct FH sep 2006 -o -> -a 
 
208
    if test "$with_flib" != no -a -n  "$with_flib"
 
209
    then 
 
210
        ff_g2c_lib="$with_flib"
 
211
        FLIBS="$with_flib"
 
212
    fi
 
213
# add FH oct 2007 for download f2c
 
214
    if test -z "$F77"  ; then 
 
215
        ff_f77=`pwd`/download/bin/fort77
 
216
        ff_flibs=`pwd`/download/lib/libf2c.a
 
217
        if test -x $ff_f77  -a -f $ff_flibs ; then
 
218
            AC_MSG_WARN([ no fortran, but find download f2c/fort]);
 
219
            F77=$ff_f77
 
220
            FLIBS=$ff_flibs
 
221
        else
 
222
            AC_MSG_NOTICE( [ fatal error : no fortran ] );
 
223
            AC_MSG_NOTICE( [add --disable-fortran  ] );
 
224
            AC_MSG_NOTICE( [or try to compile f2c in directory download/f2c  ] );
 
225
            AC_MSG_NOTICE( [  just do:  make install ] );
 
226
            AC_MSG_ERROR([ Fatal error No Fortran compiler . ],1);  
 
227
        fi
 
228
    fi
 
229
#  check if the FLIBS is correct
 
230
    ff_libs="$LIBS"
 
231
    LIBS="$ff_libs $FLIBS"
 
232
    AC_TRY_LINK_FUNC(exit,ff_err=,ff_err=ok);
 
233
    if test "$ff_err" = "ok" ; then  AC_MSG_ERROR([ Fatal FLIBS: $FLIBS is incorrect. ],1); fi
 
234
    LIBS="$ff_libs"
 
235
    echo "F77 LD $ff_libs" >config_LIB_INFO
 
236
 
 
237
    AC_MSG_CHECKING([ Size of fortran 77 integer ])     
 
238
    
 
239
    
 
240
    
 
241
##   AC_LANG(fortran);
 
242
    AC_LANG_PUSH([Fortran 77])
 
243
    AC_RUN_IFELSE([AC_LANG_SOURCE([[
 
244
                program test
 
245
                integer  p,i
 
246
                p=1024*1024
 
247
                i= p*p
 
248
                open(7,file="conftest.out")
 
249
                if (i>0) then
 
250
                    write(7,*) 8
 
251
                else
 
252
         write(7,*) 4
 
253
         endif
 
254
         close(7)
 
255
         end
 
256
 ]])] ,ff_f77intsize=`cat conftest.out`,ff_f77intsize=4,ff_f77intsize=4)
 
257
## AC_LANG(C++)
 
258
    AC_LANG_POP([Fortran 77])
 
259
    AC_MSG_RESULT($ff_f77intsize)
 
260
    AC_F77_WRAPPERS
 
261
    
 
262
    ff_cfagsf77=""
 
263
    case $ac_cv_f77_mangling in
 
264
#  "lower case, no underscore, no extra underscore")
 
265
#  "lower case, no underscore, extra underscore")
 
266
# ;;
 
267
        "lower case, underscore, no extra underscore")  ff_cfagsf77="-DAdd_";;
 
268
        "lower case, underscore, extra underscore")             ff_cfagsf77="-DAdd__ -Df77IsF2C";;
 
269
        "upper case, no underscore, no extra underscore")     ff_cfagsf77="-DUPPER";;
 
270
        "upper case, no underscore, extra underscore")        ff_cfagsf77="-DUPPER -DAdd__";;
 
271
        "upper case, underscore, no extra underscore")      ff_cfagsf77="-DUPPER -DAdd_";;
 
272
        "upper case, underscore, extra underscore")           ff_cfagsf77="-DUPPER -DAdd__";;
 
273
        *) ;;
 
274
    esac
 
275
    AC_SUBST(CFLAGSF77,$ff_cfagsf77)
 
276
    if test $ff_f77intsize -ne  4
 
277
    then
 
278
        AC_MSG_ERROR([ Fatal Error: Your fortran 77  compiler have by not 4 bytes integer ( $ff_f77intsize bytes) ],1);  
 
279
    fi
 
280
    test -f /mingw/bin/libpthread-2.dll && ff_pthread_dll=/mingw/bin/libpthread-2.dll ; \
 
281
    AC_FF_ADDWHERELIB(f77,$FLIBS,$ff_cfagsf77 $ff_pthread_dll)
 
282
    AC_FF_ADDWHERELIB(fc,$FLIBS,$ff_cfagsf77 $ff_pthread_dll)
 
283
 
 
284
dnl    [echo f77 LD  $FLIBS  >>$ff_where_lib_conf]
 
285
dnl    [echo f77 INCLUDE $ff_cfagsf77  >>$ff_where_lib_conf]
 
286
#  bof bof -- FH ... 
 
287
dnl    [echo fc LD  $FLIBS  >>$ff_where_lib_conf]
 
288
dnl    [echo fc INCLUDE $ff_cfagsf77  >>$ff_where_lib_conf]
 
289
 
 
290
# AC_DEFINE_UNQUOTED(FF_F77_INTEGER_SIZE,$ff_f77intsize,[ size of F77 integer ])
 
291
fi
 
292
#  fin test FORTRAN ..........
 
293
# -----------------------------
 
294
AC_ARG_ENABLE(c,[  --disable-c          No C compiler available (C BLAS need it)])
 
295
if test "$enable_c" != no
 
296
then
 
297
    AC_PROG_CC
 
298
    AM_PROG_CC_C_O
 
299
else
 
300
 
 
301
        # We need to define this otherwise ./configure crashes with
 
302
        # the message "configure: error: conditional "am__fastdepCC"
 
303
        # was never defined".
 
304
    
 
305
    am__fastdepCC_TRUE=
 
306
    am__fastdepCC_FALSE='#'
 
307
fi
 
308
 
 
309
AM_PROG_LEX
 
310
AC_PROG_YACC
 
311
AC_LANG(C++)
 
312
 
 
313
 
 
314
# Some useful libraries
 
315
 
 
316
AC_CHECK_LIB(pthread,pthread_create,ff_pthread="-lpthread",ff_pthread="")
 
317
 
 
318
if test -n "$ff_pthread"  ; then
 
319
    AC_FF_ADDWHERELIB(pthread,$ff_pthread,)
 
320
fi
 
321
 
 
322
# Necessary absolute pathname for local directory when some libraries
 
323
# are used from several different locations (for instance locally in
 
324
# configure.ac and in a subdir).
 
325
curdir=`pwd`
 
326
 
 
327
# Configure options
 
328
# -----------------
 
329
 
 
330
echo $ac_configure_args > configure.param
 
331
# by default the suffix of the  .so lib file is .so
 
332
#      it is .dll   under windows
 
333
#      it is .dylib under macos X
 
334
ff_suffix_dylib="so";   
 
335
# Checking wether we can produce a MacIntosh-specific version
 
336
# -----------------------------------------------------------
 
337
 
 
338
AC_MSG_CHECKING(wether we are on a MacIntosh)
 
339
ff_mac=no
 
340
if test `uname` = Darwin;
 
341
then
 
342
        ff_HOSTARCH_pastix=i686_mac
 
343
        ff_suffix_dylib="dylib"
 
344
        ff_mac=yes
 
345
AC_DEFINE_UNQUOTED(FF_PREFIX_DIR_APPLE,"/Applications/FreeFem++.app/Contents/",FreeFem prefix  dir)     
 
346
fi
 
347
AC_MSG_RESULT($ff_mac)
 
348
 
 
349
AC_MSG_CHECKING(wether we are on  SunOS)
 
350
ff_sunos=no
 
351
if test `uname -s` = SunOS;
 
352
then
 
353
        ff_sunos=yes
 
354
fi
 
355
AC_MSG_RESULT($ff_sunos)
 
356
 
 
357
# Checking wether we can produce a Microsoft Windows-specific version
 
358
# -------------------------------------------------------------------
 
359
 
 
360
# Sometimes (under cygwin for instance) the default version of FLTK
 
361
# does not fit our purpose
 
362
 
 
363
AC_ARG_ENABLE(default-fltk,
 
364
        [  --disable-default-fltk       Does not use default FLTK])
 
365
 
 
366
AC_ARG_ENABLE(cygwindll,
 
367
        [  --enable-cygwindll   Forces the use of the Cygwin DLL (not recommended)])
 
368
 
 
369
# Default FLTK version under Cygwin does not use threads. So we cannot
 
370
# use it.
 
371
 
 
372
if test "$enable_cygwindll" = yes
 
373
then
 
374
        enable_default_fltk=no
 
375
fi
 
376
 
 
377
AC_MSG_CHECKING(wether we are on Microsoft Windows)
 
378
ff_uname=`uname`
 
379
#  flag to build window 32   version   ff_mingw = yes 
 
380
ff_mingw=no
 
381
case $ff_uname in
 
382
    CYGWIN*)    
 
383
 
 
384
        # FFCS - 17/1/12 - -mno-cygwin is not recognised by the latest version of mingw32
 
385
        if test $enable_ffcs = no
 
386
        then
 
387
            ff_nocygwin=-mno-cygwin
 
388
        fi
 
389
 
 
390
        AC_SUBST(GCCNOCYGWIN,$ff_nocygwin);;
 
391
    MINGW*)
 
392
        enable_cygwindll=no;;
 
393
esac
 
394
case $ff_uname in
 
395
CYGWIN*|MINGW*)
 
396
 
 
397
        ff_suffix_dylib="dll";
 
398
        ff_win32=yes;
 
399
 
 
400
        # FFCS - 8/3/12 - remove -D_MSC_VER under MinGW64 because it forces system calls to be compiled into any object
 
401
        # (which creates thousands of duplicate definitions for sytem calls like time()).
 
402
 
 
403
        if test $enable_ffcs = yes
 
404
        then
 
405
            AC_SUBST(FFMETIS_CFLAGS,"-D__VC__")
 
406
        else
 
407
            AC_SUBST(FFMETIS_CFLAGS,"-D__VC__ -D_MSC_VER")
 
408
        fi
 
409
 
 
410
        # We need Mingw to avoid Cygwin's extra DLLs
 
411
        if test "$enable_cygwindll" != yes
 
412
        then
 
413
#               CHECK_COMPILE_FLAG(C++,-mwindows,CXXFLAGS)
 
414
                ff_glut_ok=yes
 
415
 
 
416
                # FFCS: on Windows, FF crashes when compiling GL/glut.h and the option "--disable-opengl" is not
 
417
                # operational because ff_glut_ok is forced to yes here.
 
418
                if test $enable_ffcs = yes
 
419
                then
 
420
                    ff_glut_ok=no
 
421
                    enable_opengl=no
 
422
                fi
 
423
 
 
424
                ff_mingw=yes 
 
425
                enable_cygwindll=no;
 
426
                ff_pthread="-mthreads"
 
427
 
 
428
                # FFCS does not use the Cygwin MinGW compilers any more
 
429
                if test $enable_ffcs = no
 
430
                then
 
431
                    CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw"              
 
432
                    FFLAGS="$FFLAGS $ff_nocygwin"
 
433
                    CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw"
 
434
                    AC_COMPILE_IFELSE([AC_LANG_SOURCE([int a;])],[],
 
435
                        [ff_nocygwin="";
 
436
                            AC_MSG_NOTICE([Sorry $ff_nocygwin optio is wrong try whitout , but try with gcc-3.3])
 
437
                            ])
 
438
                    CXXFLAGS="$CXXFLAGS $ff_nocygwin -I/usr/include/mingw"              
 
439
                    FFLAGS="$FFLAGS $ff_nocygwin"
 
440
                    CFLAGS="$CFLAGS $ff_nocygwin -I/usr/include/mingw"
 
441
                    CNOFLAGS="$CNOFLAGS $ff_nocygwin -I/usr/include/mingw"
 
442
                fi
 
443
 
 
444
                LIBS="$LIBS $ff_nocygwin -mthreads -lws2_32 -lcomdlg32" 
 
445
                LIBSNOCONSOLE="-mwindows"
 
446
 
 
447
                # FFCS uses a specific compiler, so we specify its libraries explicitely
 
448
                if test $enable_ffcs = no
 
449
                then
 
450
                    test -z "$MPIRUN" &&  MPIRUN=`which mpiexe.exe` 
 
451
                    if test "$enable_fortran" != no  -o  "$with_flib" != no ;   then
 
452
                        case "$F77" in
 
453
                            *gfortran) FLIBS="$ff_nocygwin -lgfortran";;
 
454
                            *g77) FLIBS="$ff_nocygwin -lg2c";;
 
455
                            *)   AC_MSG_ERROR([ Sorry no known FLIBS with this $F77  !]) ;;
 
456
                        esac 
 
457
                    fi
 
458
                fi
 
459
 
 
460
                ff_glutname="glut32"
 
461
                #  check abort a existing function just to find in glut32.dll exist in the path 
 
462
                #  because glutInit is not the real symbol on win32 dur dur FH !!!!!!!!!
 
463
                AC_CHECK_LIB(glut32,abort,ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32",ff_glut="")
 
464
                if test -z "$ff_glut" ; then
 
465
                ff_glutname="freeglut"
 
466
                AC_CHECK_LIB(freeglut,abort,ff_glut="-l$ff_glutname -mthreads -lglu32 -lopengl32",ff_glut_ok=no)
 
467
                fi
 
468
                # Resources for FreeFem++-cs in Microsoft Windows format
 
469
                AC_SUBST(FFGLUTNAME,$ff_glutname)
 
470
                AC_SUBST(WINDRESOBJ,windres.o)
 
471
                AC_SUBST(LIBSNOCONSOLE,$LIBSNOCONSOLE)
 
472
                AC_SUBST(WIN32DLLTARGET,win32-dll-target)
 
473
                AC_DEFINE(PURE_WIN32,1,A pure windows applications no cygwin dll)
 
474
                ff_dynload=yes
 
475
        fi
 
476
 
 
477
 
 
478
        ;;
 
479
*)ff_win32=no;;
 
480
esac
 
481
AC_MSG_RESULT($ff_win32)
 
482
 
 
483
if test "$ff_win32" = no
 
484
then
 
485
        enable_cygwindll=no
 
486
fi
 
487
 
 
488
# FreeFem++-specific version information
 
489
# --------------------------------------
 
490
 
 
491
# Version numbering, converted to a floating point value
 
492
ff_numver="`echo $VERSION|sed 's/-\(.*\)/+\1.0*0.000001/'`"
 
493
AC_DEFINE_UNQUOTED(VersionFreeFempp,$ff_numver,FreeFem++ version as a float)
 
494
 
 
495
# Since src/fflib/strversionnumber.cpp is recreated at each build, this
 
496
# date is only useful for config-version.h
 
497
 
 
498
test "$prefix" = NONE && prefix="$ac_default_prefix"
 
499
ff_prefix_dir="${prefix}/lib/ff++/$VERSION"   
 
500
AC_MSG_CHECKING(prefix dir freefem++  )
 
501
AC_MSG_RESULT($ff_prefix_dir)    
 
502
 
 
503
FF_DATE=`date`
 
504
AC_DEFINE_UNQUOTED(VersionFreeFemDate,"$FF_DATE",FreeFem++ build date)
 
505
AC_DEFINE_UNQUOTED(FF_PREFIX_DIR,"${ff_prefix_dir}",FreeFem prefix  dir)
 
506
AC_SUBST(ff_prefix_dir,$ff_prefix_dir)
 
507
 
 
508
# Separate configuration header file for version information, included
 
509
# in config-macos9.h
 
510
 
 
511
cat << EOF > config-version.h
 
512
/* FreeFem++ version information for MacOS 9 configuration */
 
513
/* File generated by configure.ac */
 
514
 
 
515
/* Define to the full name and version of this package. */
 
516
#define PACKAGE_STRING "$PACKAGE_STRING"
 
517
 
 
518
/* Define to the one symbol short name of this package. */
 
519
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 
520
 
 
521
/* Define to the version of this package. */
 
522
#define PACKAGE_VERSION "$PACKAGE_VERSION"
 
523
 
 
524
/* Version number of package */
 
525
#define VERSION "$VERSION"
 
526
 
 
527
/* FreeFem++ build date */
 
528
#define VersionFreeFemDate "$FF_DATE"
 
529
 
 
530
/* FreeFem++ version as a float */
 
531
#define VersionFreeFempp ($ff_numver)
 
532
EOF
 
533
 
 
534
# Checking wether to produce a debug version
 
535
# ------------------------------------------
 
536
 
 
537
# Generic or hardware-dependant optimization
 
538
m4_include(acmacros.m4)
 
539
m4_include(acoptim.m4)
 
540
 
 
541
 
 
542
# ------------------------------
 
543
# compilation flags of FreeFem++ 
 
544
# ------------------------------
 
545
#  -DDRAWING  bamg active some drawing facility in bamg (inquire mesh)
 
546
#  -DBAMG_LONG_LONG active the use of  long long in bamg
 
547
#  -DDEBUG active the  checking in bamg  
 
548
#  -DNCHECKPTR remove check pointer facility 
 
549
#  -DCHECK_KN active subscripting of some array  
 
550
#  -DWITHCHECK of the dynamic type ckecking of the langague (very slow)
 
551
#  -DEIGENVALUE  to compile the eigen value part
 
552
#  ------------------------------------------------
 
553
 
 
554
# FreeFrem++-specific optimizations -fpascal-strings 
 
555
if test "$enable_debug" = yes;
 
556
then
 
557
        CXXFLAGS="$CXXFLAGS  -DBAMG_LONG_LONG -DCHECK_KN"
 
558
        if test "$ff_mac" = yes;
 
559
        then
 
560
                CXXFLAGS="$CXXFLAGS -fno-inline  -fexceptions"
 
561
        fi
 
562
else
 
563
        CXXFLAGS="$CXXFLAGS -DBAMG_LONG_LONG  -DNCHECKPTR"
 
564
        if test "$ff_mac" = yes;
 
565
        then
 
566
                CXXFLAGS="$CXXFLAGS "
 
567
        fi
 
568
fi
 
569
 
 
570
#whether or not to add a suffix to the package name
 
571
#--------------------------------------------------
 
572
 
 
573
AC_ARG_WITH(suffix,[  --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix to package name)])
 
574
 
 
575
AC_MSG_CHECKING(suffix to add to package name)  
 
576
ff_suffix=
 
577
if test "$with_suffix" = yes -o "$with_suffix" = no -o "$with_suffix" = ""
 
578
then
 
579
  AC_MSG_RESULT(none)
 
580
else
 
581
  ff_suffix="-$with_suffix"
 
582
  AC_MSG_RESULT($ff_suffix)
 
583
fi
 
584
AC_SUBST(ADD_PACKAGE_NAME,$ff_suffix)
 
585
 
 
586
 
 
587
 
 
588
 
 
589
# Checking that OpenGL is accessible
 
590
# ----------------------------------
 
591
 
 
592
ff_gl_ok=no
 
593
ff_glx_ok=no
 
594
 
 
595
ff_libs="$LIBS"
 
596
AC_ARG_WITH(flib,[  --with-flib= the fortran library ])
 
597
AC_ARG_ENABLE([opengl],AS_HELP_STRING([--enable-opengl],
 
598
                                      [Enable/disable support for OpenGL]))
 
599
 
 
600
# echo "  .... LIBS = $LIBS .... " 
 
601
if test x$enable_opengl != xno; then
 
602
# GL libraries seem to depend on some dlopen capabilities
 
603
if test "$enable_static" != yes -a "$ff_glut_ok" != yes
 
604
then
 
605
        # If we cannot find gl.h, no OpenGL version can be produced
 
606
    AC_CHECK_HEADERS(OpenGL/gl.h,
 
607
        ff_gl_ok=yes
 
608
        ,
 
609
        ff_gl_ok=no
 
610
        )
 
611
    
 
612
    
 
613
    if test "$ff_gl_ok" = no 
 
614
    then
 
615
        AC_CHECK_HEADERS(GL/gl.h,
 
616
            ff_gl_ok=yes
 
617
            ,
 
618
            ff_gl_ok=no
 
619
            )
 
620
    fi
 
621
    AC_CHECK_HEADERS(GLUT/glut.h,
 
622
        ff_glut_ok=yes,
 
623
        ff_glut_ok=no)
 
624
 
 
625
    if test "$ff_glut_ok" = no 
 
626
    then
 
627
        AC_CHECK_HEADERS(GL/glut.h,
 
628
            ff_glut_ok=yes,
 
629
            ff_glut_ok=no)
 
630
    fi
 
631
    
 
632
# GLUT .....
 
633
    if test "$ff_glut_ok" =     yes
 
634
    then                        
 
635
        for glut in \
 
636
            "-framework GLUT -framework OpenGL -framework Cocoa" \
 
637
            "-lglut -lGLU -lGL"         
 
638
        do
 
639
            ff_glut="$glut"
 
640
            ff_libs1="$LIBS"
 
641
            LIBS="$LIBS $ff_glut"
 
642
            AC_TRY_LINK_FUNC(glutInit,
 
643
                ff_glut_ok=yes
 
644
                LIBS="$ff_libs1"
 
645
                break,
 
646
                ff_glut_ok=next);
 
647
            LIBS="$ff_libs1"
 
648
        done    
 
649
    fi
 
650
    
 
651
 
 
652
fi
 
653
fi
 
654
AC_SUBST(LIBSPTHREAD,$ff_pthread)
 
655
 
 
656
if test "$ff_glut_ok" = yes
 
657
then
 
658
    AC_SUBST(LIBSGLUT,$ff_glut)
 
659
    if test -n  "$ff_pthread" ; then 
 
660
        ff_ffglutprog="ffglut${EXEEXT}"
 
661
        AC_DEFINE_UNQUOTED(PROG_FFGLUT,"$ff_ffglutprog", the ffglut application for the new graphics )
 
662
    fi
 
663
    ff_meditprog="ffmedit${EXEEXT}"
 
664
fi
 
665
# echo "  .... LIBS = $LIBS .... " 
 
666
 
 
667
 
 
668
 
 
669
AC_ARG_WITH(suffix,[  --with-suffix=[G3/G4/G4,P4,..] or --without-suffix (default no suffix package name)])
 
670
if test "$with_suffix" = yes
 
671
then
 
672
  with_suffix=""
 
673
elif test "$with_suffix" = no -o -z "$with_suffix" 
 
674
then
 
675
  with_suffix=""
 
676
else
 
677
  with_suffix="-$with_suffix"
 
678
fi
 
679
  AC_MSG_CHECKING(add suffix $with_suffix )     
 
680
  AC_SUBST(ADD_PACKAGE_NAME,$with_suffix)
 
681
  AC_MSG_RESULT(yes)
 
682
 
 
683
 
 
684
# Checking wether we can produce a parallel version
 
685
# -------------------------------------------------
 
686
 
 
687
if test $enable_ffcs = no
 
688
then
 
689
    # FF case
 
690
    m4_include(acmpi.m4)
 
691
else
 
692
    # FFCS - use the same MPI configuration choices as FFCS
 
693
    ff_mpi=yes
 
694
    AC_SUBST(MPICXX,$MPICXX)
 
695
    AC_SUBST(MPICC,$MPICC)
 
696
    AC_SUBST(MPIF77,$MPIF77)
 
697
    AC_SUBST(MPIFC,$MPIFC)
 
698
    AC_SUBST(MPIPROG,"FreeFem++-mpi${EXEEXT}")
 
699
    AC_SUBST(MPI_INCLUDE,"-I $MPI_INC_DIR")
 
700
    AC_SUBST(MPI_INC_DIR,$MPI_INC_DIR)
 
701
    AC_SUBST(MPI_LIB_DIRS,"")
 
702
    AC_SUBST(MPI_LIB,$MPI_LIB)
 
703
    AC_SUBST(MPI_LIBC,"")
 
704
    AC_SUBST(MPI_LIBFC,"")
 
705
 
 
706
    # Extra MPI-dependant configuration options that are set by FF during MPI configuration. FFCS - 25/2/13 - Fred
 
707
    # noticed that if PASTIX_HOSTARCH stays blank, pastix compilation breaks. At least i686_pc_linux and i686_mac are
 
708
    # accepted by pastix. So we just use $ac_build_alias which is much more reliable than $ff_HOSTARCH_pastix.
 
709
 
 
710
    AC_SUBST(PASTIX_HOSTARCH,$ac_build_alias)
 
711
 
 
712
    # these values should not be empty otherwise examples++-load/ff-get-dep will think that they are not defined
 
713
    AC_FF_ADDWHERELIB(mpi,-DDUMMY,-I$MPI_INC_DIR)
 
714
 
 
715
    # mpifc and mpif77 libraries should always be specified because FF never calls the Fortran MPI compiler. It always
 
716
    # uses mpicxx in [[file:examples++-load/ff-c++]]. The resulting Fortran libraries (eg Mumps) would compile even
 
717
    # without the proper Fortran libs, but they would not load properly.
 
718
 
 
719
    # under Win32, libmpi_f77.a is not the right name and ff/mingw/mpicxx adds the right libraries by itself
 
720
 
 
721
    if test $ff_win32 != yes
 
722
    then
 
723
        AC_FF_ADDWHERELIB(mpifc,-lmpi_f77,)
 
724
        AC_FF_ADDWHERELIB(mpif77,-lmpi_f77,)
 
725
    else
 
726
        AC_FF_ADDWHERELIB(mpifc,-DDUMMY,)
 
727
        AC_FF_ADDWHERELIB(mpif77,-DDUMMY,)
 
728
    fi
 
729
 
 
730
    # FFCS - MPI_DOUBLE_COMPLEX kept from original FF configure script
 
731
    AC_MSG_CHECKING( MPI_DOUBLE_COMPLEX)
 
732
    AC_COMPILE_IFELSE(
 
733
    [AC_LANG_SOURCE([
 
734
#include <mpi.h>
 
735
                MPI_Datatype xxxx=MPI_DOUBLE_COMPLEX;
 
736
                ])],
 
737
    ff_mpi_double_complex=yes,
 
738
    ff_mpi_double_complex=no)
 
739
    AC_MSG_RESULT($ff_mpi_double_complex)
 
740
    if test "$ff_mpi_double_complex" = yes  ; then
 
741
        AC_DEFINE(HAVE_MPI_DOUBLE_COMPLEX,1, mpi_double_complex)
 
742
    fi
 
743
fi
 
744
 
 
745
# FFCS needs to change some of the FF makefiles to compile without MPI on MacOS
 
746
AM_CONDITIONAL([FFCS_MPIOK],[test $ff_mpi = yes])
 
747
 
 
748
# Looking for useful configuration utilities
 
749
# ------------------------------------------
 
750
 
 
751
#getting utility software archives through the internet
 
752
AC_ARG_ENABLE(generic_blas,[  --enable-generic_blas     Downloadc generic blas (implie --enable-download)])
 
753
 
 
754
AC_ARG_ENABLE(download,[  --enable-download     Download missing libraries (BLAS,ARPACK,UMFPACK,FLTK)])
 
755
 
 
756
#replacing wget with another command
 
757
ff_wget_command="wget --no-check-certificate"
 
758
ff_wget=no
 
759
 
 
760
AC_ARG_WITH(wget,
 
761
        [  --with-wget=command  Replace "wget" with another command. Implies --enable-download],
 
762
           enable_download=yes
 
763
           ff_wget=yes
 
764
           ff_wget_command="${withval}")
 
765
 
 
766
ff_mkl_libpath=yes
 
767
AC_ARG_WITH(mkl,
 
768
        [  --with-mkl= the  MKL LIBPATH : (ie. /opt/intel/mkl/RR.r.y.xxx/lib/<arch>)],
 
769
           ff_mkl_libpath="${withval}")
 
770
 
 
771
 
 
772
if test "$enable_generic_blas" = yes
 
773
then
 
774
        enable_download=yes
 
775
fi
 
776
#  echo " ----------- $enable_download --"
 
777
# if enabling downloads find wget or curl to do download 
 
778
# ------------------------------------------------------
 
779
 
 
780
if test  "$ff_wget" =  no 
 
781
then
 
782
        ff_wget=""      
 
783
        AC_CHECK_PROG(ff_wget,wget --no-check-certificate,yes,no)
 
784
fi      
 
785
if test  "$ff_wget" = no 
 
786
then
 
787
        ff_wget_command="curl --fail -O "
 
788
        ff_curl=""
 
789
        AC_CHECK_PROG(ff_curl,curl -O,yes,no)
 
790
        ff_wget="$ff_curl"
 
791
fi
 
792
 
 
793
# for automatique compilation of 
 
794
# lib in download 
 
795
if test  "$ff_wget" != yes  -a "$enable_download"  = "yes"  ; then
 
796
  enable_download=no
 
797
  AC_MSG_ERROR([   enable-download and no wget or curl. ],1);  
 
798
fi
 
799
if test "$enable_download"  = "yes" ; then
 
800
DOWNLOADCOMPILE=compile-pkg
 
801
else
 
802
DOWNLOADCOMPILE=
 
803
fi 
 
804
 
 
805
AC_SUBST(WGET,$ff_wget_command)
 
806
AC_SUBST(DOWNLOADCOMPILE,$DOWNLOADCOMPILE)
 
807
 
 
808
#  modif FH -----
 
809
#  -- looking for cadna  
 
810
#  the round-off error propagation 
 
811
# the web site http://www-anp.lip6.fr/cadna/
 
812
#  --------------------
 
813
AC_ARG_WITH(cadna,[  --with-cadna= cadna library --without-cadna  ])
 
814
if test "$with_cadna" != no -o -n  "$with_cadna"
 
815
    then 
 
816
    ff_cadna="$with_cadna"
 
817
fi
 
818
ff_cadna_ok=no
 
819
if test "$with_cadna" != no  
 
820
    then 
 
821
    ff_libs_old="$LIBS"
 
822
    ff_ldflags_old="$LDFLAGS"
 
823
    ff_cadna_dir="${curdir}/download/cadna"
 
824
    LDFLAGS="$LDFLAGS -L$ff_cadna_dir"
 
825
    AC_CHECK_LIB(cadnafree,arit_zero,
 
826
        ff_cadna_ok=yes)
 
827
    AC_CHECK_HEADERS(${ff_cadna_dir}/cadnafree.h,
 
828
        ff_cadna_h=yes, ff_cadna_h=no)
 
829
    
 
830
    LIBS="$ff_libs_old"
 
831
    LDFLAGS="$ff_ldflags_old"    
 
832
    
 
833
    if test "$ff_cadna_ok" = yes  -a "$ff_cadna_h" = yes 
 
834
        then
 
835
        AC_DEFINE(HAVE_CADNA,1, freecadna is use to evalute the round-off error propagation )
 
836
        CPPFLAGS="$CPPFLAGS -I$ff_cadna_dir"
 
837
        LIBS=" -L$ff_cadna_dir -lcadnafree $ff_libs_old"
 
838
    else
 
839
        AC_MSG_NOTICE([ without cadna ***** ])
 
840
    fi
 
841
else
 
842
    AC_MSG_NOTICE([ without cadna ***** ])
 
843
fi
 
844
 
 
845
dnl  : Looking for the FFTW3
 
846
dnl --------------------------
 
847
AC_CHECK_LIB(fftw3,fftw_execute,ff_fftw_ok=yes)
 
848
AC_CHECK_HEADERS(fftw3.h,ff_fftw_h=yes, ff_fftw_h=no)
 
849
if test "$ff_fftw_ok" = yes -a "$ff_fftw_h" = yes
 
850
then
 
851
AC_FF_ADDWHERELIB(fftw3,-lfftw3,)
 
852
dnl    [echo fftw3 LD  -lfftw3   >>$ff_where_lib_conf]
 
853
fi
 
854
dnl ---------------------------
 
855
dnl   Looking for the tetgen
 
856
dnl --------------------------
 
857
AC_CHECK_LIB(tet,tetrahedralize,ff_fftet_ok=yes)
 
858
AC_CHECK_HEADERS(tetgen.h,ff_tet_h=yes, ff_tet_h=no)
 
859
if test "$ff_tet_ok" = yes -a "$ff_tet_h" = yes
 
860
then
 
861
   AC_FF_ADDWHERELIB(tetgen,-ltet,)
 
862
dnl    [echo tetgen LD  -ltet   >>$ff_where_lib_conf]
 
863
    AC_DEFINE(HAVE_TETGEN,1, tetgen is compute tetrahedralize volume of an enclosed surface)
 
864
fi
 
865
dnl ---------------------------
 
866
 
 
867
 
 
868
# Looking for the BLAS
 
869
# --------------------
 
870
ff_blas_ok=no
 
871
ff_blas_inc=""
 
872
# User-specified location
 
873
# add MKL  seach dec 2010  FH ....
 
874
 
 
875
ff_mkl_flags=""
 
876
if test "$ff_mkl_libpath" != "not" ; then
 
877
   ff_CFLAGS="$CFLAGS"
 
878
   CHECK_COMPILE_FLAG(C,-mkl,CFLAGS)
 
879
   if test  "$ff_CFLAGS" != "$CFLAGS" ; then
 
880
     ff_ff_mkl_flags="-mkl"
 
881
   fi
 
882
   CFLAGS="$ff_CFLAGS"
 
883
fi
 
884
 
 
885
AC_MSG_CHECKING(for MKL )
 
886
ff_mkl_root=""
 
887
if test "$ff_mkl_libpath" != "not" -a -z "$ff_mkl_flags" ; then
 
888
    if test "$ff_mkl_libpath"  = "yes"  ; then
 
889
        ff_IFS="$IFS"
 
890
        IFS=":"
 
891
        for i in $LD_LIBRARY_PATH:$LIBRARY_PATH ; do 
 
892
            case $i in 
 
893
                */mkl/*) ff_mkl_libpath=$i;;
 
894
            esac ;
 
895
        done;
 
896
      IFS="$ff_IFS"
 
897
    else 
 
898
        ff_mkl_libpath=no
 
899
    fi
 
900
    if test "$ff_mkl_libpath" != "no" -a -d "$ff_mkl_libpath" ; then
 
901
        ff_mkl_root=`expr "//$ff_mkl_libpath" : '//\(.*\)/lib/.*'`
 
902
        ff_mkl_arch=`expr "//$ff_mkl_libpath" : '//.*/lib/\(.*\)'`
 
903
        ff_mkl_lp=
 
904
        case "$ff_mkl_arch" in
 
905
            *64*)  ff_mkl_lp=_lp64
 
906
        esac
 
907
        case $F77 in
 
908
            *ifort*) ff_mkl_cc=intel;;
 
909
            *) ff_mkl_cc=gf;;
 
910
        esac
 
911
#   bof bof .... 
 
912
        case "$MPIRUN" in
 
913
        */sgi/*)         ff_mkl_mpi=_sgimpt;;
 
914
        */intel/*)         ff_mkl_mpi=_intelmpi;;
 
915
        *)        ff_mkl_mpi=_openmpi;;
 
916
        esac
 
917
#       echo ................  ff_mkl_root = $ff_mkl_root  .. $ff_mkl_arch
 
918
        if test  -f $ff_mkl_root/lib/$ff_mkl_arch/libmkl_rt.a ; then
 
919
          mkl_blas=rt
 
920
          mkk_lapack=rt 
 
921
          ff_mkl_mlt="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_rt -lmkl_intel_thread -lmkl_core  -liomp5 -lpthread"
 
922
          ff_mkl_blas="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_rt -lmkl_sequential -lmkl_core  -liomp5 -lpthread"
 
923
          ff_mkl_lapack="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_rt -lmkl_sequential -lmkl_core -liomp5 -lpthread"
 
924
        else 
 
925
        if test -f $ff_mkl_root/lib/$ff_mkl_arch/libmkl_lapack.a ; then
 
926
          ff_mkl_mlt="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_intel_thread  -lmkl_core -lguide  -lm -lpthread"
 
927
          ff_mkl_blas="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_${ff_mkl_cc}${ff_mkl_lp} -lmkl_lapack -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core -lguide -lm -lpthread"
 
928
          ff_mkl_lapack="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_lapack"
 
929
        else
 
930
          ff_mkl_mlt="-Wl,--start-group  -L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_${ff_mkl_cc}${ff_mkl_lp}  -lmkl_intel${ff_mkl_lp}  -lmkl_intel_thread  -lmkl_core -lmkl_intel_thread -liomp5  -Wl,--end-group  -lm -lpthread"
 
931
          ff_mkl_blas="-Wl,--start-group  -L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_${ff_mkl_cc}${ff_mkl_lp}  -lmkl_intel${ff_mkl_lp} -lmkl_sequential -lmkl_core  -lmkl_sequential -Wl,--end-group  -lm -lpthread"
 
932
          ff_mkl_lapack="$ff_mkl_blas"
 
933
        fi
 
934
        fi
 
935
        ff_mkl_scalapack="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp} "
 
936
        ff_mkl_blacs="-L$ff_mkl_root/lib/$ff_mkl_arch -lmkl_blacs${ff_mkl_mpi}${ff_mkl_lp} -lmkl_scalapack${ff_mkl_lp}"
 
937
        ff_blas_ok=yes
 
938
        ff_lapack_ok=yes
 
939
        ff_blas_libs="$ff_mkl_blas"
 
940
        ff_blas_inc="-I$ff_mkl_root/include"
 
941
dnl  scalapack, and blacs don not work with mlk and sgi 
 
942
     if test "$ff_mkl_mpi" != "_sgimpt" ; then  
 
943
        AC_FF_ADDWHERELIB(scalapack,$ff_mkl_scalapack,$ff_blas_inc)
 
944
        AC_FF_ADDWHERELIB(blacs,$ff_mkl_blacs,$ff_blas_inc)
 
945
     else
 
946
       ff_warm=" (We do not use MKL scalapack and blacs with sgi MPI),  " 
 
947
     fi
 
948
     AC_FF_ADDWHERELIB(lapack,$ff_mkl_lapack,$ff_blas_inc)
 
949
     AC_FF_ADDWHERELIB(mkl,$ff_mkl_mlt,$ff_blas_inc)
 
950
        
 
951
dnl     echo scalapack  LD  \'$ff_mkl_scalapack\'  >>$ff_where_lib_conf 
 
952
dnl     echo blacs  LD  \'$ff_mkl_blacs\'  >>$ff_where_lib_conf 
 
953
dnl     echo lapack  LD  \'$ff_mkl_lapack\'  >>$ff_where_lib_conf       
 
954
dnl     echo scalapack  INCLUDE  \'$ff_blas_inc\' >>$ff_where_lib_conf  
 
955
dnl     echo blacs  INCLUDE  \'$ff_blas_inc\' >>$ff_where_lib_conf      
 
956
dnl     echo lapack INCLUDE  \'$ff_blas_inc\' >>$ff_where_lib_conf      
 
957
    else 
 
958
        ff_mkl_libpath=no
 
959
        
 
960
        # FH - pardiso is there as soon as mkl is
 
961
        enable_pardiso=no
 
962
    fi
 
963
fi
 
964
 
 
965
 
 
966
AC_MSG_RESULT( [ $ff_warm  root: $ff_mkl_root , arch: $ff_mkl_arch , $ff_mkl_lp ...  ])
 
967
 
 
968
AC_ARG_WITH(blas,
 
969
    [  --with-blas=library      Use a specific version of the Blas],
 
970
        ff_blas_ok=yes
 
971
        ff_blas_libs="${withval}")
 
972
 
 
973
 
 
974
 
 
975
# Specific BLAS library location for FreeBSD
 
976
ff_freebsd_blas="-lf2c -lf77blas -latlas -lgslcblas"
 
977
#  zmach is in lapack 
 
978
# Trying  blas library
 
979
# echo "LIBS =  $LIBS blas --- $ff_blas_ok"
 
980
for iblas in \
 
981
     "-framework vecLib" "$ff_mkl_blas" "-lblas"  "-L/usr/lib/atlas -lblas" \
 
982
    $ff_freebsd_blas
 
983
do
 
984
#   
 
985
#"-L${curdir}/download/blas -lcblas -lf77blas" \
 
986
#"-L${curdir}/download/blas/ATLAS/lib/ff++ -lcblas -lf77blas -latlas" \ 
 
987
#"-L${curdir}/download/blas/WinNT_PPRO256 -lcblas -lf77blas -latlas" \
 
988
#
 
989
if test "$ff_blas_ok" = no;
 
990
then
 
991
        AC_MSG_CHECKING(for daxpy_ in $iblas)
 
992
        ff_save_libs="$LIBS"
 
993
        LIBS="$LIBS $iblas"
 
994
        AC_LINK_IFELSE(
 
995
                [AC_LANG_CALL(,daxpy_)],
 
996
                ff_blas_ok=yes
 
997
                ff_blas_libs="$iblas",)
 
998
                LIBS="$ff_save_libs"
 
999
        AC_MSG_RESULT($ff_blas_ok)
 
1000
fi
 
1001
done
 
1002
 
 
1003
 
 
1004
#cblas_zdotu_sub
 
1005
#echo "LIBS = " $LIBS
 
1006
ff_cblas_libs=no
 
1007
if test "$ff_blas_ok" = yes 
 
1008
then
 
1009
    AC_MSG_CHECKING(for blas_zdotu_sub in $ff_blas_libs)
 
1010
    ff_save_libs="$LIBS"
 
1011
    LIBS="$LIBS $ff_blas_libs $FLIBS"
 
1012
    AC_LINK_IFELSE(
 
1013
        [AC_LANG_CALL(,cblas_zdotu_sub)],
 
1014
        ff_cblas_libs=yes)
 
1015
    AC_MSG_RESULT($ff_cblas_libs)
 
1016
    LIBS="$ff_save_libs"        
 
1017
fi
 
1018
#echo "LIBS = " $LIBS
 
1019
# If all else fails, download!
 
1020
 
 
1021
if test "$ff_blas_ok" = no -a "$enable_download" = yes \
 
1022
    -a "$enable_fortran" != no -a "$enable_c" != no
 
1023
then
 
1024
    AC_CHECK_PROG(ff_unzip,unzip,yes,no)
 
1025
    
 
1026
    AC_MSG_CHECKING(for BLAS version to download)
 
1027
    
 
1028
        # Do not update $LIBS, but create an extra LIB variable,
 
1029
        # because this lib does not exist yet, and this could make the
 
1030
        # following tests fail.
 
1031
    
 
1032
        # When compiling a generic version, we do not need an
 
1033
        # optimized version of the BLAS.
 
1034
    
 
1035
#       if test "$enable_generic" = yes -o "$enable_generic_blas" = yes 
 
1036
#   supress the automatic compilation of atlas, to expencive  (FH version 3.0-5)
 
1037
    if true 
 
1038
    then
 
1039
        ff_download_blas=generic
 
1040
        ff_blas_libs="-L${curdir}/download/blas -lcblas -lf77blas"
 
1041
        ff_blas_inc="-I${curdir}/download/blas/CBLAS/src"
 
1042
        
 
1043
        AC_SUBST(GENERIC_BLAS,"libf77blas.a libcblas.a")
 
1044
        AC_SUBST(GENERIC_BLAS_BUILT_SOURCES,'BLAS CBLAS  $(F77BLAS_SOURCES) $(CBLAS_SOURCES)')
 
1045
    else
 
1046
                # There are precompiled versions for Windows. We cannot
 
1047
                # distinguish the different versions easily so we just
 
1048
                # download the most generic one. A more specific version can
 
1049
                # always be downloaded by hand.
 
1050
        
 
1051
                # BUG: at the moment, some necessary symbols are missing from
 
1052
                # the precompiled version (e.g. _dgemm_).
 
1053
        
 
1054
###     if test "$ff_win32" = yes -a "$enable_generic" = yes -a "$ff_unzip" = yes
 
1055
        if false
 
1056
        then
 
1057
            ff_download_blas=atlas-binary
 
1058
            ff_blas_libs="-L${curdir}/download/blas/WinNT_PPRO256 -lcblas -llapack -lf77blas -latlas"
 
1059
            ff_blas_inc="-I${curdir}/download/blas/WinNT_PPRO256"
 
1060
            ff_lapack_ok=ok
 
1061
        else
 
1062
 
 
1063
            # ALH - FFCS - 23/12/8 - ATLAS compilation does not work anymore on Linux
 
1064
            AC_MSG_ERROR(No BLAS library found - please install one or install Lapack)
 
1065
 
 
1066
            ff_download_blas=atlas-source
 
1067
            ff_blas_libs="-L${curdir}/download/blas/ATLAS/lib/ff++ -lcblas -llapack -lf77blas -latlas"
 
1068
            ff_blas_inc="-I${curdir}/download/blas/ATLAS/include"
 
1069
            ff_lapack_ok=ok
 
1070
        fi
 
1071
    fi
 
1072
 
 
1073
    AC_MSG_RESULT($ff_download_blas)
 
1074
    AC_SUBST(DOWNLOAD_BLAS,$ff_download_blas)
 
1075
    ff_blas_ok=yes
 
1076
    ff_cblas_h=yes
 
1077
    ff_cblas_libs=yes
 
1078
fi
 
1079
AC_SUBST(BLASLIBS,$ff_blas_libs)
 
1080
AC_SUBST(BLASINC,$ff_blas_inc)
 
1081
#looking for cblas.h  FH
 
1082
 
 
1083
if test "$ff_blas_ok" = yes -a "$ff_cblas_libs" = yes ;
 
1084
then
 
1085
    AC_CHECK_HEADERS(cblas.h,
 
1086
        ff_cblas_h=yes,
 
1087
        ff_cblas_h=no)
 
1088
    AC_CHECK_HEADERS(vecLib/cblas.h,
 
1089
        ff_cblas_h=yes
 
1090
        ff_cblas_h=no)
 
1091
    AC_CHECK_HEADERS(atlas/cblas.h,
 
1092
        ff_cblas_h=yes
 
1093
        ff_cblas_h=no)
 
1094
    
 
1095
fi
 
1096
 
 
1097
 
 
1098
# FFCS: do not specify the default BLAS LDADD if a specific one will be built in the download directory
 
1099
 
 
1100
if test "$ff_blas_ok" = yes && test "$ff_download_blas" = ""
 
1101
then
 
1102
    AC_FF_ADDWHERELIB(blas,$ff_blas_libs,)
 
1103
    dnl    echo blas LD  \'$ff_blas_libs\'  >>$ff_where_lib_conf
 
1104
fi
 
1105
 
 
1106
# end of BLAS -------------------
 
1107
 
 
1108
 
 
1109
# Looking for ARPACK
 
1110
# ------------------
 
1111
 
 
1112
# We need the following g77 libraries to connect to the Fortran 77
 
1113
# Arpack.
 
1114
 
 
1115
if test "$ff_blas_ok" = yes;
 
1116
then
 
1117
  ff_g2c_lib="$FLIBS"
 
1118
       if test  -n "$ff_g2c_lib"
 
1119
       then
 
1120
           LIBS="$LIBS $ff_g2c_lib"       
 
1121
       else 
 
1122
          ff_g2c_ok=no
 
1123
          AC_CHECK_LIB(g2c,G77_second_0,
 
1124
                LIBS="$LIBS -lg2c"
 
1125
                ff_g2c_lib="-lg2c"
 
1126
                ff_g2c_ok=yes)
 
1127
 
 
1128
          if test "$ff_g2c_ok" = no;
 
1129
             then
 
1130
                AC_MSG_CHECKING(for G77_second_0 in /sw/lib/libg2c.a)
 
1131
                ff_save_libs="$LIBS"
 
1132
                LIBS="$LIBS -L/sw/lib -lg2c"
 
1133
                AC_LINK_IFELSE(
 
1134
                        [AC_LANG_CALL(,G77_second_0)],
 
1135
                        ff_g2c_lib="-L/sw/lib -lg2c"
 
1136
                        ff_g2c_ok=yes,
 
1137
                        LIBS="$ff_save_libs")
 
1138
                AC_MSG_RESULT($ff_g2c_ok)
 
1139
          fi
 
1140
        fi
 
1141
fi
 
1142
 
 
1143
# Copy the result of g2c investigations into a separate variable
 
1144
# because BLAS compilation will need it.
 
1145
 
 
1146
AC_SUBST(G2CLIB,$ff_g2c_lib)
 
1147
#looking of  lapack if no compile the arpack lapack 
 
1148
# warning $$ because the make eat one 
 
1149
ff_lapack_ok=no;
 
1150
ff_lapack_lib=
 
1151
AC_MSG_CHECKING([for lapack in $LIBS, $ff_blas_libs and -llapack] )
 
1152
    if test "$ff_blas_ok" = yes ; then
 
1153
        AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], ff_lapack_ok=yes)
 
1154
        if test "$ff_lapack_ok" = no ; then
 
1155
            ff_save_libs=$LIBS    
 
1156
            LIBS="$ff_save_libs $ff_blas_libs"
 
1157
            AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], ff_lapack_ok=yes) 
 
1158
            if test "$ff_lapack_ok" = no ; then
 
1159
            LIBS="$ff_save_libs -llapack $ff_blas_libs"
 
1160
            AC_LINK_IFELSE( [AC_LANG_CALL(,dgeqr2_)], [ff_lapack_ok=yes
 
1161
            ff_lapack_lib="-llapack"] ) 
 
1162
            fi              
 
1163
            LIBS="$ff_save_libs"           
 
1164
        fi
 
1165
    fi
 
1166
 
 
1167
AC_MSG_RESULT($ff_lapack_ok)
 
1168
if test "$ff_lapack_ok" != no ; then
 
1169
AC_SUBST(LAPACKLIBS,$ff_lapack_libs)
 
1170
fi
 
1171
if test "$ff_lapack_ok" = no; then
 
1172
AC_ARG_WITH(lapack,
 
1173
        [  --with-lapack=library        Use a specific version of the Lapack],
 
1174
        ff_lapack_ok=yes
 
1175
        ff_lapack_lib="${withval}"
 
1176
        LIBS="$ff_lapack_lib $LIBS"
 
1177
)
 
1178
fi
 
1179
 
 
1180
ff_lapackdir='$$(LAPACKdir)'
 
1181
if  test "$ff_lapack_ok" = yes ; then
 
1182
  # no compilation of lapack in  arpack 
 
1183
  ff_lapackdir=
 
1184
  if test "$ff_lapack_ok" = yes   
 
1185
  then
 
1186
AC_FF_ADDWHERELIB(lapack,$ff_lapack_lib,)
 
1187
dnl      echo lapack LD  \'$ff_lapack_lib\'  >>$ff_where_lib_conf
 
1188
  fi   
 
1189
 
 
1190
else
 
1191
  ff_lapack_lib=-llapack
 
1192
fi
 
1193
# Arpack itself
 
1194
 
 
1195
ff_arpack_ok=no   
 
1196
ff_save_libs="$LIBS"
 
1197
ff_arpack_libs=
 
1198
if test "$ff_blas_ok" = yes;
 
1199
then
 
1200
 
 
1201
        # User-specified location
 
1202
        AC_ARG_WITH(arpack,
 
1203
                [  --with-arpack=library        Use a specific version of Arpack],
 
1204
                ff_arpack_ok=yes
 
1205
                ff_arpack_libs="${withval}")
 
1206
 
 
1207
        # Default locations
 
1208
        if test "$ff_arpack_ok" = no;
 
1209
        then
 
1210
                AC_CHECK_LIB(arpack,dsaupd_,
 
1211
                        ff_arpack_libs="-larpack -llapack"
 
1212
                        ff_arpack_ok=yes,,
 
1213
                        -llapack)
 
1214
        fi
 
1215
 
 
1216
   # Trying to "locate" Arpack
 
1217
   if test "$ff_arpack_ok" = no -a "$enable_download" != yes ;
 
1218
   then
 
1219
        AC_MSG_CHECKING(for libarpack with locate)
 
1220
        ff_lib_arpack=`locate libarpack|grep  'libarpack.*.a$'|head -1`
 
1221
        LIBS="$ff_lib_arpack $LIBS"
 
1222
        AC_LINK_IFELSE(
 
1223
                [AC_LANG_CALL(,dsaupd_)],
 
1224
                ff_arpack_ok=yes
 
1225
                ff_arpack_libs="$ff_lib_arpack")
 
1226
        AC_MSG_RESULT($ff_arpack_ok)
 
1227
    fi
 
1228
  if test "$ff_arpack_ok" = yes 
 
1229
  then
 
1230
      AC_FF_ADDWHERELIB(arpack,$ff_arpack_libs,)
 
1231
      echo  arpack LD "'$ff_arpack_libs'"  >>$ff_where_lib_conf
 
1232
  fi   
 
1233
  
 
1234
        # If all else fails, download!
 
1235
        if test "$ff_arpack_ok" = no -a "$enable_download" = yes \
 
1236
           -a "$enable_fortran" != no
 
1237
        then
 
1238
                ff_arpack_download=yes
 
1239
                AC_MSG_NOTICE(using downloaded Arpack)
 
1240
                AC_SUBST(DOWNLOAD_ARPACK,arpack)
 
1241
                AC_SUBST(FF_LAPACKdir,$ff_lapackdir)
 
1242
                AC_SUBST(ARPACKLIB,${curdir}/download/lib/libarpack.a)
 
1243
                AC_SUBST(LAPACK_arpack_LIB,${curdir}/download/lib/liblapack.a)
 
1244
 
 
1245
                # Do not update $LIBS, but create an extra LIB variable,
 
1246
                # because this lib does not exist yet, and this could make the
 
1247
                # following tests fail.
 
1248
                ff_arpack_libs="-L${curdir}/download/lib -larpack  $ff_lapack_lib"
 
1249
                ff_arpack_ok=yes
 
1250
        fi
 
1251
fi
 
1252
if test  "$ff_arpack_ok" != yes 
 
1253
 then
 
1254
            AC_MSG_NOTICE([-- NO ARPACK --  enable_download : $enable_download , wget: $ff_wget ])
 
1255
fi
 
1256
 
 
1257
# Do not insert ARPACK libs in $LIBS yet, because they may not exist
 
1258
# yet, and this could make the following tests fail.
 
1259
 
 
1260
LIBS="$ff_save_libs"
 
1261
 
 
1262
if test "$ff_arpack_ok" = yes;
 
1263
then
 
1264
        AC_SUBST(ARPACKLIBS,$ff_arpack_libs)
 
1265
        EIGENOBJ='eigenvalue.$(OBJEXT)'
 
1266
        AC_DEFINE(HAVE_LIBARPACK,1,Arpack is used for eigenvalue computation)
 
1267
 
 
1268
        # Determines whether to run the eigenvalue tests
 
1269
else 
 
1270
# all eigen test fails 
 
1271
        AC_SUBST([SKIP_TESTS_EIGEN],[yes])
 
1272
fi
 
1273
AC_SUBST([EIGENOBJ])
 
1274
 
 
1275
# Looking for UMFPACK
 
1276
# -------------------
 
1277
 
 
1278
ff_amd_ok=no
 
1279
ff_umfpack_ok=no
 
1280
ff_save_libs="$LIBS"
 
1281
if test "$ff_blas_ok" = yes;
 
1282
then
 
1283
        # User-specified location
 
1284
        AC_ARG_WITH(amd,
 
1285
                [  --with-amd=library   Use a specific version of AMD],
 
1286
                ff_amd_ok=yes
 
1287
                ff_umfpack_libs="${withval}")
 
1288
 
 
1289
        AC_ARG_WITH(umfpack,
 
1290
                [  --with-umfpack=library       Use a specific version of Umfpack],
 
1291
                ff_umfpack_ok=yes
 
1292
                ff_umfpack_libs="${withval} $ff_umfpack_libs"
 
1293
               )
 
1294
#               AC_DEFINE(HAVE_LIBUMFPACK,1,
 
1295
#                       Umfpack is used for sparse matrices computations))
 
1296
 
 
1297
        # Trying default locations
 
1298
 
 
1299
        AC_CHECK_HEADERS(umfpack.h umfpack/umfpack.h ufsparse/umfpack.h suitesparse/umfpack.h,
 
1300
            ff_umfpack_header=yes
 
1301
            ff_umfpack_dir=`dirname $ac_header`)
 
1302
 
 
1303
        # Somes systems like FreeBSD hide umfpack.h in a directory
 
1304
        # called UMFPACK (all capitals). This breaks the standard
 
1305
        # #define produced by autoconf in config.h.in.
 
1306
 
 
1307
        if test "$ff_umfpack_header" != yes;
 
1308
        then
 
1309
                AC_CHECK_HEADER(UMFPACK/umfpack.h,
 
1310
                        ff_umfpack_header=yes
 
1311
                        ff_umfpack_dir=UMFPACK
 
1312
                        AC_DEFINE(HAVE_BIG_UMFPACK_UMFPACK_H,1,
 
1313
                                If umfpack.h is located in UMFPACK subdir))
 
1314
        fi
 
1315
        LIBS="$ff_blas_libs $LIBS"
 
1316
        if test "$ff_amd_ok" = no;
 
1317
        then
 
1318
                AC_CHECK_LIB(amd,amd_info,
 
1319
                        ff_umfpack_libs="$ff_umfpack_libs -lamd"
 
1320
                        ff_amd_ok=yes)
 
1321
        fi
 
1322
 
 
1323
        if test "$ff_umfpack_ok" = no -a "$ff_amd_ok" = yes;
 
1324
        then        
 
1325
                AC_CHECK_LIB(umfpack,umf_i_malloc,
 
1326
                        ff_umfpack_libs=" -lumfpack $ff_umfpack_libs"
 
1327
                        ff_umfpack_ok=yes,,$ff_umfpack_libs)
 
1328
                if test "$ff_umfpack_ok" != yes -o "$ff_umfpack_header" != yes ; then
 
1329
                        AC_MSG_WARN([           Sorry we find UMFPACK lib but not the include umfpack.h file])
 
1330
                fi
 
1331
        fi      
 
1332
        if  test         "$ff_umfpack_header" != yes -a "$ff_umfpack_ok" != no; then
 
1333
            ff_umfpack_ok=no
 
1334
         fi
 
1335
         if test "$ff_umfpack_ok" = yes -a "$ff_amd_ok" = yes; then
 
1336
                AC_DEFINE(HAVE_LIBUMFPACK,1, Umfpack is used for sparse matrices computations )                 
 
1337
         fi
 
1338
fi
 
1339
 
 
1340
# FFCS - moved UMFPACK configuration settings in wherelib to _after_ configuring the download version, and removed
 
1341
# -I/usr/include/$ff_umfpack_dir from include options because it breaks the MingW64 compilation process.
 
1342
 
 
1343
#if test $enable_ffcs = yes
 
1344
#then
 
1345
    if test "$ff_umfpack_ok" = yes 
 
1346
    then
 
1347
        AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,-I/usr/include/$ff_umfpack_dir)
 
1348
        AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,-I/usr/include/$ff_umfpack_dir)
 
1349
 
 
1350
        dnl      echo  amd LD \'$ff_umfpack_libs\'  >>$ff_where_lib_conf
 
1351
        dnl      echo  amd INCLUDE  \'-I/usr/include/$ff_umfpack_dir\'  >>$ff_where_lib_conf
 
1352
        dnl      echo  umfpack LD  '$ff_umfpack_libs\'   >>$ff_where_lib_conf     
 
1353
        dnl       echo  umfpack  INCLUDE  \'-I/usr/include/$ff_umfpack_dir\'  >>$ff_where_lib_conf
 
1354
    fi   
 
1355
#fi
 
1356
 
 
1357
LIBS="$ff_save_libs"
 
1358
 
 
1359
 
 
1360
# If all else fails, download!
 
1361
if test "$ff_umfpack_ok" = no -a "$enable_download" = yes 
 
1362
   then
 
1363
        AC_MSG_NOTICE(using downloaded UMFPACK)
 
1364
        AC_SUBST(DOWNLOAD_UMFPACK,"umfpack cholmod")
 
1365
        ff_umfpack_download=yes
 
1366
        # Do not update $LIBS, but create an extra LIB variable,
 
1367
        # because this lib does not exist yet, and this could make the
 
1368
        # following tests fail.
 
1369
 
 
1370
        ff_umfpack_libs="-L${curdir}/download/lib -lumfpack -lcholmod -lcolamd -lamd -lsuitesparseconfig"
 
1371
        AC_DEFINE(HAVE_LIBUMFPACK,1,UMFPACK)
 
1372
        if test "$ff_win32" = yes; then
 
1373
        AC_SUBST(FF_UMFPACK_CONFIG,-DCBLAS)
 
1374
        fi
 
1375
        ff_umfpack_ok=yes
 
1376
fi
 
1377
 
 
1378
# FFCS - moved UMFPACK configuration settings in wherelib to _after_ configuring the download version, and removed
 
1379
# -I/usr/include/$ff_umfpack_dir from include options because it breaks the MingW64 compilation process.
 
1380
 
 
1381
## if test $enable_ffcs = yes && test "$ff_umfpack_ok" = yes 
 
1382
if  test "$ff_umfpack_ok" = yes 
 
1383
then
 
1384
    AC_FF_ADDWHERELIB(amd,$ff_umfpack_libs,)
 
1385
    AC_FF_ADDWHERELIB(umfpack,$ff_umfpack_libs,)
 
1386
fi   
 
1387
 
 
1388
if test "$ff_umfpack_ok" = no
 
1389
then
 
1390
         AC_MSG_NOTICE( -- NOT  UMFPACK  ff_wget = $ff_wget)
 
1391
fi
 
1392
 
 
1393
AC_SUBST(UMFPACKLIBS,$ff_umfpack_libs)
 
1394
 
 
1395
# Checking for some functions that may not appear everywhere
 
1396
# ----------------------------------------------------------
 
1397
AC_CHECK_HEADERS([unistd.h])
 
1398
# asinh acosh atanh are not in Mingw yet gettimeofday
 
1399
ff_malloc_h=""
 
1400
AC_HEADER_TIME
 
1401
AC_CHECK_HEADERS(malloc.h,ff_malloc_h=1)
 
1402
AC_SUBST(FF_MALLOC_H,$ff_malloc_h)
 
1403
AC_CHECK_FUNCS(asinh acosh atanh getenv jn erfc tgamma gettimeofday)
 
1404
AC_CHECK_FUNCS(srandomdev)
 
1405
 
 
1406
AC_CHECK_FUNCS(second_,ff_second="",ff_second=second.o)
 
1407
AC_SUBST(FF_SECOND,"$ff_second")
 
1408
 
 
1409
# If times() and sysconf() are not here, UMFPACK should know
 
1410
if test "$ff_umfpack_ok" = yes
 
1411
then
 
1412
        AC_CHECK_FUNCS(times sysconf,
 
1413
                             ff_umfpack_posix_ok=yes,
 
1414
                             ff_umfpack_posix_ok=no)
 
1415
        if test "$ff_umfpack_posix_ok" = no
 
1416
        then
 
1417
                AC_SUBST(FF_UMFPACK_CONFIG,"-DCBLAS -DNPOSIX")
 
1418
        fi
 
1419
fi
 
1420
 
 
1421
# Enable static linking (no shared libraries)
 
1422
# -------------------------------------------
 
1423
AC_CHECK_PROG(ff_libtool,libtool,yes,no)        
 
1424
if test  "$ff_mac" = "yes"  -a "$ff_libtool" = yes ; then  
 
1425
  ff_AR="libtool"
 
1426
  ff_ARFLAGS="-static -o"
 
1427
  ff_RANLIB="echo" 
 
1428
fi
 
1429
 
 
1430
AC_ARG_ENABLE(static,
 
1431
        [  --enable-static      Build binaries with no shared library dependencies])
 
1432
if test "$enable_static" = yes
 
1433
then
 
1434
        AC_CHECK_PROG(ff_libtool,libtool,yes,no)
 
1435
        if test "$ff_libtool" = yes
 
1436
        then
 
1437
                LDFLAGS="$LDFLAGS -all-static"
 
1438
                AC_SUBST(STATICTOOL,libtool)
 
1439
        else
 
1440
                AC_MSG_ERROR(libtool not found)
 
1441
        fi
 
1442
fi
 
1443
#  for compiation of  arpack  use libtool to bluid universal library on MacOs. 
 
1444
AC_SUBST(AR,$ff_AR)
 
1445
AC_SUBST(ARFLAGS,$ff_ARFLAGS)
 
1446
AC_SUBST(RANLIN,$ff_RANLIB)
 
1447
 
 
1448
 
 
1449
# Dynamic loading of compiled functions
 
1450
# -------------------------------------
 
1451
 
 
1452
# Not if we don't want shared libraries (non FH  modif FH juin 2005)
 
1453
ff_dynload=no
 
1454
if test "$enable_static" != yes
 
1455
then
 
1456
 
 
1457
        # Availability of dlopen(). Use AC_COMPILE rather than
 
1458
        # AC_CHECK_HEADERS because the latter has problems seeing it (in
 
1459
        # Cygwin) when it does not compile (in Mingw).
 
1460
 
 
1461
        AC_MSG_CHECKING(for dlfcn.h)
 
1462
        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <dlfcn.h>]])],
 
1463
                ff_dynload=yes,
 
1464
                ff_dynload=no)
 
1465
        AC_MSG_RESULT($ff_dynload)
 
1466
fi
 
1467
 
 
1468
# FFCS - -lm missing for ffmedit link stage on Debian Testing
 
1469
AC_CHECK_LIB(m,sin)
 
1470
 
 
1471
# Checks that we also have the corresponding library
 
1472
if test "$ff_dynload" = yes
 
1473
then
 
1474
        AC_CHECK_LIB(dl,dlinfo)
 
1475
 
 
1476
        # Checks that everythings works ok
 
1477
        AC_MSG_CHECKING(whether dlopen links ok)
 
1478
        AC_LINK_IFELSE(
 
1479
[AC_LANG_SOURCE([[#include <dlfcn.h>
 
1480
int main(int argc,char **argv){
 
1481
  dlopen("",RTLD_LAZY);
 
1482
  return 0;
 
1483
}]])],
 
1484
        ff_dynload=yes,
 
1485
        ff_dynload=no)
 
1486
        AC_MSG_RESULT($ff_dynload)
 
1487
fi
 
1488
 
 
1489
#  the -rdynamic don't exist on macos and sunOS
 
1490
if test "$ff_dynload" = yes
 
1491
then
 
1492
        AC_DEFINE(HAVE_DLFCN_H,1,Dynamic loading - not mandatory)
 
1493
        # Activate dynamic loading tests (see examples++-load/Makefile.am)
 
1494
        AC_SUBST(LOAD_TESTS,../regtests.sh)
 
1495
        AC_SUBST(LOAD_COMPILE,load_compile)
 
1496
 
 
1497
        # gcc on MacOS does not produce an error with "-rdynamic" but
 
1498
        # still complains about it.
 
1499
        if test "$ff_mac" = "no" -a "$ff_win32"  = "no" -a "$ff_sunos"  = "no" ;
 
1500
        then
 
1501
                CHECK_COMPILE_FLAG(C++,-rdynamic,LDFLAGS)
 
1502
dnl             CHECK_COMPILE_FLAG(C,-rdynamic,CNOFLAGS)
 
1503
dnl             CHECK_COMPILE_FLAG(C,-rdynamic,CFLAGS)
 
1504
        fi
 
1505
        CHECK_COMPILE_FLAG(C++,-fPIC,CXXFLAGS)
 
1506
        CHECK_COMPILE_FLAG(C,-fPIC,CFLAGS)
 
1507
        CHECK_COMPILE_FLAG(C,-fPIC,CNOFLAGS)
 
1508
        if test "$enable_fortran" != no 
 
1509
         then 
 
1510
         CHECK_COMPILE_FLAG(Fortran,-fPIC,FFLAGS)       
 
1511
         CHECK_COMPILE_FLAG(Fortran,-fPIC,FNOFLAGS)     
 
1512
         CHECK_COMPILE_FLAG(Fortran,-fPIC,FCFLAGS)      
 
1513
         CHECK_COMPILE_FLAG(Fortran,-fPIC,FCNOFLAGS)    
 
1514
dnl      CHECK_COMPILE_FLAG(Fortran,-rdynamic,FNOFLAGS)
 
1515
dnl      CHECK_COMPILE_FLAG(Fortran,-rdynamic,FFLAGS)
 
1516
 
 
1517
        fi
 
1518
fi
 
1519
AC_SUBST(DYLIB_SUFFIX,$ff_suffix_dylib)
 
1520
 
 
1521
# Checking wether we can generate some documentation
 
1522
# --------------------------------------------------
 
1523
 
 
1524
AC_CHECK_PROG(ff_latex,latex,yes,no)
 
1525
AC_CHECK_PROG(ff_makeindex,makeindex,yes,no)
 
1526
AC_CHECK_PROG(ff_dvips,dvips,yes,no)
 
1527
# to translate the figure 
 
1528
AC_CHECK_PROG(ff_pdf2ps,pdf2ps,yes,no)
 
1529
AC_CHECK_PROGS(EPSTOPDF,[epstopdf pstopdf],[false])
 
1530
AC_CHECK_PROG(ff_convert,convert,yes,no)
 
1531
if test "$ff_latex" = yes -a "$ff_makeindex" = yes -a "$ff_dvips" = yes -a $ff_pdf2ps = yes -a $ff_convert = yes;
 
1532
then
 
1533
        AC_SUBST(DOCPS,"freefem++doc.ps")
 
1534
 
 
1535
        AC_CHECK_PROG(ff_gzip,gzip,yes,no)
 
1536
        if test "$ff_gzip" = yes;
 
1537
        then
 
1538
                AC_SUBST(DOCPSGZ,"freefem++doc.ps.gz")
 
1539
        fi
 
1540
fi
 
1541
 
 
1542
# PDF documentation building sometimes poses problems because of
 
1543
# pdfsync.sty. So we need to be able to disable it.
 
1544
enable_pdf=yes
 
1545
AC_ARG_ENABLE(pdf,[  --disable-pdf      Disable PDF documentation building])
 
1546
if test "$enable_pdf" != no
 
1547
then
 
1548
   AC_CHECK_PROG(ff_pdflatex,pdflatex,yes,no)
 
1549
   if test "$ff_pdflatex" = yes -a $EPSTOPDF != false -a $ff_convert = yes;
 
1550
   then
 
1551
        AC_SUBST(DOCPDF,"freefem++doc.pdf")
 
1552
   fi
 
1553
fi
 
1554
 
 
1555
# HISTORY logging through CVS, but only if we are in a CVS working area
 
1556
if test -d CVS
 
1557
then
 
1558
        AC_CHECK_PROG(ff_history,cvs2cl,yes,no)
 
1559
        if test "$ff_history" = yes
 
1560
        then
 
1561
           AC_SUBST(HISTORY,history)
 
1562
        fi
 
1563
fi
 
1564
 
 
1565
# Choosing compilation options for the standard version (in src/std)
 
1566
# ------------------------------------------------------------------
 
1567
 
 
1568
# The "standard" configured version can use win32 (mingw) 
 
1569
 
 
1570
if test "$ff_mingw" = yes 
 
1571
then
 
1572
 
 
1573
    # FFCS does not use FreeFem++-std, and Pcrgraph.cpp does not compile under mingwin64
 
1574
    if test $enable_ffcs = no
 
1575
    then
 
1576
        ff_stdprog="FreeFem++-std${EXEEXT}"
 
1577
        ff_std_graph_obj=Pcrgraph.$OBJEXT
 
1578
    fi
 
1579
 
 
1580
    # ALH - FFCS - 30/11/8 - I need to get the output from FF for FFCS regression tests
 
1581
    if test $enable_ffcs = yes
 
1582
    then
 
1583
        ff_std_ldflags="-mconsole -mwindows"
 
1584
    else
 
1585
        ff_std_ldflags=-mwindows
 
1586
    fi
 
1587
 
 
1588
        ff_std_libs=
 
1589
fi
 
1590
AC_SUBST(STD_GRAPH_OBJ,$ff_std_graph_obj)
 
1591
AC_SUBST(STD_LDFLAGS,$ff_std_ldflags)
 
1592
 
 
1593
AC_SUBST(STD_LIBS,$ff_std_libs)
 
1594
 
 
1595
# Can we produce an IDE?
 
1596
# ----------------------
 
1597
 
 
1598
# For development purposes, we may need to use X libraries instead of
 
1599
# native libraries (mainly to run the programs remotely)
 
1600
#  AC_ARG_WITH(fltk,[  --without-fltk   (to suppress explicity    --enable-download imply --with-fltk ) ])
 
1601
#  AC_ARG_WITH(xfltk,[  --with-xfltk    When recompiling FLTK, use X libraries instead of native Win32 or MacOS])
 
1602
#  remove all fltk stuff
 
1603
# to remove of FLTK
 
1604
#AC_MSG_NOTICE(without ide/ fltk ..... Please wait the next version.... ) 
 
1605
if test 0 != 0 
 
1606
 then  
 
1607
if test "$with_fltk" = no 
 
1608
then 
 
1609
     ff_fltk=no
 
1610
        AC_MSG_NOTICE(without FLTK sorry in next no ide today ) 
 
1611
else
 
1612
# under mingw use download fltk version
 
1613
if test "$ff_mingw" = yes 
 
1614
then
 
1615
        AC_MSG_NOTICE(under mingw not using default FLTK)
 
1616
 enable_default_fltk=no 
 
1617
fi
 
1618
 
 
1619
# Default FLTK (in the machine's default PATH)
 
1620
if test "$enable_default_fltk" = no
 
1621
then
 
1622
        AC_MSG_NOTICE(not using default FLTK)
 
1623
        ff_fltk=no
 
1624
else
 
1625
 
 
1626
        # Checks that fltk-config exists
 
1627
        ff_fltk_config=fltk-config
 
1628
        AC_CHECK_PROG(ff_fltk,fltk-config,yes,no)
 
1629
 
 
1630
        # Checks that FLTK is compiled with threads enabled
 
1631
        AC_MSG_CHECKING(that FLTK is compiled with threads)
 
1632
        AC_COMPILE_IFELSE(
 
1633
[AC_LANG_SOURCE([[#include <FL/Fl.H>
 
1634
main(){
 
1635
  Fl::lock();
 
1636
}
 
1637
]])],
 
1638
                ff_fltk_threads=yes,
 
1639
                ff_fltk_threads=no)
 
1640
        AC_MSG_RESULT($ff_fltk_threads)
 
1641
        if test "$ff_fltk_threads" = no
 
1642
        then
 
1643
                ff_fltk=no
 
1644
                AC_MSG_NOTICE(not using default FLTK because it does not know threads)
 
1645
        fi      
 
1646
fi
 
1647
 
 
1648
# Downloading and compiling FLTK
 
1649
if test "$ff_fltk" = no -a "$enable_download" = yes
 
1650
then
 
1651
        AC_MSG_NOTICE(using downloaded FLTK)
 
1652
        AC_SUBST(DOWNLOAD_FLTK,fltk)
 
1653
        ff_fltk_version=1.1.6
 
1654
        AC_SUBST(FLTK_VERSION,$ff_fltk_version)
 
1655
        ff_fltk_config="$curdir/download//bin/fltk-config"
 
1656
        ff_fltk=yes
 
1657
fi
 
1658
 
 
1659
if test "$ff_fltk" = yes
 
1660
then
 
1661
        # For the moment, FreeFem++-ide${EXEEXT} is not built
 
1662
        # because it first needs FreeFEM++ to accept several
 
1663
        # successive runs without restart.
 
1664
        
 
1665
        ff_ideprog="FreeFem++-ide${EXEEXT} FreeFem++-cs${EXEEXT} FreeFem++-client${EXEEXT} FreeFem++-server${EXEEXT}"
 
1666
        ff_idetest="./testhighlight.sh"
 
1667
        ff_testideprog="testhighlight${EXEEXT}"
 
1668
        if test "$enable_cygwindll" = yes 
 
1669
         then
 
1670
           AC_SUBST(FLTK_CONFIG_PARAM,"--enable-localzlib --enable-cygwin")
 
1671
        elif test "$ff_mingw" = yes 
 
1672
         then
 
1673
           AC_SUBST(FLTK_CONFIG_PARAM,"--enable-localzlib --disable-cygwin")
 
1674
        else
 
1675
           AC_SUBST(FLTK_CONFIG_PARAM,"--disable-cygwin")
 
1676
        fi
 
1677
 
 
1678
        AC_SUBST(FLTK_CONFIG,$ff_fltk_config)
 
1679
 
 
1680
 
 
1681
fi
 
1682
fi
 
1683
# end of remove fltk
 
1684
fi 
 
1685
# Flex compatibility with Bison
 
1686
# -----------------------------
 
1687
 
 
1688
# If Flex does not know Bison options, it cannot deal with
 
1689
# src/ide/hl_lex.l++. So we need to make src/ide/hl_lex.c++ up-to-date
 
1690
# by hand (under Cygwin, "cvs update" does not make hl_lex.c++ newer
 
1691
# than hl_lex.l++ even if it was when a commit was done).
 
1692
AC_MSG_CHECKING(flex compatibility with bison)
 
1693
if test `flex --help|fgrep bison|wc -l` = 0
 
1694
then
 
1695
        AC_MSG_RESULT(no)
 
1696
        touch src/ide/hl_lex.c++
 
1697
else
 
1698
        AC_MSG_RESULT(yes)
 
1699
fi
 
1700
 
 
1701
# Allow some downloaded tools not to be compiled
 
1702
# ----------------------------------------------
 
1703
 
 
1704
# $1 = tool name, $2 = dynamic library name, $3 = download directory name if different from $1
 
1705
m4_define([FFCS_DISABLE_DOWNLOAD],
 
1706
    [AC_ARG_ENABLE($1,[  --disable-$1      Do not download $1])
 
1707
    if test "$enable_$1" = "no"
 
1708
    then
 
1709
        AC_SUBST([FFCS_COMPILE_$1],"")
 
1710
        AC_SUBST([FFCS_DYLIB_$1],"")
 
1711
    else
 
1712
        AC_SUBST([FFCS_COMPILE_$1],ifelse($3,,$1,$3))
 
1713
        AC_SUBST([FFCS_DYLIB_$1],$2)
 
1714
    fi
 
1715
])
 
1716
 
 
1717
 
 
1718
FFCS_DISABLE_DOWNLOAD(fflapack,fflapack.$DYLIB_SUFFIX)
 
1719
#  move FFCS_DISABLE_DOWNLOAD gls  , after find gsl ... 
 
1720
FFCS_DISABLE_DOWNLOAD(hips,hips_FreeFem.$DYLIB_SUFFIX)
 
1721
FFCS_DISABLE_DOWNLOAD(hypre,hypre.$DYLIB_SUFFIX)
 
1722
FFCS_DISABLE_DOWNLOAD(ipopt,ff-Ipopt.$DYLIB_SUFFIX)
 
1723
FFCS_DISABLE_DOWNLOAD(lapack,lapack.$DYLIB_SUFFIX)
 
1724
FFCS_DISABLE_DOWNLOAD(mmg3d,mmg3d-v4.0.$DYLIB_SUFFIX)
 
1725
FFCS_DISABLE_DOWNLOAD(mshmet,mshmet.$DYLIB_SUFFIX)
 
1726
FFCS_DISABLE_DOWNLOAD(mumps,"MUMPS_FreeFem.$DYLIB_SUFFIX MUMPS.$DYLIB_SUFFIX")
 
1727
FFCS_DISABLE_DOWNLOAD(mumps_seq,MUMPS_seq.$DYLIB_SUFFIX,mumps-seq)
 
1728
FFCS_DISABLE_DOWNLOAD(parms,parms_FreeFem.$DYLIB_SUFFIX)
 
1729
FFCS_DISABLE_DOWNLOAD(pastix,"interfacepastix.$DYLIB_SUFFIX complex_pastix_FreeFem.$DYLIB_SUFFIX real_pastix_FreeFem.$DYLIB_SUFFIX")
 
1730
FFCS_DISABLE_DOWNLOAD(scotch,scotch.$DYLIB_SUFFIX)
 
1731
FFCS_DISABLE_DOWNLOAD(superludist,"complex_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX real_SuperLU_DIST_FreeFem.$DYLIB_SUFFIX dSuperLU_DIST.$DYLIB_SUFFIX")
 
1732
FFCS_DISABLE_DOWNLOAD(yams,freeyams.$DYLIB_SUFFIX)
 
1733
FFCS_DISABLE_DOWNLOAD(pipe,pipe.$DYLIB_SUFFIX)
 
1734
 
 
1735
# FFCS - MUMPS_seq has a different Win32 compiler setup from FFCS, so we need to add some extra parameters
 
1736
if test "$OS" = Windows_NT
 
1737
then
 
1738
    CFLAGS="$CFLAGS -DWITHOUT_PTHREAD -DAdd_"
 
1739
 
 
1740
    # we also need to satisfy ff-c++ that the pthread are not a blocking point
 
1741
    if test -n "$ff_pthread"  ; then
 
1742
       AC_FF_ADDWHERELIB(pthread,"",)
 
1743
    fi
 
1744
fi
 
1745
 
 
1746
# Find out kernel and libc versions
 
1747
# ---------------------------------
 
1748
 
 
1749
if test "$ff_win32" != yes -a "$ff_mac" != yes
 
1750
then
 
1751
        AC_MSG_CHECKING(kernel version)
 
1752
        ff_kernel_version=`cat /proc/version|perl -e '<STDIN>=~/(\d+\.\d+\.\d+)/;print $1;'`
 
1753
        AC_MSG_RESULT($ff_kernel_version)
 
1754
        AC_SUBST(KERNEL_VERSION,$ff_kernel_version)
 
1755
 
 
1756
        AC_MSG_CHECKING(libc version)
 
1757
        ff_libc_version=`ldd /bin/sh | awk '/libc/{print $3}' | xargs readlink | sed -e 's/\.so$//'`
 
1758
        AC_MSG_RESULT($ff_libc_version)
 
1759
        AC_SUBST(LIBC_VERSION,$ff_libc_version)
 
1760
fi
 
1761
#  def variable pour les makefiles 
 
1762
 
 
1763
# creating all makefiles
 
1764
# ----------------------
 
1765
ff_bamgprog="bamg${EXEEXT}  cvmsh2${EXEEXT}"
 
1766
 
 
1767
 
 
1768
AC_SUBST(CNOFLAGS,$CNOFLAGS) dnl for superludist CFLAGS without optim  ...
 
1769
AC_SUBST(FNOFLAGS,$FNOFLAGS) dnl for blacs CFLAGS without optim  ...
 
1770
# The final list of executable programs
 
1771
AC_SUBST(MEDITPROG,$ff_meditprog)
 
1772
 
 
1773
# ALH - FFCS - 5/1/9 - ffglut cannot be compiled with FFCS under Cygwin because it requires a GLUT versions that works
 
1774
# with Mingw, and the standard Cygwin Glut is not enough. But FFCS needs a working ffglut on other platforms for testing
 
1775
# purposes.
 
1776
 
 
1777
if test "$ff_win32" = yes
 
1778
then
 
1779
        AC_SUBST(FFGLUTPROG,'')
 
1780
else
 
1781
        AC_SUBST(FFGLUTPROG,$ff_ffglutprog)
 
1782
fi
 
1783
 
 
1784
AC_SUBST(BAMGPROG,$ff_bamgprog)
 
1785
AC_SUBST(STDPROG,$ff_stdprog)
 
1786
AC_SUBST(IDEPROG,$ff_ideprog)
 
1787
AC_SUBST(TESTIDEPROG,$ff_testideprog)
 
1788
# The final test program
 
1789
AC_SUBST(IDE_TESTS,$ff_idetest)
 
1790
ff_progs="FreeFem++-nw $ff_bamgprog  $ff_mpiprog $ff_meditprog $ff_ffglutprog"
 
1791
 
 
1792
 
 
1793
#echo xxxxxxxxxxx
 
1794
# hips LD -L/Users/hecht/work/freefem++/download/lib/hips -lio -lhips
 
1795
# hips INCLUDE -I/Users/hecht/work/freefem++/download/include/hips
 
1796
# hipssequential LD -L/Users/hecht/work/freefem++/download/lib/hips -lio -lhipssequential
 
1797
# hipssequential INCLUDE -I/Users/hecht/work/freefem++/download/include/hips
 
1798
# hypre LD -L/Users/hecht/work/freefem++/download/lib/hypre  -lHYPRE
 
1799
# hypre INCLUDE -I/Users/hecht/work/freefem++/download/include/hypre
 
1800
#metis LD -L/Users/hecht/work/freefem++/download/lib -lmetis
 
1801
#metis INCLUDE -I/Users/hecht/work/freefem++/download/include/metis
 
1802
# mumps LD '-L/Users/hecht/work/freefem++/download//lib  -lpord -lmumps_common -ldmumps -lzmumps -lpord'
 
1803
# mumps INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1804
# parmetis LD -L/Users/hecht/work/freefem++/download/lib -lparmetis -lmetispar
 
1805
# parmetis INCLUDE -I/Users/hecht/work/freefem++/download/include/metis
 
1806
# scalapack LD '-L/Users/hecht/work/freefem++/download/lib  -lscalapack '
 
1807
# scalapack INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1808
# ptscotch LD '-L/Users/hecht/work/freefem++/download/lib  -lptesmumps -lptscotch -lptscotcherr '
 
1809
# ptscotch INCLUDE '-I/Users/hecht/work/freefem++/download/include/scotch'
 
1810
# scotch LD '-L/Users/hecht/work/freefem++/download/lib   -lscotch -lscotcherr '
 
1811
# scotch INCLUDE '-I/Users/hecht/work/freefem++/download/include/scotch'
 
1812
# superlu LD -L/Users/hecht/work/freefem++/download/lib -lsuperlu
 
1813
# superlu INCLUDE -I/Users/hecht/work/freefem++/download/include
 
1814
# superlu_dist LD '-L/Users/hecht/work/freefem++/download/lib -lsuperlu_dist_2.3'
 
1815
# superlu_dist INCLUDE '-I/Users/hecht/work/freefem++/download/include/superludist'
 
1816
# tetgen LD -L/Users/hecht/work/freefem++/download/lib -ltet
 
1817
# tetgen INCLUDE -I/Users/hecht/work/freefem++/download/include/
 
1818
# arpack LD '-L/Users/hecht/work/freefem++/download/lib' '-larpack'
 
1819
# arpack INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1820
# umfpack LD '-L/Users/hecht/work/freefem++/download/lib' '-lumfpack'
 
1821
# umfpack INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1822
# amd LD '-L/Users/hecht/work/freefem++/download/lib' '-lamd'
 
1823
# amd INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1824
# fftw3 LD '-L/Users/hecht/work/freefem++/download/lib' '-lfftw3'
 
1825
# fftw3 INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1826
# mmg3d LD '-L/Users/hecht/work/freefem++/download/lib' '-lmmg3d'
 
1827
# mmg3d INCLUDE '-I/Users/hecht/work/freefem++/download/include'
 
1828
 
 
1829
 
 
1830
#if test -f download/pkg/mmg3dlib.tar.gz  ;then
 
1831
#    AC_MSG_NOTICE([      Compile : download/pkg/mmg3dlib.tar.gz  (3d mesh adapaton)])
 
1832
#else
 
1833
#    ff_MACOS=`expr "xx $CXXFLAGS" : '.*-mmacosx-version-min=\([0-9.]*\).*'`
 
1834
#    
 
1835
#    ff_mmg3dlib=""
 
1836
#    if test "$ff_mac" = yes ; then
 
1837
#        case $ff_MACOS  in
 
1838
#            [0-9.]*) ff_MACOS="$ff_MACOS";;
 
1839
#            *) ff_MACOS=`sw_vers -productVersion| awk -F. '{print $1"."$2}'`
 
1840
#       esac
 
1841
#       MACOS=10.4
 
1842
#       ff_mmg3dlib="libmmg3d-1001-OSX-$ff_MACOS.tar.gz"
 
1843
#    elif test "$ff_win32" = yes ; then
 
1844
#        case `uname` in 
 
1845
#        MINGW32*)      ff_mmg3dlib="libmmg3d-1001-MINGW32.tar.gz";;
 
1846
#        MINGW64*)      ff_mmg3dlib="libmmg3d-1001-MINGW64.tar.gz";;
 
1847
#        CYWIN*)        ff_mmg3dlib="libmmg3d-1001-WIN32.tar.gz";;
 
1848
#        esac 
 
1849
#    else 
 
1850
#       ff_mmg3dlib="libmmg3d-1001-LINUX-$ff_size_ptr.tar.gz"
 
1851
#    fi
 
1852
    
 
1853
#    if test -f  download/pkg/$ff_mmg3dlib ; then 
 
1854
#        tar zxf download/pkg/$ff_mmg3dlib -C download
 
1855
#    elif test "enable_download" = yes ; then
 
1856
#       mkdir download/pkg 
 
1857
#       ( cd download/pkg
 
1858
#           $ff_wget_command  http://www.freefem.org/ff++/ftp/libmmg3d/$ff_mmg3dlib
 
1859
#           tar zxf $ff_mmg3dlib -C ..  
 
1860
#           )
 
1861
#    fi
 
1862
#    if test -f "download/lib/libmmg3d.a" ; then
 
1863
#       AC_MSG_CHECKING(for MMG_mmg3dlib in mmg3dlib )
 
1864
#           ff_save_libs="$LIBS"
 
1865
#           LIBS="$LIBS -Ldownload/lib -lmmg3d"
 
1866
#           AC_LINK_IFELSE(
 
1867
#               [AC_LANG_CALL(,MMG_mmg3dlib)],
 
1868
#               ff_mmg3d_ok=yes 
 
1869
#               ,
 
1870
#               ff_mmg3d_ok=no
 
1871
#               rm download/lib/libmmg3d.a download/include/libmmg3d.a
 
1872
#                ff_mmg3d_ok=
 
1873
#               )
 
1874
#           LIBS="$ff_save_libs"
 
1875
#           AC_MSG_RESULT($ff_mmg3d_ok)
 
1876
#    fi
 
1877
#    AC_SUBST(MMG3DLIB_TAR,$ff_mmg3dlib) 
 
1878
#fi
 
1879
 
 
1880
AC_SUBST(TEST_FFPP,"../src/nw/FreeFem++")  
 
1881
AC_SUBST(TEST_FFPPMPI,"../src/mpi/ff-mpirun")  
 
1882
 
 
1883
ff_with_mpi=-openmpi; 
 
1884
 
 
1885
ff_blacs="-lblacsCinit$ff_with_mpi     -lblacsF77init$ff_with_mpi      -lblacs$ff_with_mpi"
 
1886
ff_scalapack=-lscalapack
 
1887
 
 
1888
# change MKL interface ...
 
1889
test -n "$ff_mkl_blacs" && ff_blacs="$ff_mkl_blacs"
 
1890
test -n "$ff_mkl_scalapack" && ff_scalapack="$ff_mkl_scalapack"
 
1891
test -n "$ff_mkl_root" && ff_winc="$ff_mkl_root/include/mkl_blas.h"
 
1892
 
 
1893
 
 
1894
m4_map([AC_FF_WHERELIB],[ 
 
1895
        [[mumps],[-ldmumps -lzmumps  -lmumps_common  -lpord],[dmumps_c.h],[]],
 
1896
        [[mumps_ptscotch],[-lpord_ptscotch -lmumps_common_ptscotch -ldmumps_ptscotch -lzmumps_ptscotch -lpord_ptscotch],[dmumps_c.h]],
 
1897
        [[mumps_scotch],[-lpord_scotch -lmumps_common_scotch -ldmumps_scotch -lzmumps_scotch -lpord_scotch],[dmumps_c.h]],
 
1898
        [[hypre],[-lHYPRE]],
 
1899
        [[fftw3],[-lfftw3],[/usr/include/fftw3.h],[]],
 
1900
        [[superlu_dist],[-lsuperlu-dist],[superlu-dist/superlu_defs.h],[]],
 
1901
        [[superlu],[-lsuperlu],[superlu/slu_ddefs.h],[]],
 
1902
        [[Superlu4],[-lsuperlu4],[superlu4/slu_ddefs.h],[]],
 
1903
        [[blacs],[ -lblacsCinit$ff_with_mpi     -lblacsF77init$ff_with_mpi      -lblacs$ff_with_mpi],[]],
 
1904
        [[scalapack],[-lscalapack$ff_with_mpi],[]],
 
1905
        [[scotch],[-lscotch -lscotcherr],[]],
 
1906
        [[ptscotch],[-lptscotch -lptscotcherr],[]],
 
1907
        [[metis],[-lscotch -lmetis],[metis/metis.h],[]],
 
1908
        [[metis],[-lscotch -lmetis],[metis.h],[]],
 
1909
        [[parmetis],[-lptscotch -lparmetis],[],[]],
 
1910
        [[freeyams],[-lfreeyams],[freeyamslib.h],[]],
 
1911
        [[mmg3d],[-lmmg3d],[libmmg3d.h],[]],
 
1912
        [[mshmet],[-lmshmet],[],[]],
 
1913
        [[gsl],[-lgsl -lgslcblas -lm],[gsl/gsl_sf.h],[]],
 
1914
        [[parms],[-lparms -litsol -llapack -lblas -lm],[],[]],
 
1915
        [[tetgen],[-ltet],[tetgen.h],[]],
 
1916
    ]
 
1917
    )
 
1918
 
 
1919
# FFCS - 27/10/11 - Some extra conditionals for things that do not work on certain systems (eg MPI libraries under
 
1920
# Windows)
 
1921
#  remove gsl if not find ... FK 
 
1922
 
 
1923
if test  "$ff_where_lib_conf_gsl" == 1  -a -z "$enable_gsl" ; then enable_gsl=no; fi;  
 
1924
if test  "$ff_where_lib_conf_mkl" == 1  -a -z "$enable_mkl" ; then enable_pardiso=no; fi;  
 
1925
FFCS_DISABLE_DOWNLOAD(gsl,"gsl.$DYLIB_SUFFIX NewSolver.$DYLIB_SUFFIX")
 
1926
FFCS_DISABLE_DOWNLOAD(pardiso,PARDISO.$DYLIB_SUFFIX)
 
1927
 
 
1928
 
 
1929
AM_CONDITIONAL([FFCS_WINDOWS],[test $OS = Windows_NT])
 
1930
 
 
1931
# All makefiles
 
1932
AC_OUTPUT(Makefile
 
1933
    download/Makefile
 
1934
    download/blas/Makefile
 
1935
    download/arpack/Makefile
 
1936
    download/umfpack/Makefile
 
1937
    src/Makefile
 
1938
    src/bamglib/Makefile
 
1939
    src/Graphics/Makefile
 
1940
    src/femlib/Makefile
 
1941
    src/Algo/Makefile
 
1942
    src/lglib/Makefile
 
1943
    src/fflib/Makefile
 
1944
dnl    src/std/Makefile
 
1945
    src/nw/Makefile
 
1946
    src/mpi/Makefile
 
1947
    src/bamg/Makefile
 
1948
    src/libMesh/Makefile
 
1949
    src/medit/Makefile
 
1950
    src/bin-win32/Makefile
 
1951
    examples++/Makefile
 
1952
    examples++-eigen/Makefile
 
1953
    examples++-tutorial/Makefile
 
1954
    examples++-mpi/Makefile
 
1955
    examples++-load/Makefile
 
1956
    examples++-chapt3/Makefile
 
1957
    examples++-bug/Makefile
 
1958
    examples++-other/Makefile
 
1959
    examples++-3d/Makefile
 
1960
    DOC/Makefile)
 
1961
AC_MSG_NOTICE([  freefem++ used  download : $enable_download ])
 
1962
AC_MSG_NOTICE([          --  Dynamic load facility: $ff_dynload ])
 
1963
AC_MSG_NOTICE([          --  ARPACK (eigen value): $ff_arpack_ok ])
 
1964
AC_MSG_NOTICE([          --  UMFPACK (sparse solver) $ff_umfpack_ok ])
 
1965
AC_MSG_NOTICE([          --  BLAS $ff_blas_ok ])
 
1966
AC_MSG_NOTICE([          --  with MPI             $ff_mpi])
 
1967
AC_MSG_NOTICE([    progs: $ff_progs ])
 
1968
if test  "$ff_umfpack_download" = yes  ;then
 
1969
    AC_MSG_NOTICE([      use of download UMFPACK see  download/umfpack/SuiteSparse/UMFPACK/README.txt for the License])
 
1970
fi
 
1971
if test "$ff_arpack_download" = yes  ; then
 
1972
    AC_MSG_NOTICE([      use of download ARPACK see  download/arpack/ARPACK/README  no License ])
 
1973
fi
 
1974
 
 
1975
if test "$enable_download" = yes  ;then
 
1976
    AC_MSG_NOTICE([      use of download fftw   see  download/fftw/fftw-3.2/COPYRIGHT ])
 
1977
    AC_MSG_NOTICE([      use of download tetgen  see download/tetgen/tetgen1.4.3/LICENSE ])
 
1978
    AC_MSG_NOTICE([      use of download freeyams  see download/yams/freeyams.2011.02.22 (suface mesh adaptation)  ])
 
1979
    AC_MSG_NOTICE([      use of download mmg3d (v4)   see download/mmg3d/mmg3d4/LICENCE.txt  ])
 
1980
    AC_MSG_NOTICE([      use of download superlu, metis])
 
1981
    if test -n "$MPICC" ; then
 
1982
        AC_MSG_NOTICE([      try to download: blacs parmetis  scalapack scotch superludist pastix hypre hips library])
 
1983
    fi
 
1984
 
 
1985
dnl    if test -f download/lib/libmmg3d.a ; then
 
1986
dnl        AC_FF_ADDWHERELIB(mmg3d,-L`pwd`/download/lib,-I`pwd`/download/include)
 
1987
dnl     echo "mmg3d LD '-L`pwd`/download/lib' '-lmmg3d'" >>$ff_where_lib_conf
 
1988
dnl     echo "mmg3d INCLUDE '-I`pwd`/download/include'" >>$ff_where_lib_conf
 
1989
dnl    else 
 
1990
dnl     AC_MSG_NOTICE([   sorry no download/pkg/mmg3dlib.tar.gz 3d mesh adapaton see Dobrzynski Cecile <cecile.dobrzynski@math.u-bordeaux1.fr> ])
 
1991
dnl    fi
 
1992
    
 
1993
    if test "$ff_download_blas" = "generic"  ; then
 
1994
        AC_MSG_NOTICE([      use of download generic blas and cblas freefem may be slow  ])
 
1995
        AC_MSG_NOTICE([      you can try to use the  Kazushige Goto s BLAS at http://www.cs.utexas.edu/users/flame/goto/  ])
 
1996
        AC_MSG_NOTICE([          or at  http://www.tacc.utexas.edu/~kgoto/ for the best BLAS .])
 
1997
        AC_MSG_NOTICE([      or try to download/compile the altas blas .])
 
1998
    fi
 
1999
 
 
2000
dnl    if test -f download/pkg/mmg3dlib.tar.gz  ; then
 
2001
dnl     AC_MSG_NOTICE([      Compile : download/pkg/mmg3dlib.tar.gz  (3d mesh adapaton)])
 
2002
dnl    elif test          "$ff_mmg3d_ok" = yes ; then
 
2003
dnl     AC_MSG_NOTICE([      Use of precompile version : download/pkg/$ff_mmg3dlib  (3d mesh adapaton)])
 
2004
dnl    else
 
2005
dnl     AC_MSG_NOTICE([   sorry no download/pkg/mmg3dlib.tar.gz 3d mesh adapaton see Dobrzynski Cecile <cecile.dobrzynski@math.u-bordeaux1.fr> ])
 
2006
dnl    fi       
 
2007
fi  # ---  test "$enable_download" = yes  ;then
 
2008
 
 
2009
 
 
2010
# FFCS: remove this message because it could make the user think that something is broken
 
2011
if test $enable_ffcs = no
 
2012
then
 
2013
    if test "$ff_glut_ok" != yes  ; then
 
2014
        AC_MSG_NOTICE([     *********************************************** ])
 
2015
        AC_MSG_NOTICE([     WARNING: you do not have the new grachics tools ])
 
2016
        AC_MSG_NOTICE([         because the configure do not find OpenGL, GLUT or pthread  developer stuff ])
 
2017
        AC_MSG_NOTICE([         read the README to find missing package  ])
 
2018
        AC_MSG_NOTICE([         F. Hecht  ])
 
2019
        AC_MSG_NOTICE([ to install missing package  under debian or ubuntu, try: sudo apt-get install freeglut3-dev ])  
 
2020
        AC_MSG_NOTICE([     *********************************************** ])
 
2021
    fi
 
2022
fi
 
2023
 
 
2024
# Local Variables:
 
2025
# mode:shell-script
 
2026
# ispell-local-dictionary:"british"
 
2027
# coding:utf-8
 
2028
# End: