Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hpc-compendium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZIH
hpcsupport
hpc-compendium
Commits
2479b508
Commit
2479b508
authored
1 year ago
by
Bert Wesarg
Browse files
Options
Downloads
Patches
Plain Diff
Singularity: Prefer `${var}` over `$var`
parent
2a22e050
No related branches found
No related tags found
2 merge requests
!919
Automated merge from preview to main
,
!911
Its "Open MPI"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc.zih.tu-dresden.de/docs/software/singularity_recipe_hints.md
+19
-19
19 additions, 19 deletions
...h.tu-dresden.de/docs/software/singularity_recipe_hints.md
with
19 additions
and
19 deletions
doc.zih.tu-dresden.de/docs/software/singularity_recipe_hints.md
+
19
−
19
View file @
2479b508
...
...
@@ -74,9 +74,9 @@ From: ubuntu:20.04
%environment
export
MPICH_DIR
=
/opt/mpich
export
SINGULARITY_MPICH_DIR
=
$MPICH_DIR
export
SINGULARITYENV_APPEND_PATH
=
$MPICH_DIR
/bin
export
SINGULAIRTYENV_APPEND_LD_LIBRARY_PATH
=
$MPICH_DIR
/lib
export
SINGULARITY_MPICH_DIR
=
$
{
MPICH_DIR
}
export
SINGULARITYENV_APPEND_PATH
=
$
{
MPICH_DIR
}
/bin
export
SINGULAIRTYENV_APPEND_LD_LIBRARY_PATH
=
$
{
MPICH_DIR
}
/lib
%post
echo
"Installing required packages..."
...
...
@@ -88,23 +88,23 @@ From: ubuntu:20.04
echo
"Installing MPICH"
export
MPICH_DIR
=
/opt/mpich
export
MPICH_VERSION
=
4.1
export
MPICH_URL
=
"https://www.mpich.org/static/downloads/
$MPICH_VERSION
/mpich-
$MPICH_VERSION
.tar.gz"
export
MPICH_URL
=
"https://www.mpich.org/static/downloads/
$
{
MPICH_VERSION
}
/mpich-
$
{
MPICH_VERSION
}
.tar.gz"
mkdir
-p
/tmp/mpich
mkdir
-p
/opt
# Download
cd
/tmp/mpich
&&
wget
-O
mpich-
$MPICH_VERSION
.tar.gz
$MPICH_URL
&&
tar
-xf
mpich-
$MPICH_VERSION
.tar.gz
cd
/tmp/mpich
&&
wget
-O
mpich-
$
{
MPICH_VERSION
}
.tar.gz
$
{
MPICH_URL
}
&&
tar
-xf
mpich-
$
{
MPICH_VERSION
}
.tar.gz
# Configure and compile/install
cd
/tmp/mpich/mpich-
$MPICH_VERSION
./configure
--prefix
=
$MPICH_DIR
&&
make
install
cd
/tmp/mpich/mpich-
$
{
MPICH_VERSION
}
./configure
--prefix
=
$
{
MPICH_DIR
}
&&
make
install
# Set env variables so we can compile our application
export
PATH
=
$MPICH_DIR
/bin:
$PATH
export
LD_LIBRARY_PATH
=
$MPICH_DIR
/lib:
$LD_LIBRARY_PATH
export
MANPATH
=
$MPICH_DIR
/share/man:
$MANPATH
export
PATH
=
$
{
MPICH_DIR
}
/bin:
$
{
PATH
}
export
LD_LIBRARY_PATH
=
$
{
MPICH_DIR
}
/lib:
$
{
LD_LIBRARY_PATH
}
export
MANPATH
=
$
{
MPICH_DIR
}
/share/man:
$
{
MANPATH
}
echo
"Compiling the MPI application..."
cd
/opt
&&
mpicc
-o
mpitest mpitest.c
```
...
...
@@ -195,13 +195,13 @@ This image may be run with
singularity exec xeyes.sif xeyes.
```
This works because all the magic is done by Singularity already like setting
`$DISPLAY`
to the outside
display and mounting
`$HOME`
so
`$HOME/.Xauthority`
(X11 authentication cookie) is found. When you are
This works because all the magic is done by Singularity already like setting
`$
{
DISPLAY
}
`
to the outside
display and mounting
`$
{
HOME
}
`
so
`$
{
HOME
}
/.Xauthority`
(X11 authentication cookie) is found. When you are
using
`--contain`
or
`--no-home`
you have to set that cookie yourself or mount/copy it inside
the container. Similar for
`--cleanenv`
you have to set
`$DISPLAY`
, e.g., via
the container. Similar for
`--cleanenv`
you have to set
`$
{
DISPLAY
}
`
, e.g., via
```
console
export SINGULARITY_DISPLAY=$
DISPLAY
export SINGULARITY_DISPLAY=$
{
DISPLAY
}
```
When you run a container as root (via
`sudo`
) you may need to allow root for your local display
...
...
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