Commit ce4c19c7 authored by mark's avatar mark
Browse files

COMP: adjust to use non-gcc compilers for scotch and ptscotch

parent c291d574
......@@ -38,7 +38,7 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
exit 1
}
[ -n "$FOAM_EXT_LIBBIN" ] || {
echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set for ThirdParty"
echo " Check your OpenFOAM environment and installation"
exit 1
}
......@@ -51,6 +51,7 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
useGccFlag $@ # Scan arguments for a '-gcc' option
warnBuildIssues()
{
......@@ -131,9 +132,6 @@ then
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
# 'CC' already set (eg, from WM_CC) - set scotch-specific 'CCS' too
[ -n "$CC" ] && export CCS="$CC"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
......@@ -144,8 +142,10 @@ then
exit 1
}
make realclean 2>/dev/null # Extra safety
export CCS="${CC:-$WM_CC}" # CCS (serial compiler) default=$(CC)
export CCP=$(whichMpicc) # CCP (parallel compiler) default=mpicc
make realclean 2>/dev/null # Extra safety
make -j $WM_NCOMPPROCS scotch \
&& make \
prefix=$prefixDIR \
......@@ -153,7 +153,7 @@ then
libdir=$libDIR \
install
make realclean 2>/dev/null || true # Failed cleanup is uncritical
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues SCOTCH
else
warnNotFound SCOTCH
......@@ -196,9 +196,6 @@ then
mkdir -p $incDIR 2>/dev/null
mkdir -p $libDIR 2>/dev/null
# 'CC' already set (eg, from WM_CC) - set scotch-specific 'CCS' too
[ -n "$CC" ] && export CCS="$CC"
if [ -f $scotchMakefile ]
then
rm -f Makefile.inc
......@@ -209,8 +206,10 @@ then
exit 1
}
make realclean 2>/dev/null # Extra safety
export CCS="${CC:-$WM_CC}" # CCS (serial compiler) default=$(CC)
export CCP=$(whichMpicc) # CCP (parallel compiler) default=mpicc
make realclean 2>/dev/null # Extra safety
make -j $WM_NCOMPPROCS ptscotch \
&& make \
prefix=$prefixDIR \
......@@ -218,7 +217,7 @@ then
libdir=$libDIR \
install
make realclean 2>/dev/null || true # Failed cleanup is uncritical
make realclean 2>/dev/null || true # Failed cleanup is uncritical
) || warnBuildIssues PTSCOTCH
fi
......
......@@ -45,6 +45,31 @@ useGcc()
export CXX=g++
}
# Scan arguments for a '-gcc' option, forcing gcc/g++ when found
useGccFlag()
{
for i
do
if [ "$i" = "-gcc" ]
then
useGcc
break
fi
done
}
# Return mpiicc (for INTELMPI) or mpicc etc.
whichMpicc()
{
local mpicc
case "$WM_MPLIB" in
(INTELMPI)
mpicc=$(command -v mpiicc) # Try using intel 'mpiicc'
;;
esac
echo "${mpicc:-mpicc}" # mpiicc | mpicc
}
#------------------------------------------------------------------------------
# Some functions as per OpenFOAM etc/config.sh/functions
......
# openfoam notes:
#-------------------------------*- makefile -*---------------------------------
# OpenFOAM notes:
#
# WM_CFLAGS, WM_LDFLAGS contain "-m32 -fPIC" etc
# WM_LABEL_SIZE == 64 for 'long' instead of 'int' for OpenFOAM labels
# compiled without pthread
#
# - compiled without pthread
#
# Normally set CCS, CCP by caller
EXE =
LIB = .so
OBJ = .o
MAKE = make
AR = gcc
AR = $(CC)
ARFLAGS = $(WM_CFLAGS) -shared -o
CAT = cat
CCS = gcc
CCP = mpicc
CCD = mpicc
CFLAGS = $(WM_CFLAGS) -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -Drestrict=__restrict
CCS ?= $(CC)
CCP ?= mpicc
CCD = $(CCP)
CFLAGS = $(WM_CFLAGS) -O3 \
-DCOMMON_FILE_COMPRESS_GZ \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_RENAME \
-Drestrict=__restrict
# 32-bit vs. 64-bit labels
ifeq ($(WM_LABEL_SIZE),64)
......@@ -24,10 +30,15 @@ endif
CLIBFLAGS = -shared
LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lz -lm -lrt
MAKE = make
CP = cp
LEX = flex -Pscotchyy -olex.yy.c
CAT = cat
LN = ln
MKDIR = mkdir
MV = mv
RANLIB = echo
LEX = flex -Pscotchyy -olex.yy.c
YACC = bison -pscotchyy -y -b y
#------------------------------------------------------------------------------
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment