Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
ThirdParty-common
Commits
cc216185
Commit
cc216185
authored
Nov 27, 2016
by
mark
Browse files
ENH: improve third-party make with central installations
- initial attempt for building CGAL as headers-only, and without gmp/mpfr
parent
0f5e1d67
Changes
17
Hide whitespace changes
Inline
Side-by-side
BUILD.md
View file @
cc216185
...
...
@@ -295,7 +295,7 @@ GNU *configure* can only be used prior to clang version 3.9.
|-----------------------|------------------------|
|
[
CMake
][
page cmake
]
|
[
download
][
link cmake
]
|
|
[
boost
][
page boost
]
|
[
download
][
link boost
]
|
|
[
CGAL
][
page CGAL
]
|
[
download
][
link CGAL
]
or
[
new
er
][
new
er CGAL
]
|
|
[
CGAL
][
page CGAL
]
|
[
download
][
link CGAL
]
or
[
old
er
][
old
er CGAL
]
|
|
[
FFTW
][
page FFTW
]
|
[
download
][
link FFTW
]
|
|
[
ADF/CGNS
][
page CGNS
]
, ccm |
[
link ccmio
][
link ccmio
]
|
|
[
tecio
][
page tecio
]
|
[
link tecio
][
link tecio
]
|
...
...
@@ -368,8 +368,8 @@ The minimum CMake requirements for building various components.
[
link boost
]:
https://sourceforge.net/projects/boost/files/boost/1.62.0/boost_1_62_0.tar.bz2
[
page CGAL
]:
http://cgal.org
[
link CGAL
]:
https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.
8.2
/CGAL-4.
8.2
.tar.xz
[
new
er CGAL
]:
https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.
9
/CGAL-4.
9
.tar.xz
[
link CGAL
]:
https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.
9
/CGAL-4.
9
.tar.xz
[
old
er CGAL
]:
https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.
8.2
/CGAL-4.
8.2
.tar.xz
[
page FFTW
]:
http://www.fftw.org/
[
link FFTW
]:
http://www.fftw.org/fftw-3.3.5.tar.gz
...
...
etc/tools/ThirdPartyFunctions
View file @
cc216185
...
...
@@ -151,7 +151,7 @@ NOT_FOUND
fi
# Default to use the path, try resolving (so we know what we are using)
foundExe
=
$(
command
-v
cmake 2> /dev/null
)
||
foundExe
=
q
make
foundExe
=
$(
command
-v
cmake 2> /dev/null
)
||
foundExe
=
c
make
echo
"Using cmake=
${
foundExe
:-
NotFound
}
"
1>&2
echo
"
${
foundExe
:-
cmake
}
"
}
...
...
makeADIOS
View file @
cc216185
...
...
@@ -29,7 +29,6 @@
# Build script for ADIOS
#
#------------------------------------------------------------------------------
# Get version info
.
$WM_PROJECT_DIR
/etc/config.sh/functions
unset
-f
_foamAddPath _foamAddLib _foamAddMan
# get settings only
...
...
@@ -38,7 +37,7 @@ _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ADIOS)
adiosPACKAGE
=
${
adios_version
:-
adios
-none
}
#------------------------------------------------------------------------------
#
r
un from third-party directory only
#
R
un from third-party directory only
wmakeCheckPwd
"
$WM_THIRD_PARTY_DIR
"
||
{
echo
"Error: Current directory is not
\$
WM_THIRD_PARTY_DIR"
echo
" The environment variables are inconsistent with the installation."
...
...
@@ -47,7 +46,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage
()
{
exec
1>&2
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
...
...
@@ -64,15 +62,14 @@ options:
USAGE
exit
1
}
#------------------------------------------------------------------------------
#
e
xport WM settings in a form that GNU configure recognizes
#
E
xport WM settings in a form that GNU configure recognizes
[
-n
"
$WM_CC
"
]
&&
export
CC
=
"
$WM_CC
"
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
[
-n
"
$WM_CFLAGS
"
]
&&
export
CFLAGS
=
"
$WM_CFLAGS
"
[
-n
"
$WM_CXXFLAGS
"
]
&&
export
CXXFLAGS
=
"
$WM_CXXFLAGS
"
#
p
arse options
#
P
arse options
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
...
...
@@ -109,6 +106,8 @@ fi
#------------------------------------------------------------------------------
#
# Build ADIOS
# ADIOS_ARCH_PATH : installation directory
# ADIOS_SOURCE_DIR : location of the original sources
ADIOS_ARCH_PATH
=
$installBASE
/
$adiosPACKAGE
ADIOS_SOURCE_DIR
=
$WM_THIRD_PARTY_DIR
/
$adiosPACKAGE
...
...
@@ -186,9 +185,10 @@ else
CXX
=
mpicxx
fi
#
i
nstall
s
into lib64/
#
I
nstall into lib64/
cd
$buildDIR
&&
$ADIOS_SOURCE_DIR
/configure
\
--prefix
=
$ADIOS_ARCH_PATH
\
--libdir
=
$ADIOS_ARCH_PATH
/lib
$WM_COMPILER_LIB_ARCH
\
--disable-fortran
\
--with-pic
\
--without-fastbit
\
...
...
@@ -214,7 +214,9 @@ else
{
# We don't need/use XML things
\r
m
-f
adios_lint
}
&&
$ADIOS_ARCH_PATH
/bin/adios_config
-m
$ADIOS_ARCH_PATH
/bin/adios_config
-m
2>/dev/null
||
\
echo
"Warning: Problems running adios_config"
}
)
||
{
echo
"Error building:
$adiosPACKAGE
"
}
...
...
makeCCMIO
View file @
cc216185
...
...
@@ -29,7 +29,6 @@
# Build CD-adapco's ccmio library
#
#------------------------------------------------------------------------------
# Get version info
.
$WM_PROJECT_DIR
/etc/config.sh/functions
_foamSource
$(
$WM_PROJECT_DIR
/bin/foamEtcFile config.sh/ccmio
)
...
...
@@ -38,7 +37,7 @@ ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
targetType
=
lib
#------------------------------------------------------------------------------
#
r
un from third-party directory only
#
R
un from third-party directory only
cd
${
0
%/*
}
||
exit
1
wmakeCheckPwd
"
$WM_THIRD_PARTY_DIR
"
||
{
echo
"Error: Current directory is not
\$
WM_THIRD_PARTY_DIR"
...
...
@@ -53,7 +52,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage
()
{
exec
1>&2
...
...
@@ -79,6 +77,7 @@ options:
USAGE
exit
1
}
#------------------------------------------------------------------------------
# Parse options
...
...
@@ -104,16 +103,16 @@ done
# assert: directory must be available
[
-d
"
$ccmioPACKAGE
"
]
||
die
"missing source directory '
$ccmioPACKAGE
'"
#------------------------------------------------------------------------------
CCMIO_ARCH_PATH
=
$installBASE
/
$ccmioPACKAGE
CCMIO_SOURCE_DIR
=
$WM_THIRD_PARTY_DIR
/
$ccmioPACKAGE
#
# Build LIBCCMIO
#
echo
"---------------"
(
cd
$
ccmioPACKAGE
||
exit
1
cd
$
CCMIO_SOURCE_DIR
||
exit
1
incDIR
=
$CCMIO_ARCH_PATH
/include/libccmio
libDIR
=
$CCMIO_ARCH_PATH
/lib
...
...
@@ -135,5 +134,4 @@ echo "---------------"
fi
)
#------------------------------------------------------------------------------
makeCGAL
View file @
cc216185
...
...
@@ -35,13 +35,14 @@
# makeCGAL boost-system gmp-system
#
#------------------------------------------------------------------------------
# Get CGAL, boost and gmp/mpfr versions
.
$WM_PROJECT_DIR
/etc/config.sh/functions
unset
-f
_foamAddPath _foamAddLib _foamAddMan
# get settings only
unset
-f
_foamAddPath _foamAddLib _foamAddMan
# get settings only
unset
BOOST_ARCH_PATH CGAL_ARCH_PATH
# purge current values
_foamSource
$(
$WM_PROJECT_DIR
/bin/foamEtcFile config.sh/CGAL
)
# compiler first, let CGAL config override GMP (eg, when there is no GMP
)
_foamSource
$(
$WM_PROJECT_DIR
/bin/foamEtcFile config.sh/compiler
)
_foamSource
$(
$WM_PROJECT_DIR
/bin/foamEtcFile config.sh/CGAL
)
boostPACKAGE
=
${
boost_version
:-
boost
-system
}
gmpPACKAGE
=
${
gmp_version
:-
gmp
-system
}
...
...
@@ -59,7 +60,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script
=
"
${
0
##*/
}
"
usage
()
{
exec
1>&2
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
...
...
@@ -69,6 +69,7 @@ usage: $Script [OPTION] [CGAL-VERSION] [boost-VERSION] [gmp-VERSION] [mpfr-VERSI
options:
-cmake PATH with cmake from the path given
-gcc force gcc/g++ instead of the values from
\$
WM_CC,
\$
WM_CXX
-no-lib compile CGAL for use in headers only mode (since CGAL 4.9)
-system use system versions for boost/gmp/mpfr
-help
...
...
@@ -83,6 +84,8 @@ To override this behaviour (and use the system boost and/or gmp/mpfr),
simply specify a 'system' version. For example,
$Script
boost-system gmp-system
Use gmp-none to disable use of gmp/mpfr (eg, not available)
USAGE
exit
1
}
...
...
@@ -91,6 +94,8 @@ USAGE
[
-n
"
$WM_CC
"
]
&&
export
CC
=
"
$WM_CCX
"
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
unset
optHeadersOnly
# Parse options
while
[
"$#"
-gt
0
]
do
...
...
@@ -114,18 +119,24 @@ do
gmpPACKAGE
=
"gmp-system"
mpfrPACKAGE
=
"mpfr-system"
boostPACKAGE
=
"boost-system"
unset
BOOST_ARCH_PATH
# avoid inconsistency
;;
-no-lib
)
optHeadersOnly
=
true
;;
gmp-[4-9]
*
|
gmp-system
)
gmp-[4-9]
*
|
gmp-system
|
gmp-none
)
gmpPACKAGE
=
"
${
1
%%/
}
"
;;
mpfr-[2-9]
*
|
mpfr-system
)
mpfr-[2-9]
*
|
mpfr-system
|
mpfr-none
)
mpfrPACKAGE
=
"
${
1
%%/
}
"
;;
CGAL-[0-9]
*
)
cgalPACKAGE
=
"
${
1
%%/
}
"
unset
CGAL_ARCH_PATH
# avoid inconsistency
;;
boost-[0-9]
*
|
boost_[0-9]
*
|
boost-system
)
boostPACKAGE
=
"
${
1
%%/
}
"
unset
BOOST_ARCH_PATH
# avoid inconsistency
;;
*
)
die
"unknown option/argument: '
$1
'"
...
...
@@ -136,13 +147,13 @@ done
[
-n
"
$cgalPACKAGE
"
]
||
die
"The cgal-VERSION was not specified"
#
n
othing to build
if
_foamIsNone
"
$boostPACKAGE
"
#
N
othing to build
if
_foamIsNone
$boostPACKAGE
then
echo
"Using boost-none (skip ThirdParty build of BOOST/CGAL)"
exit
0
fi
if
_foamIsNone
"
$cgalPACKAGE
"
if
_foamIsNone
$cgalPACKAGE
then
echo
"Using cgal-none (skip ThirdParty build of CGAL)"
exit
0
...
...
@@ -156,21 +167,26 @@ fi
# - use Third-Party 'lib64' for consistency.
# Boost 1_62_0 and older normally build into 'lib'.
#
# BOOST_ARCH_PATH : installation directory
# BOOST_SOURCE_DIR : location of the original sources
BOOST_ARCH_PATH
=
$installBASE
/
$boostPACKAGE
BOOST_SOURCE_DIR
=
$WM_THIRD_PARTY_DIR
/
$boostPACKAGE
:
${
BOOST_ARCH_PATH
:
=
$installBASE
/
$boostPACKAGE
}
# Fallback
boostInc
=
"
$BOOST_ARCH_PATH
/include"
boostLib
=
"
$BOOST_ARCH_PATH
/lib
$WM_COMPILER_LIB_ARCH
"
if
_foamIsSystem
$
BOOST_ARCH_PATH
if
_foamIsSystem
$
boostPACKAGE
then
echo
"Using boost-system (skip ThirdParty build of BOOST)"
boostInc
=
"/usr/include"
boostLib
=
"/usr/lib
$WM_COMPILER_LIB_ARCH
"
elif
[
-f
"
$boostInc
/boost/version.hpp"
-a
-d
"
$boostLib
"
]
# Tagged as 'system' but could actually point to a central location
[
-d
"
$BOOST_ARCH_PATH
/include"
]
||
{
boostInc
=
"/usr/include"
boostLib
=
"/usr/lib
$WM_COMPILER_LIB_ARCH
"
}
elif
[
-f
"
$boostInc
/boost/version.hpp"
]
then
echo
"Using
$boostPACKAGE
"
else
...
...
@@ -197,7 +213,7 @@ else
fi
# nothing left to build
if
_foamIsSystem
"
$cgalPACKAGE
"
if
_foamIsSystem
$cgalPACKAGE
then
echo
"Using cgal-system (skip ThirdParty build of CGAL)"
exit
0
...
...
@@ -239,20 +255,30 @@ SUMMARY
#
# CGAL_SOURCE_DIR : location of the original sources
# CGAL_BINARY_DIR : location of the build
# CGAL_
DIR : location of the installed program
# CGAL_
ARCH_PATH : installation directory
CGAL_SOURCE_DIR
=
$WM_THIRD_PARTY_DIR
/
$cgalPACKAGE
CGAL_BINARY_DIR
=
$buildBASE
/
$cgalPACKAGE
CGAL_ARCH_PATH
=
$installBASE
/
$cgalPACKAGE
CGAL_DIR
=
$CGAL_ARCH_PATH
:
${
CGAL_ARCH_PATH
:
=
$installBASE
/
$cgalPACKAGE
}
# Fallback
#
# gmp/mpfr installed without compiler name
# gmp/mpfr are installed without compiler name
installBASE
=
$WM_THIRD_PARTY_DIR
/platforms/
$WM_ARCH$WM_COMPILER_ARCH
GMP_ARCH_PATH
=
$installBASE
/
$gmpPACKAGE
MPFR_ARCH_PATH
=
$installBASE
/
$mpfrPACKAGE
# Enable/disable gmp/mpfr together
if
_foamIsNone
$gmpPACKAGE
||
_foamIsNone
$mpfrPACKAGE
then
GMP_ARCH_PATH
=
none
MPFR_ARCH_PATH
=
none
elif
_foamIsSystem
$GMP_ARCH_PATH
||
_foamIsSystem
$MPFR_ARCH_PATH
then
GMP_ARCH_PATH
=
system
# for an accurate record
MPFR_ARCH_PATH
=
system
fi
#
# build information recorded for later use
#
...
...
@@ -274,6 +300,7 @@ BOOST_VERSION=$BOOST_VERSION
CGAL_lib=lib
$WM_COMPILER_LIB_ARCH
BOOST_lib=lib
$WM_COMPILER_LIB_ARCH
CGAL_HEADER_ONLY=
${
optHeadersOnly
:-
false
}
BUILD_INFO
}
...
...
@@ -316,6 +343,7 @@ cgalIsCurrent()
return
0
}
if
cgalIsCurrent
then
echo
"
${
CGAL_ARCH_PATH
##*/
}
build appears to be up-to-date - skipping"
...
...
@@ -340,10 +368,21 @@ fi
echo
"Configuring
$cgalPACKAGE
with boost
$BOOST_VERSION
"
echo
" Source :
$CGAL_SOURCE_DIR
"
echo
" Build :
$CGAL_BINARY_DIR
"
echo
" Target :
$CGAL_
DIR
"
echo
" Target :
$CGAL_
ARCH_PATH
"
if
[
-d
"
$BOOST_ARCH_PATH
"
]
# See http://doc.cgal.org/latest/Manual/installation.html
if
_foamIsSystem
$boostPACKAGE
then
echo
" system : boost"
# Tagged as 'system' but could actually point to a central location
if
[
-d
"
$BOOST_ARCH_PATH
/include"
]
then
configBoost
=
"-DBOOST_ROOT=
$BOOST_ARCH_PATH
"
fi
## For system - possible that /usr/lib64 not being found?
## configBoost="-DBoost_LIBRARY_DIRS=$boostLib"
elif
[
-d
"
$BOOST_ARCH_PATH
"
]
then
echo
" ThirdParty : boost"
configBoost
=
$(
cat
<<
CMAKE_OPTIONS
...
...
@@ -355,16 +394,17 @@ fi
-DBoost_SYSTEM_LIBRARY_RELEASE=
$boostLib
/libboost_system.so
-DBoost_VERSION=
$BOOST_VERSION
CMAKE_OPTIONS
)
else
echo
" system : boost"
configBoost
=
$(
cat
<<
CMAKE_OPTIONS
-DBOOST_LIBRARYDIR=
$boostLib
CMAKE_OPTIONS
)
fi
if
[
-d
"
$GMP_ARCH_PATH
"
]
if
_foamIsSystem
$GMP_ARCH_PATH
then
echo
" system : gmp"
elif
_foamIsNone
$GMP_ARCH_PATH
then
echo
" disabled : gmp"
configGmp
=
"-DCGAL_DISABLE_GMP:BOOL=TRUE"
# Also used for mpfr
elif
[
-d
"
$GMP_ARCH_PATH
"
]
then
echo
" ThirdParty : gmp"
configGmp
=
$(
cat
<<
CMAKE_OPTIONS
...
...
@@ -376,10 +416,17 @@ CMAKE_OPTIONS
CMAKE_OPTIONS
)
else
echo
" system : gmp"
echo
" system : gmp
(did not find
$GMP_ARCH_PATH
)
"
fi
if
[
-d
"
$MPFR_ARCH_PATH
"
]
if
_foamIsSystem
$MPFR_ARCH_PATH
then
echo
" system : mpfr"
elif
_foamIsNone
$MPFR_ARCH_PATH
then
echo
" disabled : mpfr"
configGmp
=
"-DCGAL_DISABLE_GMP:BOOL=TRUE"
# Also used for mpfr
elif
[
-d
"
$MPFR_ARCH_PATH
"
]
then
echo
" ThirdParty : mpfr"
configMpfr
=
$(
cat
<<
CMAKE_OPTIONS
...
...
@@ -389,7 +436,7 @@ CMAKE_OPTIONS
CMAKE_OPTIONS
)
else
echo
" system : mpfr"
echo
" system : mpfr
(did not find
$MPFR_ARCH_PATH
)
"
fi
cmake
=
$(
findCMake
)
...
...
@@ -403,6 +450,7 @@ CMAKE_OPTIONS
-DCGAL_INSTALL_LIB_DIR
=
lib
$WM_COMPILER_LIB_ARCH
\
-DCMAKE_BUILD_TYPE
=
Release
\
-DWITH_CGAL_Qt5
=
OFF
\
${
optHeadersOnly
:+-DCGAL_HEADER_ONLY
=TRUE
}
\
$configBoost
$configGmp
$configMpfr
\
$CGAL_SOURCE_DIR
\
&&
make
-j
$WM_NCOMPPROCS
\
...
...
makeCmake
View file @
cc216185
...
...
@@ -33,7 +33,7 @@
unset
cmakePACKAGE
#------------------------------------------------------------------------------
#
r
un from third-party directory only
#
R
un from third-party directory only
wmakeCheckPwd
"
$WM_THIRD_PARTY_DIR
"
||
{
echo
"Error: Current directory is not
\$
WM_THIRD_PARTY_DIR"
echo
" The environment variables are inconsistent with the installation."
...
...
@@ -42,7 +42,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage
()
{
exec
1>&2
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
...
...
@@ -60,12 +59,11 @@ USAGE
exit
1
}
#------------------------------------------------------------------------------
# ensure CMake gets the correct C/CC++ compiler
# Ensure CMake gets the correct C/CC++ compiler
[
-n
"
$WM_CC
"
]
&&
export
CC
=
"
$WM_CC
"
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
#
p
arse options
#
P
arse options
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
...
...
@@ -89,36 +87,38 @@ done
[
-n
"
$cmakePACKAGE
"
]
||
die
"The cmake-VERSION was not specified"
#------------------------------------------------------------------------------
CMAKE_ARCH_PATH
=
$installBASE
/
$cmakePACKAGE
#
# Build CMAKE
#
echo
"---------------"
# CMAKE_ARCH_PATH : installation directory
# CMAKE_SOURCE_DIR : location of the original sources
CMAKE_ARCH_PATH
=
$installBASE
/
$cmakePACKAGE
CMAKE_SOURCE_DIR
=
$WM_THIRD_PARTY_DIR
/
$cmakePACKAGE
if
[
-d
"
$CMAKE_ARCH_PATH
"
-a
-r
"
$CMAKE_ARCH_PATH
/bin/cmake"
]
then
echo
"Already built:
$cmakePACKAGE
"
else
echo
"Starting build:
$cmakePACKAGE
"
(
sourceDIR
=
$WM_THIRD_PARTY_DIR
/
$cmakePACKAGE
buildDIR
=
$buildBASE
/
$cmakePACKAGE
(
buildDIR
=
$buildBASE
/
$cmakePACKAGE
cd
$
source
DIR
||
exit
1
make distclean 2>/dev/null
cd
$
CMAKE_SOURCE_
DIR
||
exit
1
make distclean 2>/dev/null
rm
-rf
$buildDIR
mkdir
-p
$buildDIR
cd
$buildDIR
rm
-rf
$buildDIR
mkdir
-p
$buildDIR
cd
$buildDIR
$sourceDIR
/bootstrap
--prefix
=
$CMAKE_ARCH_PATH
\
&&
time
make
-j
$WM_NCOMPPROCS
\
&&
make
install
\
&&
echo
"Built:
$cmakePACKAGE
"
)
||
{
echo
"Error building:
$cmakePACKAGE
"
exit
1
}
$CMAKE_SOURCE_DIR
/bootstrap
\
--prefix
=
$CMAKE_ARCH_PATH
\
&&
time
make
-j
$WM_NCOMPPROCS
\
&&
make
install
\
&&
echo
"Built:
$cmakePACKAGE
"
)
||
{
echo
"Error building:
$cmakePACKAGE
"
exit
1
}
fi
#------------------------------------------------------------------------------
makeFFTW
View file @
cc216185
...
...
@@ -29,7 +29,6 @@
# Build script for FFTW
#
#------------------------------------------------------------------------------
# Get FFTW versions
.
$WM_PROJECT_DIR
/etc/config.sh/functions
unset
-f
_foamAddPath _foamAddLib _foamAddMan
# get settings only
...
...
@@ -48,14 +47,12 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
Script
=
"
${
0
##*/
}
"
usage
()
{
exec
1>&2
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
cat
<<
USAGE
usage:
$
Script
[OPTION] [fftw-VERSION]
usage:
$
{
0
##*/
}
[OPTION] [fftw-VERSION]
options:
-gcc Force gcc/g++ instead of the values from
\$
WM_CC,
\$
WM_CXX
-help
...
...
@@ -67,8 +64,7 @@ USAGE
exit
1
}
#------------------------------------------------------------------------------
# ensure configure gets the correct C/C++ compiler
# Ensure configure gets the correct C/C++ compiler
[
-n
"
$WM_CC
"
]
&&
export
CC
=
"
$WM_CC
"
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
...
...
@@ -98,14 +94,12 @@ done
[
-n
"
$fftwPACKAGE
"
]
||
die
"The fftw-VERSION was not specified"
#
n
othing to build
#
N
othing to build
if
_foamIsNone
"
$fftwPACKAGE
"
then
echo
"Using fftw-none (skip ThirdParty build of FFTW)"
exit
0
fi
if
_foamIsSystem
"
$fftwPACKAGE
"
elif
_foamIsSystem
"
$fftwPACKAGE
"
then
echo
"Using fftw-system (skip ThirdParty build of FFTW)"
exit
0
...
...
@@ -120,6 +114,7 @@ fi
# - Third-Party builds into 'lib64'
# - system is normally built into 'lib64'
#
# FFTW_ARCH_PATH : installation directory
# FFTW_SOURCE_DIR : location of the original sources
FFTW_ARCH_PATH
=
$installBASE
/
$fftwPACKAGE
...
...
@@ -169,5 +164,4 @@ else
}
fi
#------------------------------------------------------------------------------
makeGcc
View file @
cc216185
...
...
@@ -88,8 +88,7 @@ USAGE
exit
1
}
#------------------------------------------------------------------------------
# build 32-bit libraries on 64-bit systems (normally not needed)
# Build 32-bit libraries on 64-bit systems (normally not needed)
optMultilib
=
disable
unset
optThreadSafe
# unset=auto
...
...
makeGperftools
View file @
cc216185
...
...
@@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation |
Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
...
...
@@ -28,14 +28,17 @@
# Description
# Build script for gperftools
#
# Note
#
#------------------------------------------------------------------------------
# Get gperftools version
.
$WM_PROJECT_DIR
/etc/config.sh/functions
unset
-f
_foamAddPath _foamAddLib _foamAddMan
# get settings only
_foamSource
$(
$WM_PROJECT_DIR
/bin/foamEtcFile config.sh/gperftools
)
gperftoolsPACKAGE
=
gperftools
-svn
gperftoolsPACKAGE
=
${
gperftools
_version
:-
gperftools
-system
}
#------------------------------------------------------------------------------
#
r
un from third-party directory only
#
R
un from third-party directory only
wmakeCheckPwd
"
$WM_THIRD_PARTY_DIR
"
||
{
echo
"Error: Current directory is not
\$
WM_THIRD_PARTY_DIR"
echo
" The environment variables are inconsistent with the installation."
...
...
@@ -44,13 +47,15 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
}
.
etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage
()
{
exec
1>&2
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
cat
<<
USAGE
usage:
${
0
##*/
}
[gperftools-VERSION]
options:
-gcc Force gcc/g++ instead of the values from
\$
WM_CC,
\$
WM_CXX
-help
* build gperftools
$gperftoolsPACKAGE
...
...
@@ -58,16 +63,23 @@ usage: ${0##*/} [gperftools-VERSION]
USAGE
exit
1
}
#------------------------------------------------------------------------------
# Ensure configure gets the correct C/C++ compiler
[
-n
"
$WM_CC
"
]
&&
export
CC
=
"
$WM_CC
"
[
-n
"
$WM_CXX
"
]
&&
export
CXX
=
"
$WM_CXX
"
# parse options
# Parse options
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
-h
|
-help
)
usage
;;
gperftools-[0-9]
*
|
gperftools-svn
*
)
-gcc
)
export
CC
=
gcc
# use gcc/g++