📄 configure.ac
字号:
then AC_MSG_NOTICE([-- NO ARPACK -- enable_download : $enable_download , wget: $ff_wget ])fi# Do not insert ARPACK libs in $LIBS yet, because they may not exist# yet, and this could make the following tests fail.LIBS="$ff_save_libs"if test "$ff_arpack_ok" = yes;then AC_SUBST(ARPACKLIBS,$ff_arpack_libs) EIGENOBJ='eigenvalue.$(OBJEXT)' AC_DEFINE(HAVE_LIBARPACK,1,Arpack is used for eigenvalue computation) # Determines whether to run the eigenvalue tests AC_SUBST([EIGENTEST],../regtests.sh)fiAC_SUBST([EIGENOBJ])# Looking for UMFPACK# -------------------ff_amd_ok=noff_umfpack_ok=noff_save_libs="$LIBS"if test "$ff_blas_ok" = yes;then # User-specified location AC_ARG_WITH(amd, [ --with-amd=library Use a specific version of AMD], ff_amd_ok=yes ff_umfpack_libs="${withval}") AC_ARG_WITH(umfpack, [ --with-umfpack=library Use a specific version of Umfpack], ff_umfpack_ok=yes ff_umfpack_libs="${withval} $ff_umfpack_libs" )# AC_DEFINE(HAVE_LIBUMFPACK,1,# Umfpack is used for sparse matrices computations)) # Trying default locations AC_CHECK_HEADERS(umfpack.h umfpack/umfpack.h ufsparse/umfpack.h suitesparse/umfpack.h,ff_umfpack_header=yes) # Somes systems like FreeBSD hide umfpack.h in a directory # called UMFPACK (all capitals). This breaks the standard # #define produced by autoconf in config.h.in. if test "$ff_umfpack_header" != yes; then AC_CHECK_HEADER(UMFPACK/umfpack.h, ff_umfpack_header=yes AC_DEFINE(HAVE_BIG_UMFPACK_UMFPACK_H,1, If umfpack.h is located in UMFPACK subdir)) fi LIBS="$ff_blas_libs $LIBS" if test "$ff_amd_ok" = no; then AC_CHECK_LIB(amd,amd_info, ff_umfpack_libs="$ff_umfpack_libs -lamd" ff_amd_ok=yes) fi if test "$ff_umfpack_ok" = no -a "$ff_amd_ok" = yes; then AC_CHECK_LIB(umfpack,umf_i_malloc, ff_umfpack_libs=" -lumfpack $ff_umfpack_libs" ff_umfpack_ok=yes,,$ff_umfpack_libs) if test "$ff_umfpack_ok" != yes -o "$ff_umfpack_header" != yes ; then AC_MSG_WARN([ Sorry we find UMFPACK lib but not the include umfpack.h file]) fi fi if test "$ff_umfpack_header" != yes -a "$ff_umfpack_ok" != no; then ff_umfpack_ok=no fi if test "$ff_umfpack_ok" = yes -a "$ff_amd_ok" = yes; then AC_DEFINE(HAVE_LIBUMFPACK,1, Umfpack is used for sparse matrices computations ) fifiLIBS="$ff_save_libs"# If all else fails, download!if test "$ff_umfpack_ok" = no -a "$enable_download" = yes then AC_MSG_NOTICE(using downloaded UMFPACK) AC_SUBST(DOWNLOAD_UMFPACK,umfpack) ff_umfpack_download=yes # Do not update $LIBS, but create an extra LIB variable, # because this lib does not exist yet, and this could make the # following tests fail. ff_umfpack_libs="${curdir}/download/lib/libumfpack.a ${curdir}/download/lib/libamd.a" AC_DEFINE(HAVE_LIBUMFPACK,1,UMFPACK) if test "$ff_win32" = yes; then AC_SUBST(FF_UMFPACK_CONFIG,-DCBLAS) fi ff_umfpack_ok=yesfiif test "$ff_umfpack_ok" = nothen AC_MSG_NOTICE( -- NOT UMFPACK ff_wget = $ff_wget)fiAC_SUBST(UMFPACKLIBS,$ff_umfpack_libs)# Checking for some functions that may not appear everywhere# ----------------------------------------------------------# asinh acosh atanh are not in Mingw yetAC_CHECK_FUNCS(asinh acosh atanh getenv jn erfc tgamma)AC_CHECK_FUNCS(srandomdev)AC_CHECK_FUNCS(second_,ff_second="",ff_second=second.o)AC_SUBST(FF_SECOND,"$ff_second")# If times() and sysconf() are not here, UMFPACK should knowif test "$ff_umfpack_ok" = yesthen AC_CHECK_FUNCS(times sysconf, ff_umfpack_posix_ok=yes, ff_umfpack_posix_ok=no) if test "$ff_umfpack_posix_ok" = no then AC_SUBST(FF_UMFPACK_CONFIG,"-DCBLAS -DNPOSIX") fifi# Enable static linking (no shared libraries)# -------------------------------------------AC_CHECK_PROG(ff_libtool,libtool,yes,no) if test "$ff_mac" = "yes" -a "$ff_libtool" = yes ; then ff_AR="libtool" ff_ARFLAGS="-static -o" ff_RANLIB="echo" fiAC_ARG_ENABLE(static, [ --enable-static Build binaries with no shared library dependencies])if test "$enable_static" = yesthen AC_CHECK_PROG(ff_libtool,libtool,yes,no) if test "$ff_libtool" = yes then LDFLAGS="$LDFLAGS -all-static" AC_SUBST(STATICTOOL,libtool) else AC_MSG_ERROR(libtool not found) fifi# for compiation of arpack use libtool to bluid universal library on MacOs. AC_SUBST(AR,$ff_AR)AC_SUBST(ARFLAGS,$ff_ARFLAGS)AC_SUBST(RANLIN,$ff_RANLIB)# Dynamic loading of compiled functions# -------------------------------------# Not if we don't want shared libraries (non FH modif FH juin 2005)ff_dynload=noif test "$enable_static" != yesthen # Availability of dlopen(). Use AC_COMPILE rather than # AC_CHECK_HEADERS because the latter has problems seeing it (in # Cygwin) when it does not compile (in Mingw). AC_MSG_CHECKING(for dlfcn.h) AC_COMPILE_IFELSE([#include <dlfcn.h>], ff_dynload=yes, ff_dynload=no) AC_MSG_RESULT($ff_dynload)fi# Checks that we also have the corresponding libraryif test "$ff_dynload" = yesthen AC_CHECK_LIB(dl,dlinfo) # Checks that everythings works ok AC_MSG_CHECKING(whether dlopen links ok) AC_LINK_IFELSE([#include <dlfcn.h>int main(int argc,char **argv){ dlopen("",RTLD_LAZY); return 0;}], ff_dynload=yes, ff_dynload=no) AC_MSG_RESULT($ff_dynload)fi# the -rdynamic don't exist on macos and sunOSif test "$ff_dynload" = yesthen AC_DEFINE(HAVE_DLFCN_H,1,Dynamic loading - not mandatory) # Activate dynamic loading tests (see examples++-load/Makefile.am) AC_SUBST(LOAD_TESTS,../regtests.sh) AC_SUBST(LOAD_COMPILE,load_compile) # gcc on MacOS does not produce an error with "-rdynamic" but # still complains about it. if test "$ff_mac" = "no" -a "$ff_win32" = "no" -a "$ff_sunos" = "no" ; then CHECK_COMPILE_FLAG(C++,-rdynamic,CXXFLAGS) fifiAC_SUBST(DYLIB_SUFFIX,$ff_suffix_dylib)# Checking wether we can generate some documentation# --------------------------------------------------AC_CHECK_PROG(ff_latex,latex,yes,no)AC_CHECK_PROG(ff_makeindex,makeindex,yes,no)AC_CHECK_PROG(ff_dvips,dvips,yes,no)# to translate the figure AC_CHECK_PROG(ff_pdf2ps,pdf2ps,yes,no)AC_CHECK_PROGS(EPSTOPDF,[epstopdf pstopdf],[false])AC_CHECK_PROG(ff_convert,convert,yes,no)if test "$ff_latex" = yes -a "$ff_makeindex" = yes -a "$ff_dvips" = yes -a $ff_pdf2ps = yes -a $ff_convert = yes;then AC_SUBST(DOCPS,"freefem++doc.ps") AC_CHECK_PROG(ff_gzip,gzip,yes,no) if test "$ff_gzip" = yes; then AC_SUBST(DOCPSGZ,"freefem++doc.ps.gz") fifi# PDF documentation building sometimes poses problems because of# pdfsync.sty. So we need to be able to disable it.enable_pdf=yesAC_ARG_ENABLE(pdf,[ --disable-pdf Disable PDF documentation building])if test "$enable_pdf" = yes then AC_CHECK_PROG(ff_pdflatex,pdflatex,yes,no) if test "$ff_pdflatex" = yes -a $EPSTOPDF != false -a $ff_convert = yes; then AC_SUBST(DOCPDF,"freefem++doc.pdf") fifi# HISTORY logging through CVS, but only if we are in a CVS working areaif test -d CVSthen AC_CHECK_PROG(ff_history,cvs2cl,yes,no) if test "$ff_history" = yes then AC_SUBST(HISTORY,history) fifi# Choosing compilation options for the standard version (in src/std)# ------------------------------------------------------------------# The "standard" configured version can use win32 (mingw) or x11if test "$ff_mingw" = yes then ff_stdprog="FreeFem++-std${EXEEXT}" ff_std_graph_obj=Pcrgraph.$OBJEXT ff_std_ldflags=-mwindows ff_std_libs=elif test "$ff_x11" = yes ; then ff_std_graph_obj=Xrgraph.$OBJEXT ff_std_ldflags= ff_std_libs=$ff_x11_libs # If the standard version already uses x11, we do not need to # make the contents of the src/x11 directory. ff_x11prog="FreeFem++-x11${EXEEXT}"fiAC_SUBST(STD_GRAPH_OBJ,$ff_std_graph_obj)AC_SUBST(STD_LDFLAGS,$ff_std_ldflags)AC_SUBST(STD_LIBS,$ff_std_libs)# Can we produce an IDE?# ----------------------# For development purposes, we may need to use X libraries instead of# native libraries (mainly to run the programs remotely)# AC_ARG_WITH(fltk,[ --without-fltk (to suppress explicity --enable-download imply --with-fltk ) ])# AC_ARG_WITH(xfltk,[ --with-xfltk When recompiling FLTK, use X libraries instead of native Win32 or MacOS])# remove all fltk stuff# to remove of FLTKAC_MSG_NOTICE(without ide/ fltk ..... Please wait the next version.... ) if test 0 != 0 then if test "$with_fltk" = no then ff_fltk=no AC_MSG_NOTICE(without FLTK sorry in next no ide today ) else# under mingw use download fltk versionif test "$ff_mingw" = yes then AC_MSG_NOTICE(under mingw not using default FLTK) enable_default_fltk=no fi# Default FLTK (in the machine's default PATH)if test "$enable_default_fltk" = nothen AC_MSG_NOTICE(not using default FLTK) ff_fltk=noelse # Checks that fltk-config exists ff_fltk_config=fltk-config AC_CHECK_PROG(ff_fltk,fltk-config,yes,no) # Checks that FLTK is compiled with threads enabled AC_MSG_CHECKING(that FLTK is compiled with threads) AC_COMPILE_IFELSE([#include <FL/Fl.H>main(){ Fl::lock();}], ff_fltk_threads=yes, ff_fltk_threads=no) AC_MSG_RESULT($ff_fltk_threads) if test "$ff_fltk_threads" = no then ff_fltk=no AC_MSG_NOTICE(not using default FLTK because it does not know threads) fi fi# Downloading and compiling FLTKif test "$ff_fltk" = no -a "$enable_download" = yesthen AC_MSG_NOTICE(using downloaded FLTK) AC_SUBST(DOWNLOAD_FLTK,fltk) ff_fltk_version=1.1.6 AC_SUBST(FLTK_VERSION,$ff_fltk_version) ff_fltk_config="$curdir/download//bin/fltk-config" ff_fltk=yesfiif test "$ff_fltk" = yesthen # For the moment, FreeFem++-ide${EXEEXT} is not built # because it first needs FreeFEM++ to accept several # successive runs without restart. ff_ideprog="FreeFem++-ide${EXEEXT} FreeFem++-cs${EXEEXT} FreeFem++-client${EXEEXT} FreeFem++-server${EXEEXT}" ff_idetest="./testhighlight.sh" ff_testideprog="testhighlight${EXEEXT}" if test "$enable_cygwindll" = yes then AC_SUBST(FLTK_CONFIG_PARAM,"--enable-localzlib --enable-cygwin") elif test "$ff_mingw" = yes then AC_SUBST(FLTK_CONFIG_PARAM,"--enable-localzlib --disable-cygwin") else AC_SUBST(FLTK_CONFIG_PARAM,"--disable-cygwin") fi AC_SUBST(FLTK_CONFIG,$ff_fltk_config) # Only links X11 libraries into FreeFem++-cs if we are not on # Windows (Mingw) or Macintosh (these do not need X11) if test "$ff_mac" != yes -a "$ff_mingw" != yes then AC_SUBST(IDE_LIBS,$ff_x11_libs) fi if test "$with_xfltk" = yes then AC_SUBST(FLTK_XONLY,"--with-x") fififi# end of remove fltkfi # Flex compatibility with Bison# -----------------------------# If Flex does not know Bison options, it cannot deal with# src/ide/hl_lex.l++. So we need to make src/ide/hl_lex.c++ up-to-date# by hand (under Cygwin, "cvs update" does not make hl_lex.c++ newer# than hl_lex.l++ even if it was when a commit was done).AC_MSG_CHECKING(flex compatibility with bison)if test `flex --help|fgrep bison|wc -l` = 0then AC_MSG_RESULT(no) touch src/ide/hl_lex.c++else AC_MSG_RESULT(yes)fi# Find out kernel and libc versions# ---------------------------------if test "$ff_win32" != yes -a "$ff_mac" != yesthen AC_MSG_CHECKING(kernel version) ff_kernel_version=`cat /proc/version|perl -e '<STDIN>=~/(\d+\.\d+\.\d+)/;print $1;'` AC_MSG_RESULT($ff_kernel_version) AC_SUBST(KERNEL_VERSION,$ff_kernel_version) AC_MSG_CHECKING(libc version) ff_libc_version=`ldd /bin/sh | awk '/libc/{print $3}' | xargs readlink | sed -e 's/\.so$//'` AC_MSG_RESULT($ff_libc_version) AC_SUBST(LIBC_VERSION,$ff_libc_version)fi# def variable pour les makefiles # creating all makefiles# ----------------------ff_bamgprog="bamg${EXEEXT} cvmsh2${EXEEXT}"if test "$ff_x11" = yes -o "$ff_win32" = yes ; thenff_bamgprog="$ff_bamgprog drawbdmesh${EXEEXT}"fi# The final list of executable programsAC_SUBST(MEDITPROG,$ff_meditprog)AC_SUBST(FFGLUTPROG,$ff_ffglutprog)AC_SUBST(BAMGPROG,$ff_bamgprog)AC_SUBST(GLXPROG,$ff_glxprog)AC_SUBST(STDPROG,$ff_stdprog)AC_SUBST(AGLPROG,$ff_aglprog)AC_SUBST(X11PROG,$ff_x11prog)AC_SUBST(IDEPROG,$ff_ideprog)AC_SUBST(TESTIDEPROG,$ff_testideprog)# The final test programAC_SUBST(IDE_TESTS,$ff_idetest)ff_progs="$ff_stdprog FreeFem++-nw $ff_bamgprog $ff_glxprog $ff_aglprog $ff_x11prog $ff_ideprog $ff_mpiprog $ff_meditprog $ff_ffglutprog"# All makefilesAC_OUTPUT(Makefile download/Makefile download/blas/Makefile download/arpack/Makefile download/umfpack/Makefile download/fltk/Makefile src/Makefile src/bamglib/Makefile src/Graphics/Makefile src/femlib/Makefile src/Algo/Makefile src/lglib/Makefile src/fflib/Makefile src/std/Makefile src/x11/Makefile src/ide/Makefile src/nw/Makefile src/mpi/Makefile src/agl/Makefile src/glx/Makefile src/bamg/Makefile src/libMesh/Makefile src/medit/Makefile src/bin-win32/Makefile examples++/Makefile examples++-eigen/Makefile examples++-tutorial/Makefile examples++-mpi/Makefile examples++-load/Makefile examples++-chapt3/Makefile examples++-bug/Makefile examples++-other/Makefile examples++-3d/Makefile DOC/Makefile) AC_MSG_NOTICE([ freefem++ used download : $enable_download ]) AC_MSG_NOTICE([ -- Dynamic load facility: $ff_dynload ]) AC_MSG_NOTICE([ -- ARPACK (eigen value): $ff_arpack_ok ]) AC_MSG_NOTICE([ -- UMFPACK (sparse solver) $ff_umfpack_ok ]) AC_MSG_NOTICE([ -- BLAS $ff_blas_ok ]) AC_MSG_NOTICE([ -- FLTK (ide package) $ff_fltk ]) AC_MSG_NOTICE([ -- with X11 $ff_x11]) AC_MSG_NOTICE([ -- with MPI $ff_mpi]) AC_MSG_NOTICE([ progs: $ff_progs ])if test "$ff_umfpack_download" = yes ;then AC_MSG_NOTICE([ use of download UMFPACK see download/umfpack/SuiteSparse/UMFPACK/README.txt for the License])fiif test "$ff_arpack_download" = yes ; then AC_MSG_NOTICE([ use of download ARPACK see download/arpack/ARPACK/README no License ])fiif test "$enable_download" = yes ;then AC_MSG_NOTICE([ use of download fftw see download/fftw/fftw-3.2/COPYRIGHT ]) AC_MSG_NOTICE([ use of download tetgen see download/tetgen/tetgen1.4.2/LICENSE ])fiif test "$ff_download_blas" = "generic" ; then AC_MSG_NOTICE([ use of download generic blas and cblas freefem may be slow ]) AC_MSG_NOTICE([ you can try to use the Kazushige Goto's BLAS at http://www.cs.utexas.edu/users/flame/goto/ ]) AC_MSG_NOTICE([ or at http://www.tacc.utexas.edu/~kgoto/ for the best BLAS .]) AC_MSG_NOTICE([ or try to download/compile the altas blas .])fiif test "$ff_glut_ok" != yes ; then AC_MSG_NOTICE([ *********************************************** ]) AC_MSG_NOTICE([ WARNING: you do not have the new grachics tools ]) AC_MSG_NOTICE([ because the configure do not find OpenGL, GLUT or pthread developer stuff ]) AC_MSG_NOTICE([ read the README to find missing package ]) AC_MSG_NOTICE([ F. Hecht ]) AC_MSG_NOTICE([ *********************************************** ])fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -