-
Notifications
You must be signed in to change notification settings - Fork 0
/
xenial-8.4.0-mesa.def
154 lines (123 loc) · 4.4 KB
/
xenial-8.4.0-mesa.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Bootstrap: docker
From: trophime/mesa-demos:18.2.4
%help
USAGE: salome [-h]
NOTES:
1) This image is read-only!
EXAMPLES:
List availailable apps
$ singularity apps <image-name>
Run salome in TUI mode:
$ singularity run <image-name> -t scrypt.py args:....
Run salome in GUI mode:
$ singularity run --nv --app salome <image-name>
Run salome in GUI mode on NoVNC/Virtual :
$ singularity run --nv --app vgl_salome <image-name> ...
Run salome in TUI mode for Hifimagnet :
$ singularity run --app hifimagnet-tui <image-name> ...
Run salome in GUI mode for Hifimagnet :
$ singularity run --nv --app hifimagnet_gui <image-name> ...
To add support for MeshGems:
$ singularity run --nv -B ${MESHGEMS_LICDIR}:/opt/DISTENE/DLim [--app <app>] <image-app>
where MESHGEMS_LICDIR points to the directory holding a valid MeshGems license
%runscript
exec salome "$@"
%setup
echo "Looking in directory '$SINGULARITY_ROOTFS' for /bin/sh"
if [ ! -x "$SINGULARITY_ROOTFS/bin/sh" ]; then
echo "Hrmm, this container does not have /bin/sh installed..."
exit 1
fi
# prepare for MeshGems
mkdir -p $SINGULARITY_ROOTFS/opt/DISTENE/DLim
mkdir -p $SINGULARITY_ROOTFS/tmp
cp /home/LNCMI-G/trophime/Salome_Packages/SALOME-8.4.0-MPI-UB16.04.tgz $SINGULARITY_ROOTFS/tmp/
cp /home/LNCMI-G/trophime/github/hifimagnet/singularity/salome/install-SALOME-8.4.0-MPI-UB16.04.sh $SINGULARITY_ROOTFS/tmp/
mkdir -p $SINGULARITY_ROOTFS/usr/local/share/salome/test
for script in $(ls /home/LNCMI-G/trophime/Salome_Tests/scripts/*py); do
cp $script $SINGULARITY_ROOTFS/usr/local/share/salome/test
done
mkdir -p $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
for cfg in $(ls /home/LNCMI-G/trophime/Salome_Tests/H1H4/*yaml); do
cp $cfg $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
done
for dat in $(ls /home/LNCMI-G/trophime/Salome_Tests/H1H4/*dat); do
cp $dat $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
done
exit 0
%environment
export PATH=/opt/SALOME-8.4.0-MPI-UB16.04:$PATH
export DISTENE_LICENSE_FILE=/opt/DISTENE/DLim/dlim8.key
export FEELPP_REPOSITORY=/feel
export HIFIMAGNET=/opt/SALOME-8.4.0-MPI-UB16.04/BINARIES-UB16.04/HIFIMAGNET/bin/salome/
# Defining alias for security
alias ls='ls --color=auto'
alias ll='ls -ls'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias grep='grep --color'
# Add support for openmp
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export LANG=C
%labels
AUTHOR [email protected]
Maintainer: Christophe Trophime
Maintainer_email: [email protected]
Version 1.0
%post
mkdir -p /feel
mkdir -p /scratch /tmp
# Installing Salome
cd /tmp && sh ./install-SALOME-8.4.0-MPI-UB16.04.sh
rm /tmp/install-SALOME-8.4.0-MPI-UB16.04.sh
find /opt/SALOME-8.4.0-MPI-U16.04 -name \*.py[co] | xargs -r rm
## Installing VirtualGl for noVNC
wget https://sourceforge.net/projects/virtualgl/files/2.6/virtualgl_2.6_amd64.deb/download -O /tmp/virtualgl_2.6_amd64.deb
#wget https://sourceforge.net/projects/virtualgl/files/2.5.2/virtualgl_2.5.2_amd64.deb/download -O /tmp/virtualgl_2.5.2_amd64.deb
apt-get -y install x11-apps libxv1
dpkg -i /tmp/virtualgl_2.6_amd64.deb
#dpkg -i /tmp/virtualgl_2.5.2_amd64.deb
rm -f /tmp/virtualgl_2.6_amd64.deb
#rm -f /tmp/virtualgl_2.5-2_amd64.deb
# To use on Cluster with InfinyBand and Slurm
apt-get -y install dapl2-utils \
libdapl2 \
libibverbs1 \
librdmacm1 \
libcxgb3-1 \
libipathverbs1 \
libmlx4-1 \
libmlx5-1 \
libmthca1 \
libnes1 \
libpmi0 \
libslurm29
# Cleanup
apt -y clean
apt -y autoclean
# # Try to cleanup more
# for package in $(dpkg -l | egrep ".*\-dev\b" | awk '{print $2}'); do \
# echo "Remove $package"; \
# apt -y remove $package; \
# done
%test
for script in $(ls /usr/local/share/salome/test/*py); do
echo -n "Running $script"
export LD_LIBRARY_PATH=/usr/lib/paraview:$LD_LIBRARY_PATH
export PATH=/opt/SALOME-8.6.0-MPI-UB16.04:$PATH
salome -t $script > /dev/null 2>&1
status=$?
if [ "x$status" = "0" ]; then
echo -en "[\033[32m OK \033[39m]"
else
echo -en "[\033[32m OK \033[39m]"
fi
echo
done
%apprun salome
echo "Need to pass --nv options to singularity"
salome "$@"
%apprun vgl_salome
vglrun salome "$@"