-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcp2k-8.1.def
executable file
·79 lines (63 loc) · 2.54 KB
/
cp2k-8.1.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
Bootstrap: docker
From: ubuntu:20.04
# First stage: Build CP2K with the full oneAPI installation
Stage: devel
%post
export DEBIAN_FRONTEND=noninteractive
apt-get update -y && apt-get upgrade -y
apt-get install -y libboost-all-dev libgmp-dev build-essential automake wget curl git gnupg lsb-release
# Add oneAPI repository
echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -O - | apt-key add -
# Update and install oneAPI Base Toolkit
apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
intel-oneapi-compiler-dpcpp-cpp \
intel-oneapi-mkl-devel \
intel-oneapi-compiler-fortran \
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \
intel-oneapi-mpi-devel \
&& rm -rf /var/lib/apt/lists/*
# Set oneAPI environment variables
source /opt/intel/oneapi/setvars.sh
# Build Libint
git clone /~https://github.com/evaleev/libint.git
cd libint
./autogen.sh
mkdir build
cd build
../configure --prefix=/usr/local --enable-eri=1 --with-eri-max-am=6 --with-eri-opt-am=6
make -j$(nproc)
make install
cd ../..
# Clone CP2K and build it
git clone --recursive --branch v8.2 /~https://github.com/cp2k/cp2k.git
cd cp2k
cp ./tools/toolchain/scripts/install_cp2k_toolchain.sh .
chmod +x install_cp2k_toolchain.sh
./install_cp2k_toolchain.sh --mpi=ON --openmp=ON --mkl=ON --fftw=ON --scalapack=ON --libint=ON --install-all --yes
mkdir build
cd build
../tools/toolchain/scripts/setup_cp2k_toolchain.sh
make -j$(nproc) VERSION="popt"
# Move the CP2K binary to /opt/cp2k
mkdir -p /opt/cp2k/bin
mv ./exe/Linux-x86-64-intelx/cp2k.popt /opt/cp2k/bin
%files
/opt/cp2k /opt/cp2k
# Second stage: Runtime with only necessary libraries
Stage: runtime
%post
apt-get update -y && apt-get upgrade -y
apt-get install -y gnupg lsb-release
# Add oneAPI repository
echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB -O - | apt-key add -
# Update and install oneAPI Runtime
apt-get update -y
apt-get install -y intel-oneapi-mpi-runtime intel-oneapi-mkl-runtime intel-oneapi-fftw-runtime intel-oneapi-scalapack-runtime
# Clean up
apt-get autoremove -y
apt-get clean
rm -rf /var/lib/apt/lists/*
%files from devel