diff --git a/Makefile b/Makefile index 5e2d5f1f9dbf1966bc3d9eb7c7b68fe34f4af97c..8a965ae11c8c952332714a6021167ace6431c137 100644 --- a/Makefile +++ b/Makefile @@ -36,17 +36,13 @@ GMSH_EMBEDDED = ${GMSH_API} Geo/discrete*.cpp\ Numeric/NumericEmbedded.{cpp,h} Numeric/FunctionSpace.{cpp,h}\ utils/embed/GmshEmbedded.{cpp,h} utils/embed/Makefile +# Main building rules + all: link link: compile ${LINKER} ${OPTIM} ${DASH}o bin/gmsh${EXEEXT} ${GMSH_LIBS} -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 - compile: variables initialtag @for i in ${GMSH_DIRS}; do (cd $$i && ${MAKE}); done @@ -61,12 +57,7 @@ uninstall: rm -f ${bindir}/gmsh${EXEEXT} rm -f ${mandir}/man1/gmsh.1 -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 +# Rules to build the Gmsh library .PHONY: lib lib: variables initialtag @@ -86,6 +77,27 @@ uninstall-lib: rm -rf ${includedir}/gmsh rm -rf ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT} +embed: + @if [ -r ../getdp/contrib/gmsh/Makefile ]; then \ + rsync -av ${GMSH_EMBEDDED} ../getdp/contrib/gmsh;\ + rm -f ../getdp/contrib/gmsh/Message.h;\ + fi + +# 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 @@ -102,11 +114,23 @@ framework: lib cd Gmsh.framework && ln -s Versions/Current/Headers cd Gmsh.framework && ln -s Versions/Current/Resources -embed: - @if [ -r ../getdp/contrib/gmsh/Makefile ]; then \ - rsync -av ${GMSH_EMBEDDED} ../getdp/contrib/gmsh;\ - rm -f ../getdp/contrib/gmsh/Message.h;\ - fi +# Windows specific rules that will work in a DOS command window +# without any unix-type shell (only gmake.exe needs to be present) + +dos: tag + for %%i in (${GMSH_DIRS}) do gmake -C %%i + ${LINKER} ${OPTIM} ${DASH}o bin/gmsh${EXEEXT} ${GMSH_LIBS} + +dos-lib: tag + for %%i in (${GMSH_DIRS}); do gmake -C %%i cpobj + ${AR} ${ARFLAGS}lib/libGmsh${LIBEXT} lib/*${OBJEXT} + erase lib\*${OBJEXT} + +dos-clean: + for %%i in (doc lib ${GMSH_DIRS}) do gmake -C clean + erase Common\GmshVersion.h + +# Utilities variables: configure @echo "********************************************************************" @@ -165,7 +189,6 @@ nodepend: done tag: - rm -f ${GMSH_VERSION_FILE} 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} diff --git a/doc/README.occ b/doc/README.occ index ded707aa6d718a7c647b05c6047cce0fd25dc9a2..076fb3bdce4ab0a53a70f7d328da064dff6d5390 100644 --- a/doc/README.occ +++ b/doc/README.occ @@ -1,27 +1,41 @@ -How to build OpenCascade 6.2 (OCC) for Gmsh: +How to build OpenCascade 6.3 (OCC) for Gmsh: -- Get the linux (source) distribution of OCC and unpack it. In the - following <OpenCascade dir> refers to the directory where OCC is - installed (e.g ~/OpenCascade) +- Get the source distribution of OCC and unpack it (you only need the + "ros" subdirectory). In the following <OpenCascade dir> refers to + the directory where OCC is installed (e.g ~/OpenCASCADE6.3.0) - OS/compiler specific stuff: - * On Cygwin/Mingw32 (Windows) define + * On Windows/MinGW define - export CC="gcc -mno-cygwin -DWNT=1 -DWIN32 -DHAVE_NO_DLL" - export CXX="g++ -mno-cygwin -DWNT=1 -DWIN32 -DHAVE_NO_DLL" + export CC="gcc -DWNT=1 -DWIN32 -DHAVE_NO_DLL" + export CXX="g++ -DWNT=1 -DWIN32 -DHAVE_NO_DLL" - * With new versions of gcc, add "-ffriend-injection -fpermissive" - to the compiler options (this prevents the - "Standard_Transient_Type_ not declared" error), i.e., define + (With cygwin add "-mno-cygwin") + + You'll also need to fix a few things in the source code as you + go, depending on the version MinGW and of the bundled g++: + + - remove all pthread tests in ./configure + - replace all refs to #include <limits> with #include <limits.h> in + <OpenCascade dir>/ros/inc/Standard_values.h + - fix "delete RefToCurrentTMSKrnl;" & co calls in OSD_Chronometer.cxx + - remove STATUS_FLOAT_MULTIPLE_TRAPS & co switch cases in + OSD_Signal_Wnt.cxx + - add explicit (void*) cast in Standard_MMgrOpt.cxx + + * With new versions of gcc, you might have to add + "-ffriend-injection -fpermissive" to the compiler options (this + prevents the "Standard_Transient_Type_ not declared" error), + i.e., define export CXXFLAGS="${CXXFLAGS} -ffriend-injection -fpermissive" * on Mac OS X unfortunately you cannot build universal libs simply by using "-arch i386 -arch ppc" (the code depends on configure-time endinanness checks). So, first configure and build - with + with export CFLAGS="-arch i386" export CXXFLAGS="-arch i386" @@ -36,13 +50,13 @@ How to build OpenCascade 6.2 (OCC) for Gmsh: lipo -create libi386.a libppc.a -output libuniversal.a -- Go to the <OpenCascade dir>/Linux/ros directory and type +- Go to the <OpenCascade dir>/ros directory and type ./configure --prefix=/usr/local/opencascade --enable-debug=no --enable-production=yes --enable-static=yes --enable-shared=no --disable-dependency-tracking -- Then go to the <OpenCascade dir>/Linux/ros/adm/make/ directory and +- Then go to the <OpenCascade dir>/ros/adm/make/ directory and run "make" in the following subdirectories, e.g. by running the following bash script: @@ -69,7 +83,7 @@ How to build OpenCascade 6.2 (OCC) for Gmsh: cd $lib && make install; cd ..; done - and copy config.h and the <OpenCascade dir>/Linux/ros/inc/ subdirectory + and copy config.h and the <OpenCascade dir>/ros/inc/ subdirectory to /usr/local/opencascade (This is the same as a doing a partial 'make install') diff --git a/doc/gmsh.html b/doc/gmsh.html index 243ceb380e8744624f266b2a7ebceb17ca28d956..c5addecb3e05902267f042a6f37fe24eba7db887 100644 --- a/doc/gmsh.html +++ b/doc/gmsh.html @@ -60,8 +60,8 @@ Gmsh's capabilities</a>. Gmsh is distributed under the terms of the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License (GPL)</a>. Pre-compiled binaries<a href="#opengl-footnote" -name="opengl-footmark"><sup>1</sup></a> are available for Windows -(2000, XP), Linux (Intel, glibc 2.3) and Mac OS X (10.4, Universal +name="opengl-footmark"><sup>1</sup></a> are available for Windows (XP +& Vista), Linux (Intel, glibc 2.3) and Mac OS X (10.5, Universal binary). Tutorial and demos files are included in all the archives. <ul>