Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2w
autoicon
Commits
1077da26
Commit
1077da26
authored
2 years ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
Try to install enstools with pip.
parent
bb1a44b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/build_enstools.sh
+25
-12
25 additions, 12 deletions
templates/build_enstools.sh
with
25 additions
and
12 deletions
templates/build_enstools.sh
+
25
−
12
View file @
1077da26
...
...
@@ -6,10 +6,9 @@ SPACK_URL=%spack.url%
SPACK_BRANCH
=
%spack.branch%
SPACK_COMPILER
=
%spack.compiler%
# If the workdir directory does not exist create it
if
[
!
-d
${
WORKDIR
}
]
;
then
mkdir
-p
${
WORKDIR
}
if
[
!
-d
${
WORKDIR
}
]
;
then
mkdir
-p
${
WORKDIR
}
fi
# Go to the working directory
...
...
@@ -17,7 +16,7 @@ cd ${WORKDIR}
# Check if experiment's spack installation already exists, if it doesn't, clone it.
SPACK_ENV
=
spack/share/spack/setup-env.sh
if
[
!
-f
${
SPACK_ENV
}
]
;
then
if
[
!
-f
${
SPACK_ENV
}
]
;
then
git clone
${
SPACK_URL
}
-b
${
SPACK_BRANCH
}
#TODO: Would be good to enable the re-utilization of existing spack packages (via packages.yaml or upstreams.yaml)
fi
...
...
@@ -25,16 +24,30 @@ fi
# Setup the environment
source
${
SPACK_ENV
}
if
[
$(
spack find py-enstools-compression &> /dev/null
;
echo
$?
)
-ne
0
]
;
then
echo
"Installing enstools-compression."
# Compile openmpi with schedulers=slurm
spack
install
py-enstools-compression
# Use spack to get a recent enough version of python3
if
[
$(
spack find python@3.8: &>/dev/null
echo
$?
)
-ne
0
]
;
then
echo
"Installing a version of python3"
# Compile openmpi with schedulers=slurm
spack
install
python3@3.8:
else
echo
"py-enstools-compression already installed!"
echo
"py-enstools-compression already installed!"
fi
# Link the python binary into the main folder so can be easily used later:
spack load py-enstools-compression
ln
-sf
$(
which python3
)
${
WORKDIR
}
/python3
\ No newline at end of file
spack load python@3.8:
# Create virtual environment
python3
-m
venv
--prompt
AS venv
# Load environment
source
venv/bin/activate
# Create a link to the binary
ln
-sf
$(
which python3
)
${
WORKDIR
}
/python3
# Install enstools-compression via pip
pip
install
enstools-compression
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment