-
Notifications
You must be signed in to change notification settings - Fork 2
/
nn-benchmark.def
86 lines (70 loc) · 2.63 KB
/
nn-benchmark.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
Bootstrap: docker
From: ubuntu:20.04
Stage: polyfem
%post
# Install basic requirements
DEBIAN_FRONTEND="noninteractive" apt -y update
DEBIAN_FRONTEND="noninteractive" apt -y install wget gnupg software-properties-common
# Install MKL
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
DEBIAN_FRONTEND="noninteractive" apt -y update
DEBIAN_FRONTEND="noninteractive" apt -y install intel-oneapi-mkl-devel
# Add symlink for MKL path
ln -s /opt/intel/oneapi/mkl/latest/ /opt/intel/mkl
# Install dev requirements
DEBIAN_FRONTEND="noninteractive" apt -y install build-essential git cmake
# Build polyfem
git clone https://github.com/polyfem/polyfem.git polyfem-build
cd polyfem-build
git reset --hard '4f79356d82250219fa7d849ed81dc2a7eb3f1b93'
cd ..
mkdir -p polyfem-build/build
cd polyfem-build/build
MKLROOT=/opt/intel/mkl/ cmake .. -DPOLYSOLVE_WITH_PARDISO=ON -DPOLYFEM_NO_UI=ON
MKLROOT=/opt/intel/mkl/ make -j10
mkdir -p /opt/polyfem/
cp PolyFEM_bin /opt/polyfem/
# ------------------------------
Bootstrap: docker
From: ubuntu:20.04
Stage: final
%files from polyfem
/opt/polyfem/PolyFEM_bin /opt/polyfem/PolyFEM_bin
%files
environment.yml /opt/environment.yml
%environment
export POLYFEM_BIN_DIR=/opt/polyfem/
export MKLROOT=/opt/intel/mkl/
%post
# Install basic requirements
DEBIAN_FRONTEND="noninteractive" apt -y update
DEBIAN_FRONTEND="noninteractive" apt -y upgrade
DEBIAN_FRONTEND="noninteractive" apt -y install wget gnupg software-properties-common libgomp1
# Install MKL
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
DEBIAN_FRONTEND="noninteractive" apt -y update
DEBIAN_FRONTEND="noninteractive" apt -y install intel-oneapi-mkl
DEBIAN_FRONTEND="noninteractive" apt -y autoremove
DEBIAN_FRONTEND="noninteractive" apt -y clean
# Add symlink for MKL path
ln -s /opt/intel/oneapi/mkl/latest/ /opt/intel/mkl
# Install miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda/
rm Miniconda3-latest-Linux-x86_64.sh
export PATH="/opt/conda/bin:$PATH"
conda shell.bash hook >> $SINGULARITY_ENVIRONMENT
# Create conda env
chmod 444 /opt/environment.yml
conda env create -f /opt/environment.yml
conda shell.bash activate nn-benchmark >> $SINGULARITY_ENVIRONMENT
conda clean --all
%runscript
#! /bin/bash
exec "${@:-/bin/bash}"