---
# System prepended metadata

title: Docker_gpaw 安裝

---

# Docker_gpaw 安裝

1. 安裝完成後，進入容器後先 `source /etc/profile`
=> 讀取gpaw 路徑

2. 安裝數據 `gpaw install-data pawdir`

3. 執行gpaw `mpiexec -n 8 gpaw python test.py --allow-run-as-root`


---
一版
```
FROM centos:7
MAINTAINER gpaw

WORKDIR /
RUN yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl && \
    yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl && \
    yum install -y blacs-openmpi-devel scalapack-openmpi-devel blas-devel devtoolset-7 rh-python36 && \
        python3 -m pip install ase --user
ENV PATH=/usr/lib64/openmpi/bin/:$PATH \
    LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH \
    LC_CTYPE=en_US.UTF-8
RUN git clone -b 21.1.0 https://gitlab.com/gpaw/gpaw.git && \
    cd gpaw && \
    echo "fftw=True" >> siteconfig.py && \
    echo "scalapack=True" >> siteconfig.py && \
    echo "libraries=['xc','fftw3','scalapack','mpiblacs']" >> siteconfig.py && \
    echo "library_dirs=['/usr/lib64/openmpi/lib/']" >> siteconfig.py
ENV GPAW_CONFIG=/gpaw/siteconfig.py
RUN python3 -m pip install -v gpaw --user && \
    echo 'export PATH=/root/.local/bin/:$PATH' >> /etc/profile && \
    source /etc/profile
CMD ["/bin/bash"]
```
二版
```
FROM centos:7
MAINTAINER gpaw

WORKDIR /
RUN yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl && \
    yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl && \
        python3 -m pip install ase --user
ENV PATH=/usr/lib64/openmpi/bin/:$PATH \
    LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH \
    LC_CTYPE=en_US.UTF-8
RUN git clone -b 21.1.0 https://gitlab.com/gpaw/gpaw.git && \
    cd gpaw && \
    echo "fftw=True" >> siteconfig.py && \
    echo "scalapack=True" >> siteconfig.py && \
    echo "libraries=['xc','fftw3','scalapack','mpiblacs']" >> siteconfig.py && \
    echo "library_dirs=['/usr/lib64/openmpi/lib/']" >> siteconfig.py
ENV GPAW_CONFIG=/gpaw/siteconfig.py
RUN python3 -m pip install -v gpaw --user && \
    echo 'export PATH=/root/.local/bin/:$PATH' >> /etc/profile && \
    /bin/bash -c "source /etc/profile"
ENV PATH=/root/.local/bin/:$PATH
CMD ["/bin/bash"]
```



USER_BASE: '/root/.local' (exists)
USER_SITE: '/root/.local/lib/python3.6/site-packages' (exists)

直接搬整個root資料夾到其他地方

## singurality 進行中4/13
```
FROM centos:7
MAINTAINER gpaw

WORKDIR /
RUN yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl && \
    yum install -y epel-release git which vim python3-pip epel-release python3-devel pip3-devel libxc-devel openblas-devel openmpi-devel fftw-devel blacs-openmpi-devel scalapack-openmpi-devel blas-devel centos-release-scl
ENV PATH=/usr/lib64/openmpi/bin/:$PATH \
    LD_LIBRARY_PATH=/usr/lib64/openmpi/lib:$LD_LIBRARY_PATH \
    LC_CTYPE=en_US.UTF-8
RUN python3 -m pip install ase --user && \
    git clone -b 21.1.0 https://gitlab.com/gpaw/gpaw.git && \
    cd gpaw && \
    echo "fftw=True" >> siteconfig.py && \
    echo "scalapack=True" >> siteconfig.py && \
    echo "libraries=['xc','fftw3','scalapack','mpiblacs']" >> siteconfig.py && \
    echo "library_dirs=['/usr/lib64/openmpi/lib/']" >> siteconfig.py
ENV GPAW_CONFIG=/gpaw/siteconfig.py
RUN python3 -m pip install -v gpaw --user && \
    mv /root/.local / && \
    echo 'export PATH=/.local/bin/:$PATH' >> /etc/profile && \
    /bin/bash -c "source /etc/profile"
ENV PATH=/.local/bin/:$PATH
CMD ["/bin/bash"]

```
