diff --git a/.hgignore b/.hgignore new file mode 100644 index 000000000..2d5047e97 --- /dev/null +++ b/.hgignore @@ -0,0 +1,79 @@ +syntax: glob + +# This line is a comment, and will be skipped. +# Empty lines are skipped too. + +# Backup files left behind by the Emacs editor. +*~ +.*~ +*.bak +*.bak[0-9][0-9] +*.orig +*.orig[0-9][0-9] +\#*\# + +# CVS recovered versions - anywhere +.#* + +# objects and archives - anywhere +*.[oa] +*.la +*.so +*.jar +*.dylib + +# Lock files used by the Emacs editor. +# Notice that the "#" character is quoted with a backslash. +# This prevents it from being interpreted as starting a comment. +.\#* + +# Temporary files used by the vim editor. +.*.swp + +# A hidden file created by the Mac OS X Finder. +.DS_Store + +# Ignore the build-dirctories +darwinIntel*Opt*/ +darwinIntel*Debug*/ +linux*Gcc*/ +linux*Icc*/ +linuxming*/ +SiCortex*Gcc*/ +solaris*Gcc*/ +SunOS*Gcc*/ + +# reinstate wmake/rules that might look like build folders +!wmake/rules/*/ + +# those have to go +lnInclude + +# derived files +lex.yy.c + +# Corefiles +core + +# dependency-files +*.dep + +# no Doxygen stuff +doc/[Dd]oxygen/html +doc/[Dd]oxygen/latex +doc/[Dd]oxygen/man + +# patch residue +*.orig +*.rej + +# pyFoam-stuff +PlyParser_FoamFileParser_parsetab.py + +# python-compile +*.pyc + +# other stuff +.build +# .gitignore +.timeStamp diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options index 8a563c4ea..823dd44d0 100644 --- a/applications/solvers/combustion/PDRFoam/Make/options +++ b/applications/solvers/combustion/PDRFoam/Make/options @@ -21,6 +21,7 @@ EXE_INC = \ EXE_LIBS = \ -lengine \ -lmeshTools \ + -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lbasicThermophysicalModels \ -lreactionThermophysicalModels \ diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/GLOBAL.h b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/GLOBAL.h index 21e35a947..097385dd5 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/GLOBAL.h +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/GLOBAL.h @@ -648,7 +648,8 @@ defined LINUXI64 || \ defined LINUX64 || \ defined MAC64 || \ - defined COMPAQALPHA + defined COMPAQALPHA || \ + defined darwin #define LONGIS64 #endif diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/MASTER.h b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/MASTER.h index 38c495dcf..ed0fa9b7d 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/MASTER.h +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/MASTER.h @@ -373,7 +373,7 @@ #define SYSV #endif -#if defined DECX || defined LINUX || defined IBMRS6000X || defined COMPAQX || defined DARWIN +#if defined DECX || defined LINUX || defined IBMRS6000X || defined COMPAQX || defined DARWIN || defined darwin #define UNIXX #endif @@ -524,7 +524,11 @@ # if XmVERSION == 1 && XmREVISION == 0 # endif # else -# include +# ifndef darwin +# include +# else + typedef void *Widget; +# endif # endif #endif diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions index f8dcf4875..acf30e5fe 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/tecio/tecsrc/Make/tecioOptions @@ -2,6 +2,10 @@ TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 +#elif defined(darwinIntel) || defined(darwinIntel64) || defined(darwinPpc) || defined(darwinPpc64) + + TECIO_FLAGS = -DMAKEARCHIVE -DDARWIN -DUSEENUM -DTHREED -U_WIN32 + #elif defined(linuxIA64) TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUXI64 -DUSEENUM -DTHREED -U_WIN32 diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake index c7a80fc7f..452d0dedd 100755 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/Allwmake @@ -12,6 +12,11 @@ then mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 cd Make/$WM_OPTIONS cmake ../.. + if [ $WM_ARCH_BASE == "darwin" ] + then + sed -i bak -e 's/-dynamiclib /& -undefined dynamic_lookup /' CMakeFiles/PV3FoamReader.dir/link.txt + sed -i bak -e 's/-dynamiclib /& -undefined dynamic_lookup /' CMakeFiles/PV3FoamReader_SM.dir/link.txt + fi make ) ;; diff --git a/bin/addr2line4Mac.py b/bin/addr2line4Mac.py new file mode 100755 index 000000000..7a97c1505 --- /dev/null +++ b/bin/addr2line4Mac.py @@ -0,0 +1,30 @@ +#! /usr/bin/python + +import sys +filename=sys.argv[1] +address=sys.argv[2] +import re + +import subprocess + +p = subprocess.Popen("gdb -batch -x /dev/stdin", + shell=True, + bufsize=0, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + close_fds=True) + +(child_stdin, child_stdout) = (p.stdin, p.stdout) +child_stdin.write("set sharedlibrary preload-libraries no\n") +child_stdin.write("file "+filename+"\n") +child_stdin.write("info line *"+address+"\n") +result=child_stdout.readline() + +answer="??:0" + +match=re.compile('Line (.+) of "(.+)" starts at').match(result) +if match: + answer=match.group(2)+":"+match.group(1) +print answer, + +sys.exit(255) diff --git a/bin/foamEtcFile b/bin/foamEtcFile new file mode 100755 index 000000000..5bae566b5 --- /dev/null +++ b/bin/foamEtcFile @@ -0,0 +1,277 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------- +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# Script +# foamEtcFile +# +# Description +# Locate user/group/shipped file with semantics similar to the +# ~OpenFOAM/fileName expansion. +# +# The -mode option can be used to allow chaining from +# personal settings to site-wide settings. +# +# For example, within the user ~/.OpenFOAM//prefs.sh: +# @verbatim +# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \ +# && _foamSource $foamPrefs +# @endverbatim +# +#------------------------------------------------------------------------------- +usage() { + [ "$quietOpt" = true ] && exit 1 + + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat< any combination of u(user), g(group), o(other) + -prefix specify an alternative installation prefix + -quiet suppress all normal output + -version specify an alternative OpenFOAM version + in the form Maj.Min.Rev (eg, 1.7.0) + -help print the usage + + Locate user/group/shipped file with semantics similar to the + ~OpenFOAM/fileName expansion. + + The options can also be specified as a single character + (eg, '-q' instead of '-quiet'), but must not be grouped. + + Exit status + 0 when the file is found. Print resolved path to stdout. + 1 for miscellaneous errors. + 2 when the file is not found. + +USAGE + exit 1 +} + +# +# This script must exist in /OpenFOAM-/bin/ +# or /openfoam/bin/ (for the debian version) +# +#------------------------------------------------------------------------------- + +# the bindir: +binDir="${0%/*}" + +# the project dir: +projectDir="${binDir%/bin}" + +# the prefix dir (same as foamInstall): +prefixDir="${projectDir%/*}" + +# the name used for the project directory +projectDirName="${projectDir##*/}" + +# version number used for debian packaging +unset versionNum + +# +# handle standard and debian naming convention +# +case "$projectDirName" in +OpenFOAM-*) # standard naming convention OpenFOAM- + version="${projectDirName##OpenFOAM-}" + ;; + +openfoam[0-9]*) # debian naming convention 'openfoam' + versionNum="${projectDirName##openfoam}" + case "$versionNum" in + ??) # convert 2 digit version number to decimal delineated + version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@') + ;; + ???) # convert 3 digit version number to decimal delineated + version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@') + ;; + ????) # convert 4 digit version number to decimal delineated + version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@') + ;; + *) # failback - use current environment setting + version="$WM_PROJECT_VERSION" + ;; + esac + ;; + +*) + echo "Error : unknown/unsupported naming convention" + exit 1 + ;; +esac + + +# default mode is 'ugo' +mode=ugo +unset listOpt quietOpt + +# parse options +while [ "$#" -gt 0 ] +do + case "$1" in + -h | -help) + usage + ;; + -l | -list) + listOpt=true + ;; + -m | -mode) + [ "$#" -ge 2 ] || usage "'$1' option requires an argument" + mode="$2" + + # sanity check: + case "$mode" in + *u* | *g* | *o* ) + ;; + *) + usage "'$1' option with invalid mode '$mode'" + ;; + esac + shift + ;; + -p | -prefix) + [ "$#" -ge 2 ] || usage "'$1' option requires an argument" + prefixDir="$2" + shift + ;; + -q | -quiet) + quietOpt=true + ;; + -v | -version) + [ "$#" -ge 2 ] || usage "'$1' option requires an argument" + version="$2" + # convert x.y.z -> xyz version (if installation looked like debian) + if [ -n "$versionNum" ] + then + versionNum=$(echo "$version" | sed -e 's@\.@@g') + fi + shift + ;; + --) + shift + break + ;; + -*) + usage "unknown option: '$*'" + ;; + *) + break + ;; + esac + shift +done + + +# debugging: +# echo "Installed locations:" +# for i in projectDir prefixDir projectDirName version versionNum +# do +# eval echo "$i=\$$i" +# done + + +# Save the essential bits of information +# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile) +nArgs=$# +fileName="${1#~OpenFOAM/}" + +# Define the various places to be searched: +unset dirList +case "$mode" in +*u*) # user + dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$version" + dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}" + ;; +esac + +case "$mode" in +*g*) # group + dirList="$dirList $prefixDir/site/$version" + dirList="$dirList $prefixDir/site" + ;; +esac + +case "$mode" in +*o*) # other (shipped) + if [ -n "$versionNum" ] + then + # debian packaging + dirList="$dirList $prefixDir/openfoam$versionNum/etc" + else + # standard packaging + dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc" + fi + ;; +esac +set -- $dirList + + +# +# The main routine +# + +if [ "$listOpt" = true ] +then + + # list directories, or potential file locations + [ "$nArgs" -le 1 ] || usage + + # a silly combination, but -quiet has precedence + [ "$quietOpt" = true ] && exit 0 + + for dir + do + if [ "$nArgs" -eq 1 ] + then + echo "$dir/$fileName" + else + echo "$dir" + fi + done + exit 0 + +else + + [ "$nArgs" -eq 1 ] || usage + + for dir + do + if [ -f "$dir/$fileName" ] + then + [ "$quietOpt" = true ] || echo "$dir/$fileName" + exit 0 + fi + done + +fi + + +# general error, eg file not found +exit 2 + +#------------------------------------------------------------------------------ diff --git a/etc/bashrc b/etc/bashrc index 965a08265..f3f7dd017 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -78,6 +78,37 @@ export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION +# Source files, possibly with some verbosity +_foamSource() +{ + while [ $# -ge 1 ] + do + [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" + . $1 + shift + done +} + +# Add in preset user or site preferences: +foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` && _foamSource $foamPrefs +unset foamPrefs + +# Evaluate command-line parameters +while [ $# -gt 0 ] +do + case "$1" in + *=) + # name= -> unset name + eval "unset ${1%=}" + ;; + *=*) + # name=value -> export name=value + eval "export $1" + ;; + esac + shift +done + # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -179,6 +210,9 @@ Linux) ;; Darwin) + # this makes certain things easier + export WM_ARCH_BASE=darwin + case `uname -p` in powerpc) export WM_ARCH=darwinPpc @@ -191,6 +225,45 @@ Darwin) export WM_ARCH=darwinIntel ;; esac + case $WM_ARCH_OPTION in + 32) + export WM_CFLAGS='-m32 -fPIC' + export WM_CXXFLAGS='-m32 -fPIC' + export WM_LDFLAGS='-m32' + ;; + 64) + export WM_ARCH=${WM_ARCH}64 + export WM_CFLAGS='-m64 -fPIC' + export WM_CXXFLAGS='-m64 -fPIC' + export WM_LDFLAGS='-m64' + ;; + *) + echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64 + ;; + esac + + # Make sure that binaries use the best features of the used OS-Version + export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion` + + # Use Mac-Ports-Compiler instead of Apple-gcc-4.2 + case $WM_COMPILER in + Gcc43) + export WM_CC='gcc-mp-4.3' + export WM_CXX='g++-mp-4.3' + ;; + Gcc44) + export WM_CC='gcc-mp-4.4' + export WM_CXX='g++-mp-4.4' + ;; + Gcc45) + export WM_CC='gcc-mp-4.5' + export WM_CXX='g++-mp-4.5' + ;; + *) + export WM_COMPILER= + ;; + esac + ;; SunOS) @@ -223,6 +296,12 @@ cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv" #- Clean LD_LIBRARY_PATH cleanEnv=`$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleanEnv" +#- Clean DYLD_LIBRARY_PATH +if [[ "$WM_ARCH_BASE" == "darwin" ]] +then + cleanEnv=`$cleanProg "$DYLD_LIBRARY_PATH" "$foamOldDirs"` && DYLD_LIBRARY_PATH="$cleanEnv" +fi + #- Clean MANPATH cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv" @@ -230,16 +309,6 @@ export PATH LD_LIBRARY_PATH MANPATH # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource() -{ - while [ $# -ge 1 ] - do - [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" - . $1 - shift - done -} - _foamSource $WM_PROJECT_DIR/etc/settings.sh _foamSource $WM_PROJECT_DIR/etc/aliases.sh diff --git a/etc/controlDict b/etc/controlDict index 4812cbc73..f80503aa9 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -18,6 +18,7 @@ FoamFile Documentation { + // for Macs: docBrowser "open %f"; docBrowser "kde-open %f"; doxyDocDirs ( diff --git a/etc/cshrc b/etc/cshrc index a9385547b..26f57cb9d 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -72,6 +72,31 @@ setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION +# Source files, possibly with some verbosity +alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; source + +# Add in preset user or site preferences: +set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` +if ( $status == 0 ) then + _foamSource $foamPrefs +endif +unset foamPrefs + +# Evaluate command-line parameters +while ( $#argv > 0 ) + switch ($argv[1]) + case *=: + # name= -> unsetenv name + eval "unsetenv $argv[1]:s/=//" + breaksw + case *=*: + # name=value -> setenv name value + eval "setenv $argv[1]:s/=/ /" + breaksw + endsw + shift +end + # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -230,8 +255,6 @@ setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"` # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Executing: \!*"; source \!*' - _foamSource $WM_PROJECT_DIR/etc/settings.csh _foamSource $WM_PROJECT_DIR/etc/aliases.csh diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE new file mode 100644 index 000000000..6222054e2 --- /dev/null +++ b/etc/prefs.csh-EXAMPLE @@ -0,0 +1,52 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# File +# etc/prefs.csh +# +# Description +# Preset variables for the OpenFOAM configuration - C-Shell shell syntax. +# +# The prefs.csh file will be sourced by the OpenFOAM etc/cshrc when it is +# found by foamEtcFile. +# +# See Also +# 'foamEtcFile -help' or 'foamEtcFile -list' for information about the +# paths searched +# +#------------------------------------------------------------------------------ + +## Specify system compiler +## ~~~~~~~~~~~~~~~~~~~~~~~ +#set compilerInstall=system + +## Specify system openmpi +## ~~~~~~~~~~~~~~~~~~~~~~ +#setenv WM_MPLIB SYSTEMOPENMPI + +# Specify ParaView version +# ~~~~~~~~~~~~~~~~~~~~~~~~ +setenv ParaView_VERSION git # eg, cvs/git version +setenv ParaView_MAJOR 3.7 + +# ----------------------------------------------------------------- end-of-file diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE new file mode 100644 index 000000000..598c5710c --- /dev/null +++ b/etc/prefs.sh-EXAMPLE @@ -0,0 +1,52 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# File +# etc/prefs.sh +# +# Description +# Preset variables for the OpenFOAM configuration - POSIX shell syntax. +# +# The prefs.sh file will be sourced by the OpenFOAM etc/bashrc when it is +# found by foamEtcFile. +# +# See Also +# 'foamEtcFile -help' or 'foamEtcFile -list' for information about the +# paths searched +# +#------------------------------------------------------------------------------ + +# Specify system compiler +# ~~~~~~~~~~~~~~~~~~~~~~~ +compilerInstall=system + +# Specify system openmpi +# ~~~~~~~~~~~~~~~~~~~~~~ +export WM_MPLIB=SYSTEMOPENMPI + +# Specify ParaView version +# ~~~~~~~~~~~~~~~~~~~~~~~~ +export ParaView_VERSION=git # eg, cvs/git version +export ParaView_MAJOR=3.7 + +# ----------------------------------------------------------------- end-of-file diff --git a/etc/settings.sh b/etc/settings.sh index c6f17b094..caad5bd3f 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -47,6 +47,10 @@ _foamAddLib() while [ $# -ge 1 ] do export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH + if [ "$WM_ARCH_BASE" == "darwin" ] + then + export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH + fi shift done } diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C index 65e7c7ff6..0e78d5150 100644 --- a/src/OSspecific/POSIX/printStack.C +++ b/src/OSspecific/POSIX/printStack.C @@ -56,11 +56,22 @@ string pOpen(const string &cmd, label line=0) for (label cnt = 0; cnt <= line; cnt++) { char buffer[MAX]; + char* s = fgets(buffer, MAX-1, cmdPipe); if (s == NULL) { +#ifdef darwin + // workaround for the Python-Script + for(int i=0;i dummyFeatures; + PtrList dummy(0); + labelList candidateCells ( meshRefiner_.refineCandidates @@ -435,6 +437,8 @@ Foam::label Foam::autoRefineDriver::shellRefine const PtrList dummyFeatures; + PtrList dummy(0); + labelList candidateCells ( meshRefiner_.refineCandidates diff --git a/src/decompositionMethods/scotchDecomp/Make/options b/src/decompositionMethods/scotchDecomp/Make/options index 24c94d4b0..8fdd435c0 100644 --- a/src/decompositionMethods/scotchDecomp/Make/options +++ b/src/decompositionMethods/scotchDecomp/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch/lnInclude \ + -I$(WM_THIRD_PARTY_DIR)/scotch_5.1/include \ -I/usr/include/scotch \ -I../decompositionMethods/lnInclude diff --git a/wmake/Makefile b/wmake/Makefile index 8dcba0d1f..b4b90e091 100644 --- a/wmake/Makefile +++ b/wmake/Makefile @@ -90,7 +90,7 @@ EXE_DEP = $(OBJECTS_DIR)/options LIB = libNULL # Shared library extension -ifeq ($(WM_ARCH),darwin) +ifeq ($(WM_ARCH_BASE),darwin) # Using Mac OSX SO = dylib else @@ -173,8 +173,13 @@ libso: $(LIB).$(SO) $(LIB).$(SO): $(OBJECTS) @$(WM_SCRIPTS)/mkObjectDir $(LIB) @rm -f so_locations +ifeq ($(WM_ARCH_BASE),darwin) + @cd $(OBJECTS_DIR) ; \ + $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -install_name $(notdir $(LIB)).$(SO) -o $(LIB).$(SO) +else @cd $(OBJECTS_DIR) ; \ $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) +endif lib: $(LIB).a @echo \'$(LIB).a\' is up to date. diff --git a/wmake/rules/darwinIntel64/X b/wmake/rules/darwinIntel64/X new file mode 100644 index 000000000..bed8bfedd --- /dev/null +++ b/wmake/rules/darwinIntel64/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib -lXext -lX11 diff --git a/wmake/rules/darwinIntel64/c b/wmake/rules/darwinIntel64/c new file mode 100644 index 000000000..9485f3b30 --- /dev/null +++ b/wmake/rules/darwinIntel64/c @@ -0,0 +1,17 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +# cc = gcc-mp-4.3 -m64 +cc = g++ $(WM_CXXFLAGS) + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC -Ddarwin + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -dynamiclib -flat_namespace -undefined suppress +LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/darwinIntel64/c++ b/wmake/rules/darwinIntel64/c++ new file mode 100644 index 000000000..913899734 --- /dev/null +++ b/wmake/rules/darwinIntel64/c++ @@ -0,0 +1,23 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast + +# CC = g++-mp-4.3 -m64 +CC = g++ $(WM_CXXFLAGS) + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-40 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC -Ddarwin + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) -lpthread + +LINKLIBSO = $(CC) $(c++FLAGS) -lpthread -dynamiclib -undefined dynamic_lookup +# LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_LIBBIN) -lOpenFOAM -L$(FOAM_MPI_LIBBIN) -lPstream +LINKEXE = $(CC) $(c++FLAGS) -lpthread -L$(FOAM_MPI_LIBBIN) -lPstream diff --git a/wmake/rules/darwinIntel64/c++Debug b/wmake/rules/darwinIntel64/c++Debug new file mode 100644 index 000000000..684957e11 --- /dev/null +++ b/wmake/rules/darwinIntel64/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb2 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/darwinIntel64/c++Opt b/wmake/rules/darwinIntel64/c++Opt new file mode 100644 index 000000000..8ac07d212 --- /dev/null +++ b/wmake/rules/darwinIntel64/c++Opt @@ -0,0 +1,4 @@ +c++DBUG = +c++OPT = -O3 +#c++OPT = -march=nocona -O3 +# -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/darwinIntel64/c++Prof b/wmake/rules/darwinIntel64/c++Prof new file mode 100644 index 000000000..3bda4dad5 --- /dev/null +++ b/wmake/rules/darwinIntel64/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/darwinIntel64/cDebug b/wmake/rules/darwinIntel64/cDebug new file mode 100644 index 000000000..72b638f45 --- /dev/null +++ b/wmake/rules/darwinIntel64/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/darwinIntel64/cOpt b/wmake/rules/darwinIntel64/cOpt new file mode 100644 index 000000000..a8b063547 --- /dev/null +++ b/wmake/rules/darwinIntel64/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 diff --git a/wmake/rules/darwinIntel64/cProf b/wmake/rules/darwinIntel64/cProf new file mode 100644 index 000000000..ca3ac9bf5 --- /dev/null +++ b/wmake/rules/darwinIntel64/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/darwinIntel64/general b/wmake/rules/darwinIntel64/general new file mode 100644 index 000000000..4c3abf801 --- /dev/null +++ b/wmake/rules/darwinIntel64/general @@ -0,0 +1,10 @@ +CPP = cpp-mp-4.3 $(GFLAGS) +LD = ld + +PROJECT_LIBS = -l$(WM_PROJECT) + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ diff --git a/wmake/rules/darwinIntel64/mplib b/wmake/rules/darwinIntel64/mplib new file mode 100644 index 000000000..8a84b4014 --- /dev/null +++ b/wmake/rules/darwinIntel64/mplib @@ -0,0 +1,3 @@ +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/darwinIntel64/mplibOPENMPI b/wmake/rules/darwinIntel64/mplibOPENMPI new file mode 100644 index 000000000..834d2d3e2 --- /dev/null +++ b/wmake/rules/darwinIntel64/mplibOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi