diff --git a/Allwmake b/Allwmake index 1d0c9d1..ddeee3b 100755 --- a/Allwmake +++ b/Allwmake @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -32,13 +32,8 @@ cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { } . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ -# Compiler/linker settings for CMake/configure -[ -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" -[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" - +exportCompiler true # Compiler info + flags for CMake/configure +exportLinker # Linker flags for CMake/configure useGccFlag $@ # Scan arguments for a '-gcc' option warnBuildIssues() diff --git a/etc/tools/ThirdPartyFunctions b/etc/tools/ThirdPartyFunctions index 8ac3ef7..3dd146c 100644 --- a/etc/tools/ThirdPartyFunctions +++ b/etc/tools/ThirdPartyFunctions @@ -3,7 +3,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -26,6 +26,35 @@ installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER unset BUILD_SUFFIX #------------------------------------------------------------------------------ +# Export WM compiler settings (and flags) for CMake/configure +# $1 = true: export compiler flags too +exportCompiler() +{ + if test -n "$WM_CC" && command -v "$WM_CC" >/dev/null + then + export CC="$WM_CC" + if [ "$1" = true -a -n "$WM_CFLAGS" ] + then + export CFLAGS="$WM_CFLAGS" + fi + fi + + if test -n "$WM_CXX" && command -v "$WM_CXX" >/dev/null + then + export CXX="$WM_CXX" + if [ "$1" = true -a -n "$WM_CXXFLAGS" ] + then + export CXXFLAGS="$WM_CXXFLAGS" + fi + fi +} + +# Export WM linker settings for CMake/configure +exportLinker() +{ + [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" +} + # Force use of gcc/g++ useGcc() { diff --git a/makeADIOS b/makeADIOS index ed57758..65a4d83 100755 --- a/makeADIOS +++ b/makeADIOS @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -52,11 +52,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -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" +exportCompiler true # Compiler info + flags for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeCGAL b/makeCGAL index 5b13fb1..e40e44e 100755 --- a/makeCGAL +++ b/makeCGAL @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -104,12 +104,9 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure unset optHeadersOnly - # Parse options while [ "$#" -gt 0 ] do diff --git a/makeCmake b/makeCmake index 96b3c24..9dcd7bb 100755 --- a/makeCmake +++ b/makeCmake @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -53,9 +53,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure unset optLink # Parse options diff --git a/makeFFTW b/makeFFTW index 4e829df..c9448bf 100755 --- a/makeFFTW +++ b/makeFFTW @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -66,9 +66,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeGperftools b/makeGperftools index 47c2d03..b5773ec 100755 --- a/makeGperftools +++ b/makeGperftools @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -51,9 +51,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeLLVM b/makeLLVM index b5141a2..0f6f78f 100755 --- a/makeLLVM +++ b/makeLLVM @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -72,10 +72,8 @@ options: USAGE exit 1 } -#----------------------------------------------------------------------------- -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +#------------------------------------------------------------------------------ +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeMETIS b/makeMETIS index cdcff2e..c028cf2 100755 --- a/makeMETIS +++ b/makeMETIS @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -81,9 +81,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeMGridGen b/makeMGridGen index 72d8f55..30c3a79 100755 --- a/makeMGridGen +++ b/makeMGridGen @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -53,9 +53,7 @@ USAGE } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeMPICH b/makeMPICH index d361caa..2067524 100755 --- a/makeMPICH +++ b/makeMPICH @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -77,9 +77,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeMesa b/makeMesa index 3534dff..cf97154 100755 --- a/makeMesa +++ b/makeMesa @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -59,9 +59,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Non-standard location for clang? case "$WM_COMPILER_TYPE-$WM_COMPILER" in diff --git a/makeOPENMPI b/makeOPENMPI index 3831548..0862b91 100755 --- a/makeOPENMPI +++ b/makeOPENMPI @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -80,9 +80,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure unset optMemchecker optThreaded diff --git a/makeParaView b/makeParaView index 402e5ee..c72fad0 100755 --- a/makeParaView +++ b/makeParaView @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -111,9 +111,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Various building stages unset runPATCH runCONFIG runMAKE runINSTALL diff --git a/makeQt b/makeQt index 44e691e..99a3648 100755 --- a/makeQt +++ b/makeQt @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -44,11 +44,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler/linker settings for CMake/configure -[ -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" +exportCompiler true # Compiler info + flags for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeTecio b/makeTecio index b34bd31..743e878 100755 --- a/makeTecio +++ b/makeTecio @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -61,9 +61,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Parse options while [ "$#" -gt 0 ] diff --git a/makeVTK b/makeVTK index 670fcad..2adf637 100755 --- a/makeVTK +++ b/makeVTK @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -95,9 +95,7 @@ USAGE exit 1 } #------------------------------------------------------------------------------ -# Compiler settings for CMake/configure -[ -n "$WM_CC" ] && export CC="$WM_CC" -[ -n "$WM_CXX" ] && export CXX="$WM_CXX" +exportCompiler # Compiler info for CMake/configure # Various building stages unset runPATCH runCONFIG runMAKE runINSTALL