Merge bgschaid stuff into the rest. Should make it compile with the Standard-Apple-Compiler

--HG--
branch : macMerge
This commit is contained in:
Bernhard F.W. Gschaider 2010-10-05 17:47:03 +02:00
commit c50ad6d1fd
30 changed files with 749 additions and 52 deletions

79
.hgignore Normal file
View file

@ -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

View file

@ -21,6 +21,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lengine \ -lengine \
-lmeshTools \ -lmeshTools \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lbasicThermophysicalModels \ -lbasicThermophysicalModels \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \

View file

@ -648,7 +648,8 @@
defined LINUXI64 || \ defined LINUXI64 || \
defined LINUX64 || \ defined LINUX64 || \
defined MAC64 || \ defined MAC64 || \
defined COMPAQALPHA defined COMPAQALPHA || \
defined darwin
#define LONGIS64 #define LONGIS64
#endif #endif

View file

@ -373,7 +373,7 @@
#define SYSV #define SYSV
#endif #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 #define UNIXX
#endif #endif
@ -524,7 +524,11 @@
# if XmVERSION == 1 && XmREVISION == 0 # if XmVERSION == 1 && XmREVISION == 0
# endif # endif
# else # else
# include <X11/Intrinsic.h> # ifndef darwin
# include <X11/Intrinsic.h>
# else
typedef void *Widget;
# endif
# endif # endif
#endif #endif

View file

@ -2,6 +2,10 @@
TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUX64 -DUSEENUM -DTHREED -U_WIN32 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) #elif defined(linuxIA64)
TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUXI64 -DUSEENUM -DTHREED -U_WIN32 TECIO_FLAGS = -DMAKEARCHIVE -DLINUX -DLINUXI64 -DUSEENUM -DTHREED -U_WIN32

View file

@ -12,6 +12,11 @@ then
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1 mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS cd Make/$WM_OPTIONS
cmake ../.. 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 make
) )
;; ;;

30
bin/addr2line4Mac.py Executable file
View file

@ -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)

277
bin/foamEtcFile Executable file
View file

@ -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 <http://www.gnu.org/licenses/>.
#
# 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/<VER>/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<<USAGE
Usage: ${0##*/} [OPTION] fileName
${0##*/} [OPTION] -list
options:
-list list the directories to be searched
-mode <mode> any combination of u(user), g(group), o(other)
-prefix <dir> specify an alternative installation prefix
-quiet suppress all normal output
-version <ver> 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 <foamInstall>/OpenFOAM-<VERSION>/bin/
# or <foamInstall>/openfoam<VERSION>/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>
version="${projectDirName##OpenFOAM-}"
;;
openfoam[0-9]*) # debian naming convention 'openfoam<VERSION>'
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
#------------------------------------------------------------------------------

View file

@ -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 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 # Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~
@ -179,6 +210,9 @@ Linux)
;; ;;
Darwin) Darwin)
# this makes certain things easier
export WM_ARCH_BASE=darwin
case `uname -p` in case `uname -p` in
powerpc) powerpc)
export WM_ARCH=darwinPpc export WM_ARCH=darwinPpc
@ -191,6 +225,45 @@ Darwin)
export WM_ARCH=darwinIntel export WM_ARCH=darwinIntel
;; ;;
esac 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) SunOS)
@ -223,6 +296,12 @@ cleanEnv=`$cleanProg "$PATH" "$foamOldDirs"` && PATH="$cleanEnv"
#- Clean LD_LIBRARY_PATH #- Clean LD_LIBRARY_PATH
cleanEnv=`$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` && LD_LIBRARY_PATH="$cleanEnv" 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 #- Clean MANPATH
cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv" cleanEnv=`$cleanProg "$MANPATH" "$foamCleanDirs"` && MANPATH="$cleanEnv"
@ -230,16 +309,6 @@ export PATH LD_LIBRARY_PATH MANPATH
# Source project setup files # 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/settings.sh
_foamSource $WM_PROJECT_DIR/etc/aliases.sh _foamSource $WM_PROJECT_DIR/etc/aliases.sh

View file

