Skip to content

Commit

Permalink
#2: fix setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
tlamonthezie committed Sep 30, 2024
1 parent 7f9646c commit cd5a19c
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 48 deletions.
26 changes: 9 additions & 17 deletions ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ defaults:
CXX: ~
GCOV: gcov
CMAKE_CXX_STANDARD: 17
CMAKE_BUILD_TYPE: Release

setup:
macos-14-clang-14:
Expand All @@ -68,29 +69,20 @@ setup:
GCOV: llvm-gcov
deps:
packages: !extend [ *apk-packages, clang, clang-dev ]
mpich: ['3.3.2', '-j4', '', 'clang', 'clang++']
mpich: ['3.3.2', '-j4']

# setup from vt
amd64-ubuntu-20.04-gcc-9-12.2.0-cpp:
label: vt, gcc-9, ubuntu, cuda 12.2, mpich, zoltan
env:
<<: *env
CC: gcc-9
CXX: g++-9
# deps and versions to find in vt
amd64-ubuntu-20.04-gcc-9-12.2.0-cpp: &amd64-ubuntu-20.04-gcc-9-12.2.0-cpp
label: vt, gcc-9, ubuntu, cuda 12.2, mpich
env: { <<: *env, CC: gcc-9, CXX: g++9 }
deps:
packages: !extend [ *apt-packages, gcc-9, g++-9 ]
cmake: *cmake-args # 3.23.4 in vt but seems to be an error with vtk tiff build because error in Cmake CheckSize.
openmpi: *openmpi-args
zoltan: *zoltan-args
mpich: *mpich-args
mpich: ['3.3.2', '-j4']
nvcc_wrapper: ~

amd64-ubuntu-20.04-gcc-9-11.2.2-cpp:
label: vt, gcc-9, ubuntu, cuda 11.2, mpich, zoltan
env:
<<: *env
CC: gcc-9
CXX: g++-9
<<: *amd64-ubuntu-20.04-gcc-9-12.2.0-cpp

# TODO: add the following
# :
Expand Down Expand Up @@ -194,7 +186,7 @@ images:
dockerfile: ubuntu-cpp-base.dockerfile
arch: linux/amd64
base: nvidia/cuda:11.2.2-devel-ubuntu20.04
setup: ubuntu-20.04-gcc-9-11.2.2-cpp
setup: amd64-ubuntu-20.04-gcc-9-11.2.2-cpp


# TODO: add the following
Expand Down
30 changes: 20 additions & 10 deletions ci/docker/base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,28 @@ ARG GCOV
ARG MPICH_CC
ARG MPICH_CXX

ARG CMAKE_BUILD_TYPE
ARG CMAKE_CXX_STANDARD

# Environment
ENV PATH=/opt/cmake/bin:$PATH
ENV CC=$CC
ENV CXX=$CXX
ENV MPICH_CC=$MPICH_CC
ENV MPICH_CXX=$MPICH_CXX
ENV GCOV=$GCOV
ENV CONDA_INSTALL_DIR=/opt/conda
ENV CONDA_AUTO_ACTIVATE_BASE=false
ENV VTK_DIR=/opt/vtk/build
ENV DOCKER_RUN=1
ENV DOCKER_RUN=1 \
CC=$CC \
CXX=$CXX \
MPICH_CC=$MPICH_CC \
MPICH_CXX=$MPICH_CXX \
GCOV=$GCOV \
\
CONDA_INSTALL_DIR=/opt/conda \
CONDA_AUTO_ACTIVATE_BASE=false \
\
VTK_DIR=/opt/vtk/build \
\
LESSCHARSET=utf-8 \
\
PATH=/opt/cmake/bin:/opt/nvcc_wrapper/bin:/opt/vtk/bin:$PATH

COPY ci/shared/scripts/setup-${SETUP_ID}.sh setup.sh

RUN chmod +x setup.sh && ./setup.sh

RUN echo "CXX=$CXX"
7 changes: 6 additions & 1 deletion ci/setup-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand All @@ -93,3 +93,8 @@ then
else
echo "No cleanup instructions defined for OS=$OS."
fi

if [ -e "opt/nvcc_wrapper/bin/nvcc_wrapper" ]
then
export CXX=nvcc_wrapper
fi
9 changes: 3 additions & 6 deletions ci/shared/scripts/deps/mpich.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ mpich_name="mpich-${mpich_version}"
mpich_tar_name="${mpich_name}.tar.gz"
make_flags="$2"
installation_prefix="${3-}"
make_cc="${4:-$CC}"
make_cxx="${5:-$CXX}"
make_fc="${6:-$FC}"

echo "${mpich_version}"
echo "${mpich_name}"
Expand All @@ -35,9 +32,9 @@ cd ${mpich_name}
--enable-fast=all \
--enable-g=none \
--enable-timing=none \
CC=$make_cc \
CXX=$make_cxx \
FC=$make_fc \
CC=$CC \
CXX=$CXX \
FC=$FC \
${installation_prefix:+ --prefix"=${installation_prefix}"}
make ${make_flags}
make install
Expand Down
10 changes: 10 additions & 0 deletions ci/shared/scripts/deps/nvcc_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -exo pipefail

mkdir -p /opt/nvcc_wrapper/bin

wget https://raw.githubusercontent.com/kokkos/kokkos/master/bin/nvcc_wrapper -P /opt/nvcc_wrapper/bin
chmod +x /opt/nvcc_wrapper/bin/nvcc_wrapper

which nvcc_wrapper
4 changes: 2 additions & 2 deletions ci/shared/scripts/setup-amd64-alpine-clang-13-clang-13-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ wget $SCRIPTS_DEPS_URL/mpich.sh
chmod u+x *.sh
ls -l
./packages.sh "alpine-sdk" "autoconf" "automake" "binutils-dev" "ccache" "cmake" "dpkg" "libdwarf-dev" "libunwind-dev" "libtool" "linux-headers" "m4" "make" "ninja" "zlib" "zlib-dev" "clang" "clang-dev"
./mpich.sh "3.3.2" "-j4" "" "clang" "clang++"
./mpich.sh "CC=clang" "CXX=clang++" "3.3.2" "-j4"

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,17 @@ mkdir -p $SCRIPTS_INSTALL_DIR/deps
cd $SCRIPTS_INSTALL_DIR/deps
wget $SCRIPTS_DEPS_URL/packages.sh
wget $SCRIPTS_DEPS_URL/cmake.sh
wget $SCRIPTS_DEPS_URL/openmpi.sh
wget $SCRIPTS_DEPS_URL/zoltan.sh
wget $SCRIPTS_DEPS_URL/mpich.sh
# 2. Install dependency
chmod u+x *.sh
ls -l
./packages.sh "curl" "jq" "less" "libomp5" "libunwind-dev make-guile" "ninja-build" "valgrind" "zlib1g" "zlib1g-dev" "ccache" "python3" "gcc-9" "g++-9"
./cmake.sh "3.30.3"
./openmpi.sh "v5.0" "5.0.4"
./zoltan.sh "-j4'" "/trilinos-install"
./mpich.sh "4.0.2" "-j4"
./mpich.sh "CC=clang" "CXX=clang++" "3.3.2" "-j4"

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
2 changes: 1 addition & 1 deletion ci/shared/scripts/setup-macos-14-clang-14.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ls -l

# Remove install scripts
rm -rf $SCRIPTS_INSTALL_DIR
if [ DOCKER_RUN == "1" ]; then
if [ "DOCKER_RUN" == "1" ]; then
rm -rf /var/lib/apt/lists/*
fi

Expand Down

0 comments on commit cd5a19c

Please sign in to comment.