-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
144 lines (129 loc) · 5.09 KB
/
Dockerfile
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
ARG IMAGE="rocm_gpu:6.2.4"
FROM ${IMAGE}
ARG QUDA_BRANCH="develop"
ARG QMP_BRANCH="devel"
ARG QIO_BRANCH="master"
ENV LLVN_DIR=${ROCM_PATH}/llvm/lib/cmake/llvm \
LLD_DIR=${ROCM_PATH}/llvm/lib/cmake/lld \
OMPI_CC=hipcc \
OMPI_CXX=hipcc \
MPICC=$OMPI_PATH/bin/mpicc \
MPICXX=$OMPI_PATH/bin/mpic++ \
MPIF77=$OMPI_PATH/bin/mpif77 \
MPIF90=$OMPI_PATH/bin/mpif90 \
INSTALLROOT=/opt
WORKDIR /tmp
#qmp
RUN git clone -b ${QMP_BRANCH} --recursive https://github.com/usqcd-software/qmp.git \
&& cd qmp \
&& mkdir build \
&& cd build \
&& cmake .. \
-DQMP_MPI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_C_STANDARD=99 \
-DCMAKE_C_EXTENSIONS=OFF \
-DCMAKE_INSTALL_PREFIX=${INSTALLROOT}/qmp \
-DBUILD_SHARED_LIBS=ON \
&& cmake --build . -j $(nproc) -v \
&& make install \
&& rm -rf /tmp/*
ENV PATH=${INSTALLROOT}/qmp/bin:$PATH \
LD_LIBRARY_PATH=${INSTALLROOT}/qmp/lib:$LD_LIBRARY_PATH \
LIBRARY_PATH=${INSTALLROOT}/qmp/lib:$LIBRARY_PATH \
C_INCLUDE_PATH=${INSTALLROOT}/qmp/include:$C_INCLUDE_PATH \
CPLUS_INCLUDE_PATH=${INSTALLROOT}/qmp/include:$CPLUS_INCLUDE_PATH \
PKG_CONFIG_PATH=${INSTALLROOT}/qmp/lib/pkgconfig:$PKG_CONFIG_PATH
#qio
RUN git clone -b ${QIO_BRANCH} --recursive https://github.com/usqcd-software/qio.git \
&& cd qio \
&& mkdir build \
&& ./autogen.sh \
&& cd build \
&& ../configure \
CFLAGS=-std=gnu99 CC=mpicc CFLAGS=-std=gnu99 LDFLAGS=-lmpi \
--prefix=${INSTALLROOT}/qio \
-with-qmp=${INSTALLROOT}/qmp \
--enable-largefile \
--disable-qmp-route \
--enable-fast_route \
--enable-dml-output-buffering \
--enable-dml-bufsize=33554432 \
&& make -j $(nproc) -v \
&& make install \
&& rm -rf /tmp/*
ENV PATH=${INSTALLROOT}/qio/bin:$PATH \
LD_LIBRARY_PATH=${INSTALLROOT}/qio/lib:$LD_LIBRARY_PATH \
LIBRARY_PATH=${INSTALLROOT}/qio/lib:$LIBRARY_PATH \
C_INCLUDE_PATH=${INSTALLROOT}/qio/include:$C_INCLUDE_PATH \
CPLUS_INCLUDE_PATH=${INSTALLROOT}/qio/include:$CPLUS_INCLUDE_PATH \
PKG_CONFIG_PATH=${INSTALLROOT}/qio/lib/pkgconfig:$PKG_CONFIG_PATH
#quda
RUN git clone -b ${QUDA_BRANCH} --recursive https://github.com/lattice/quda.git \
&& cd quda \
&& mkdir build \
&& cd build \
&& cmake /tmp/quda \
-G "Unix Makefiles" \
-DQUDA_TARGET_TYPE=HIP \
-DQUDA_GPU_ARCH="$GPU_TARGET" \
-DROCM_PATH=${ROCM_PATH} \
-DQUDA_DIRAC_CLOVER=ON \
-DQUDA_DIRAC_CLOVER_HASENBUSCH=ON \
-DQUDA_DIRAC_DOMAIN_WALL=ON \
-DQUDA_DIRAC_NDEG_TWISTED_MASS=OFF \
-DQUDA_DIRAC_STAGGERED=ON \
-DQUDA_DIRAC_TWISTED_MASS=OFF \
-DQUDA_DIRAC_TWISTED_CLOVER=OFF \
-DQUDA_DIRAC_WILSON=ON \
-DQUDA_DYNAMIC_CLOVER=OFF \
-DQUDA_FORCE_GAUGE=ON \
-DQUDA_FORCE_HISQ=ON \
-DQUDA_GAUGE_ALG=ON \
-DQUDA_GAUGE_TOOLS=OFF \
-DQUDA_QDPJIT=OFF \
-DQUDA_INTERFACE_QDPJIT=OFF \
-DQUDA_INTERFACE_MILC=ON \
-DQUDA_INTERFACE_CPS=OFF \
-DQUDA_INTERFACE_QDP=ON \
-DQUDA_INTERFACE_TIFR=OFF \
-DQUDA_MAGMA=OFF \
-DQUDA_ENABLE_P2P=ON \
-DQUDA_QMP=ON \
-DQMP_DIR=${INSTALLROOT}/qmp/lib/cmake/QMP \
-DQUDA_OPENMP=OFF \
-DQUDA_MULTIGRID=ON \
-DQUDA_MAX_MULTI_BLAS_N=9 \
-DQUDA_DOWNLOAD_EIGEN=ON \
-DQUDA_PRECISION=8 \
-DCMAKE_INSTALL_PREFIX=${INSTALLROOT}/quda \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_CXX_COMPILER=mpicxx\
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_HIP_COMPILER=mpicxx \
-DBUILD_SHARED_LIBS=ON \
-DQUDA_BUILD_SHAREDLIB=ON \
-DQUDA_BUILD_ALL_TESTS=ON \
-DQUDA_CTEST_DISABLE_BENCHMARKS=ON \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_STANDARD=99 \
-DCMAKE_CXX_FLAGS="-O3 -ggdb" \
-DCMAKE_C_FLAGS="-O3 -ggdb" \
-DCMAKE_HIP_FLAGS="-O3 -ggdb --offload-arch=${GPU_TARGET} --gpu-max-threads-per-block=1024" \
-DCMAKE_SHARED_LINKER_FLAGS="-O3 -ggdb" \
-DCMAKE_EXE_LINKER_FLAGS="-O3 -ggdb --offload-arch=${GPU_TARGET}" \
&& cmake --build . -v -j $(nproc) \
&& cmake --install . \
&& rm -rf /tmp/*
ENV PATH=${INSTALLROOT}/quda/bin:$PATH \
LD_LIBRARY_PATH=${INSTALLROOT}/quda/lib:$LD_LIBRARY_PATH \
LIBRARY_PATH=${INSTALLROOT}/quda/lib:$LIBRARY_PATH \
C_INCLUDE_PATH=${INSTALLROOT}/quda/include:$C_INCLUDE_PATH \
CPLUS_INCLUDE_PATH=${INSTALLROOT}/quda/include:$CPLUS_INCLUDE_PATH \
PKG_CONFIG_PATH=${INSTALLROOT}/quda/lib/pkgconfig:$PKG_CONFIG_PATH
# Adding Milc to PATH
ENV QUDA_ENABLE_P2P=0 \
QUDA_ENABLE_GDR=1 \
QUDA_RESOURCE_PATH=/tmp/
CMD ["/bin/bash"]