@ -18,6 +18,7 @@ FoamFile
Documentation Documentation
{ {
// for Macs: docBrowser "open %f";
docBrowser "kde-open %f"; docBrowser "kde-open %f";
doxyDocDirs doxyDocDirs
( (

View file

@ -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 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 # Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~
@ -230,8 +255,6 @@ setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"`
# Source project setup files # 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/settings.csh
_foamSource $WM_PROJECT_DIR/etc/aliases.csh _foamSource $WM_PROJECT_DIR/etc/aliases.csh

52
etc/prefs.csh-EXAMPLE Normal file
View file

@ -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 <http://www.gnu.org/licenses/>.
#
# 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

52
etc/prefs.sh-EXAMPLE Normal file
View file

@ -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 <http://www.gnu.org/licenses/>.
#
# 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

View file

@ -47,6 +47,10 @@ _foamAddLib()
while [ $# -ge 1 ] while [ $# -ge 1 ]
do do
export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
if [ "$WM_ARCH_BASE" == "darwin" ]
then
export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH
fi
shift shift
done done
} }

View file

@ -56,11 +56,22 @@ string pOpen(const string &cmd, label line=0)
for (label cnt = 0; cnt <= line; cnt++) for (label cnt = 0; cnt <= line; cnt++)
{ {
char buffer[MAX]; char buffer[MAX];
char* s = fgets(buffer, MAX-1, cmdPipe); char* s = fgets(buffer, MAX-1, cmdPipe);
if (s == NULL) if (s == NULL)
{ {
#ifdef darwin
// workaround for the Python-Script
for(int i=0;i<MAX;i++) {
if(buffer[i]=='\n') {
buffer[i]='\0';
}
}
return buffer;
#else
return ""; return "";
#endif
} }
if (cnt == line) if (cnt == line)
@ -123,7 +134,8 @@ void printSourceFileAndLine
#ifndef darwin #ifndef darwin
"addr2line -f --demangle=auto --exe " "addr2line -f --demangle=auto --exe "
#else #else
"gaddr2line -f --inline --demangle=auto --exe " // "gaddr2line -f --inline --demangle=auto --exe "
"addr2line4Mac.py "
#endif #endif
+ filename + filename
+ " " + " "
@ -150,38 +162,6 @@ void printSourceFileAndLine
} }
} }
void getSymbolForRaw
(
Ostream& os,
const string& raw,
const fileName& filename,
const word& address
)
{
if (filename.size() && filename[0] == '/')
{
string fcnt = pOpen
(
#ifndef darwin
"addr2line -f --demangle=auto --exe "
#else
"gaddr2line -f --inline --demangle=auto --exe "
#endif
+ filename
+ " "
+ address
);
if (fcnt != "")
{
os << fcnt.c_str();
return;
}
}
os << "Uninterpreted: " << raw.c_str();
}
#ifdef darwin #ifdef darwin
// Trying to emulate the original backtrace and backtrace_symbol from the glibc // Trying to emulate the original backtrace and backtrace_symbol from the glibc
@ -265,11 +245,11 @@ char **backtrace_symbols(void **bt,unsigned nr)
int result=dladdr(bt[i],&info); int result=dladdr(bt[i],&info);
char tmp[1000]; char tmp[1000];
# ifdef darwin #ifdef darwinIntel64
sprintf(tmp,"%s(%s+%p) [%p]",info.dli_fname,info.dli_sname,(void *)((unsigned long)bt[i]-(unsigned long)info.dli_saddr),bt[i]); sprintf(tmp,"%s(%s+%p) [%p]",info.dli_fname,info.dli_sname,(void *)((unsigned long)bt[i]-(unsigned long)info.dli_saddr),bt[i]);
# else #else
sprintf(tmp,"%s(%s+%p) [%p]",info.dli_fname,info.dli_sname,(void *)((unsigned int)bt[i]-(unsigned int)info.dli_saddr),bt[i]); sprintf(tmp,"%s(%s+%p) [%p]",info.dli_fname,info.dli_sname,(void *)((unsigned int)bt[i]-(unsigned int)info.dli_saddr),bt[i]);
# endif #endif
strings[i]=(char *)malloc(strlen(tmp)+1); strings[i]=(char *)malloc(strlen(tmp)+1);
strcpy(strings[i],tmp); strcpy(strings[i],tmp);
} }
@ -279,6 +259,38 @@ char **backtrace_symbols(void **bt,unsigned nr)
#endif #endif
void getSymbolForRaw
(
Ostream& os,
const string& raw,
const fileName& filename,
const word& address
)
{
if (filename.size() && filename[0] == '/')
{
string fcnt = pOpen
(
#ifndef darwin
"addr2line -f --demangle=auto --exe "
#else
// "gaddr2line -f --inline --demangle=auto --exe "
"addr2line4Mac.py "
#endif
+ filename
+ " "
+ address
);
if (fcnt != "")
{
os << fcnt.c_str();
return;
}
}
os << "Uninterpreted: " << raw.c_str();
}
void error::printStack(Ostream& os) void error::printStack(Ostream& os)
{ {
// Do not print anything if FOAM_ABORT is not set // Do not print anything if FOAM_ABORT is not set

View file

@ -269,6 +269,8 @@ Foam::label Foam::autoRefineDriver::surfaceOnlyRefine
const PtrList<featureEdgeMesh> dummyFeatures; const PtrList<featureEdgeMesh> dummyFeatures;
PtrList<featureEdgeMesh> dummy(0);
labelList candidateCells labelList candidateCells
( (
meshRefiner_.refineCandidates meshRefiner_.refineCandidates
@ -435,6 +437,8 @@ Foam::label Foam::autoRefineDriver::shellRefine
const PtrList<featureEdgeMesh> dummyFeatures; const PtrList<featureEdgeMesh> dummyFeatures;
PtrList<featureEdgeMesh> dummy(0);
labelList candidateCells labelList candidateCells
( (
meshRefiner_.refineCandidates meshRefiner_.refineCandidates

View file

@ -1,5 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(WM_THIRD_PARTY_DIR)/scotch_5.1/src/libscotch/lnInclude \ -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/usr/include/scotch \
-I../decompositionMethods/lnInclude -I../decompositionMethods/lnInclude

View file

@ -90,7 +90,7 @@ EXE_DEP = $(OBJECTS_DIR)/options
LIB = libNULL LIB = libNULL
# Shared library extension # Shared library extension
ifeq ($(WM_ARCH),darwin) ifeq ($(WM_ARCH_BASE),darwin)
# Using Mac OSX # Using Mac OSX
SO = dylib SO = dylib
else else
@ -173,8 +173,13 @@ libso: $(LIB).$(SO)
$(LIB).$(SO): $(OBJECTS) $(LIB).$(SO): $(OBJECTS)
@$(WM_SCRIPTS)/mkObjectDir $(LIB) @$(WM_SCRIPTS)/mkObjectDir $(LIB)
@rm -f so_locations @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) ; \ @cd $(OBJECTS_DIR) ; \
$(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO) $(LINKLIBSO) $(LOCAL_OBJECTS) -L$(LIB_WM_OPTIONS_DIR) $(LIB_LIBS) $(GLIB_LIBS) -o $(LIB).$(SO)
endif
lib: $(LIB).a lib: $(LIB).a
@echo \'$(LIB).a\' is up to date. @echo \'$(LIB).a\' is up to date.

View file

@ -0,0 +1,3 @@
XFLAGS =
XINC = $(XFLAGS) -I/usr/X11R6/include
XLIBS = -L/usr/X11R6/lib -lXext -lX11

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,2 @@
c++DBUG = -ggdb2 -DFULLDEBUG
c++OPT = -O0 -fdefault-inline

View file

@ -0,0 +1,4 @@
c++DBUG =
c++OPT = -O3
#c++OPT = -march=nocona -O3
# -ftree-vectorize -ftree-vectorizer-verbose=3

View file

@ -0,0 +1,2 @@
c++DBUG = -pg
c++OPT = -O2

View file

@ -0,0 +1,2 @@
cDBUG = -ggdb -DFULLDEBUG
cOPT = -O1 -fdefault-inline -finline-functions

View file

@ -0,0 +1,2 @@
cDBUG =
cOPT = -O3

View file

@ -0,0 +1,2 @@
cDBUG = -pg
cOPT = -O2

View file

@ -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++

View file

@ -0,0 +1,3 @@
PFLAGS =
PINC =
PLIBS =

View file

@ -0,0 +1,3 @@
PFLAGS = -DOMPI_SKIP_MPICXX
PINC = -I$(MPI_ARCH_PATH)/include
PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi