Skip to content

Commit

Permalink
Merge pull request #1610 from DARMA-tasking/1609-clean-up-workspace-b…
Browse files Browse the repository at this point in the history
…efore-tpl-sample-build

#1609 clean up workspace before compiling vt-sample-project with vt as TPL
  • Loading branch information
PhilMiller authored Nov 16, 2021
2 parents d5b21bb + b5e4b97 commit 53b4c56
Show file tree
Hide file tree
Showing 13 changed files with 85 additions and 40 deletions.
39 changes: 0 additions & 39 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,42 +225,3 @@ then
echo "There was an error during compilation"
exit "$compilation_ret"
fi

inclusion_type=""
if test "$VT_INCLUSION_TYPE" = "TPL"
then
inclusion_type="-Dbuild_with_tpl=1"
elif test "$VT_INCLUSION_TYPE" = "EXT_LIB"
then
inclusion_type="-Dbuild_with_libs=1"
fi

# Don't build vt-sample on Alpine Linux
is_alpine="$(grep ID < /etc/os-release | grep -c alpine || true)"
if test "$is_alpine" -eq 0 && test "${VT_CI_BUILD:-0}" -eq 1 && test "${target}" = "install"
then
git clone https://github.com/DARMA-tasking/vt-sample-project
mkdir -p vt-sample-project/build
cd vt-sample-project/build
export vt_DIR="$VT_BUILD/install"
cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-Dvt_DIR="${VT}" \
-Dcheckpoint_DIR="${CHECKPOINT}" \
-Ddetector_DIR="${DETECTOR}" \
-Dkokkos_DISABLE:BOOL=1 \
-Dkokkos_kernels_DISABLE:BOOL=1 \
-Dvt_trace_only="1" \
-DVT_BUILD_EXAMPLES="0" \
-DVT_BUILD_TESTS="0" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" \
-DCMAKE_CXX_COMPILER="${CXX:-c++}" \
-DCMAKE_C_COMPILER="${CC:-cc}" \
"$inclusion_type" \
..
cmake --build .

# Try to actually run samples
mpiexec -n 2 ./vt-runtime-sample
mpiexec -n 2 ./vt-trace-only-sample
fi
63 changes: 63 additions & 0 deletions ci/build_vt_sample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash

set -ex

source_dir=${1}
build_dir=${2}

inclusion_type=""
if test "$VT_INCLUSION_TYPE" = "TPL"
then
inclusion_type="-Dbuild_with_tpl=1"
elif test "$VT_INCLUSION_TYPE" = "EXT_LIB"
then
inclusion_type="-Dbuild_with_libs=1"
fi

if test "${VT_CI_BUILD:-0}" -eq 1
then
export VT=${source_dir}
export VT_BUILD=${build_dir}/vt
export VT_INSTALL=${VT_BUILD}/install
export DETECTOR=${build_dir}/detector
export CHECKPOINT=${DETECTOR}/build/checkpoint

cd "$VT_BUILD"

if test "$VT_INCLUSION_TYPE" = "TPL"
then
echo "Clean up before building vt-sample-project"
cmake --build . --target clean
rm -rf "$VT_INSTALL"
fi

if test "$VT_INCLUSION_TYPE" = "EXT_LIB"
then
export vt_DIR="$VT_INSTALL"
fi

git clone https://github.com/DARMA-tasking/vt-sample-project
mkdir -p vt-sample-project/build
cd vt-sample-project/build || exit

cmake -G "${CMAKE_GENERATOR:-Ninja}" \
-Dvt_DIR="${VT}" \
-Dcheckpoint_DIR="${CHECKPOINT}" \
-Ddetector_DIR="${DETECTOR}" \
-Dkokkos_DISABLE:BOOL=1 \
-Dkokkos_kernels_DISABLE:BOOL=1 \
-Dvt_trace_only="1" \
-DVT_BUILD_EXAMPLES="0" \
-DVT_BUILD_TESTS="0" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" \
-DCMAKE_CXX_COMPILER="${CXX:-c++}" \
-DCMAKE_C_COMPILER="${CC:-cc}" \
"$inclusion_type" \
..
cmake --build .

# Try to actually run samples
mpiexec -n 2 ./vt-runtime-sample
mpiexec -n 2 ./vt-trace-only-sample
fi
1 change: 1 addition & 0 deletions ci/docker/develop.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ ENV VT_LB_ENABLED=${VT_LB_ENABLED} \

RUN /vt/ci/build_cpp.sh /vt /build
RUN /vt/ci/test_cpp.sh /vt /build
RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-18.04-clang-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-18.04-gnu-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-18.04-intel-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-18.04-intel-oneapi-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-18.04-nvidia-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-20.04-clang-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-20.04-gnu-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
2 changes: 2 additions & 0 deletions ci/docker/ubuntu-20.04-gnu-openmpi-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@ RUN /vt/ci/build_cpp.sh /vt /build

FROM build as test
RUN /vt/ci/test_cpp.sh /vt /build

RUN /vt/ci/build_vt_sample.sh /vt /build
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ services:
command: &vt-cpp-command >
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build &&
/vt/ci/test_cpp.sh /vt /build"
/vt/ci/test_cpp.sh /vt /build &&
/vt/ci/build_vt_sample.sh /vt /build"

##############################################################################
# C++ build/test/clean target for VT on ubuntu platform from container
Expand All @@ -219,6 +220,7 @@ services:
/bin/bash -c "
/vt/ci/build_cpp.sh /vt /build &&
/vt/ci/test_cpp.sh /vt /build &&
/vt/ci/build_vt_sample.sh /vt /build &&
/vt/ci/clean_cpp.sh /vt /build"

##############################################################################
Expand All @@ -230,6 +232,7 @@ services:
# You will get a command line where you can run the build command:
# $ /vt/ci/build_cpp.sh /vt /build
# $ /vt/ci/test_cpp.sh /vt /build
# $ /vt/ci/build_vt_sample.sh /vt /build
ubuntu-cpp-interactive:
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-${COMPILER}-cpp
build:
Expand Down
1 change: 1 addition & 0 deletions docs/md/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ $ cd vt
$ docker-compose run -e BUILD_TYPE=debug -e VT_TRACE=1 ubuntu-cpp-interactive
# /vt/ci/build_cpp.sh /vt /build
# /vt/ci/test_cpp.sh /vt /build
# /vt/ci/build_vt_sample.sh /vt /build
```

The same call applies to alpine distro builds if you swap
Expand Down

0 comments on commit 53b4c56

Please sign in to comment.