diff --git a/.github/workflows/docker-portability-system.yml b/.github/workflows/docker-portability-system.yml new file mode 100644 index 0000000..b0f4974 --- /dev/null +++ b/.github/workflows/docker-portability-system.yml @@ -0,0 +1,71 @@ +name: docker-portability-system + +on: + workflow_dispatch: + inputs: + ubuntu_release: + description: 'Ubuntu release' + required: true + type: string + default: 'mantic' + +jobs: + docker: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - tags: | + chaste/runner:${{ github.event.inputs.ubuntu_release }}.portability-system + build-args: | + BASE=${{ github.event.inputs.ubuntu_release }} + XSD=system + XERCESC=system + SUNDIALS=system + BOOST=system + VTK=system + PETSC=system + HDF5=system + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and export to Docker + uses: docker/build-push-action@v4 + with: + context: . + pull: true + load: true + tags: ${{ matrix.tags }} + build-args: ${{ matrix.build-args }} + + - name: Test image + run: | + tags=( ${{ matrix.tags }} ) + for tag in "${tags[@]}"; do + docker run --rm --entrypoint /bin/bash ${tag} + done + + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + pull: true + push: true + tags: ${{ matrix.tags }} + build-args: ${{ matrix.build-args }} diff --git a/scripts/install_boost.sh b/scripts/install_boost.sh index e71dcd2..2d1a1dc 100755 --- a/scripts/install_boost.sh +++ b/scripts/install_boost.sh @@ -36,6 +36,55 @@ if [ -z "${base_dir}" ]; then usage; fi parallel="${parallel:-$(nproc)}" +# Modulefile pointing to system version +if [ "$version" = "system" ]; then + version=$(dpkg -s libboost-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3) + + mkdir -p ${base_dir}/modulefiles/boost && cd ${base_dir}/modulefiles/boost + cat < ${version} +#%Module1.0##################################################################### +### +## boost ${version} modulefile +## +proc ModulesTest { } { + set paths "[getenv BOOST_ROOT] + [getenv BOOST_ROOT]/lib + [getenv BOOST_ROOT]/include" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for boost ${version}\n" +} + +module-whatis "This adds the environment variables for boost ${version}" + +setenv BOOST_ROOT /usr +setenv BOOST_INCLUDEDIR /usr/include/boost +setenv BOOST_LIBRARYDIR /usr/lib/x86_64-linux-gnu + +prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu + +prepend-path INCLUDE /usr/include/boost +prepend-path C_INCLUDE_PATH /usr/include/boost +prepend-path CPLUS_INCLUDE_PATH /usr/include/boost + +prepend-path CMAKE_PREFIX_PATH /usr + +conflict boost +EOF + exit 0 +fi + version_arr=(${version//\./ }) major=${version_arr[0]} minor=${version_arr[1]} diff --git a/scripts/install_petsc_hdf5.sh b/scripts/install_petsc_hdf5.sh index e54a547..69cad36 100755 --- a/scripts/install_petsc_hdf5.sh +++ b/scripts/install_petsc_hdf5.sh @@ -49,10 +49,84 @@ if [ -z "${base_dir}" ]; then usage; fi parallel="${parallel:-$(nproc)}" if [[ ! (${petsc_arch} = 'linux-gnu' - || ${petsc_arch} = 'linux-gnu-opt') ]]; then + || ${petsc_arch} = 'linux-gnu-opt' + || ${petsc_arch} = 'system') ]]; then usage fi +# Modulefile pointing to system version +if [[ ("$petsc_version" = "system") + || ("$hdf5_version" = "system") + || ("$petsc_arch" = "system") ]]; then + petsc_version=$(dpkg -s libpetsc-real-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1) + hdf5_version=$(dpkg -s libhdf5-openmpi-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1) + + mkdir -p ${base_dir}/modulefiles/petsc_hdf5/${petsc_version}_${hdf5_version} + cd ${base_dir}/modulefiles/petsc_hdf5/${petsc_version}_${hdf5_version} + cat < ${petsc_arch} +#%Module1.0##################################################################### +### +## petsc_hdf5 ${petsc_version}_${hdf5_version}/${petsc_arch} modulefile +## +proc ModulesTest { } { + set paths "[getenv PETSC_DIR] + [getenv PETSC_DIR]/[getenv PETSC_ARCH] + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/bin + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/bin/h5pcc + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/include + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib/libhdf5.so + [getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib/libpetsc.so" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for petsc ${petsc_version} and hdf5 ${hdf5_version}, with PETSC_ARCH=${petsc_arch}\n" +} + +module-whatis "This adds the environment variables for petsc ${petsc_version} and hdf5 ${hdf5_version}, with PETSC_ARCH=${petsc_arch}" + +setenv PETSC_DIR "" +setenv PETSC_ARCH "" + +prepend-path PATH /usr/bin + +prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu + +prepend-path INCLUDE /usr/include/petsc +prepend-path C_INCLUDE_PATH /usr/include/petsc +prepend-path CPLUS_INCLUDE_PATH /usr/include/petsc + +prepend-path CMAKE_PREFIX_PATH /usr/ + +setenv HDF5_ROOT /usr/ + +prepend-path INCLUDE /usr/include/hdf5 +prepend-path C_INCLUDE_PATH /usr/include/hdf5 +prepend-path CPLUS_INCLUDE_PATH /usr/include/hdf5 + +setenv PARMETIS_ROOT /usr/ + +prepend-path INCLUDE /usr/include +prepend-path C_INCLUDE_PATH /usr/include +prepend-path CPLUS_INCLUDE_PATH /usr/include + +conflict petsc +conflict hdf5 +conflict petsc_hdf5 +EOF + exit 0 +fi + petsc_version_arr=(${petsc_version//\./ }) petsc_major=${petsc_version_arr[0]} petsc_minor=${petsc_version_arr[1]} diff --git a/scripts/install_sundials.sh b/scripts/install_sundials.sh index b449df6..8c3e055 100755 --- a/scripts/install_sundials.sh +++ b/scripts/install_sundials.sh @@ -34,6 +34,53 @@ if [ -z "${base_dir}" ]; then usage; fi parallel="${parallel:-$(nproc)}" +# Modulefile pointing to system version +if [ "$version" = "system" ]; then + version=$(dpkg -s libsundials-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1) + + mkdir -p ${base_dir}/modulefiles/sundials && cd ${base_dir}/modulefiles/sundials + cat < ${version} +#%Module1.0##################################################################### +### +## sundials ${version} modulefile +## +proc ModulesTest { } { + set paths "[getenv SUNDIALS_ROOT] + [getenv SUNDIALS_ROOT]/include + [getenv SUNDIALS_ROOT]/lib" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for sundials ${version}\n" +} + +module-whatis "This adds the environment variables for sundials ${version}" + +setenv SUNDIALS_ROOT /usr + +prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu + +prepend-path INCLUDE /usr/include/sundials +prepend-path C_INCLUDE_PATH /usr/include/sundials +prepend-path CPLUS_INCLUDE_PATH /usr/include/sundials + +prepend-path CMAKE_PREFIX_PATH /usr + +conflict sundials +EOF + exit 0 +fi + version_arr=(${version//\./ }) major=${version_arr[0]} minor=${version_arr[1]} diff --git a/scripts/install_vtk.sh b/scripts/install_vtk.sh index 1c6428b..8a79d2d 100755 --- a/scripts/install_vtk.sh +++ b/scripts/install_vtk.sh @@ -36,6 +36,63 @@ if [ -z "${base_dir}" ]; then usage; fi parallel="${parallel:-$(nproc)}" +# Modulefile pointing to system version +if [ "$version" = "system" ]; then + version="" + for i in 9 8 7 6 + do + version=$(dpkg -s "libvtk${i}-dev" | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1) + if [ -n "${version}" ]; then break; fi + done + + if [ -z "${version}" ]; then echo "Unknown VTK system version"; exit 1; fi + + major=$(echo $version | cut -d. -f1) + minor=$(echo $version | cut -d. -f2) + + mkdir -p ${base_dir}/modulefiles/vtk && cd ${base_dir}/modulefiles/vtk + cat < ${version} +#%Module1.0##################################################################### +### +## vtk ${version} modulefile +## +proc ModulesTest { } { + set paths "[getenv VTK_ROOT] + [getenv VTK_ROOT]/include/vtk-${major}.${minor} + [getenv VTK_ROOT]/lib" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for vtk ${version}\n" +} + +module-whatis "This adds the environment variables for vtk ${version}" + +setenv VTK_ROOT /usr + +prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu + +prepend-path INCLUDE /usr/include/vtk-${major}.${minor} +prepend-path C_INCLUDE_PATH /usr/include/vtk-${major}.${minor} +prepend-path CPLUS_INCLUDE_PATH /usr/include/vtk-${major}.${minor} + +prepend-path CMAKE_PREFIX_PATH /usr + +conflict vtk +EOF + exit 0 +fi + version_arr=(${version//\./ }) major=${version_arr[0]} minor=${version_arr[1]} diff --git a/scripts/install_xercesc.sh b/scripts/install_xercesc.sh index 96376bd..2134e61 100755 --- a/scripts/install_xercesc.sh +++ b/scripts/install_xercesc.sh @@ -34,6 +34,55 @@ if [ -z "${base_dir}" ]; then usage; fi parallel="${parallel:-$(nproc)}" +# Modulefile pointing to system version +if [ "$version" = "system" ]; then + version=$(dpkg -s libxerces-c-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1) + + mkdir -p ${base_dir}/modulefiles/xercesc && cd ${base_dir}/modulefiles/xercesc + cat < ${version} +#%Module1.0##################################################################### +### +## xercesc ${version} modulefile +## +proc ModulesTest { } { + set paths "[getenv XERCESC_ROOT] + [getenv XERCESC_INCLUDE] + [getenv XERCESC_LIBRARY]" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for xercesc ${version}\n" +} + +module-whatis "This adds the environment variables for xercesc ${version}" + +setenv XERCESC_ROOT /usr +setenv XERCESC_INCLUDE usr/include/xercesc +setenv XERCESC_LIBRARY /usr/lib/x86_64-linux-gnu + +prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu +prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu + +prepend-path INCLUDE usr/include/xercesc +prepend-path C_INCLUDE_PATH usr/include/xercesc +prepend-path CPLUS_INCLUDE_PATH usr/include/xercesc + +prepend-path CMAKE_PREFIX_PATH /usr + +conflict xercesc +EOF + exit 0 +fi + ver_si_on=${version//\./_} # Converts 3.1.1 to 3_1_1 version_arr=(${version//\./ }) major=${version_arr[0]} diff --git a/scripts/install_xsd.sh b/scripts/install_xsd.sh index 5a5648a..2b020df 100755 --- a/scripts/install_xsd.sh +++ b/scripts/install_xsd.sh @@ -28,6 +28,51 @@ done if [ -z "${version}" ]; then usage; fi if [ -z "${base_dir}" ]; then usage; fi +# Modulefile pointing to system version +if [ "$version" = "system" ]; then + version=$(dpkg -s xsdcxx | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d- -f1) + + mkdir -p ${base_dir}/modulefiles/xsd && cd ${base_dir}/modulefiles/xsd + cat < ${version} +#%Module1.0##################################################################### +### +## xsd ${version} modulefile +## +proc ModulesTest { } { + set paths "[getenv XSD_ROOT] + [getenv XSD_ROOT]/bin + [getenv XSD_ROOT]/libxsd" + + foreach path \$paths { + if { ![file exists \$path] } { + puts stderr "ERROR: Does not exist: \$path" + return 0 + } + } + return 1 +} + +proc ModulesHelp { } { + puts stderr "\tThis adds the environment variables for xsd ${version}\n" +} + +module-whatis "This adds the environment variables for xsd ${version}" + +setenv XSD_ROOT /usr + +prepend-path PATH /usr/bin + +prepend-path INCLUDE /usr/include/xsd +prepend-path C_INCLUDE_PATH /usr/include/xsd +prepend-path CPLUS_INCLUDE_PATH /usr/include/xsd + +prepend-path CMAKE_PREFIX_PATH /usr + +conflict xsd +EOF + exit 0 +fi + version_arr=(${version//\./ }) major=${version_arr[0]} minor=${version_arr[1]} @@ -80,9 +125,9 @@ setenv XSD_ROOT ${install_dir} prepend-path PATH ${install_dir}/bin -prepend-path LIBRARY_PATH ${install_dir}/libxsd -prepend-path LD_LIBRARY_PATH ${install_dir}/libxsd -prepend-path LD_RUN_PATH ${install_dir}/libxsd +prepend-path INCLUDE ${install_dir}/libxsd +prepend-path C_INCLUDE_PATH ${install_dir}/libxsd +prepend-path CPLUS_INCLUDE_PATH ${install_dir}/libxsd prepend-path CMAKE_PREFIX_PATH ${install_dir} diff --git a/scripts/setup_ubuntu2304.sh b/scripts/setup_ubuntu2304.sh new file mode 100755 index 0000000..e809237 --- /dev/null +++ b/scripts/setup_ubuntu2304.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +export DEBIAN_FRONTEND=noninteractive + +apt-get update && \ +apt-get install -y --no-install-recommends \ + cmake \ + cmake-curses-gui \ + doxygen \ + environment-modules \ + g++ \ + git \ + gnuplot \ + graphviz \ + hdf5-tools \ + lcov \ + libboost-serialization-dev \ + libboost-filesystem-dev \ + libboost-program-options-dev \ + libhdf5-openmpi-dev \ + libmetis-dev \ + libopenmpi-dev \ + libparmetis-dev \ + libpetsc-real3.18 \ + libpetsc-real3.18-dbg \ + libpetsc-real3.18-dev \ + libsundials-dev \ + libvtk9.1 \ + libvtk9-dev \ + libxerces-c-dev \ + mencoder \ + petsc-dev \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + valgrind \ + xsdcxx + +update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 +update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10 diff --git a/scripts/setup_ubuntu2310.sh b/scripts/setup_ubuntu2310.sh new file mode 100755 index 0000000..e809237 --- /dev/null +++ b/scripts/setup_ubuntu2310.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +export DEBIAN_FRONTEND=noninteractive + +apt-get update && \ +apt-get install -y --no-install-recommends \ + cmake \ + cmake-curses-gui \ + doxygen \ + environment-modules \ + g++ \ + git \ + gnuplot \ + graphviz \ + hdf5-tools \ + lcov \ + libboost-serialization-dev \ + libboost-filesystem-dev \ + libboost-program-options-dev \ + libhdf5-openmpi-dev \ + libmetis-dev \ + libopenmpi-dev \ + libparmetis-dev \ + libpetsc-real3.18 \ + libpetsc-real3.18-dbg \ + libpetsc-real3.18-dev \ + libsundials-dev \ + libvtk9.1 \ + libvtk9-dev \ + libxerces-c-dev \ + mencoder \ + petsc-dev \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + valgrind \ + xsdcxx + +update-alternatives --install /usr/local/bin/python python /usr/bin/python3 10 +update-alternatives --install /usr/local/bin/pip pip /usr/bin/pip3 10