Skip to content

Commit

Permalink
Merge pull request #51 from GEOS-ESM/feature/mathomp4/aggressive-comp…
Browse files Browse the repository at this point in the history
…ile-flags

Changes needed to allow use of aggressive flags with GEOS
  • Loading branch information
mathomp4 committed Dec 10, 2020
2 parents dcdc636 + 4936812 commit f218ab3
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions build.csh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ setenv esmadir ""
setenv docmake 1
setenv usegnu 0
setenv ddb 0
setenv debug ""
setenv debug 0
setenv aggressive 0
setenv verbose ""
setenv interactive 0
setenv proc ""
Expand All @@ -83,6 +84,7 @@ setenv partition ""
setenv account ""
setenv tmpdir ""
setenv walltime ""
setenv cmake_build_type "Release"

# Detect if on compute node already
# ---------------------------------
Expand All @@ -108,7 +110,15 @@ while ($#argv)
# compile with debug
#-------------------
if (("$1" == "-debug") || ("$1" == "-db")) then
setenv debug "-DCMAKE_BUILD_TYPE=Debug"
setenv cmake_build_type "Debug"
set debug = 1
endif

# compile with aggressive
#------------------------
if ("$1" == "-aggressive") then
setenv cmake_build_type "Aggressive"
set aggressive = 1
endif

# specify node type
Expand Down Expand Up @@ -216,6 +226,14 @@ while ($#argv)
shift
end

# Only allow one of debug and aggressive
# --------------------------------------

if ( ($aggressive) && ($debug) ) then
echo "ERROR. Only one of -debug and -aggressive is allowed"
exit 1
endif

# default nodeTYPE
#-----------------
if (! $?nodeTYPE) then
Expand Down Expand Up @@ -300,8 +318,10 @@ endif
# --------------------------
if ($?BUILDDIR) then
setenv Pbuild_build_directory $ESMADIR/$BUILDDIR
else if ("$debug" != "") then
else if ($debug) then
setenv Pbuild_build_directory $ESMADIR/build-Debug
else if ($aggressive) then
setenv Pbuild_build_directory $ESMADIR/build-Aggressive
else
setenv Pbuild_build_directory $ESMADIR/build
endif
Expand All @@ -310,8 +330,10 @@ endif
# ----------------------------
if ($?INSTALLDIR) then
setenv Pbuild_install_directory $ESMADIR/$INSTALLDIR
else if ("$debug" != "") then
else if ($debug) then
setenv Pbuild_install_directory $ESMADIR/install-Debug
else if ($aggressive) then
setenv Pbuild_install_directory $ESMADIR/install-Aggressive
else
setenv Pbuild_install_directory $ESMADIR/install
endif
Expand All @@ -321,6 +343,7 @@ endif
if ($ddb) then
echo "ESMADIR = $ESMADIR"
echo "debug = $debug"
echo "aggressive = $aggressive"
echo "verbose = $verbose"
if ($?nodeTYPE) then
echo "nodeTYPE = $nodeTYPE"
Expand All @@ -335,8 +358,9 @@ if ($ddb) then
echo "account = $account"
echo "walltime = $walltime"
echo "prompt = $prompt"
echo "nocmake = $nocmake"
echo "nocmake = $docmake"
echo "NCPUS_DFLT = $NCPUS_DFLT"
echo "CMAKE_BUILD_TYPE = $cmake_build_type"
echo "Build directory = $Pbuild_build_directory"
echo "Install directory = $Pbuild_install_directory"
exit
Expand Down Expand Up @@ -672,9 +696,7 @@ echo1 "SITE: $SITE"
if ($?TMPDIR) then
echo1 "TMPDIR = $TMPDIR"
endif
if ("$debug" != "") then
echo1 "debug: $debug"
endif
echo1 "cmake_build_type: $cmake_build_type"
if ("$verbose" != "") then
echo1 "verbose: $verbose"
endif
Expand Down Expand Up @@ -711,7 +733,7 @@ else
setenv FORTRAN_COMPILER 'ifort'
endif

set cmd1 = "cmake $ESMADIR -DCMAKE_INSTALL_PREFIX=$Pbuild_install_directory -DBASEDIR=${BASEDIR}/${ARCH} -DCMAKE_Fortran_COMPILER=${FORTRAN_COMPILER} $debug"
set cmd1 = "cmake $ESMADIR -DCMAKE_INSTALL_PREFIX=$Pbuild_install_directory -DBASEDIR=${BASEDIR}/${ARCH} -DCMAKE_Fortran_COMPILER=${FORTRAN_COMPILER} -DCMAKE_BUILD_TYPE=${cmake_build_type}"
set cmd2 = "make --jobs=$numjobs install $verbose"
echo1 ""
echo1 ""
Expand Down

0 comments on commit f218ab3

Please sign in to comment.