Skip to content
Snippets Groups Projects
Commit e52c835e authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 4d6f33e4
No related branches found
No related tags found
No related merge requests found
# Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
#
# See the LICENSE.txt file for license information. Please report all
# bugs and problems to <gmsh@geuz.org>.
include variables
GMSH_MAJOR_VERSION = 2
GMSH_MINOR_VERSION = 4
GMSH_PATCH_VERSION = 0
GMSH_EXTRA_VERSION = ""
GMSH_VERSION =\
${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}.${GMSH_PATCH_VERSION}${GMSH_EXTRA_VERSION}
GMSH_SHORT_LICENSE = "GNU General Public License"
GMSH_VERSION_FILE = Common/GmshVersion.h
GMSH_DATE = `date "+%Y%m%d"`
GMSH_API =\
Geo/GModel.h Geo/GEntity.h\
Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h Geo/GFace.h Geo/GRegion.h\
Geo/GEdgeLoop.h Geo/GEdgeCompound.h Geo/GFaceCompound.h Geo/GRegionCompound.h\
Geo/MVertex.h Geo/MEdge.h Geo/MFace.h Geo/MElement.h Geo/MPoint.h Geo/MLine.h\
Geo/MTriangle.h Geo/MQuadrangle.h Geo/MTetrahedron.h Geo/MHexahedron.h\
Geo/MPrism.h Geo/MPyramid.h Geo/MElementCut.h\
Geo/discreteVertex.h Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h\
Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/SBoundingBox3d.h Geo/Pair.h\
Geo/Range.h Geo/SOrientedBoundingBox.h Geo/CellComplex.h Geo/ChainComplex.h\
contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h contrib/kbipack/gmp_blas.h\
Numeric/Gauss.h Numeric/FunctionSpace.h Numeric/GmshMatrix.h\
Numeric/gmshAssembler.h Numeric/gmshTermOfFormulation.h Numeric/gmshLaplace.h\
Numeric/gmshElasticity.h Numeric/gmshLinearSystem.h Numeric/gmshLinearSystemGmm.h\
Numeric/gmshLinearSystemFull.h Numeric/gmshFunction.h\
Post/PView.h Post/PViewData.h Plugin/PluginManager.h\
Graphics/drawContext.h\
Common/VertexArray.h Common/GmshMessage.h\
Common/Gmsh.h Common/GmshConfig.h Common/GmshDefines.h Common/GmshVersion.h
# Main building rules
all: link
link: compile
${LINKER} ${OPTIM} ${DASH}o bin/gmsh${EXEEXT} ${GMSH_LIBS}
compile: variables initialtag
ifneq (${UNAME},WIN32MSVC)
@for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE}); done
else
for %%i in (${GMSH_DIRS}) do ${MAKE} -C %%i
endif
install: variables
mkdir -p ${bindir}
cp -f bin/gmsh${EXEEXT} ${bindir}
chmod 755 ${bindir}/gmsh${EXEEXT}
mkdir -p ${mandir}/man1
cp -f doc/gmsh.1 ${mandir}/man1
uninstall:
rm -f ${bindir}/gmsh${EXEEXT}
rm -f ${mandir}/man1/gmsh.1
tag:
ifneq (${UNAME},WIN32MSVC)
echo "#define GMSH_MAJOR_VERSION ${GMSH_MAJOR_VERSION}" > ${GMSH_VERSION_FILE}
echo "#define GMSH_MINOR_VERSION ${GMSH_MINOR_VERSION}" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_PATCH_VERSION ${GMSH_PATCH_VERSION}" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_EXTRA_VERSION \"${GMSH_EXTRA_VERSION}\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_VERSION \"${GMSH_VERSION}\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_DATE \"`date`\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_HOST \"${HOSTNAME}\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_PACKAGER \"`whoami`\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_OS \"${UNAME}\"" >> ${GMSH_VERSION_FILE}
echo "#define GMSH_SHORT_LICENSE \"${GMSH_SHORT_LICENSE}\"" >> ${GMSH_VERSION_FILE}
else
echo #define GMSH_MAJOR_VERSION ${GMSH_MAJOR_VERSION} > ${GMSH_VERSION_FILE}
echo #define GMSH_MINOR_VERSION ${GMSH_MINOR_VERSION} >> ${GMSH_VERSION_FILE}
echo #define GMSH_PATCH_VERSION ${GMSH_PATCH_VERSION} >> ${GMSH_VERSION_FILE}
echo #define GMSH_EXTRA_VERSION "${GMSH_EXTRA_VERSION}" >> ${GMSH_VERSION_FILE}
echo #define GMSH_VERSION "${GMSH_VERSION}" >> ${GMSH_VERSION_FILE}
echo #define GMSH_DATE "" >> ${GMSH_VERSION_FILE}
echo #define GMSH_HOST "${HOSTNAME}" >> ${GMSH_VERSION_FILE}
echo #define GMSH_PACKAGER "" >> ${GMSH_VERSION_FILE}
echo #define GMSH_OS "${UNAME}" >> ${GMSH_VERSION_FILE}
echo #define GMSH_SHORT_LICENSE ${GMSH_SHORT_LICENSE} >> ${GMSH_VERSION_FILE}
endif
# Rules to build the Gmsh library
.PHONY: lib
lib: variables initialtag
ifneq (${UNAME},WIN32MSVC)
@for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE} cpobj); done
${AR} ${ARFLAGS}lib/libGmsh${LIBEXT} lib/*${OBJEXT}
${RANLIB} lib/libGmsh${LIBEXT}
rm -f lib/*${OBJEXT}
else
for %%i in (${GMSH_DIRS}); do ${MAKE} -C %%i
${AR} ${ARFLAGS}bin\libGmsh${LIBEXT} lib\*${LIBEXT}
erase lib\*${LIBEXT}
move bin\libGmsh${LIBEXT} "lib"
endif
install-lib: lib
ifneq (${UNAME},WIN32MSVC)
mkdir -p ${includedir}/gmsh
rm -f ${includedir}/gmsh/*
cp -f ${GMSH_API} ${includedir}/gmsh
mkdir -p ${libdir}
cp -f lib/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT}
else
if not exist ${includedir}\gmsh mkdir ${includedir}\gmsh
if not exist ${libdir} mkdir ${libdir}
erase /q ${includedir}\gmsh\*.h
for %%i in (${subst /,\,${GMSH_API}}) do copy %%i ${includedir}\gmsh
copy /y lib\libGmsh${LIBEXT} ${libdir}\libGmsh${LIBSUFFIX}${LIBEXT}
endif
uninstall-lib:
rm -rf ${includedir}/gmsh
rm -rf ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT}
# Macintosh-specific rules
link-mac-universal: compile
${LINKER} -arch i386 ${OPTIM} -o bin/gmsh_i386 ${GMSH_LIBS}
${LINKER} -arch ppc ${OPTIM} -o bin/gmsh_ppc ${GMSH_LIBS}
lipo -create bin/gmsh_i386 bin/gmsh_ppc -output bin/gmsh
rm -f bin/gmsh_i386 bin/gmsh_ppc
install-mac: variables package-mac
cp -rf gmsh-${GMSH_VERSION}/Gmsh.app /Applications
rm -rf gmsh-${GMSH_VERSION} gmsh-${GMSH_VERSION}-MacOSX.tgz
uninstall-mac:
rm -rf /Applications/Gmsh.app
framework: lib
rm -rf Gmsh.framework
mkdir -p Gmsh.framework
mkdir -p Gmsh.framework/Versions
mkdir -p Gmsh.framework/Versions/A
mkdir -p Gmsh.framework/Versions/A/Headers
mkdir -p Gmsh.framework/Versions/A/Resources
cp lib/libGmsh${LIBEXT} Gmsh.framework/Versions/A/Gmsh
cp ${GMSH_API} Gmsh.framework/Versions/A/Headers/
sed -e "s/GMSH_VERSION/${GMSH_VERSION}/g" utils/misc/Info_framework.plist\
> Gmsh.framework/Versions/A/Resources/Info.plist
cd Gmsh.framework/Versions && ln -s A Current
cd Gmsh.framework && ln -s Versions/Current/Gmsh
cd Gmsh.framework && ln -s Versions/Current/Headers
cd Gmsh.framework && ln -s Versions/Current/Resources
# Utilities
variables: configure
@echo "********************************************************************"
@echo "Please configure Gmsh by running ./configure"
@echo "For help, type ./configure --help"
@echo "********************************************************************"
@exit 1
.PHONY: parser
parser:
cd Parser && ${MAKE} parser
.PHONY: utils
utils:
cd utils/converters/autocad && ${MAKE}
cd utils/misc && ${MAKE}
.PHONY: doc
doc:
cd doc/texinfo && ${MAKE} all
cd doc && tar zcf ../gmsh-${GMSH_VERSION}-doc.tgz\
FAQ.txt CREDITS.txt VERSIONS.txt README.win32 gmsh.1\
texinfo/gmsh.pdf texinfo/gmsh.txt\
texinfo/*.html texinfo/gmsh-info.tgz
doc-info:
cd doc/texinfo && ${MAKE} info
purge:
rm -f `find . -name "*~" -o -name "*~~" -o -name ".gmsh-errors"\
-o -name "\#*" -o -name ".\#*" -o -name ".DS_Store"\
-o -name "gmon.out" -o -name ".gdb_history" -o -name "debug?.pos"\
-o -name "*.bak"`
clean:
ifneq (${UNAME},WIN32MSVC)
for i in doc lib ${GMSH_DIRS}; do (cd $$i && ${MAKE} clean); done
rm -f ${GMSH_VERSION_FILE}
else
for %%i in (doc lib ${GMSH_DIRS}) do ${MAKE} -C %%i clean
erase Common\GmshVersion.h
endif
clean-fm:
rm -f Geo/fourier*.o Geo/GModelIO_Fourier.o Fltk/GUI_Projection.o
depend: initialtag
mv -f Common/GmshConfig.h .
cp -f utils/misc/GmshConfig.depend Common/GmshConfig.h
for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE} depend); done
mv -f GmshConfig.h Common/
nodepend:
for i in ${GMSH_DIRS} ; do\
(cd $$i && (sed '/^# DO NOT DELETE THIS LINE/q' Makefile) > Makefile.new\
&& cp Makefile Makefile.bak\
&& cp Makefile.new Makefile\
&& rm -f Makefile.new);\
done
initialtag:
ifneq (${UNAME},WIN32MSVC)
@if [ ! -r ${GMSH_VERSION_FILE} ]; then ${MAKE} tag ; fi
else
${MAKE} tag
endif
tags:
gtags
htags
etags:
etags `find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" -o\
-name "*.y" -o -name "*.l" \)`
# Rules to package the sources
source-tree: purge
rm -rf gmsh-${GMSH_VERSION}
tar zcf gmsh.tgz --exclude "*.o" --exclude "*.a" --exclude "gmsh"\
--exclude "variables" --exclude "config.log" --exclude "config.status"\
--exclude "autom4*" --exclude "Makefile.distrib" --exclude "Makefile.bak"\
--exclude "benchmarks" --exclude "zzz_*" --exclude "HTML"\
--exclude "*TAGS*" --exclude "GSYMS" --exclude "GPATH" --exclude "CVS"\
*
mkdir gmsh-${GMSH_VERSION}
cd gmsh-${GMSH_VERSION} && tar zxf ../gmsh.tgz
rm -f gmsh.tgz
source: source-tree
cd gmsh-${GMSH_VERSION} && rm -rf ${GMSH_VERSION_FILE}\
Common/GmshConfig.h contrib/Tetgen*/*.{cxx,h}\
utils/nightly utils/misc/variables.i*
tar zcf gmsh-${GMSH_VERSION}-source.tgz gmsh-${GMSH_VERSION}
# Rules to package the binaries
package-unix:
rm -rf gmsh-${GMSH_VERSION}
mkdir gmsh-${GMSH_VERSION}
cp bin/gmsh gmsh-${GMSH_VERSION}
strip gmsh-${GMSH_VERSION}/gmsh
cp doc/gmsh.1 doc/LICENSE.txt doc/VERSIONS.txt doc/FAQ.txt doc/CREDITS.txt\
gmsh-${GMSH_VERSION}
cp -R tutorial gmsh-${GMSH_VERSION}
cp -R demos gmsh-${GMSH_VERSION}
rm -rf gmsh-${GMSH_VERSION}/*/CVS
rm -f gmsh-${GMSH_VERSION}/tutorial/t*.msh
rm -f gmsh-${GMSH_VERSION}/*/*~
tar cf gmsh-${GMSH_VERSION}-${UNAME}.tar gmsh-${GMSH_VERSION}
gzip gmsh-${GMSH_VERSION}-${UNAME}.tar
mv gmsh-${GMSH_VERSION}-${UNAME}.tar.gz gmsh-${GMSH_VERSION}-${UNAME}.tgz
package-win:
rm -rf gmsh-${GMSH_VERSION}
mkdir gmsh-${GMSH_VERSION}
cp bin/gmsh.exe gmsh-${GMSH_VERSION}
strip gmsh-${GMSH_VERSION}/gmsh.exe
cp doc/README.win32 gmsh-${GMSH_VERSION}/README.txt
cp doc/LICENSE.txt doc/VERSIONS.txt doc/FAQ.txt doc/CREDITS.txt\
gmsh-${GMSH_VERSION}
cp -R tutorial gmsh-${GMSH_VERSION}
cp -R demos gmsh-${GMSH_VERSION}
rm -rf gmsh-${GMSH_VERSION}/*/CVS
rm -f gmsh-${GMSH_VERSION}/tutorial/t*.msh
rm -f gmsh-${GMSH_VERSION}/*/*~
unix2dos gmsh-${GMSH_VERSION}/*.txt
unix2dos gmsh-${GMSH_VERSION}/tutorial/*
unix2dos gmsh-${GMSH_VERSION}/demos/*
cd gmsh-${GMSH_VERSION} && zip -r gmsh-${GMSH_VERSION}-Windows.zip *
mv gmsh-${GMSH_VERSION}/gmsh-${GMSH_VERSION}-Windows.zip .
package-mac:
rm -rf gmsh-${GMSH_VERSION}
mkdir gmsh-${GMSH_VERSION}
mkdir gmsh-${GMSH_VERSION}/Gmsh.app
mkdir gmsh-${GMSH_VERSION}/Gmsh.app/Contents
mkdir gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Resources
mkdir gmsh-${GMSH_VERSION}/Gmsh.app/Contents/MacOS
echo "APPLGMSH" > gmsh-${GMSH_VERSION}/Gmsh.app/Contents/PkgInfo
sed -e "s/GMSH_VERSION/Gmsh ${GMSH_VERSION}/g" utils/misc/Info.plist\
> gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Info.plist
cp bin/gmsh gmsh-${GMSH_VERSION}/Gmsh.app/Contents/MacOS/Gmsh
strip gmsh-${GMSH_VERSION}/Gmsh.app/Contents/MacOS/Gmsh
cp Fltk/MacIcons.icns gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Resources/Gmsh.icns
cp Fltk/MacIconsGeo.icns gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Resources/GmshGeo.icns
cp Fltk/MacIconsMsh.icns gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Resources/GmshMsh.icns
cp Fltk/MacIconsPos.icns gmsh-${GMSH_VERSION}/Gmsh.app/Contents/Resources/GmshPos.icns
cp -R tutorial demos gmsh-${GMSH_VERSION}
cp doc/LICENSE.txt doc/VERSIONS.txt doc/FAQ.txt doc/CREDITS.txt\
gmsh-${GMSH_VERSION}
rm -rf gmsh-${GMSH_VERSION}/*/CVS\
gmsh-${GMSH_VERSION}/tutorial/t*.msh\
gmsh-${GMSH_VERSION}/*/*~
tar zcf gmsh-${GMSH_VERSION}-MacOSX.tgz gmsh-${GMSH_VERSION}
package-rpm:
tar zcf /usr/src/rpm/SOURCES/gmsh-${GMSH_VERSION}.tar.gz .
rpmbuild -bb --define 'gmshversion ${GMSH_VERSION}' utils/misc/gmsh.spec
mv /usr/src/rpm/RPMS/i386/gmsh-${GMSH_VERSION}-?.i386.rpm .
mv /usr/src/rpm/BUILD/gmsh-${GMSH_VERSION}/gmsh-${GMSH_VERSION}-${UNAME}.tgz .
rm -f /usr/src/rpm/SOURCES/gmsh-${GMSH_VERSION}.tar.gz
rm -rf /usr/src/rpm/BUILD/gmsh-${GMSH_VERSION}
# Rules to distribute official releases
distrib-pre:
mv -f Makefile Makefile.distrib
sed -e "s/^GMSH_EXTRA_VERSION.*/GMSH_EXTRA_VERSION =/g"\
Makefile.distrib > Makefile
make tag
distrib-pre-cvs:
mv -f Makefile Makefile.distrib
sed -e "s/^GMSH_EXTRA_VERSION.*/GMSH_EXTRA_VERSION = \"-cvs-${GMSH_DATE}\"/g"\
Makefile.distrib > Makefile
make tag
distrib-post:
mv -f Makefile.distrib Makefile
rm -f ${GMSH_VERSION_FILE}
distrib-unix:
make distrib-pre
make link
make package-unix
make distrib-post
ldd bin/gmsh
distrib-unix-nightly:
make distrib-pre-cvs
make link
make package-unix
make distrib-post
distrib-win:
make distrib-pre
make link
make package-win
make distrib-post
objdump -p bin/gmsh.exe | grep DLL
distrib-win-nightly:
make distrib-pre-cvs
make link
make package-win
make distrib-post
distrib-mac:
make distrib-pre
make link-mac-universal
make package-mac
make distrib-post
otool -L bin/gmsh
distrib-mac-nightly:
make distrib-pre-cvs
make link-mac-universal
make package-mac
make distrib-post
distrib-source:
make distrib-pre
make source
make distrib-post
distrib-source-nightly:
make distrib-pre-cvs
make source
make distrib-post
This is Gmsh, an automatic three-dimensional finite element mesh
generator with built-in pre- and post-processing facilities.
To install Gmsh, type
./configure
make
make install
This requires FLTK 1.1.7 or above, configured with OpenGL support.
FLTK is freely available from http://www.fltk.org. To install a
non-graphical version of Gmsh (that does not require FLTK), type
./configure --disable-gui
make
make install
For a description of all other configuration options, type
./configure --help
To build Gmsh with Microsoft Visual C++, follow the intructions in
doc/README.msvc.
Gmsh is distributed under the terms of the GNU General Public License,
with an exception to allow for easier linking with external mesh
generators. See doc/LICENSE.txt and doc/CREDITS.txt for more
information.
See the doc/ and tutorial/ directories for documentation. The
reference manual is located in doc/texinfo/.
See the demos/ directory for additional examples.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
dnl Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
dnl
dnl See the LICENSE.txt file for license information. Please report all
dnl bugs and problems to <gmsh@geuz.org>.
dnl Process this file with autoconf to produce the configure script.
dnl Check that this is the gmsh source tree
AC_INIT(Geo/GModel.h)
dnl Parse '--with' command-line options
AC_ARG_WITH(taucs-prefix,
AC_HELP_STRING([--with-taucs-prefix=PFX],
[prefix where TAUCS is installed]),
[TAUCS_PREFIX=$withval])
AC_ARG_WITH(fltk-prefix,
AC_HELP_STRING([--with-fltk-prefix=PFX],
[prefix where FLTK is installed]),
[FLTK_PREFIX=$withval])
AC_ARG_WITH(jpeg-prefix,
AC_HELP_STRING([--with-jpeg-prefix=PFX],
[prefix where the JPEG library and includes are installed]),
[JPEG_PREFIX=$withval])
AC_ARG_WITH(png-prefix,
AC_HELP_STRING([--with-png-prefix=PFX],
[prefix where the PNG library and includes are installed]),
[PNG_PREFIX=$withval])
AC_ARG_WITH(zlib-prefix,
AC_HELP_STRING([--with-zlib-prefix=PFX],
[prefix where the ZLIB library and includes are installed]),
[ZLIB_PREFIX=$withval])
AC_ARG_WITH(osmesa-prefix,
AC_HELP_STRING([--with-osmesa-prefix=PFX],
[prefix where OSMesa is installed]),
[OSMESA_PREFIX=$withval])
AC_ARG_WITH(cgns-prefix,
AC_HELP_STRING([--with-cgns-prefix=PFX],
[prefix where CGNS is installed]),
[CGNS_PREFIX=$withval])
AC_ARG_WITH(occ-prefix,
AC_HELP_STRING([--with-occ-prefix=PFX],
[prefix where OpenCascade is installed]),
[OCC_PREFIX=$withval])
AC_ARG_WITH(occ-mesh-constraints-prefix,
AC_HELP_STRING([--occ-mesh-constraints-prefix=PFX],
[prefix where OCC mesh contraints source code is located]),
[OCC_MESH_CONTRAINTS_PREFIX=$withval])
AC_ARG_WITH(hdf5-prefix,
AC_HELP_STRING([--with-hdf5-prefix=PFX],
[prefix where HDF5 is installed]),
[HDF5_PREFIX=$withval])
AC_ARG_WITH(med-prefix,
AC_HELP_STRING([--with-med-prefix=PFX],
[prefix where MED is installed]),
[MED_PREFIX=$withval])
AC_ARG_WITH(mpi-prefix,
AC_HELP_STRING([--with-mpi-prefix=PFX],
[prefix where MPI is installed]),
[MPI_PREFIX=$withval])
AC_ARG_WITH(fftw3-prefix,
AC_HELP_STRING([--with-fftw3-prefix=PFX],
[prefix where FFTW3 is installed]),
[FFTW3_PREFIX=$withval])
AC_ARG_WITH(fm-prefix,
AC_HELP_STRING([--with-fm-prefix=PFX],
[prefix where FourierModel is installed]),
[FM_PREFIX=$withval])
AC_ARG_WITH(blas-lapack-prefix,
AC_HELP_STRING([--with-blas-lapack-prefix=PFX],
[prefix where BLAS and LAPACK are installed]),
[BLAS_LAPACK_PREFIX=$withval])
dnl Parse '--enable' command line options
AC_ARG_ENABLE(gui,
AC_HELP_STRING([--enable-gui],
[build the graphical user interface (default=yes)]))
AC_ARG_ENABLE(parser,
AC_HELP_STRING([--enable-parser],
[build the parser (default=yes)]))
AC_ARG_ENABLE(post,
AC_HELP_STRING([--enable-post],
[build the post-processing module (default=yes)]))
AC_ARG_ENABLE(cygwin,
AC_HELP_STRING([--enable-cygwin],
[use the Cygwin library on Windows (default=no)]))
AC_ARG_ENABLE(jpeg,
AC_HELP_STRING([--enable-jpeg],
[enable JPEG support (default=yes)]))
AC_ARG_ENABLE(zlib,
AC_HELP_STRING([--enable-zlib],
[enable ZLIB support (default=yes)]))
AC_ARG_ENABLE(png,
AC_HELP_STRING([--enable-png],
[enable PNG support (default=yes)]))
AC_ARG_ENABLE(contrib,
AC_HELP_STRING([--enable-contrib],
[enable contrib packages (default=yes)]))
AC_ARG_ENABLE(netgen,
AC_HELP_STRING([--enable-netgen],
[compile Netgen if available (default=yes)]))
AC_ARG_ENABLE(ann,
AC_HELP_STRING([--enable-ann],
[compile ANN if available (default=yes)]))
AC_ARG_ENABLE(metis,
AC_HELP_STRING([--enable-metis],
[compile METIS partitioner (default=yes)]))
AC_ARG_ENABLE(chaco,
AC_HELP_STRING([--enable-chaco],
[compile Chaco partitioner (default=yes)]))
AC_ARG_ENABLE(tetgen,
AC_HELP_STRING([--enable-tetgen],
[compile Tetgen if available (default=yes)]))
AC_ARG_ENABLE(matheval,
AC_HELP_STRING([--enable-matheval],
[compile MathEval if available (default=yes)]))
AC_ARG_ENABLE(kbipack,
AC_HELP_STRING([--enable-kbipack],
[compile kbipack if available (default=yes)]))
AC_ARG_ENABLE(dintegration,
AC_HELP_STRING([--enable-dintegration],
[compile Discrete Integration if available (default=yes)]))
AC_ARG_ENABLE(gmm,
AC_HELP_STRING([--enable-gmm],
[use gmm++ if available (default=yes)]))
AC_ARG_ENABLE(osmesa,
AC_HELP_STRING([--enable-osmesa],
[use OSMesa for offscreen rendering (default=no)]))
AC_ARG_ENABLE(cgns,
AC_HELP_STRING([--enable-cgns],
[enable CGNS output (default=no)]))
AC_ARG_ENABLE(occ,
AC_HELP_STRING([--enable-occ],
[enable OpenCascade support (default=no)]))
AC_ARG_ENABLE(taucs,
AC_HELP_STRING([--enable-taucs],
[enable Taucs support (default=no)]))
AC_ARG_ENABLE(hdf5,
AC_HELP_STRING([--enable-hdf5],
[enable HDF5 support (default=no)]))
AC_ARG_ENABLE(med,
AC_HELP_STRING([--enable-med],
[enable MED support (default=yes)]))
AC_ARG_ENABLE(fm,
AC_HELP_STRING([--enable-fm],
[enable support for FourierModel (default=yes)]))
AC_ARG_ENABLE(universal,
AC_HELP_STRING([--enable-universal],
[enable support for universal binaries on Mac (default=no)]))
AC_ARG_ENABLE(native-file-chooser,
AC_HELP_STRING([--enable-native-file-chooser],
[enable native file chooser (default=yes, except on Linux)]))
AC_ARG_ENABLE(tree-browser,
AC_HELP_STRING([--enable-tree-browser],
[enable tree browser (default=yes)]))
AC_ARG_ENABLE(mpi,
AC_HELP_STRING([--enable-mpi],
[enable MPI support (default=no)]))
dnl undocumented options
AC_ARG_ENABLE(graphics)
AC_ARG_ENABLE(minimal)
AC_ARG_ENABLE(tetgen-new)
dnl "minimal" build shortcut
if test "x$enable_minimal" = "xyes"; then
enable_gui=no;
enable_fm=no;
enable_netgen=no;
enable_tetgen=no;
enable_matheval=no;
enable_kbipack=no;
enable_dintegration=no;
enable_gmm=no;
enable_ann=no;
enable_metis=no;
enable_chaco=no;
enable_med=no;
enable_cgns=no;
enable_hdf5=no;
enable_zlib=no;
enable_taucs=no;
if test "x$enable_post" != "xyes"; then
enable_post=no;
fi
if test "x$enable_parser" != "xyes"; then
enable_parser=no;
fi
if test "x$enable_occ" != "xyes"; then
enable_occ=no;
fi
CXXFLAGS=-O2;
fi
dnl Get the operating system and machine names
UNAME=`uname`
HOSTNAME=`hostname`
dnl Check for default compilers
AC_PROG_CC
AC_PROG_CXX
if test "x${CC}" = "x" -o "x${CXX}" = "x" ; then
AC_MSG_ERROR([Could not find required compilers, aborting.])
fi
dnl Set preprocessor and linker
AC_PROG_CPP
LINKER="${CXX}"
dnl Set default compiler flags
FLAGS=""
OPTIM="${CXXFLAGS}"
dnl Take care of no-cygwin option before doing any other tests
case "$UNAME" in
CYGWIN*)
if test "x$enable_cygwin" != "xyes"; then
UNAME="${UNAME}-no-cygwin"
CC="${CC} -mno-cygwin"
CXX="${CXX} -mno-cygwin"
LINKER="${LINKER} -mno-cygwin"
fi
;;
esac
dnl Use c++ for all compilation tests
AC_LANG(C++)
dnl See if we need a .exe extension on executables
AC_EXEEXT
dnl How to build static libraries?
case "$UNAME" in
Darwin*)
RANLIB=true
AR="libtool -o"
LIBEXT=".a"
;;
*)
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar)
if test "x${AR}" = "x:"; then
AC_MSG_ERROR([Could not find the library archiver, aborting.])
fi
AR="${AR} ruvs"
LIBEXT=".a"
;;
esac
dnl Choose to build the GUI or the batch version
if test "x$enable_gui" != "xno"; then
GMSH_DIRS="Common Geo Mesh Post Plugin Numeric Parser Graphics Fltk"
GMSH_LIBS="-Llib -lGmshFltk -lGmshCommon -lGmshMesh -lGmshPost -lGmshPlugin -lGmshGeo"
GMSH_LIBS="${GMSH_LIBS} -lGmshCommon -lGmshGraphics -lGmshParser -lGmshNumeric"
AC_DEFINE(HAVE_FLTK)
BO="${BO} Fltk"
if test "x${FLTK_PREFIX}" != "x" ; then
AC_PATH_PROG(FLTKCONFIG,fltk-config,[],[${FLTK_PREFIX}:${FLTK_PREFIX}/bin:$PATH])
dnl Find the libs/includes even if fltk is _not_ properly installed (ugly hack!)
GMSH_LIBS="${GMSH_LIBS} -L${FLTK_PREFIX}/lib"
FLAGS="${FLAGS} -I${FLTK_PREFIX}"
else
AC_PATH_PROG(FLTKCONFIG,fltk-config)
fi
if test "x$FLTKCONFIG" = "x"; then
AC_MSG_ERROR([Could not find fltk-config. Try --with-fltk-prefix?])
fi
dnl Check for offscreen rendering using OSMesa
if test "x$enable_osmesa" = "xyes"; then
if test "x${OSMESA_PREFIX}" != "x"; then
LDFLAGS="-L${OSMESA_PREFIX} -L${OSMESA_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(OSMesa,main,OSMESA="yes")
fi
dnl Check for native file chooser
AC_CHECK_FILE(./contrib/NativeFileChooser/Fl_Native_File_Chooser.cxx,NATIVE="yes")
if test "x${NATIVE}" = "xyes"; then
if (test "x${UNAME}" = "xLinux" -a "x$enable_native_file_chooser" = "xyes" ||
test "x${UNAME}" != "xLinux" -a "x$enable_native_file_chooser" != "xno"); then
GMSH_DIRS="${GMSH_DIRS} contrib/NativeFileChooser"
GMSH_LIBS="${GMSH_LIBS} -lGmshNativeFileChooser"
AC_DEFINE(HAVE_NATIVE_FILE_CHOOSER)
BO="${BO} NativeFileChooser"
fi
fi
dnl Check for tree browser widget
if test "x$enable_tree_browser" != "xno"; then
AC_CHECK_FILE(./contrib/TreeBrowser/Flu_Tree_Browser.cpp,TREEBROWSER="yes")
if test "x${TREEBROWSER}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/TreeBrowser"
GMSH_LIBS="${GMSH_LIBS} -lGmshTreeBrowser"
AC_DEFINE(HAVE_TREE_BROWSER)
BO="${BO} TreeBrowser"
fi
fi
if test "x${OSMESA}" = "xyes"; then
GMSH_LIBS="${GMSH_LIBS} `$FLTKCONFIG --use-images --ldflags` -lfltk_gl"
FLAGS="${FLAGS} `$FLTKCONFIG --use-images --cxxflags`"
AC_DEFINE(HAVE_OSMESA)
BO="${BO} OsMesa"
if test "x${OSMESA_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lOSMesa -lGL -lGLU"
else
GMSH_LIBS="${GMSH_LIBS} -L${OSMESA_PREFIX} -L${OSMESA_PREFIX}/lib -lOSMesa -lGL -lGLU"
FLAGS="${FLAGS} -I${OSMESA_PREFIX} -I${OSMESA_PREFIX}/include"
fi
else
GMSH_LIBS="${GMSH_LIBS} `$FLTKCONFIG --use-gl --use-images --ldflags`"
FLAGS="${FLAGS} `$FLTKCONFIG --use-gl --use-images --cxxflags`"
dnl Ugly fix for Debian bug (fltk-config does not return GL libs)
if test "x${UNAME}" = "xLinux"; then
FIX_GL="yes"
expr "x${GMSH_LIBS}" : 'x.*GL.*' >/dev/null && FIX_GL="no"
if test "x${FIX_GL}" = "xyes"; then
GMSH_LIBS="${GMSH_LIBS} -lGLU -lGL"
fi
fi
fi
expr "x${GMSH_LIBS}" : 'x.*fltk_jpeg.*' >/dev/null && FL_JPEG="yes"
expr "x${GMSH_LIBS}" : 'x.*fltk_png.*' >/dev/null && FL_PNG="yes"
expr "x${GMSH_LIBS}" : 'x.*fltk_z.*' >/dev/null && FL_ZLIB="yes"
dnl Check for libjpeg
if test "x$enable_jpeg" != "xno"; then
dnl If provided by FLTK, use that one; otherwise, look for it
if test "x${FL_JPEG}" = "xyes"; then
AC_DEFINE(HAVE_LIBJPEG)
BO="${BO} Jpeg"
else
if test "x${JPEG_PREFIX}" != "x"; then
LDFLAGS="-L${JPEG_PREFIX} -L${JPEG_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(jpeg,main,JPEG="yes")
if test "x${JPEG}" = "xyes"; then
AC_DEFINE(HAVE_LIBJPEG)
BO="${BO} Jpeg"
if test "x${JPEG_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -ljpeg"
else
dnl Find the libs/includes even if libjpeg is _not_ properly installed (ugly hack!)
GMSH_LIBS="${GMSH_LIBS} -L${JPEG_PREFIX} -L${JPEG_PREFIX}/lib -ljpeg"
FLAGS="${FLAGS} -I${JPEG_PREFIX} -I${JPEG_PREFIX}/include"
fi
fi
fi
fi
dnl Check for libz
if test "x$enable_zlib" != "xno"; then
dnl If provided by FLTK, use that one; otherwise, look for it
if test "x${FL_ZLIB}" = "xyes"; then
ZLIB="yes"
else
if test "x${ZLIB_PREFIX}" != "x"; then
LDFLAGS="-L${ZLIB_PREFIX} -L${ZLIB_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(z,main,ZLIB="yes")
fi
fi
dnl Check for libpng (only if libz is available)
if test "x$enable_png" != "xno" -a "x${ZLIB}" = "xyes"; then
dnl If provided by FLTK, use that one; otherwise, look for it
if test "x${FL_PNG}" = "xyes"; then
AC_DEFINE(HAVE_LIBPNG)
BO="${BO} Png"
else
if test "x${PNG_PREFIX}" != "x"; then
LDFLAGS="-L${PNG_PREFIX} -L${PNG_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(png,main,PNG="yes")
if test "x${PNG}" = "xyes"; then
AC_DEFINE(HAVE_LIBPNG)
BO="${BO} Png"
if test "x${PNG_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lpng"
else
dnl Find the libs/includes even if libpng is _not_ properly installed (ugly hack!)
GMSH_LIBS="${GMSH_LIBS} -L${PNG_PREFIX} -L${PNG_PREFIX}/lib -lpng"
FLAGS="${FLAGS} -I${PNG_PREFIX} -I${PNG_PREFIX}/include"
fi
fi
fi
fi
else
GMSH_DIRS="Common Geo Mesh"
GMSH_LIBS="-Llib Common/Main.o -lGmshCommon -lGmshMesh -lGmshGeo"
if test "x$enable_post" != "xno"; then
GMSH_DIRS="${GMSH_DIRS} Post Plugin"
GMSH_LIBS="${GMSH_LIBS} -lGmshPost -lGmshPlugin -lGmshGeo"
else
AC_DEFINE(HAVE_NO_POST)
BO="${BO} NoPost"
fi
if test "x$enable_parser" != "xno"; then
GMSH_DIRS="${GMSH_DIRS} Parser"
GMSH_LIBS="${GMSH_LIBS} -lGmshParser"
else
AC_DEFINE(HAVE_NO_PARSER)
BO="${BO} NoParser"
fi
if test "x$enable_graphics" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} Graphics"
GMSH_LIBS="${GMSH_LIBS} -lGmshGraphics"
fi
dnl re-add Common to work around linker shortcomings on some archs
GMSH_DIRS="${GMSH_DIRS} Numeric"
GMSH_LIBS="${GMSH_LIBS} -lGmshCommon -lGmshNumeric"
dnl Check for libz
if test "x$enable_zlib" != "xno"; then
if test "x${ZLIB_PREFIX}" != "x"; then
LDFLAGS="-L${ZLIB_PREFIX} -L${ZLIB_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(z,main,ZLIB="yes")
fi
fi
dnl Check for standard math library (no rule given if found, so gets
dnl added to $LIBS, used for further checks)
AC_CHECK_LIB(m,main)
dnl Check for various functions
AC_CHECK_FUNC(vsnprintf,[],AC_DEFINE(HAVE_NO_VSNPRINTF) BO="${BO} NoVsnprintf")
dnl Check if Unix98 socklen_t type is available
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t len = 42; return 0;],,AC_DEFINE(HAVE_NO_SOCKLEN_T) BO="${BO} NoSocklenT")
dnl Check if we should consider the packages in contrib
if test "x$enable_contrib" != "xno"; then
dnl Check for ANN
if test "x$enable_ann" != "xno"; then
AC_CHECK_FILE(./contrib/ANN/include/ANN/ANN.h,ANN="yes")
if test "x${ANN}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/ANN"
GMSH_LIBS="${GMSH_LIBS} -lGmshANN"
AC_DEFINE(HAVE_ANN)
BO="${BO} Ann"
fi
fi
dnl Check for gmm++ linear solver
if test "x$enable_gmm" != "xno"; then
AC_CHECK_FILE(./contrib/gmm/gmm.h,GMM="yes")
if test "x${GMM}" = "xyes"; then
AC_DEFINE(HAVE_GMM)
BO="${BO} Gmm"
fi
fi
dnl Check for Chaco partitionner
if test "x$enable_chaco" != "xno"; then
AC_CHECK_FILE(./contrib/Chaco/main/interface.c,CHACO="yes")
if test "x${CHACO}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/Chaco"
GMSH_LIBS="${GMSH_LIBS} -lGmshChaco"
AC_DEFINE(HAVE_CHACO)
BO="${BO} Chaco"
fi
fi
dnl Check for Metis partitionner
if test "x$enable_metis" != "xno"; then
AC_CHECK_FILE(./contrib/Metis/metis.h,METIS="yes")
if test "x${METIS}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/Metis"
GMSH_LIBS="${GMSH_LIBS} -lGmshMetis"
AC_DEFINE(HAVE_METIS)
BO="${BO} Metis"
AC_MSG_WARN([By including METIS you have to comply with METIS' special])
AC_MSG_WARN([licensing requirements stated in contrib/Metis/README. To])
AC_MSG_WARN([disable METIS use the --disable-metis option.])
fi
fi
dnl Check for Netgen
if test "x$enable_netgen" != "xno"; then
AC_CHECK_FILE(./contrib/Netgen/libsrc/meshing/meshclass.cpp,NETGEN="yes")
if test "x${NETGEN}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/Netgen"
GMSH_LIBS="${GMSH_LIBS} -lGmshNetgen"
AC_DEFINE(HAVE_NETGEN)
BO="${BO} Netgen"
fi
fi
dnl Check for Tetgen
if test "x$enable_tetgen_new" = "xyes"; then
AC_CHECK_FILE(./contrib/TetgenNew/tetgen.h,TETGEN="yes")
if test "x${TETGEN}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/TetgenNew"
GMSH_LIBS="${GMSH_LIBS} -lGmshTetgenNew"
AC_DEFINE(HAVE_TETGEN)
BO="${BO} TetgenNew"
AC_MSG_WARN([You are building with an experimental version of Tetgen that])
AC_MSG_WARN([is KNOWN TO BE BUGGY on 64 bits archs and on WIN32/MSVC.])
fi
else
if test "x$enable_tetgen" != "xno"; then
AC_CHECK_FILE(./contrib/Tetgen/tetgen.h,TETGEN="yes")
if test "x${TETGEN}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/Tetgen"
GMSH_LIBS="${GMSH_LIBS} -lGmshTetgen"
AC_DEFINE(HAVE_TETGEN)
BO="${BO} Tetgen"
AC_MSG_WARN([By including Tetgen you have to comply with Tetgen' special])
AC_MSG_WARN([licensing requirements stated in contrib/Tetgen/LICENSE. To])
AC_MSG_WARN([disable Tetgen, use the --disable-tetgen option])
fi
fi
fi
dnl Check for MathEval
if test "x$enable_matheval" != "xno"; then
AC_CHECK_FILE(./contrib/MathEval/matheval.cpp,MATHEVAL="yes")
if test "x${MATHEVAL}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/MathEval"
GMSH_LIBS="${GMSH_LIBS} -lGmshMathEval"
AC_DEFINE(HAVE_MATH_EVAL)
BO="${BO} MathEval"
fi
fi
dnl Check for kbipack
if test "x$enable_kbipack" != "xno"; then
AC_CHECK_LIB(gmp,main,GMP="yes")
if test "x${GMP}" = "xyes"; then
AC_CHECK_FILE(./contrib/kbipack/gmp_normal_form.h,KBIPACK="yes")
if test "x${KBIPACK}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/kbipack"
GMSH_LIBS="${GMSH_LIBS} -lGmshKbi -lgmp"
AC_DEFINE(HAVE_KBIPACK)
BO="${BO} Kbipack"
fi
fi
fi
dnl Check for DiscreteIntegration
if test "x$enable_dintegration" != "xno"; then
AC_CHECK_FILE(./contrib/DiscreteIntegration/Integration3D.cpp,DINTEGRATION="yes")
if test "x${DINTEGRATION}" = "xyes"; then
GMSH_DIRS="${GMSH_DIRS} contrib/DiscreteIntegration"
GMSH_LIBS="${GMSH_LIBS} -lGmshDIntegration -lGmshNumeric"
AC_DEFINE(HAVE_DINTEGRATION)
BO="${BO} DIntegration"
fi
fi
fi
dnl Check for OpenCascade
if test "x${OCC_PREFIX}" != "x"; then
if test "x$enable_occ" != "xno"; then
enable_occ="yes"
fi
fi
if test "x$enable_occ" = "xyes"; then
if test "x${OCC_PREFIX}" != "x"; then
LDFLAGS="-L${OCC_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(TKernel,sin,OCC="yes", AC_CHECK_LIB(TKernel,cos,OCC=yes,,"-ldl"))
if test "x${OCC}" = "xyes"; then
# DataExchange (subset; see occ/ros/adm/make/Makefile for more info)
OCC_LIBS="-lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKIGES -lTKXSBase"
# ModelingAlgorithms
OCC_LIBS="${OCC_LIBS} -lTKOffset -lTKFeat -lTKFillet -lTKBool -lTKShHealing"
OCC_LIBS="${OCC_LIBS} -lTKMesh -lTKHLR -lTKBO -lTKPrim -lTKTopAlgo -lTKGeomAlgo"
# ModelingData
OCC_LIBS="${OCC_LIBS} -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d"
# FoundationClasses
OCC_LIBS="${OCC_LIBS} -lTKAdvTools -lTKMath -lTKernel"
AC_DEFINE(HAVE_OCC)
BO="${BO} Occ"
if test "x${OCC_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} ${OCC_LIBS}"
else
GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib ${OCC_LIBS}"
FLAGS="${FLAGS} -I${OCC_PREFIX}/inc"
fi
fi
fi
dnl Check for Taucs
if test "x${TAUCS_PREFIX}" != "x"; then
if test "x$enable_taucs" != "xno"; then
enable_taucs="yes"
fi
fi
if test "x$enable_taucs" = "xyes"; then
if test "x${TAUCS_PREFIX}" != "x"; then
LDFLAGS="-L${TAUCS_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_FILE(${TAUCS_PREFIX}/src/taucs.h,TAUCS="yes")
if test "x${TAUCS}" = "xyes"; then
TAUCS_LIBS="-ltaucs"
AC_DEFINE(HAVE_TAUCS)
BO="${BO} Taucs"
if test "x${TAUCS_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} ${TAUCS_LIBS}"
else
GMSH_LIBS="${GMSH_LIBS} -L${TAUCS_PREFIX}/lib ${TAUCS_LIBS}"
FLAGS="${FLAGS} -I${TAUCS_PREFIX}/src -I${TAUCS_PREFIX}"
fi
fi
fi
dnl Check for OpenCascade mesh constraints
if test "x${OCC}" = "xyes"; then
if test "x${OCC_MESH_CONTRAINTS_PREFIX}" != "x"; then
AC_CHECK_FILE(${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx,OMC="yes")
if test "x${OMC}" = "xyes"; then
AC_DEFINE(HAVE_OCC_MESH_CONSTRAINTS)
BO="${BO} OccMeshConstraints"
FLAGS="${FLAGS} -I${OCC_MESH_CONTRAINTS_PREFIX}"
fi
fi
fi
dnl Check for HDF5 (required by MED, needs zlib, and optional for cgns)
if test "x${HDF5_PREFIX}" != "x" -a "x$enable_hdf5" != "xno"; then
enable_hdf5=yes
fi
if test "x${ZLIB}" = "xyes" -a "x$enable_med" != "xno"; then
enable_hdf5=yes
fi
if test "x$enable_hdf5" = "xyes"; then
if test "x${HDF5_PREFIX}" != "x"; then
LDFLAGS="-L${HDF5_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(hdf5,main,HDF5="yes")
if test "x${HDF5}" = "xyes"; then
LIBS="-lhdf5 ${LIBS}" # Necessary for CGNS with HDF5
fi
fi
dnl Check for CGNS
if test "x${CGNS_PREFIX}" != "x" -a "x$enable_cgns" != "xno"; then
enable_cgns="yes"
fi
if test "x$enable_cgns" = "xyes"; then
if test "x${CGNS_PREFIX}" != "x"; then
LDFLAGS="-L${CGNS_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(cgns,main,CGNS="yes")
if test "x${CGNS}" = "xyes"; then
AC_DEFINE(HAVE_LIBCGNS)
BO="${BO} Cgns"
if test "x${CGNS_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lcgns"
else
GMSH_LIBS="${GMSH_LIBS} -L${CGNS_PREFIX}/lib -lcgns"
FLAGS="${FLAGS} -I${CGNS_PREFIX}/include"
fi
fi
fi
dnl Check for MED (needs hdf5)
if test "x${HDF5}" = "xyes"; then
if test "x$enable_med" != "xno"; then
if test "x${MED_PREFIX}" != "x"; then
LDFLAGS="-L${MED_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(med,main,MED="yes")
if test "x${MED}" = "xyes"; then
AC_DEFINE(HAVE_MED)
BO="${BO} Med"
if test "x${MED_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lmed"
else
GMSH_LIBS="${GMSH_LIBS} -L${MED_PREFIX}/lib -lmed"
FLAGS="${FLAGS} -I${MED_PREFIX}/include"
fi
fi
fi
fi
dnl Complete HDF5 link line
if test "x${HDF5}" = "xyes"; then
if test "x${HDF5_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lhdf5"
else
GMSH_LIBS="${GMSH_LIBS} -L${HDF5_PREFIX}/lib -lhdf5"
FLAGS="${FLAGS} -I${HDF5_PREFIX}/include"
fi
fi
dnl Complete zlib link line (zlib must be linked in after libpng and
dnl libhdf5)
if test "x${ZLIB}" = "xyes"; then
AC_DEFINE(HAVE_LIBZ)
BO="${BO} Libz"
if test "x${FL_ZLIB}" != "xyes"; then
if test "x${ZLIB_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lz"
else
dnl Find the libs/includes even if libz is _not_ properly
dnl installed (ugly hack!)
GMSH_LIBS="${GMSH_LIBS} -L${ZLIB_PREFIX} -L${ZLIB_PREFIX}/lib -lz"
FLAGS="${FLAGS} -I${ZLIB_PREFIX} -I${ZLIB_PREFIX}/include"
fi
fi
fi
dnl Check for blas and lapack
AC_PROG_FC
if test "x$UNAME" != "xDarwin"; then
case "${FC}" in
*gfortran*)
FCLIB="-lgfortran"
;;
*g77*)
FCLIB="-lg2c"
;;
esac
fi
if test "x${BLAS_LAPACK_PREFIX}" != "x"; then
LDFLAGS="${LDFLAGS} -L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib"
fi
AC_CHECK_LIB(atlas,ATL_xerbla,ATLAS="yes",[],${FCLIB})
if test "x${ATLAS}" = "xyes"; then
AC_CHECK_LIB(f77blas,dgemm_,[BLAS="yes" BLAS_LIBS="${BLAS_LIBS} -lf77blas -latlas"],
[],[-latlas ${FCLIB}])
fi
if test "x${BLAS}" != "xyes"; then
AC_CHECK_LIB(blas,dgemm_,[BLAS="yes" BLAS_LIBS="${BLAS_LIBS} -lblas"],
[],${FCLIB})
fi
if test "x${BLAS}" = "xyes"; then
AC_DEFINE(HAVE_BLAS)
BO="${BO} Blas"
if test "x${ATLAS}" = "xyes"; then
AC_CHECK_LIB(lapack_atlas,dbdsqr_,[LAPACK="yes" BLAS_LIBS="-llapack_atlas ${BLAS_LIBS}"],
[],[${BLAS_LIBS} ${FCLIB}])
fi
if test "x${LAPACK}" != "xyes"; then
AC_CHECK_LIB(lapack,dbdsqr_,[LAPACK="yes" BLAS_LIBS="-llapack ${BLAS_LIBS}"],
[],[${BLAS_LIBS} ${FCLIB}])
fi
if test "x${LAPACK}" = "xyes"; then
AC_DEFINE(HAVE_LAPACK)
BO="${BO} Lapack"
fi
fi
if test "x${BLAS_LIBS}" != "x"; then
if test "x${BLAS_LAPACK_PREFIX}" != "x"; then
GMSH_LIBS="${GMSH_LIBS} -L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib ${BLAS_LIBS}"
else
GMSH_LIBS="${GMSH_LIBS} ${BLAS_LIBS}"
fi
GMSH_LIBS="${GMSH_LIBS} ${FCLIB}"
fi
if test "x${BLAS}" != "xyes" -o "x${LAPACK}" != "xyes"; then
AC_MSG_WARN([Could not find BLAS and/or LAPACK: some Gmsh features will not work.])
fi
dnl Check for FourierModel (if we have lapack)
if test "x${LAPACK}" = "xyes" -a "x$enable_fm" != "xno"; then
if test "x${FM_PREFIX}" != "x"; then
LDFLAGS="-L${FM_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(FourierModel,main,FM="yes")
if test "x${FM}" = "xyes"; then
dnl Check for FFTW3
if test "x${FFTW3_PREFIX}" != "x"; then
LDFLAGS="-L${FFTW3_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(fftw3,main,FFTW3="yes")
if test "x${FFTW3}" != "xyes"; then
FM=no
AC_MSG_WARN([Could not find FFTW3: disabling FourierModel.])
else
AC_DEFINE(HAVE_FOURIER_MODEL)
BO="${BO} FourierModel"
if test "x${FM_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lFourierModel"
else
GMSH_LIBS="${GMSH_LIBS} -L${FM_PREFIX}/lib -lFourierModel"
FLAGS="-I${FM_PREFIX} ${FLAGS}"
fi
if test "x${FFTW3_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lfftw3"
else
GMSH_LIBS="${GMSH_LIBS} -L${FFTW3_PREFIX}/lib -lfftw3"
FLAGS="${FLAGS} -I${FFTW3_PREFIX}/include"
fi
fi
fi
fi
dnl Check for MPI
if test "x$enable_mpi" = "xyes"; then
if test "x${MPI_PREFIX}" != "x"; then
LDFLAGS="-L${MPI_PREFIX}/lib ${LDFLAGS}"
fi
AC_CHECK_LIB(mpi_cxx,main,MPI="yes")
if test "x${MPI}" = "xyes"; then
AC_DEFINE(HAVE_MPI)
BO="${BO} Mpi"
if test "x${MPI_PREFIX}" = "x"; then
GMSH_LIBS="${GMSH_LIBS} -lmpi_cxx -lmpi"
else
GMSH_LIBS="${GMSH_LIBS} -L${MPI_PREFIX}/lib -lmpi_cxx -lmpi"
FLAGS="${FLAGS} -I${MPI_PREFIX}/include"
fi
fi
fi
dnl Finish link line
GMSH_LIBS="${GMSH_LIBS} -lm"
dnl Modify defaults according to OS
case "$UNAME" in
CYGWIN* | MINGW*)
dnl increase stack size to 16Mb to avoid stack overflows in
dnl recursive tet classification for large 3D Delaunay grids
LINKER="${LINKER} -mwindows -Wl,--stack,16777216"
if test "x$enable_cygwin" != "xyes"; then
AC_DEFINE(HAVE_NO_DLL)
BO="${BO} NoDll"
fi
if test "x${OCC}" = "xyes"; then
GMSH_LIBS="${GMSH_LIBS} -lwinspool"
fi
GMSH_LIBS="${GMSH_LIBS} -lws2_32"
if test "x$enable_gui" != "xno"; then
GMSH_LIBS="${GMSH_LIBS} Fltk/Win32Icon.res"
fi
;;
Darwin*)
AC_DEFINE(HAVE_NO_DLL)
BO="${BO} NoDll"
if test "x$enable_universal" = "xyes"; then
FLAGS="-arch ppc -arch i386 ${FLAGS}"
fi
if test "x$enable_gui" = "xno"; then
GMSH_LIBS="${GMSH_LIBS} -framework ApplicationServices"
fi
;;
AIX*)
AC_DEFINE(HAVE_NO_DLL)
BO="${BO} NoDll"
FLAGS="-D_BSD ${FLAGS}"
;;
IRIX*)
dnl options for native SGI compiler
case "${CXX}" in
*CC*)
dnl add "-mips3 -n32" to FLAGS, AR and LINKER for portable 32 bit exe
dnl "-DOLDCINCLUDE" is for Netgen
FLAGS="-LANG:std -OPT:Olimit=0 -DOLDCINCLUDE ${FLAGS}"
AR="${CXX} -ar -o"
LINKER="${CXX}"
;;
esac
;;
OSF1*)
AC_DEFINE(HAVE_NO_SOCKLEN_T)
BO="${BO} NoSocklenT"
dnl options for native DEC compiler
case "${CXX}" in
*cxx*)
FLAGS="-D__USE_STD_IOSTREAM ${FLAGS}"
;;
esac
;;
SunOS*)
AC_DEFINE(HAVE_NO_DLL)
BO="${BO} NoDll"
GMSH_LIBS="${GMSH_LIBS} -lsocket -lnsl -ldl"
;;
HP-UX*)
AC_DEFINE(HAVE_NO_DLL)
BO="${BO} NoDll"
;;
esac
dnl Check sizeof size_t (flag as 64 if not 32)
AC_CHECK_SIZEOF([size_t])
if test $ac_cv_sizeof_size_t != 4; then
if test $ac_cv_sizeof_size_t != 8; then
AC_MSG_WARN([Unsupported size of size_t - this may affect FNV hashing.])
else
AC_DEFINE(HAVE_64BIT_SIZE_T)
BO="${BO} Have64BitSizeT"
if test "x${OCC}" = "xyes"; then
FLAGS="${FLAGS} -D_OCC64"
fi
fi
fi
AC_DEFINE_UNQUOTED(GMSH_CONFIG_OPTIONS, "${BO}")
AC_CONFIG_HEADER(Common/GmshConfig.h:Common/GmshConfig.h.in)
dnl Write output
AC_SUBST(UNAME)
AC_SUBST(HOSTNAME)
AC_SUBST(FLAGS)
AC_SUBST(OPTIM)
AC_SUBST(LINKER)
AC_SUBST(GMSH_DIRS)
AC_SUBST(GMSH_LIBS)
AC_SUBST(AR)
AC_SUBST(LIBEXT)
AC_CONFIG_FILES([variables])
AC_OUTPUT
dnl Print some information
echo ""
echo "Gmsh has been configured for ${UNAME} with the following options:${BO}"
echo ""
echo "C compiler: ${CC}"
echo "C++ compiler: ${CXX}"
echo "Linker: ${LINKER}"
echo "Optimization flags: ${OPTIM}"
echo ""
echo "Edit 'variables' and 'Common/GmshConfig.h' to fine-tune the configuration."
Source diff could not be displayed: it is too large. Options to address this: view the blob.
project(qtgmsh)
cmake_minimum_required(VERSION 2.4.0)
find_package(Qt4 REQUIRED) # find and setup Qt4 for this project
set(QT_USE_QTOPENGL TRUE)
include(${QT_USE_FILE})
set(qtgmsh_SRCS
glwidget.cpp
main.cpp
window.cpp
)
set(qtgmsh_MOC_HDRS
glwidget.h
window.h
)
qt4_wrap_cpp(qtgmsh_MOC_SRCS ${qtgmsh_MOC_HDRS})
add_executable(qtgmsh ${qtgmsh_SRCS} ${qtgmsh_MOC_SRCS})
include_directories(../include)
find_library(GMSH_LIBRARIES Gmsh ../lib)
target_link_libraries(qtgmsh ${QT_LIBRARIES} ${GMSH_LIBRARIES} -llapack -lblas)
#install(TARGETS qtproject DESTINATION bin)
# tell cmake to process CMakeLists.txt in that subdirectory
# add_subdirectory(src)
#include <QtGui>
#include <QtOpenGL>
#include <math.h>
#include "glwidget.h"
drawContext *GLWidget::_ctx = 0;
// Gmsh redefinitions (reimplement stuff in Fltk/Draw.h)
void Draw(){ GLWidget::_ctx->draw3d(); GLWidget::_ctx->draw2d(); }
void DrawCurrentOpenglWindow(bool make_current){}
void DrawPlugin(void (*draw)(void *context)){}
int GetFontIndex(const char *fontname){ return 0; }
int GetFontEnum(int index){ return 0; }
const char *GetFontName(int index){ return "Helvetica"; }
int GetFontAlign(const char *alignstr){ return 0; }
int GetFontSize(){ return 18; }
void SetFont(int fontid, int fontsize){}
double GetStringWidth(const char *str){ return 0; }
int GetStringHeight(){ return 18; }
int GetStringDescent(){ return 6; }
void DrawString(const char *str){ }
GLWidget::GLWidget(QWidget *parent)
: QGLWidget(parent)
{
_ctx = new drawContext();
}
GLWidget::~GLWidget()
{
makeCurrent();
delete _ctx;
}
QSize GLWidget::minimumSizeHint() const
{
return QSize(50, 50);
}
QSize GLWidget::sizeHint() const
{
return QSize(400, 400);
}
void GLWidget::setXRotation(int angle)
{
emit xRotationChanged(angle);
updateGL();
}
void GLWidget::initializeGL()
{
}
void GLWidget::paintGL()
{
glViewport(_ctx->viewport[0], _ctx->viewport[1],
_ctx->viewport[2], _ctx->viewport[3]);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
Draw();
}
void GLWidget::resizeGL(int width, int height)
{
_ctx->viewport[2] = width;
_ctx->viewport[3] = height;
}
void GLWidget::mousePressEvent(QMouseEvent *event)
{
}
void GLWidget::mouseMoveEvent(QMouseEvent *event)
{
/*
int dx = event->x() - lastPos.x();
int dy = event->y() - lastPos.y();
if (event->buttons() & Qt::LeftButton) {
setXRotation(xRot + 8 * dy);
setYRotation(yRot + 8 * dx);
} else if (event->buttons() & Qt::RightButton) {
setXRotation(xRot + 8 * dy);
setZRotation(zRot + 8 * dx);
}
lastPos = event->pos();
*/
}
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QGLWidget>
#include <gmsh/Gmsh.h>
#include <gmsh/drawContext.h>
class GLWidget : public QGLWidget
{
Q_OBJECT
private:
public:
static drawContext *_ctx;
GLWidget(QWidget *parent = 0);
~GLWidget();
QSize minimumSizeHint() const;
QSize sizeHint() const;
public slots:
void setXRotation(int angle);
signals:
void xRotationChanged(int angle);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
};
#endif
#include <QApplication>
#include <gmsh/Gmsh.h>
#include "window.h"
int main(int argc, char *argv[])
{
GmshInitialize(argc, argv);
GmshSetOption("General", "Terminal", 1.);
for(int i = 1; i < argc; i++) GmshMergeFile(argv[i]);
QApplication app(argc, argv);
Window window;
window.show();
return app.exec();
}
#include <QtGui>
#include "glwidget.h"
#include "window.h"
Window::Window()
{
glWidget = new GLWidget;
xSlider = new QSlider(Qt::Vertical);
xSlider->setRange(0, 360 * 16);
xSlider->setSingleStep(16);
xSlider->setPageStep(15 * 16);
xSlider->setTickInterval(15 * 16);
xSlider->setTickPosition(QSlider::TicksRight);
xSlider->setValue(15 * 16);
connect(xSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int)));
connect(glWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
QHBoxLayout *mainLayout = new QHBoxLayout;
mainLayout->addWidget(glWidget);
mainLayout->addWidget(xSlider);
setLayout(mainLayout);
setWindowTitle(tr("QtGmsh"));
}
#ifndef WINDOW_H
#define WINDOW_H
#include <QWidget>
class QSlider;
class GLWidget;
class Window : public QWidget
{
Q_OBJECT
private:
GLWidget *glWidget;
QSlider *xSlider;
public:
Window();
};
#endif
# Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
#
# See the LICENSE.txt file for license information. Please report all
# bugs and problems to <gmsh@geuz.org>.
# OS and host
UNAME=@UNAME@
HOSTNAME=@HOSTNAME@
# The names of the C and C++ compilers
CC=@CC@
CXX=@CXX@
# If you need to link to dynamic libraries installed in non-standard
# locations and are using the GNU linker, you may want to add
# '-Wl,--rpath,/path/to/dynamic/library' to the 'LINKER' variable
# below. Alternatively, you could edit the 'LD_LIBARY_PATH'
# environement variable or use the 'ldconfig' program.
LINKER=@LINKER@
# All compiler flags except optimization flags
FLAGS=@FLAGS@
# Additional system includes
SYSINCLUDE=
# Compiler optimization flags
OPTIM=@OPTIM@
# Gmsh subdirectories
GMSH_DIRS=@GMSH_DIRS@
# Gmsh libraries
GMSH_LIBS=@GMSH_LIBS@
# How you create a static library on this machine
AR=@AR@
ARFLAGS=
RANLIB=@RANLIB@
# The symbol used in front of compiler flags
DASH=-
# The extension to use for object files, libraries and executables
OBJEXT=.o
LIBEXT=@LIBEXT@
EXEEXT=@EXEEXT@
# File handling commands
RM=rm -f
# Installation directories
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
includedir=@includedir@
libdir=@libdir@
mandir=@mandir@
infodir=@infodir@
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment