mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-28 22:25:32 -04:00
Toolchain: Add Tensorflow as an optional requirement
This commit is contained in:
parent
734046d1e0
commit
e489c1dbd3
3 changed files with 41 additions and 3 deletions
|
|
@ -11,11 +11,15 @@ ARG BASE_IMAGE
|
|||
|
||||
USER root
|
||||
|
||||
# install Linux packages.
|
||||
# Install Linux packages.
|
||||
COPY ./install_requirements*.sh ./
|
||||
RUN ./install_requirements.sh ${BASE_IMAGE}
|
||||
|
||||
# copy helper scripts
|
||||
# Install Tensorflow.
|
||||
COPY ./install_tensorflow.sh ./
|
||||
RUN ./install_tensorflow.sh ${BASE_IMAGE}
|
||||
|
||||
# Copy helper scripts.
|
||||
WORKDIR /opt/cp2k-toolchain
|
||||
RUN mkdir scripts
|
||||
COPY ./scripts/VERSION \
|
||||
|
|
|
|||
|
|
@ -9,10 +9,14 @@ FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
|
|||
ENV CUDA_PATH /usr/local/cuda
|
||||
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64
|
||||
|
||||
# install Ubuntu packages.
|
||||
# Install Ubuntu packages.
|
||||
COPY ./install_requirements_ubuntu.sh .
|
||||
RUN ./install_requirements_ubuntu.sh
|
||||
|
||||
# Install Tensorflow.
|
||||
COPY ./install_tensorflow.sh ./
|
||||
RUN ./install_tensorflow.sh ubuntu
|
||||
|
||||
# Install some more Ubuntu packages.
|
||||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
|
||||
gfortran \
|
||||
|
|
|
|||
30
tools/toolchain/install_tensorflow.sh
Executable file
30
tools/toolchain/install_tensorflow.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# author: Ole Schuett
|
||||
|
||||
if (($# != 1)); then
|
||||
echo "Usage: install_tensorflow.sh <BASE_IMAGE>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BASE_IMAGE=$1
|
||||
|
||||
echo "Installing Tensorflow..."
|
||||
|
||||
if [[ ${BASE_IMAGE} == ubuntu* ]]; then
|
||||
apt-get update -qq
|
||||
apt-get install -qq --no-install-recommends python3-pip
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
pip install --quiet tensorflow
|
||||
|
||||
elif [[ ${BASE_IMAGE} == fedora* ]]; then
|
||||
dnf -qy install python3-pip
|
||||
dnf clean -q all
|
||||
pip install --quiet tensorflow
|
||||
|
||||
else
|
||||
echo "Unknown base image: ${BASE_IMAGE}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#EOF
|
||||
Loading…
Add table
Add a link
Reference in a new issue