-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scotch library to hpc-stack #504
Open
ulmononian
wants to merge
14
commits into
NOAA-EMC:develop
Choose a base branch
from
ulmononian:feature/add_scotch_hera
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fe0faa5
Add initial build script for scotch library to support marine/WW3.
ulmononian 66e32a4
Update scotch build script.
ulmononian 8d72c96
Add scotch build_lib command to build_stack.sh.
ulmononian 24155d1
Update build_scotch.sh w/ proper prefix path, module load commands, v…
ulmononian fc25e21
Add scotch.lua modulefile.
ulmononian 6fb0fcc
Add section to remove pre-existing build directory in build_scotch.sh.
ulmononian 1a9fea0
Revert config_hera.sh to develop version. Initial commit of modified …
ulmononian cc9abda
Change version/id variables to match convention.
ulmononian 073876c
Update build_scotch.sh
ulmononian f9dcf4b
Add scotch modulefile ito hpc-stack/modulefiles/compiler/compilerName…
ulmononian 0037320
Update Fortran and C compiler cmake flags in build_scotch.sh.
ulmononian efb48eb
Merge branch 'NOAA-EMC:develop' into feature/add_scotch_hera
ulmononian 24f9771
Merge branch 'NOAA-EMC:develop' into feature/add_scotch_hera
ulmononian 9b2196f
Update build script.
ulmononian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
name="scotch" | ||
version=${1:-${STACK_scotch_version}} | ||
|
||
# Hyphenated version used for install prefix | ||
compiler=$(echo $HPC_COMPILER | sed 's/\//-/g') | ||
mpi=$(echo $HPC_MPI | sed 's/\//-/g') | ||
id=$(echo $version | sed 's/v//') | ||
|
||
if $MODULES; then | ||
set +x | ||
source $MODULESHOME/init/bash | ||
module load hpc-$HPC_COMPILER | ||
module load hpc-$HPC_MPI | ||
module load gnu | ||
module list | ||
set -x | ||
|
||
prefix="${PREFIX:-"/opt/modules"}/$compiler/$mpi/$name/$id" | ||
if [[ -d $prefix ]]; then | ||
if [[ $OVERWRITE =~ [yYtT] ]]; then | ||
echo "WARNING: $prefix EXISTS: OVERWRITING!" | ||
$SUDO rm -rf $prefix | ||
else | ||
echo "WARNING: $prefix EXISTS, SKIPPING" | ||
exit 0 | ||
fi | ||
fi | ||
else | ||
prefix=${SCOTCH_ROOT:-"/usr/local"} | ||
fi | ||
|
||
cd ${HPC_STACK_ROOT}/${PKGDIR:-"pkg"} | ||
|
||
software=$name-$version | ||
URL="https://gitlab.inria.fr/scotch/scotch/-/archive/$version/scotch-$version.tar.gz" | ||
[[ -f $software.tar.gz ]] || ( $WGET $URL ) | ||
[[ ${DOWNLOAD_ONLY} =~ [yYtT] ]] && exit 0 | ||
|
||
[[ -f $software.tar.gz ]] && tar -xvf $software.tar.gz || ( echo "$software tarfile does not exist, ABORT!"; exit 1 ) | ||
[[ -d $software ]] && cd $software || ( echo "$software does not exist, ABORT!"; exit 1 ) | ||
|
||
[[ -d build ]] && $SUDO rm -rf build | ||
mkdir -p build && cd build | ||
|
||
# Compile & Install Scotch/PTscotch | ||
cmake VERBOSE=1 -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_BUILD_TYPE=Release .. | ||
|
||
make VERBOSE=1 | ||
make install | ||
make scotch | ||
make ptscotch | ||
|
||
# generate modulefile from template | ||
[[ -z $mpi ]] && modpath=compiler || modpath=mpi | ||
$MODULES && update_modules $modpath $name $id | ||
echo $name $id $URL >> ${HPC_STACK_ROOT}/hpc-stack-contents.log |
36 changes: 36 additions & 0 deletions
36
modulefiles/mpi/compilerName/compilerVersion/mpiName/mpiVersion/scotch/scotch.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
help([[Scotch is a software package for graph and mesh/hypergraph partitioning, | ||
graph clustering, and sparse matrix ordering.]]) | ||
|
||
local pkgName = myModuleName() | ||
local pkgVersion = myModuleVersion() | ||
local pkgNameVer = myModuleFullName() | ||
|
||
local hierA = hierarchyA(pkgNameVer,2) | ||
local mpiNameVer = hierA[1] | ||
local compNameVer = hierA[2] | ||
local mpiNameVerD = mpiNameVer:gsub("/","-") | ||
local compNameVerD = compNameVer:gsub("/","-") | ||
|
||
conflict(pkgName) | ||
|
||
depends_on("zlib") | ||
|
||
local opt = os.getenv("HPC_OPT") or os.getenv("OPT") or "/opt/modules" | ||
|
||
local base = pathJoin(opt,compNameVerD,mpiNameVerD,pkgName,pkgVersion) | ||
|
||
prepend_path("PATH", pathJoin(base,"bin")) | ||
prepend_path("MANPATH", pathJoin(base,"man")) | ||
prepend_path("LIBRARY_PATH", pathJoin(base,"lib")) | ||
prepend_path("LD_LIBRARY_PATH", pathJoin(base,"lib")) | ||
prepend_path("DYLD_LIBRARY_PATH", pathJoin(base,"lib")) | ||
prepend_path("CPATH", pathJoin(base,"include")) | ||
prepend_path("CMAKE_PREFIX_PATH", base) | ||
|
||
setenv("scotch_ROOT", base) | ||
setenv("scotch_VERSION", pkgVersion) | ||
|
||
whatis("Name: ".. pkgName) | ||
whatis("Version: " .. pkgVersion) | ||
whatis("Category: library") | ||
whatis("Description: " .. pkgName .. " library") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to avoid hard-coding compiler names (such as ifort and icc), because it needs to general for different compilers.