From cb18ea06c0445ca961992122884b1643b2c30b77 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Mon, 20 Mar 2023 12:39:07 +0100 Subject: [PATCH 01/71] parview@5.11 build on hohgant with new EGL support --- hohgant-paraview/compilers.yaml | 10 ++ hohgant-paraview/config.yaml | 10 ++ hohgant-paraview/environments.yaml | 86 ++++++++++ hohgant-paraview/modules.yaml | 24 +++ hohgant-paraview/packages.yaml | 247 +++++++++++++++++++++++++++++ 5 files changed, 377 insertions(+) create mode 100644 hohgant-paraview/compilers.yaml create mode 100644 hohgant-paraview/config.yaml create mode 100644 hohgant-paraview/environments.yaml create mode 100644 hohgant-paraview/modules.yaml create mode 100644 hohgant-paraview/packages.yaml diff --git a/hohgant-paraview/compilers.yaml b/hohgant-paraview/compilers.yaml new file mode 100644 index 00000000..338278be --- /dev/null +++ b/hohgant-paraview/compilers.yaml @@ -0,0 +1,10 @@ +bootstrap: + spec: gcc@11 +gcc: + specs: + - gcc@11 +#llvm: +# requires: gcc@11 +# specs: +# - nvhpc@21.7 +# - llvm@14 diff --git a/hohgant-paraview/config.yaml b/hohgant-paraview/config.yaml new file mode 100644 index 00000000..316df01d --- /dev/null +++ b/hohgant-paraview/config.yaml @@ -0,0 +1,10 @@ +name: jb-dev +store: /user-environment +system: hohgant +spack: + repo: /scratch/e1000/biddisco/spack-hohgant + commit: paraview-egl +mirror: + enable: false +modules: false + diff --git a/hohgant-paraview/environments.yaml b/hohgant-paraview/environments.yaml new file mode 100644 index 00000000..b350e0dd --- /dev/null +++ b/hohgant-paraview/environments.yaml @@ -0,0 +1,86 @@ +gcc-nvgpu: + compiler: + - toolchain: gcc + spec: gcc@11.3 + mpi: + spec: cray-mpich + gpu: cuda + unify: true + specs: + - cmake + - ninja + - python + - paraview@5.11 +egl build_edition=rendering +cuda +mpi +opengl2 +tbb +python use_vtkm=on + packages: + - perl + - diffutils + - gettext + - openssh + - openssl + - ncurses + - cpio + variants: + - +cuda + - cuda_arch=80 + - ~fortran + - build_type=Release + - cxxstd=17 + - ~examples + +gcc-nvgpu2: + compiler: + - toolchain: gcc + spec: gcc@11.3 + mpi: + spec: cray-mpich + gpu: cuda + unify: true + specs: + - cmake + - ninja + - python + - paraview@5.11 +egl build_edition=rendering +cuda +mpi +opengl2 +tbb +python use_vtkm=off + packages: + - perl + - diffutils + - gettext + - openssh + - openssl + - ncurses + - cpio + variants: + - +cuda + - cuda_arch=80 + - ~fortran + - build_type=Release + - cxxstd=17 + - ~examples + +gcc-nvgpu3: + compiler: + - toolchain: gcc + spec: gcc@11.3 + mpi: + spec: cray-mpich + gpu: cuda + unify: true + specs: + - cmake + - ninja + - python + - paraview@5.11 +osmesa build_edition=rendering ~cuda +mpi +opengl2 +tbb +python use_vtkm=default + packages: + - perl + - diffutils + - gettext + - openssh + - openssl + - ncurses + - cpio + variants: +# - +cuda + - cuda_arch=80 + - ~fortran + - build_type=Release + - cxxstd=17 + - ~examples diff --git a/hohgant-paraview/modules.yaml b/hohgant-paraview/modules.yaml new file mode 100644 index 00000000..4594844d --- /dev/null +++ b/hohgant-paraview/modules.yaml @@ -0,0 +1,24 @@ +modules: + # Paths to check when creating modules for all module sets + prefix_inspections: + bin: + - PATH + lib: + - LD_LIBRARY_PATH + lib64: + - LD_LIBRARY_PATH + + default: + arch_folder: false + # Where to install modules + roots: + tcl: /user-environment/modules + tcl: + all: + autoload: none + hash_length: 0 + exclude_implicits: true + exclude: ['%gcc@7.5.0', 'gcc %gcc@7.5.0'] + projections: + all: '{name}/{version}' + cray-mpich-binary: 'cray-mpich' diff --git a/hohgant-paraview/packages.yaml b/hohgant-paraview/packages.yaml new file mode 100644 index 00000000..78ee2cd8 --- /dev/null +++ b/hohgant-paraview/packages.yaml @@ -0,0 +1,247 @@ +packages: + # all: + # providers: + # gl: [egl] + egl: + externals: + - spec: egl@1.0.0 + prefix: /usr + buildable: false + perl: + buildable: false + externals: + - spec: perl@5.36.0 + prefix: /usr + cpio: + buildable: false + externals: + - spec: cpio@2.12 + prefix: /usr + openssh: + buildable: false + externals: + - spec: openssh@8.4p1 + prefix: /usr + openssl: + buildable: false + externals: + - spec: openssl@1.1.1d + prefix: /usr + autoconf: + externals: + - spec: autoconf@2.69 + prefix: /usr + automake: + externals: + - spec: automake@1.15.1 + prefix: /usr + bash: + externals: + - spec: bash@4.4.23 + prefix: /usr + bison: + externals: + - spec: bison@3.0.4 + prefix: /usr + coreutils: + externals: + - spec: coreutils@8.32 + prefix: /usr + curl: + externals: + - spec: curl@7.66.0+gssapi+ldap+nghttp2 + prefix: /usr + file: + externals: + - spec: file@5.32 + prefix: /usr + findutils: + externals: + - spec: findutils@4.8.0 + prefix: /usr + flex: + externals: + - spec: flex@2.6.4+lex + prefix: /usr + gawk: + externals: + - spec: gawk@4.2.1 + prefix: /usr + gcc: + externals: + - spec: gcc@7.5.0 languages=c,c++,fortran + prefix: /usr + extra_attributes: + compilers: + c: /usr/bin/gcc-7 + cxx: /usr/bin/g++-7 + fortran: /usr/bin/gfortran-7 + gettext: + externals: + - spec: gettext@0.20.2 + prefix: /usr + ghostscript: + externals: + - spec: ghostscript@9.52 + prefix: /usr + gmake: + externals: + - spec: gmake@4.2.1 + prefix: /usr + groff: + externals: + - spec: groff@1.22.3 + prefix: /usr + hwloc: + externals: + - spec: hwloc@2.6.0a1 + prefix: /usr + openjdk: + externals: + - spec: openjdk@11.0.14_9-suse-3.74.2-x8664 + prefix: /usr + libfuse: + externals: + - spec: libfuse@2.9.7 + prefix: /usr + - spec: libfuse@3.6.1 + prefix: /usr + libtool: + externals: + - spec: libtool@2.4.6 + prefix: /usr + lustre: + externals: + - spec: lustre@2.15.0.2_rc2_cray_113_g62287d0 + prefix: /usr + m4: + externals: + - spec: m4@1.4.18 + prefix: /usr + ncurses: + externals: + - spec: ncurses@6.1.20180317+termlib abi=6 + prefix: /usr + perl: + externals: + - spec: perl@5.26.1~cpanm+shared+threads + prefix: /usr + pkg-config: + externals: + - spec: pkg-config@0.29.2 + prefix: /usr + python: + externals: + - spec: python@2.7.18+bz2+crypt+ctypes~dbm~lzma+nis+pyexpat+pythoncmd+readline+sqlite3+ssl~tix~tkinter+uuid+zlib + prefix: /usr + - spec: python@3.6.15+bz2+crypt+ctypes~dbm+lzma+nis+pyexpat~pythoncmd+readline+sqlite3+ssl~tix~tkinter+uuid+zlib + prefix: /usr + rsync: + externals: + - spec: rsync@3.1.3 + prefix: /usr + sed: + externals: + - spec: sed@4.4 + prefix: /usr + slurm: + externals: + - spec: slurm@20.11.9 + prefix: /usr + tar: + externals: + - spec: tar@1.30 + prefix: /usr + texlive: + externals: + - spec: texlive@20170524 + prefix: /usr + which: + externals: + - spec: which@2.21 + prefix: /usr + xz: + externals: + - spec: xz@5.2.3 + prefix: /usr + zip: + externals: + - spec: zip@3.0 + prefix: /usr + comgr: + externals: + - spec: comgr@5.2.4 + prefix: /opt/rocm-5.2.4 + hip: + externals: + - spec: hip@5.2.4 + prefix: /opt/rocm-5.2.4 + hipblas: + externals: + - spec: hipblas@5.2.4 + prefix: /opt/rocm-5.2.4 + hipsolver: + externals: + - spec: hipsolver@5.2.4 + prefix: /opt/rocm-5.2.4 + hipsparse: + externals: + - spec: hipsparse@5.2.4 + prefix: /opt/rocm-5.2.4 + hsa-rocr-dev: + externals: + - spec: hsa-rocr-dev@5.2.4 + prefix: /opt/rocm-5.2.4 + miopen-hip: + externals: + - spec: miopen-hip@5.2.4 + prefix: /opt/rocm-5.2.4 + miopen-opencl: + externals: + - spec: miopen-opencl@5.2.4 + prefix: /opt/rocm-5.2.4 + rccl: + externals: + - spec: rccl@5.2.4 + prefix: /opt/rocm-5.2.4 + rdma-core: + externals: + - spec: rdma-core@31.0 + prefix: /usr + rocblas: + externals: + - spec: rocblas@5.2.4 + prefix: /opt/rocm-5.2.4 + rocfft: + externals: + - spec: rocfft@5.2.4 + prefix: /opt/rocm-5.2.4 + rocm-smi-lib: + externals: + - spec: rocm-smi-lib@5.2.4 + prefix: /opt/rocm-5.2.4 + rocprofiler-dev: + externals: + - spec: rocprofiler-dev@5.2.4 + prefix: /opt/rocm-5.2.4 + rocrand: + externals: + - spec: rocrand@5.2.4 + prefix: /opt/rocm-5.2.4 + rocsolver: + externals: + - spec: rocsolver@5.2.4 + prefix: /opt/rocm-5.2.4 + rocsparse: + externals: + - spec: rocsparse@5.2.4 + prefix: /opt/rocm-5.2.4 + roctracer-dev: + externals: + - spec: roctracer-dev@5.2.4 + prefix: /opt/rocm-5.2.4 + libfabric: + externals: + - spec: libfabric@1.15.0%gcc@11.3.0 ~debug ~kdreg + prefix: /opt/cray/libfabric/1.15.0.0 + buildable: false From bdad0182c7d17146818ac01ca25160d217abd1b1 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Tue, 21 Mar 2023 09:32:48 +0100 Subject: [PATCH 02/71] osmesa debugging --- hohgant-paraview/environments.yaml | 91 ++++++++++-------------------- 1 file changed, 30 insertions(+), 61 deletions(-) diff --git a/hohgant-paraview/environments.yaml b/hohgant-paraview/environments.yaml index b350e0dd..5407cbb8 100644 --- a/hohgant-paraview/environments.yaml +++ b/hohgant-paraview/environments.yaml @@ -1,62 +1,33 @@ -gcc-nvgpu: - compiler: - - toolchain: gcc - spec: gcc@11.3 - mpi: - spec: cray-mpich - gpu: cuda - unify: true - specs: - - cmake - - ninja - - python - - paraview@5.11 +egl build_edition=rendering +cuda +mpi +opengl2 +tbb +python use_vtkm=on - packages: - - perl - - diffutils - - gettext - - openssh - - openssl - - ncurses - - cpio - variants: - - +cuda - - cuda_arch=80 - - ~fortran - - build_type=Release - - cxxstd=17 - - ~examples - -gcc-nvgpu2: - compiler: - - toolchain: gcc - spec: gcc@11.3 - mpi: - spec: cray-mpich - gpu: cuda - unify: true - specs: - - cmake - - ninja - - python - - paraview@5.11 +egl build_edition=rendering +cuda +mpi +opengl2 +tbb +python use_vtkm=off - packages: - - perl - - diffutils - - gettext - - openssh - - openssl - - ncurses - - cpio - variants: - - +cuda - - cuda_arch=80 - - ~fortran - - build_type=Release - - cxxstd=17 - - ~examples +#gcc-nvgpu: +# compiler: +# - toolchain: gcc +# spec: gcc@11.3 +# mpi: +# spec: cray-mpich +# gpu: cuda +# unify: true +# specs: +# - cmake +# - ninja +# - python +# - paraview@5.11+egl+cuda+mpi+opengl2+tbb+ospray+python use_vtkm=on build_edition=rendering +# packages: +# - perl +# - diffutils +# - gettext +# - openssh +# - openssl +# - ncurses +# - cpio +# variants: +# - +cuda +# - cuda_arch=80 +# - ~fortran +# - build_type=Release +# - cxxstd=17 +# - ~examples -gcc-nvgpu3: +gcc-osmesa: compiler: - toolchain: gcc spec: gcc@11.3 @@ -68,7 +39,7 @@ gcc-nvgpu3: - cmake - ninja - python - - paraview@5.11 +osmesa build_edition=rendering ~cuda +mpi +opengl2 +tbb +python use_vtkm=default + - paraview@5.11+osmesa~cuda+mpi+opengl2+tbb+ospray+python use_vtkm=default build_edition=rendering ^mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared packages: - perl - diffutils @@ -78,8 +49,6 @@ gcc-nvgpu3: - ncurses - cpio variants: -# - +cuda - - cuda_arch=80 - ~fortran - build_type=Release - cxxstd=17 From 7f40a514d800df07961e0491d872a9703dc76e1a Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Thu, 23 Mar 2023 21:14:32 +0100 Subject: [PATCH 03/71] Enable build-cache mirror --- hohgant-paraview/config.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hohgant-paraview/config.yaml b/hohgant-paraview/config.yaml index 316df01d..8f2b05d3 100644 --- a/hohgant-paraview/config.yaml +++ b/hohgant-paraview/config.yaml @@ -1,10 +1,14 @@ name: jb-dev store: /user-environment system: hohgant + spack: repo: /scratch/e1000/biddisco/spack-hohgant commit: paraview-egl + mirror: - enable: false + enable: true + key: /tmp/gpg-spack-paraview + modules: false From a89f166b06a768faf8d7b4e6b43fe07c4986e528 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Thu, 23 Mar 2023 21:15:57 +0100 Subject: [PATCH 04/71] Add job script for paraview build --- .../job-stackinator-hohgant-paraview.sh | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 hohgant-paraview/job-stackinator-hohgant-paraview.sh diff --git a/hohgant-paraview/job-stackinator-hohgant-paraview.sh b/hohgant-paraview/job-stackinator-hohgant-paraview.sh new file mode 100755 index 00000000..f7cd179e --- /dev/null +++ b/hohgant-paraview/job-stackinator-hohgant-paraview.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +export LC_ALL=en_US.UTF-8 +unalias cp + +echo "Setup build dir" +BUILD_DIR=/dev/shm/biddisco +# rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +cd $HOME/stackinator +./bin/stack-config -b ${BUILD_DIR} -r $HOME/alps-spack-stacks/hohgant-paraview --debug + +echo "Trigger build" +cd ${BUILD_DIR} + +# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder +cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ + +# build the squashfs image - bubblewrap is used inside the makefile +env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs /scratch/e1000/biddisco/hohgant-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config SPACK_USER_CACHE_PATH=$BUILD_DIR/cache /bin/bash --norc --noprofile + From 6363977c609edcf7ed785482fb58b10614182495 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 18 Aug 2023 12:44:24 +0200 Subject: [PATCH 05/71] More tweaks to try to fix osmesa on hohgant --- hohgant-paraview/config.yaml | 2 +- hohgant-paraview/environments.yaml | 2 ++ .../job-stackinator-hohgant-paraview.sh | 12 ++++++++---- hohgant-paraview/mirrors.yaml | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 hohgant-paraview/mirrors.yaml diff --git a/hohgant-paraview/config.yaml b/hohgant-paraview/config.yaml index 8f2b05d3..571addff 100644 --- a/hohgant-paraview/config.yaml +++ b/hohgant-paraview/config.yaml @@ -3,7 +3,7 @@ store: /user-environment system: hohgant spack: - repo: /scratch/e1000/biddisco/spack-hohgant + repo: /home/biddisco/opt/spack.git commit: paraview-egl mirror: diff --git a/hohgant-paraview/environments.yaml b/hohgant-paraview/environments.yaml index 5407cbb8..7457de54 100644 --- a/hohgant-paraview/environments.yaml +++ b/hohgant-paraview/environments.yaml @@ -39,6 +39,8 @@ gcc-osmesa: - cmake - ninja - python + - mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared + - vtk +osmesa ^mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared - paraview@5.11+osmesa~cuda+mpi+opengl2+tbb+ospray+python use_vtkm=default build_edition=rendering ^mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared packages: - perl diff --git a/hohgant-paraview/job-stackinator-hohgant-paraview.sh b/hohgant-paraview/job-stackinator-hohgant-paraview.sh index f7cd179e..f6406ea5 100755 --- a/hohgant-paraview/job-stackinator-hohgant-paraview.sh +++ b/hohgant-paraview/job-stackinator-hohgant-paraview.sh @@ -8,18 +8,22 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt -export LC_ALL=en_US.UTF-8 unalias cp echo "Setup build dir" BUILD_DIR=/dev/shm/biddisco -# rm -rf ${BUILD_DIR}/* +STACKINATOR_DIR=$HOME/stackinator +STACK_DIR=$HOME/alps-spack-stacks/hohgant-paraview + +# STACKINATOR_DIR=/home/biddisco/src/stackinator/ +# STACK_DIR=/home/biddisco/src/alps-spack-stacks/hohgant-paraview/ + +rm -rf ${BUILD_DIR}/* mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}/tmp echo "Execute stackinator" -cd $HOME/stackinator -./bin/stack-config -b ${BUILD_DIR} -r $HOME/alps-spack-stacks/hohgant-paraview --debug +$STACKINATOR_DIR/bin/stack-config -b ${BUILD_DIR} -r $STACK_DIR --debug echo "Trigger build" cd ${BUILD_DIR} diff --git a/hohgant-paraview/mirrors.yaml b/hohgant-paraview/mirrors.yaml new file mode 100644 index 00000000..6aa3c859 --- /dev/null +++ b/hohgant-paraview/mirrors.yaml @@ -0,0 +1,18 @@ +mirrors: + alpscache: + fetch: + url: file:///scratch/e1000/biddisco/spack-cache + access_pair: + - null + - null + access_token: null + profile: null + endpoint_url: null + push: + url: file:///scratch/e1000/biddisco/spack-cache + access_pair: + - null + - null + access_token: null + profile: null + endpoint_url: null From 2dd8e382941427e783e0c0de5864490519799429 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 18 Aug 2023 13:10:59 +0200 Subject: [PATCH 06/71] Moving/renaming files to fit alps recipes repo structure --- hohgant-paraview/packages.yaml | 247 ------------------ .../paraview}/compilers.yaml | 0 .../paraview}/config.yaml | 0 .../paraview}/environments.yaml | 58 ++-- .../paraview/job-build-hohgant.sh | 0 .../paraview}/mirrors.yaml | 0 .../paraview}/modules.yaml | 0 recipes/paraview/packages.yaml | 10 + 8 files changed, 39 insertions(+), 276 deletions(-) delete mode 100644 hohgant-paraview/packages.yaml rename {hohgant-paraview => recipes/paraview}/compilers.yaml (100%) rename {hohgant-paraview => recipes/paraview}/config.yaml (100%) rename {hohgant-paraview => recipes/paraview}/environments.yaml (55%) rename hohgant-paraview/job-stackinator-hohgant-paraview.sh => recipes/paraview/job-build-hohgant.sh (100%) rename {hohgant-paraview => recipes/paraview}/mirrors.yaml (100%) rename {hohgant-paraview => recipes/paraview}/modules.yaml (100%) create mode 100644 recipes/paraview/packages.yaml diff --git a/hohgant-paraview/packages.yaml b/hohgant-paraview/packages.yaml deleted file mode 100644 index 78ee2cd8..00000000 --- a/hohgant-paraview/packages.yaml +++ /dev/null @@ -1,247 +0,0 @@ -packages: - # all: - # providers: - # gl: [egl] - egl: - externals: - - spec: egl@1.0.0 - prefix: /usr - buildable: false - perl: - buildable: false - externals: - - spec: perl@5.36.0 - prefix: /usr - cpio: - buildable: false - externals: - - spec: cpio@2.12 - prefix: /usr - openssh: - buildable: false - externals: - - spec: openssh@8.4p1 - prefix: /usr - openssl: - buildable: false - externals: - - spec: openssl@1.1.1d - prefix: /usr - autoconf: - externals: - - spec: autoconf@2.69 - prefix: /usr - automake: - externals: - - spec: automake@1.15.1 - prefix: /usr - bash: - externals: - - spec: bash@4.4.23 - prefix: /usr - bison: - externals: - - spec: bison@3.0.4 - prefix: /usr - coreutils: - externals: - - spec: coreutils@8.32 - prefix: /usr - curl: - externals: - - spec: curl@7.66.0+gssapi+ldap+nghttp2 - prefix: /usr - file: - externals: - - spec: file@5.32 - prefix: /usr - findutils: - externals: - - spec: findutils@4.8.0 - prefix: /usr - flex: - externals: - - spec: flex@2.6.4+lex - prefix: /usr - gawk: - externals: - - spec: gawk@4.2.1 - prefix: /usr - gcc: - externals: - - spec: gcc@7.5.0 languages=c,c++,fortran - prefix: /usr - extra_attributes: - compilers: - c: /usr/bin/gcc-7 - cxx: /usr/bin/g++-7 - fortran: /usr/bin/gfortran-7 - gettext: - externals: - - spec: gettext@0.20.2 - prefix: /usr - ghostscript: - externals: - - spec: ghostscript@9.52 - prefix: /usr - gmake: - externals: - - spec: gmake@4.2.1 - prefix: /usr - groff: - externals: - - spec: groff@1.22.3 - prefix: /usr - hwloc: - externals: - - spec: hwloc@2.6.0a1 - prefix: /usr - openjdk: - externals: - - spec: openjdk@11.0.14_9-suse-3.74.2-x8664 - prefix: /usr - libfuse: - externals: - - spec: libfuse@2.9.7 - prefix: /usr - - spec: libfuse@3.6.1 - prefix: /usr - libtool: - externals: - - spec: libtool@2.4.6 - prefix: /usr - lustre: - externals: - - spec: lustre@2.15.0.2_rc2_cray_113_g62287d0 - prefix: /usr - m4: - externals: - - spec: m4@1.4.18 - prefix: /usr - ncurses: - externals: - - spec: ncurses@6.1.20180317+termlib abi=6 - prefix: /usr - perl: - externals: - - spec: perl@5.26.1~cpanm+shared+threads - prefix: /usr - pkg-config: - externals: - - spec: pkg-config@0.29.2 - prefix: /usr - python: - externals: - - spec: python@2.7.18+bz2+crypt+ctypes~dbm~lzma+nis+pyexpat+pythoncmd+readline+sqlite3+ssl~tix~tkinter+uuid+zlib - prefix: /usr - - spec: python@3.6.15+bz2+crypt+ctypes~dbm+lzma+nis+pyexpat~pythoncmd+readline+sqlite3+ssl~tix~tkinter+uuid+zlib - prefix: /usr - rsync: - externals: - - spec: rsync@3.1.3 - prefix: /usr - sed: - externals: - - spec: sed@4.4 - prefix: /usr - slurm: - externals: - - spec: slurm@20.11.9 - prefix: /usr - tar: - externals: - - spec: tar@1.30 - prefix: /usr - texlive: - externals: - - spec: texlive@20170524 - prefix: /usr - which: - externals: - - spec: which@2.21 - prefix: /usr - xz: - externals: - - spec: xz@5.2.3 - prefix: /usr - zip: - externals: - - spec: zip@3.0 - prefix: /usr - comgr: - externals: - - spec: comgr@5.2.4 - prefix: /opt/rocm-5.2.4 - hip: - externals: - - spec: hip@5.2.4 - prefix: /opt/rocm-5.2.4 - hipblas: - externals: - - spec: hipblas@5.2.4 - prefix: /opt/rocm-5.2.4 - hipsolver: - externals: - - spec: hipsolver@5.2.4 - prefix: /opt/rocm-5.2.4 - hipsparse: - externals: - - spec: hipsparse@5.2.4 - prefix: /opt/rocm-5.2.4 - hsa-rocr-dev: - externals: - - spec: hsa-rocr-dev@5.2.4 - prefix: /opt/rocm-5.2.4 - miopen-hip: - externals: - - spec: miopen-hip@5.2.4 - prefix: /opt/rocm-5.2.4 - miopen-opencl: - externals: - - spec: miopen-opencl@5.2.4 - prefix: /opt/rocm-5.2.4 - rccl: - externals: - - spec: rccl@5.2.4 - prefix: /opt/rocm-5.2.4 - rdma-core: - externals: - - spec: rdma-core@31.0 - prefix: /usr - rocblas: - externals: - - spec: rocblas@5.2.4 - prefix: /opt/rocm-5.2.4 - rocfft: - externals: - - spec: rocfft@5.2.4 - prefix: /opt/rocm-5.2.4 - rocm-smi-lib: - externals: - - spec: rocm-smi-lib@5.2.4 - prefix: /opt/rocm-5.2.4 - rocprofiler-dev: - externals: - - spec: rocprofiler-dev@5.2.4 - prefix: /opt/rocm-5.2.4 - rocrand: - externals: - - spec: rocrand@5.2.4 - prefix: /opt/rocm-5.2.4 - rocsolver: - externals: - - spec: rocsolver@5.2.4 - prefix: /opt/rocm-5.2.4 - rocsparse: - externals: - - spec: rocsparse@5.2.4 - prefix: /opt/rocm-5.2.4 - roctracer-dev: - externals: - - spec: roctracer-dev@5.2.4 - prefix: /opt/rocm-5.2.4 - libfabric: - externals: - - spec: libfabric@1.15.0%gcc@11.3.0 ~debug ~kdreg - prefix: /opt/cray/libfabric/1.15.0.0 - buildable: false diff --git a/hohgant-paraview/compilers.yaml b/recipes/paraview/compilers.yaml similarity index 100% rename from hohgant-paraview/compilers.yaml rename to recipes/paraview/compilers.yaml diff --git a/hohgant-paraview/config.yaml b/recipes/paraview/config.yaml similarity index 100% rename from hohgant-paraview/config.yaml rename to recipes/paraview/config.yaml diff --git a/hohgant-paraview/environments.yaml b/recipes/paraview/environments.yaml similarity index 55% rename from hohgant-paraview/environments.yaml rename to recipes/paraview/environments.yaml index 7457de54..ee9af528 100644 --- a/hohgant-paraview/environments.yaml +++ b/recipes/paraview/environments.yaml @@ -1,36 +1,36 @@ -#gcc-nvgpu: -# compiler: -# - toolchain: gcc -# spec: gcc@11.3 -# mpi: -# spec: cray-mpich -# gpu: cuda -# unify: true -# specs: -# - cmake -# - ninja -# - python -# - paraview@5.11+egl+cuda+mpi+opengl2+tbb+ospray+python use_vtkm=on build_edition=rendering -# packages: -# - perl -# - diffutils -# - gettext -# - openssh -# - openssl -# - ncurses -# - cpio -# variants: -# - +cuda -# - cuda_arch=80 -# - ~fortran -# - build_type=Release -# - cxxstd=17 -# - ~examples +gcc-nvgpu: + compiler: + - toolchain: gcc + spec: gcc@11 + mpi: + spec: cray-mpich + gpu: cuda + unify: true + specs: + - cmake + - ninja + - python + - paraview@5.11+egl+cuda+mpi+opengl2+tbb+ospray+python use_vtkm=on build_edition=rendering + packages: + - perl + - diffutils + - gettext + - openssh + - openssl + - ncurses + - cpio + variants: + - +cuda + - cuda_arch=80 + - ~fortran + - build_type=Release + - cxxstd=17 + - ~examples gcc-osmesa: compiler: - toolchain: gcc - spec: gcc@11.3 + spec: gcc@11 mpi: spec: cray-mpich gpu: cuda diff --git a/hohgant-paraview/job-stackinator-hohgant-paraview.sh b/recipes/paraview/job-build-hohgant.sh similarity index 100% rename from hohgant-paraview/job-stackinator-hohgant-paraview.sh rename to recipes/paraview/job-build-hohgant.sh diff --git a/hohgant-paraview/mirrors.yaml b/recipes/paraview/mirrors.yaml similarity index 100% rename from hohgant-paraview/mirrors.yaml rename to recipes/paraview/mirrors.yaml diff --git a/hohgant-paraview/modules.yaml b/recipes/paraview/modules.yaml similarity index 100% rename from hohgant-paraview/modules.yaml rename to recipes/paraview/modules.yaml diff --git a/recipes/paraview/packages.yaml b/recipes/paraview/packages.yaml new file mode 100644 index 00000000..2a0130d3 --- /dev/null +++ b/recipes/paraview/packages.yaml @@ -0,0 +1,10 @@ +packages: + all: + providers: + gl: [egl] + egl: + externals: + - spec: egl@1.0.0 + prefix: /usr + buildable: false + From 7f42c17d9fa9d6c30f034a3af7d2e07fafe4e6d2 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 18 Aug 2023 14:57:51 +0200 Subject: [PATCH 07/71] Update convenience build scripts for debugging --- recipes/paraview/job-build-clariden.sh | 44 ++++++++++++++++++++++++++ recipes/paraview/job-build-hohgant.sh | 17 +++++----- 2 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 recipes/paraview/job-build-clariden.sh diff --git a/recipes/paraview/job-build-clariden.sh b/recipes/paraview/job-build-clariden.sh new file mode 100644 index 00000000..7fa0df74 --- /dev/null +++ b/recipes/paraview/job-build-clariden.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +CLUSTER=clariden +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER +BUILD_DIR=/dev/shm/biddisco + +unalias cp + +echo "Setup/clean build dir" +rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug + +echo "Trigger build" +cd ${BUILD_DIR} + +# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder +cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ + +# build the squashfs image - bubblewrap is used inside the makefile +env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile + diff --git a/recipes/paraview/job-build-hohgant.sh b/recipes/paraview/job-build-hohgant.sh index f6406ea5..36331f7f 100755 --- a/recipes/paraview/job-build-hohgant.sh +++ b/recipes/paraview/job-build-hohgant.sh @@ -8,22 +8,21 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt -unalias cp - -echo "Setup build dir" +CLUSTER=hohgant +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER BUILD_DIR=/dev/shm/biddisco -STACKINATOR_DIR=$HOME/stackinator -STACK_DIR=$HOME/alps-spack-stacks/hohgant-paraview -# STACKINATOR_DIR=/home/biddisco/src/stackinator/ -# STACK_DIR=/home/biddisco/src/alps-spack-stacks/hohgant-paraview/ +unalias cp +echo "Setup/clean build dir" rm -rf ${BUILD_DIR}/* mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}/tmp echo "Execute stackinator" -$STACKINATOR_DIR/bin/stack-config -b ${BUILD_DIR} -r $STACK_DIR --debug +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug echo "Trigger build" cd ${BUILD_DIR} @@ -36,7 +35,7 @@ env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spac echo "Copy generated squashfs file" DATE=$(date +%F) -cp /dev/shm/biddisco/store.squashfs /scratch/e1000/biddisco/hohgant-paraview-$DATE.squashfs +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs # ----------------------------------------- # debug : create a shell using the spack setup used to create the squashfs From 4a79c2d8b9359672dc737161fad3193222b15011 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 18 Aug 2023 15:07:26 +0200 Subject: [PATCH 08/71] Use spack release version, with paraview customizations in stackinator repo section --- recipes/paraview/config.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/recipes/paraview/config.yaml b/recipes/paraview/config.yaml index 571addff..d905973e 100644 --- a/recipes/paraview/config.yaml +++ b/recipes/paraview/config.yaml @@ -1,14 +1,11 @@ -name: jb-dev +name: paraview-jb-dev store: /user-environment -system: hohgant +description: ParaView visualization tool spack: - repo: /home/biddisco/opt/spack.git - commit: paraview-egl + commit: releases/v0.19 + repo: https://github.com/spack/spack.git mirror: enable: true key: /tmp/gpg-spack-paraview - -modules: false - From 05e84e9c46d314970292e25b78d5e53108384b6c Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Sun, 20 Aug 2023 23:44:07 +0200 Subject: [PATCH 09/71] use architecture dirs (eg a100) for different recipes --- recipes/paraview/compilers.yaml | 10 ----- recipes/paraview/config.yaml | 11 ----- recipes/paraview/environments.yaml | 57 -------------------------- recipes/paraview/job-build-clariden.sh | 18 +++----- recipes/paraview/job-build-oryx.sh | 38 +++++++++++++++++ recipes/paraview/mirrors.yaml | 18 -------- recipes/paraview/modules.yaml | 24 ----------- recipes/paraview/packages.yaml | 10 ----- 8 files changed, 44 insertions(+), 142 deletions(-) delete mode 100644 recipes/paraview/compilers.yaml delete mode 100644 recipes/paraview/config.yaml delete mode 100644 recipes/paraview/environments.yaml mode change 100644 => 100755 recipes/paraview/job-build-clariden.sh create mode 100755 recipes/paraview/job-build-oryx.sh delete mode 100644 recipes/paraview/mirrors.yaml delete mode 100644 recipes/paraview/modules.yaml delete mode 100644 recipes/paraview/packages.yaml diff --git a/recipes/paraview/compilers.yaml b/recipes/paraview/compilers.yaml deleted file mode 100644 index 338278be..00000000 --- a/recipes/paraview/compilers.yaml +++ /dev/null @@ -1,10 +0,0 @@ -bootstrap: - spec: gcc@11 -gcc: - specs: - - gcc@11 -#llvm: -# requires: gcc@11 -# specs: -# - nvhpc@21.7 -# - llvm@14 diff --git a/recipes/paraview/config.yaml b/recipes/paraview/config.yaml deleted file mode 100644 index d905973e..00000000 --- a/recipes/paraview/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: paraview-jb-dev -store: /user-environment -description: ParaView visualization tool - -spack: - commit: releases/v0.19 - repo: https://github.com/spack/spack.git - -mirror: - enable: true - key: /tmp/gpg-spack-paraview diff --git a/recipes/paraview/environments.yaml b/recipes/paraview/environments.yaml deleted file mode 100644 index ee9af528..00000000 --- a/recipes/paraview/environments.yaml +++ /dev/null @@ -1,57 +0,0 @@ -gcc-nvgpu: - compiler: - - toolchain: gcc - spec: gcc@11 - mpi: - spec: cray-mpich - gpu: cuda - unify: true - specs: - - cmake - - ninja - - python - - paraview@5.11+egl+cuda+mpi+opengl2+tbb+ospray+python use_vtkm=on build_edition=rendering - packages: - - perl - - diffutils - - gettext - - openssh - - openssl - - ncurses - - cpio - variants: - - +cuda - - cuda_arch=80 - - ~fortran - - build_type=Release - - cxxstd=17 - - ~examples - -gcc-osmesa: - compiler: - - toolchain: gcc - spec: gcc@11 - mpi: - spec: cray-mpich - gpu: cuda - unify: true - specs: - - cmake - - ninja - - python - - mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared - - vtk +osmesa ^mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared - - paraview@5.11+osmesa~cuda+mpi+opengl2+tbb+ospray+python use_vtkm=default build_edition=rendering ^mesa+glx+llvm+opengl+osmesa swr=avx2 default_library=shared - packages: - - perl - - diffutils - - gettext - - openssh - - openssl - - ncurses - - cpio - variants: - - ~fortran - - build_type=Release - - cxxstd=17 - - ~examples diff --git a/recipes/paraview/job-build-clariden.sh b/recipes/paraview/job-build-clariden.sh old mode 100644 new mode 100755 index 7fa0df74..ddf31e66 --- a/recipes/paraview/job-build-clariden.sh +++ b/recipes/paraview/job-build-clariden.sh @@ -10,28 +10,22 @@ CLUSTER=clariden STACKI_DIR=$SRC/alps-vcluster/stackinator -RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/a100 SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER BUILD_DIR=/dev/shm/biddisco -unalias cp - echo "Setup/clean build dir" -rm -rf ${BUILD_DIR}/* +#rm -rf ${BUILD_DIR}/* mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}/tmp echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug - -echo "Trigger build" -cd ${BUILD_DIR} - -# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder -cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug # build the squashfs image - bubblewrap is used inside the makefile -env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 +echo "Trigger build" +cd /dev/shm/biddisco +env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 echo "Copy generated squashfs file" DATE=$(date +%F) diff --git a/recipes/paraview/job-build-oryx.sh b/recipes/paraview/job-build-oryx.sh new file mode 100755 index 00000000..5f36fc96 --- /dev/null +++ b/recipes/paraview/job-build-oryx.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +CLUSTER=oryx +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/turing +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER +BUILD_DIR=/dev/shm/biddisco + +echo "Setup/clean build dir" +#rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug + +# build the squashfs image - bubblewrap is used inside the makefile +echo "Trigger build" +cd /dev/shm/biddisco +env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile + diff --git a/recipes/paraview/mirrors.yaml b/recipes/paraview/mirrors.yaml deleted file mode 100644 index 6aa3c859..00000000 --- a/recipes/paraview/mirrors.yaml +++ /dev/null @@ -1,18 +0,0 @@ -mirrors: - alpscache: - fetch: - url: file:///scratch/e1000/biddisco/spack-cache - access_pair: - - null - - null - access_token: null - profile: null - endpoint_url: null - push: - url: file:///scratch/e1000/biddisco/spack-cache - access_pair: - - null - - null - access_token: null - profile: null - endpoint_url: null diff --git a/recipes/paraview/modules.yaml b/recipes/paraview/modules.yaml deleted file mode 100644 index 4594844d..00000000 --- a/recipes/paraview/modules.yaml +++ /dev/null @@ -1,24 +0,0 @@ -modules: - # Paths to check when creating modules for all module sets - prefix_inspections: - bin: - - PATH - lib: - - LD_LIBRARY_PATH - lib64: - - LD_LIBRARY_PATH - - default: - arch_folder: false - # Where to install modules - roots: - tcl: /user-environment/modules - tcl: - all: - autoload: none - hash_length: 0 - exclude_implicits: true - exclude: ['%gcc@7.5.0', 'gcc %gcc@7.5.0'] - projections: - all: '{name}/{version}' - cray-mpich-binary: 'cray-mpich' diff --git a/recipes/paraview/packages.yaml b/recipes/paraview/packages.yaml deleted file mode 100644 index 2a0130d3..00000000 --- a/recipes/paraview/packages.yaml +++ /dev/null @@ -1,10 +0,0 @@ -packages: - all: - providers: - gl: [egl] - egl: - externals: - - spec: egl@1.0.0 - prefix: /usr - buildable: false - From 88a4c7cc23758751c7c256949a4498f37dde755e Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Wed, 23 Aug 2023 10:48:21 +0200 Subject: [PATCH 10/71] Recipe for minimal paraview build on clariden --- recipes/paraview/job-build-clariden.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/paraview/job-build-clariden.sh b/recipes/paraview/job-build-clariden.sh index ddf31e66..21743e81 100755 --- a/recipes/paraview/job-build-clariden.sh +++ b/recipes/paraview/job-build-clariden.sh @@ -8,6 +8,7 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt +SRC=/users/biddisco/src CLUSTER=clariden STACKI_DIR=$SRC/alps-vcluster/stackinator RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/a100 @@ -20,7 +21,10 @@ mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}/tmp echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug + +# if using develop branch of spack, add --develop +#$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug --develop # build the squashfs image - bubblewrap is used inside the makefile echo "Trigger build" From 38f37da4552a1539ac1af19c19212f777c86c208 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 25 Aug 2023 16:01:55 +0200 Subject: [PATCH 11/71] Use symlinks for repos to avoid duplication, use copy.yaml for patch replication copy.yaml inside a packae repo tells stackinator to copy patch files from the spack source into the user repo to save the user needing to mange it by hand. --- recipes/paraview/job-build-clariden.sh | 42 -- recipes/paraview/job-build-hohgant.sh | 44 -- recipes/paraview/job-build-oryx.sh | 38 - recipes/paraview/repo/packages/egl/package.py | 93 +++ recipes/paraview/repo/packages/glew/copy.yaml | 1 + .../paraview/repo/packages/glew/package.py | 71 ++ .../paraview/repo/packages/opengl/package.py | 111 +++ .../paraview/repo/packages/paraview/copy.yaml | 1 + .../paraview/exodusII-netcdf4.9.0.patch | 14 + .../repo/packages/paraview/package.py | 677 ++++++++++++++++++ 10 files changed, 968 insertions(+), 124 deletions(-) delete mode 100755 recipes/paraview/job-build-clariden.sh delete mode 100755 recipes/paraview/job-build-hohgant.sh delete mode 100755 recipes/paraview/job-build-oryx.sh create mode 100644 recipes/paraview/repo/packages/egl/package.py create mode 100644 recipes/paraview/repo/packages/glew/copy.yaml create mode 100644 recipes/paraview/repo/packages/glew/package.py create mode 100644 recipes/paraview/repo/packages/opengl/package.py create mode 100644 recipes/paraview/repo/packages/paraview/copy.yaml create mode 100644 recipes/paraview/repo/packages/paraview/exodusII-netcdf4.9.0.patch create mode 100644 recipes/paraview/repo/packages/paraview/package.py diff --git a/recipes/paraview/job-build-clariden.sh b/recipes/paraview/job-build-clariden.sh deleted file mode 100755 index 21743e81..00000000 --- a/recipes/paraview/job-build-clariden.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=stackinator-paraview -#SBATCH --time=04:00:00 -#SBATCH --nodes=1 -#SBATCH --partition=nvgpu -#SBATCH --account=csstaff -#SBATCH --output=/users/biddisco/stackinator-output.txt -#SBATCH --error=/users/biddisco/stackinator-error.txt - -SRC=/users/biddisco/src -CLUSTER=clariden -STACKI_DIR=$SRC/alps-vcluster/stackinator -RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/a100 -SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER -BUILD_DIR=/dev/shm/biddisco - -echo "Setup/clean build dir" -#rm -rf ${BUILD_DIR}/* -mkdir -p ${BUILD_DIR} -mkdir -p ${BUILD_DIR}/tmp - -echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug - -# if using develop branch of spack, add --develop -#$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug --develop - -# build the squashfs image - bubblewrap is used inside the makefile -echo "Trigger build" -cd /dev/shm/biddisco -env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 - -echo "Copy generated squashfs file" -DATE=$(date +%F) -cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs - -# ----------------------------------------- -# debug : create a shell using the spack setup used to create the squashfs -# ----------------------------------------- -# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile - diff --git a/recipes/paraview/job-build-hohgant.sh b/recipes/paraview/job-build-hohgant.sh deleted file mode 100755 index 36331f7f..00000000 --- a/recipes/paraview/job-build-hohgant.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=stackinator-paraview -#SBATCH --time=04:00:00 -#SBATCH --nodes=1 -#SBATCH --partition=nvgpu -#SBATCH --account=csstaff -#SBATCH --output=/users/biddisco/stackinator-output.txt -#SBATCH --error=/users/biddisco/stackinator-error.txt - -CLUSTER=hohgant -STACKI_DIR=$SRC/alps-vcluster/stackinator -RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview -SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER -BUILD_DIR=/dev/shm/biddisco - -unalias cp - -echo "Setup/clean build dir" -rm -rf ${BUILD_DIR}/* -mkdir -p ${BUILD_DIR} -mkdir -p ${BUILD_DIR}/tmp - -echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug - -echo "Trigger build" -cd ${BUILD_DIR} - -# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder -cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ - -# build the squashfs image - bubblewrap is used inside the makefile -env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 - -echo "Copy generated squashfs file" -DATE=$(date +%F) -cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs - -# ----------------------------------------- -# debug : create a shell using the spack setup used to create the squashfs -# ----------------------------------------- -# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config SPACK_USER_CACHE_PATH=$BUILD_DIR/cache /bin/bash --norc --noprofile - diff --git a/recipes/paraview/job-build-oryx.sh b/recipes/paraview/job-build-oryx.sh deleted file mode 100755 index 5f36fc96..00000000 --- a/recipes/paraview/job-build-oryx.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=stackinator-paraview -#SBATCH --time=04:00:00 -#SBATCH --nodes=1 -#SBATCH --partition=nvgpu -#SBATCH --account=csstaff -#SBATCH --output=/users/biddisco/stackinator-output.txt -#SBATCH --error=/users/biddisco/stackinator-error.txt - -CLUSTER=oryx -STACKI_DIR=$SRC/alps-vcluster/stackinator -RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/turing -SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER -BUILD_DIR=/dev/shm/biddisco - -echo "Setup/clean build dir" -#rm -rf ${BUILD_DIR}/* -mkdir -p ${BUILD_DIR} -mkdir -p ${BUILD_DIR}/tmp - -echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug - -# build the squashfs image - bubblewrap is used inside the makefile -echo "Trigger build" -cd /dev/shm/biddisco -env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 - -echo "Copy generated squashfs file" -DATE=$(date +%F) -cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs - -# ----------------------------------------- -# debug : create a shell using the spack setup used to create the squashfs -# ----------------------------------------- -# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile - diff --git a/recipes/paraview/repo/packages/egl/package.py b/recipes/paraview/repo/packages/egl/package.py new file mode 100644 index 00000000..0d633426 --- /dev/null +++ b/recipes/paraview/repo/packages/egl/package.py @@ -0,0 +1,93 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re +import sys + +from spack.package import * + + +class Egl(BundlePackage): + """Placeholder for external EGL(OpenGL) libraries from hardware vendors""" + + homepage = "https://www.khronos.org/egl" + + version("1.5") + maintainers("biddisco") + + # This should really be when='platform=linux' but can't because of a + # current bug in when and how ArchSpecs are constructed + if sys.platform.startswith("linux"): + provides("gl@4.5") + + # conflict with GLX + conflicts("glx") + + # not always available, but sometimes + executables = ["^eglinfo$"] + + @classmethod + def determine_version(cls, exe): + if exe: + output = Executable(exe)(output=str, error=str) + match = re.search(r"EGL version string: (\S+)", output) + return match.group(1) if match else None + else: + return None + + # Override the fetcher method to throw a useful error message; + # fixes GitHub issue (#7061) in which this package threw a + # generic, uninformative error during the `fetch` step, + @property + def fetcher(self): + msg = """This package is intended to be a placeholder for + system-provided EGL(OpenGL) libraries from hardware vendors. Please + download and install EGL drivers/libraries for your graphics + hardware separately, and then set that up as an external package. + An example of a working packages.yaml: + + packages: + egl: + buildable: False + externals: + - spec: egl@1.5.0 + prefix: /usr/ + + In that case, /usr/ should contain these two folders: + + include/EGL/ (egl headers, including "egl.h") + lib (egl libraries, including "libEGL.so") + + """ + raise InstallError(msg) + + @fetcher.setter # Since fetcher is read-write, must override both + def fetcher(self): + _ = self.fetcher + + @property + def headers(self): + return self.egl_headers + + @property + def libs(self): + return self.egl_libs + + @property + def egl_headers(self): + header_name = "GL/gl" + gl_header = find_headers(header_name, root=self.prefix, recursive=True) + header_name = "EGL/egl" + egl_header = find_headers(header_name, root=self.prefix, recursive=True) + return gl_header + egl_header + + @property + def egl_libs(self): + spec = self.spec + lib_name = "libGL" + gl_lib = find_libraries(lib_name, root=self.prefix, recursive=True) + lib_name = "libEGL" + egl_lib = find_libraries(lib_name, root=self.prefix, recursive=True) + return gl_lib + egl_lib diff --git a/recipes/paraview/repo/packages/glew/copy.yaml b/recipes/paraview/repo/packages/glew/copy.yaml new file mode 100644 index 00000000..6f211bd8 --- /dev/null +++ b/recipes/paraview/repo/packages/glew/copy.yaml @@ -0,0 +1 @@ +patches: true diff --git a/recipes/paraview/repo/packages/glew/package.py b/recipes/paraview/repo/packages/glew/package.py new file mode 100644 index 00000000..c30e9c4e --- /dev/null +++ b/recipes/paraview/repo/packages/glew/package.py @@ -0,0 +1,71 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import sys + +from spack.package import * + + +class Glew(CMakePackage): + """The OpenGL Extension Wrangler Library.""" + + homepage = "http://glew.sourceforge.net/" + maintainers("biddisco") + url = "https://github.com/nigels-com/glew/releases/download/glew-2.1.0/glew-2.1.0.tgz" + root_cmakelists_dir = "build/cmake" + + version("2.2.0", sha256="d4fc82893cfb00109578d0a1a2337fb8ca335b3ceccf97b97e5cc7f08e4353e1") + version("2.1.0", sha256="04de91e7e6763039bc11940095cd9c7f880baba82196a7765f727ac05a993c95") + version("2.0.0", sha256="c572c30a4e64689c342ba1624130ac98936d7af90c3103f9ce12b8a0c5736764") + + variant( + "gl", + default="glx" if sys.platform.startswith("linux") else "other", + values=("glx", "osmesa", "egl", "other"), + multi=False, + description="The OpenGL provider to use", + ) + conflicts("osmesa", when="gl=glx") + conflicts("osmesa", when="gl=egl") + conflicts("osmesa", when="gl=other") + conflicts("glx", when="gl=osmesa") + conflicts("glx", when="gl=other") + conflicts("glx", when="gl=egl") + + depends_on("gl") + depends_on("osmesa", when="gl=osmesa") + depends_on("glx", when="gl=glx") + depends_on("libx11", when="gl=glx") + depends_on("xproto", when="gl=glx") + depends_on("egl", when="gl=egl") + + # glu is already forcibly disabled in the CMakeLists.txt. This prevents + # it from showing up in the .pc file + patch("remove-pkgconfig-glu-dep.patch") + + def cmake_args(self): + spec = self.spec + args = [ + self.define("BUILD_UTILS", True), + self.define("GLEW_REGAL", False), + self.define("GLEW_EGL", "gl=egl" in spec), + self.define("OpenGL_GL_PREFERENCE", "LEGACY"), + self.define("OPENGL_INCLUDE_DIR", spec["gl"].headers.directories[0]), + self.define("OPENGL_gl_LIBRARY", spec["gl"].libs[0]), + self.define("OPENGL_opengl_LIBRARY", "IGNORE"), + self.define("OPENGL_glx_LIBRARY", "IGNORE"), + self.define("OPENGL_glu_LIBRARY", "IGNORE"), + self.define("GLEW_OSMESA", "gl=osmesa" in spec), + self.define("GLEW_X11", "gl=glx" in spec), + self.define("CMAKE_DISABLE_FIND_PACKAGE_X11", "gl=glx" not in spec), + ] + if "gl=egl" in spec: + args.append( + self.define("OPENGL_egl_LIBRARY", [spec["egl"].libs[0], spec["egl"].libs[1]]) + ) + else: + args.append(self.define("OPENGL_egl_LIBRARY", "IGNORE")) + + return args diff --git a/recipes/paraview/repo/packages/opengl/package.py b/recipes/paraview/repo/packages/opengl/package.py new file mode 100644 index 00000000..bd9ec0b7 --- /dev/null +++ b/recipes/paraview/repo/packages/opengl/package.py @@ -0,0 +1,111 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re +import sys + +from spack.package import * + + +class Opengl(BundlePackage): + """Placeholder for external OpenGL libraries from hardware vendors""" + + homepage = "https://www.opengl.org/" + maintainers("biddisco") + version("4.5") + + # This should really be when='platform=linux' but can't because of a + # current bug in when and how ArchSpecs are constructed + if sys.platform.startswith("linux"): + provides("libglx") + executables = ["^glxinfo$"] + else: # windows and mac + provides("gl@4.5") + + @classmethod + def determine_version(cls, exe): + if exe: + output = Executable(exe)(output=str, error=str) + match = re.search(r"OpenGL version string: (\S+)", output) + return match.group(1) if match else None + else: + return None + + # Override the fetcher method to throw a useful error message; + # fixes GitHub issue (#7061) in which this package threw a + # generic, uninformative error during the `fetch` step, + @property + def fetcher(self): + msg = """This package is intended to be a placeholder for + system-provided OpenGL libraries from hardware vendors. Please + download and install OpenGL drivers/libraries for your graphics + hardware separately, and then set that up as an external package. + An example of a working packages.yaml: + + packages: + opengl: + buildable: False + externals: + - spec: opengl@4.5.0 + prefix: /opt/opengl + + In that case, /opt/opengl/ should contain these two folders: + + include/GL/ (opengl headers, including "gl.h") + lib (opengl libraries, including "libGL.so") + + On Apple Darwin (e.g., OS X, macOS) systems, this package is + normally installed as part of the XCode Command Line Tools in + /usr/X11R6, so a working packages.yaml would be + + packages: + opengl: + buildable: False + externals: + - spec: opengl@4.1 + prefix: /usr/X11R6 + + In that case, /usr/X11R6 should contain + + include/GL/ (OpenGL headers, including "gl.h") + lib (OpenGL libraries, including "libGL.dylib") + + On OS X/macOS, note that the version of OpenGL provided + depends on your hardware. Look at + https://support.apple.com/en-us/HT202823 to see what version + of OpenGL your Mac uses.""" + raise InstallError(msg) + + @fetcher.setter # Since fetcher is read-write, must override both + def fetcher(self): + _ = self.fetcher + + @property + def headers(self): + return self.gl_headers + + @property + def libs(self): + return self.gl_libs + + @property + def gl_headers(self): + spec = self.spec + if "platform=darwin" in spec: + header_name = "OpenGL/gl" + else: + header_name = "GL/gl" + return find_headers(header_name, root=self.prefix, recursive=True) + + @property + def gl_libs(self): + spec = self.spec + if "platform=windows" in spec: + lib_name = "opengl32" + elif "platform=darwin" in spec: + lib_name = "libOpenGL" + else: # linux and cray + lib_name = "libGL" + return find_libraries(lib_name, root=self.prefix, recursive=True) diff --git a/recipes/paraview/repo/packages/paraview/copy.yaml b/recipes/paraview/repo/packages/paraview/copy.yaml new file mode 100644 index 00000000..6f211bd8 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/copy.yaml @@ -0,0 +1 @@ +patches: true diff --git a/recipes/paraview/repo/packages/paraview/exodusII-netcdf4.9.0.patch b/recipes/paraview/repo/packages/paraview/exodusII-netcdf4.9.0.patch new file mode 100644 index 00000000..ec902242 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/exodusII-netcdf4.9.0.patch @@ -0,0 +1,14 @@ +*** a/VTK/ThirdParty/exodusII/vtkexodusII/src/ex_utils.c 2023-03-16 16:57:14.172102586 -0400 +--- b/VTK/ThirdParty/exodusII/vtkexodusII/src/ex_utils.c 2023-03-16 11:20:28.230116660 -0400 +*************** +*** 1770,1776 **** +--- 1770,1778 ---- + */ + + /* const int NC_SZIP_EC = 4; */ /* Selects entropy coding method for szip. */ ++ #ifndef NC_SZIP_NN + const int NC_SZIP_NN = 32; /* Selects nearest neighbor coding method for szip. */ ++ #endif + /* Even and between 4 and 32; typical values are 8, 10, 16, 32 */ + const int SZIP_PIXELS_PER_BLOCK = + file->compression_level == 0 ? 32 : file->compression_level; diff --git a/recipes/paraview/repo/packages/paraview/package.py b/recipes/paraview/repo/packages/paraview/package.py new file mode 100644 index 00000000..8c15b2a6 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/package.py @@ -0,0 +1,677 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import itertools +import os +import sys + +from spack.package import * + + +class Paraview(CMakePackage, CudaPackage, ROCmPackage): + """ParaView is an open-source, multi-platform data analysis and + visualization application. This package includes the Catalyst + in-situ library for versions 5.7 and greater, otherwise use the + catalyst package. + + """ + + homepage = "https://www.paraview.org" + url = "https://www.paraview.org/files/v5.7/ParaView-v5.7.0.tar.xz" + list_url = "https://www.paraview.org/files" + list_depth = 1 + git = "https://gitlab.kitware.com/paraview/paraview.git" + + maintainers("danlipsa", "vicentebolea", "kwryankrattiger") + tags = ["e4s"] + + version("master", branch="master", submodules=True) + version( + "5.11.1", + sha256="5cc2209f7fa37cd3155d199ff6c3590620c12ca4da732ef7698dec37fa8dbb34", + preferred=True, + ) + version("5.11.0", sha256="9a0b8fe8b1a2cdfd0ace9a87fa87e0ec21ee0f6f0bcb1fdde050f4f585a25165") + version("5.10.1", sha256="520e3cdfba4f8592be477314c2f6c37ec73fb1d5b25ac30bdbd1c5214758b9c2") + version("5.10.0", sha256="86d85fcbec395cdbc8e1301208d7c76d8f48b15dc6b967ffbbaeee31242343a5") + version("5.9.1", sha256="0d486cb6fbf55e428845c9650486f87466efcb3155e40489182a7ea85dfd4c8d") + version("5.9.0", sha256="b03258b7cddb77f0ee142e3e77b377e5b1f503bcabc02bfa578298c99a06980d") + version("5.8.1", sha256="7653950392a0d7c0287c26f1d3a25cdbaa11baa7524b0af0e6a1a0d7d487d034") + version("5.8.0", sha256="219e4107abf40317ce054408e9c3b22fb935d464238c1c00c0161f1c8697a3f9") + version("5.7.0", sha256="e41e597e1be462974a03031380d9e5ba9a7efcdb22e4ca2f3fec50361f310874") + version("5.6.2", sha256="1f3710b77c58a46891808dbe23dc59a1259d9c6b7bb123aaaeaa6ddf2be882ea") + version("5.6.0", sha256="cb8c4d752ad9805c74b4a08f8ae6e83402c3f11e38b274dba171b99bb6ac2460") + version("5.5.2", sha256="64561f34c4402b88f3cb20a956842394dde5838efd7ebb301157a837114a0e2d") + version("5.5.1", sha256="a6e67a95a7a5711a2b5f95f38ccbff4912262b3e1b1af7d6b9afe8185aa85c0d") + version("5.5.0", sha256="1b619e326ff574de808732ca9a7447e4cd14e94ae6568f55b6581896cd569dff") + version("5.4.1", sha256="390d0f5dc66bf432e202a39b1f34193af4bf8aad2355338fa5e2778ea07a80e4") + version("5.4.0", sha256="f488d84a53b1286d2ee1967e386626c8ad05a6fe4e6cbdaa8d5e042f519f94a9") + version("5.3.0", sha256="046631bbf00775edc927314a3db207509666c9c6aadc7079e5159440fd2f88a0") + version("5.2.0", sha256="894e42ef8475bb49e4e7e64f4ee2c37c714facd18bfbb1d6de7f69676b062c96") + version("5.1.2", sha256="ff02b7307a256b7c6e8ad900dee5796297494df7f9a0804fe801eb2f66e6a187") + version("5.0.1", sha256="caddec83ec284162a2cbc46877b0e5a9d2cca59fb4ab0ea35b0948d2492950bb") + version("4.4.0", sha256="c2dc334a89df24ce5233b81b74740fc9f10bc181cd604109fd13f6ad2381fc73") + + variant( + "development_files", + default=True, + description="Install include files for Catalyst or plugins support", + ) + variant("python", default=False, description="Enable Python support", when="@5.6:") + variant("fortran", default=False, description="Enable Fortran support") + variant("mpi", default=True, description="Enable MPI support") + variant("osmesa", default=False, description="Enable OSMesa support") + variant("egl", default=False, description="The OpenGL library being used supports EGL") + variant("qt", default=False, description="Enable Qt (gui) support") + variant("opengl2", default=True, description="Enable OpenGL2 backend") + variant("examples", default=False, description="Build examples") + variant("hdf5", default=False, description="Use external HDF5") + variant("shared", default=True, description="Builds a shared version of the library") + variant("kits", default=True, description="Use module kits") + variant("pagosa", default=False, description="Build the pagosa adaptor") + variant("eyedomelighting", default=False, description="Enable Eye Dome Lighting feature") + variant("tbb", default=False, description="Enable multi-threaded parallelism with TBB") + variant("adios2", default=False, description="Enable ADIOS2 support", when="@5.8:") + variant("visitbridge", default=False, description="Enable VisItBridge support") + variant("raytracing", default=False, description="Enable Raytracing support") + variant( + "openpmd", + default=False, + description="Enable openPMD support (w/ ADIOS2/HDF5)", + when="@5.9: +python", + ) + variant("catalyst", default=False, description="Enable Catalyst 1", when="@5.7:") + variant( + "libcatalyst", + default=False, + description="Enable Catalyst 2 (libcatalyst) implementation", + when="@5.10:", + ) + + variant( + "advanced_debug", + default=False, + description="Enable all other debug flags beside build_type, such as VTK_DEBUG_LEAK", + ) + variant( + "build_edition", + default="canonical", + multi=False, + values=("canonical", "catalyst_rendering", "catalyst", "rendering", "core"), + description="Build editions include only certain modules. " + "Editions are listed in decreasing order of size.", + ) + variant( + "use_vtkm", + default="default", + multi=False, + values=("default", "on", "off"), + description="Build VTK-m with ParaView by setting PARAVIEW_USE_VTKM=ON,OFF." + ' "default" lets the build_edition make the decision.' + ' "on" or "off" will always override the build_edition.', + ) + variant("ospray", default=False, description="Enable raytracing using osrpray library") + + conflicts("~hdf5", when="+visitbridge") + conflicts("+adios2", when="@:5.10 ~mpi") + conflicts("+openpmd", when="~adios2 ~hdf5", msg="openPMD needs ADIOS2 and/or HDF5") + conflicts("~shared", when="+cuda") + conflicts("+cuda", when="@5.8:5.10") + conflicts("+cuda", when="use_vtkm=off") + conflicts("+rocm", when="+cuda") + conflicts("+rocm", when="use_vtkm=off") + conflicts("paraview@:5.10", when="+rocm") + # Legacy rendering dropped in 5.5 + # See commit: https://gitlab.kitware.com/paraview/paraview/-/commit/798d328c + conflicts("~opengl2", when="@5.5:") + # in 5.7 you cannot reduce the size of the code for Catalyst builds. + conflicts("build_edition=catalyst_rendering", when="@:5.7") + conflicts("build_edition=catalyst", when="@:5.7") + conflicts("build_edition=rendering", when="@:5.7") + conflicts("build_edition=core", when="@:5.7") + # before 5.3.0, ParaView didn't have VTK-m + conflicts("use_vtkm=on", when="@:5.3") + # paraview@5.9.0 is recommended when using the xl compiler + # See https://gitlab.kitware.com/paraview/paraview/-/merge_requests/4433 + conflicts( + "paraview@:5.8", + when="%xl_r", + msg="Use paraview@5.9.0 with %xl_r. Earlier versions are not able to build with xl.", + ) + + # Newer abseil-cpp requires C++14, but paraview uses C++11 by default + conflicts("^abseil-cpp@2023:") + + # We only support one single Architecture + for _arch, _other_arch in itertools.permutations(CudaPackage.cuda_arch_values, 2): + conflicts( + "cuda_arch={0}".format(_arch), + when="cuda_arch={0}".format(_other_arch), + msg="Paraview only accepts one architecture value", + ) + + for _arch in range(10, 14): + conflicts("cuda_arch=%d" % _arch, when="+cuda", msg="ParaView requires cuda_arch >= 20") + + depends_on("cmake@3.3:", type="build") + depends_on("cmake@3.21:", type="build", when="+rocm") + + extends("python", when="+python") + + # VTK < 8.2.1 can't handle Python 3.8 + # This affects Paraview <= 5.7 (VTK 8.2.0) + # https://gitlab.kitware.com/vtk/vtk/-/issues/17670 + depends_on("python@3:3.7", when="@:5.7 +python", type=("build", "run")) + depends_on("python@3:", when="@5.8:+python", type=("build", "run")) + + depends_on("py-numpy", when="+python", type=("build", "run")) + depends_on("py-mpi4py", when="+python+mpi", type=("build", "run")) + + depends_on("py-matplotlib", when="+python", type="run") + depends_on("py-pandas@0.21:", when="+python", type="run") + + # openPMD is implemented as a Python module and provides ADIOS2 and HDF5 backends + depends_on("openpmd-api@0.14.5: +python", when="+python +openpmd", type=("build", "run")) + depends_on("openpmd-api +adios2", when="+openpmd +adios2", type=("build", "run")) + depends_on("openpmd-api +hdf5", when="+openpmd +hdf5", type=("build", "run")) + + depends_on("tbb", when="+tbb") + + depends_on("mpi", when="+mpi") + depends_on("qt+opengl", when="@5.3.0:+qt+opengl2") + depends_on("qt~opengl", when="@5.3.0:+qt~opengl2") + depends_on("qt@:4", when="@:5.2.0+qt") + + depends_on("gl@3.2:", when="+opengl2") + depends_on("gl@1.2:", when="~opengl2") + depends_on("glew", when="~egl") + depends_on("glew gl=egl", when="+egl") + + depends_on("osmesa", when="+osmesa") + with when("~egl"): + for p in ["linux", "cray"]: + depends_on("glx", when="~osmesa platform={}".format(p)) + depends_on("libxt", when="~osmesa platform={}".format(p)) + conflicts("+qt", when="+osmesa") + conflicts("+qt", when="+egl") + conflicts("+egl", when="+osmesa") + + depends_on("ospray@2.1:", when="+raytracing") + depends_on("openimagedenoise", when="+raytracing") + depends_on("ospray +mpi", when="+raytracing +mpi") + + depends_on("bzip2") + depends_on("double-conversion") + depends_on("expat") + depends_on("eigen@3:") + depends_on("freetype") + # depends_on('hdf5+mpi', when='+mpi') + # depends_on('hdf5~mpi', when='~mpi') + depends_on("hdf5+hl+mpi", when="+hdf5+mpi") + depends_on("hdf5+hl~mpi", when="+hdf5~mpi") + depends_on("hdf5@1.10:", when="+hdf5 @5.10:") + depends_on("adios2+mpi", when="+adios2+mpi") + depends_on("adios2~mpi", when="+adios2~mpi") + depends_on("silo", when="+visitbridge") + depends_on("silo+mpi", when="+visitbridge+mpi") + depends_on("silo~mpi", when="+visitbridge~mpi") + depends_on("boost", when="+visitbridge") + depends_on("jpeg") + depends_on("jsoncpp") + depends_on("libogg") + depends_on("libpng") + depends_on("libtheora") + depends_on("libtiff") + depends_on("netcdf-c") + depends_on("pegtl") + depends_on("protobuf@3.4:") + # Paraview 5.10 can't build with protobuf > 3.18 + # https://github.com/spack/spack/issues/37437 + depends_on("protobuf@3.4:3.18", when="@:5.10%oneapi") + depends_on("protobuf@3.4:3.18", when="@:5.10%intel@2021:") + depends_on("protobuf@3.4:3.18", when="@:5.10%xl") + depends_on("protobuf@3.4:3.18", when="@:5.10%xl_r") + depends_on("libxml2") + depends_on("lz4") + depends_on("xz") + depends_on("zlib") + depends_on("libcatalyst@2:", when="+libcatalyst") + depends_on("hip@5.2:", when="+rocm") + for target in ROCmPackage.amdgpu_targets: + depends_on( + "kokkos@:3.7.01 +rocm amdgpu_target={0}".format(target), + when="+rocm amdgpu_target={0}".format(target), + ) + + # Older builds of pugi export their symbols differently, + # and pre-5.9 is unable to handle that. + depends_on("pugixml@:1.10", when="@:5.8") + depends_on("pugixml", when="@5.9:") + + # ParaView depends on cli11 due to changes in MR + # https://gitlab.kitware.com/paraview/paraview/-/merge_requests/4951 + depends_on("cli11@1.9.1", when="@5.10:") + + # ParaView depends on nlohmann-json due to changes in MR + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8550 + depends_on("nlohmann-json", when="@5.11:") + + # ParaView depends on proj@8.1.0 due to changes in MR + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8474 + depends_on("proj@9: +curl", when="@5.11:") + + depends_on("ospray@2.8:", when="+ospray") + + patch("stl-reader-pv440.patch", when="@4.4.0") + + # Broken gcc-detection - improved in 5.1.0, redundant later + patch("gcc-compiler-pv501.patch", when="@:5.0.1") + + # Broken installation (ui_pqExportStateWizard.h) - fixed in 5.2.0 + patch("ui_pqExportStateWizard.patch", when="@:5.1.2") + + # Broken vtk-m config. Upstream catalyst changes + patch("vtkm-catalyst-pv551.patch", when="@5.5.0:5.5.2") + + # Broken H5Part with external parallel HDF5 + patch("h5part-parallel.patch", when="@5.7.0:5.7") + + # Broken downstream FindMPI + patch("vtkm-findmpi-downstream.patch", when="@5.9.0") + + # Include limits header wherever needed to fix compilation with GCC 11 + patch("paraview-gcc11-limits.patch", when="@5.9.1 %gcc@11.1.0:") + + # Fix IOADIOS2 module to work with kits + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8653 + patch("vtk-adios2-module-no-kit.patch", when="@5.8:") + + # Patch for paraview 5.9.0%xl_r + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7591 + patch("xlc-compilation-pv590.patch", when="@5.9.0%xl_r") + + # intel oneapi doesn't compile some code in catalyst + patch("catalyst-etc_oneapi_fix.patch", when="@5.10.0:5.10.1%oneapi") + + # Patch for paraview 5.10: +hdf5 ^hdf5@1.13.2: + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9690 + patch("vtk-xdmf2-hdf51.13.1.patch", when="@5.10.0:5.10") + patch("vtk-xdmf2-hdf51.13.2.patch", when="@5.10:5.11.0") + + # Fix VTK to work with external freetype using CONFIG mode for find_package + patch("FindFreetype.cmake.patch", when="@5.10.1:") + + # Fix VTK to remove deprecated ADIOS2 functions + # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10113 + patch("adios2-remove-deprecated-functions.patch", when="@5.10: ^adios2@2.9:") + + patch("exodusII-netcdf4.9.0.patch", when="@:5.10.2") + + generator("ninja", "make", default="ninja") + # https://gitlab.kitware.com/paraview/paraview/-/issues/21223 + conflicts("generator=ninja", when="%xl") + conflicts("generator=ninja", when="%xl_r") + + def url_for_version(self, version): + _urlfmt = "http://www.paraview.org/files/v{0}/ParaView-v{1}{2}.tar.{3}" + """Handle ParaView version-based custom URLs.""" + if version < Version("5.1.0"): + return _urlfmt.format(version.up_to(2), version, "-source", "gz") + elif version < Version("5.6.1"): + return _urlfmt.format(version.up_to(2), version, "", "gz") + else: + return _urlfmt.format(version.up_to(2), version, "", "xz") + + @property + def paraview_subdir(self): + """The paraview subdirectory name as paraview-major.minor""" + if self.spec.version == Version("master"): + return "paraview-5.11" + else: + return "paraview-{0}".format(self.spec.version.up_to(2)) + + def setup_dependent_build_environment(self, env, dependent_spec): + if os.path.isdir(self.prefix.lib64): + lib_dir = self.prefix.lib64 + else: + lib_dir = self.prefix.lib + env.set("ParaView_DIR", self.prefix) + + if self.spec.version <= Version("5.7.0"): + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir)) + else: + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir, "vtk")) + + def flag_handler(self, name, flags): + if name == "ldflags" and self.spec.satisfies("%intel"): + flags.append("-shared-intel") + return (None, flags, None) + # -no-ipo prevents internal compiler error from multi-file + # optimization (https://github.com/spack/spack/issues/18192) + if (name == "cflags" or name == "cxxflags") and self.spec.satisfies("%intel"): + flags.append("-no-ipo") + return (None, None, flags) + + if name in ("cflags", "cxxflags"): + # Constrain the HDF5 API + if self.spec.satisfies("@:5.9 +hdf5"): + if self.spec["hdf5"].satisfies("@1.10:"): + flags.append("-DH5_USE_18_API") + elif self.spec.satisfies("@5.10: +hdf5"): + if self.spec["hdf5"].satisfies("@1.12:"): + flags.append("-DH5_USE_110_API") + return (flags, None, None) + + def setup_run_environment(self, env): + # paraview 5.5 and later + # - cmake under lib/cmake/paraview-5.5 + # - libs under lib + # - python bits under lib/python2.8/site-packages + if os.path.isdir(self.prefix.lib64): + lib_dir = self.prefix.lib64 + else: + lib_dir = self.prefix.lib + + env.set("ParaView_DIR", self.prefix) + + if self.spec.version <= Version("5.7.0"): + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir)) + else: + env.set("PARAVIEW_VTK_DIR", join_path(lib_dir, "cmake", self.paraview_subdir, "vtk")) + + if self.spec.version <= Version("5.4.1"): + lib_dir = join_path(lib_dir, self.paraview_subdir) + + env.prepend_path("LIBRARY_PATH", lib_dir) + env.prepend_path("LD_LIBRARY_PATH", lib_dir) + + if "+python" in self.spec: + if self.spec.version <= Version("5.4.1"): + pv_pydir = join_path(lib_dir, "site-packages") + env.prepend_path("PYTHONPATH", pv_pydir) + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "vtk")) + else: + python_version = self.spec["python"].version.up_to(2) + pv_pydir = join_path(lib_dir, "python{0}".format(python_version), "site-packages") + if "+shared" in self.spec or self.spec.version <= Version("5.7.0"): + env.prepend_path("PYTHONPATH", pv_pydir) + # The Trilinos Catalyst adapter requires + # the vtkmodules directory in PYTHONPATH + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "vtkmodules")) + else: + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "_paraview.zip")) + env.prepend_path("PYTHONPATH", join_path(pv_pydir, "_vtk.zip")) + + def cmake_args(self): + """Populate cmake arguments for ParaView.""" + spec = self.spec + + def variant_bool(feature, on="ON", off="OFF"): + """Ternary for spec variant to ON/OFF string""" + if feature in spec: + return on + return off + + def nvariant_bool(feature): + """Negated ternary for spec variant to OFF/ON string""" + return variant_bool(feature, on="OFF", off="ON") + + def use_x11(): + """Return false if osmesa or egl are requested""" + if "+osmesa" in spec or "+egl" in spec: + return "OFF" + if spec.satisfies("platform=windows"): + return "OFF" + return "ON" + + rendering = variant_bool("+opengl2", "OpenGL2", "OpenGL") + includes = variant_bool("+development_files") + + cmake_args = [ + "-DVTK_OPENGL_HAS_OSMESA:BOOL=%s" % variant_bool("+osmesa"), + "-DVTK_USE_X:BOOL=%s" % use_x11(), + "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s" % includes, + "-DBUILD_TESTING:BOOL=OFF", + "-DPARAVIEW_PLUGIN_ENABLE_pvNVIDIAIndeX:BOOL=ON", + self.define_from_variant("PARAVIEW_ENABLE_VISITBRIDGE", "visitbridge"), + self.define_from_variant("VISIT_BUILD_READER_Silo", "visitbridge"), + ] + + if "+ospray" in spec: + cmake_args.extend( + ["-DPARAVIEW_ENABLE_RAYTRACING:BOOL=ON", "-DVTKOSPRAY_ENABLE_DENOISER:BOOL=ON"] + ) + + if "+egl" in spec: + cmake_args.append("-DVTK_OPENGL_HAS_EGL:BOOL=ON") + + if spec.satisfies("@5.11:"): + cmake_args.append("-DVTK_MODULE_USE_EXTERNAL_VTK_verdict:BOOL=OFF") + + if spec.satisfies("@5.10:"): + cmake_args.extend( + [ + "-DVTK_MODULE_USE_EXTERNAL_ParaView_vtkcatalyst:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_ioss:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=OFF", + ] + ) + + if spec.satisfies("@:5.7") and spec["cmake"].satisfies("@3.17:"): + cmake_args.append("-DFPHSA_NAME_MISMATCHED:BOOL=ON") + + if spec.satisfies("@5.7:"): + if spec.satisfies("@5.8:"): + cmake_args.extend( + [ + "-DPARAVIEW_BUILD_EDITION:STRING=%s" + % spec.variants["build_edition"].value.upper(), + "-DPARAVIEW_USE_QT:BOOL=%s" % variant_bool("+qt"), + "-DPARAVIEW_BUILD_WITH_EXTERNAL=OFF", + ] + ) + if spec.satisfies("%cce"): + cmake_args.append("-DVTK_PYTHON_OPTIONAL_LINK:BOOL=OFF") + else: # @5.7: + cmake_args.extend( + [ + "-DPARAVIEW_ENABLE_CATALYST:BOOL=ON", + "-DPARAVIEW_BUILD_QT_GUI:BOOL=%s" % variant_bool("+qt"), + "-DPARAVIEW_USE_EXTERNAL:BOOL=ON", + ] + ) + + cmake_args.extend( + [ + "-DPARAVIEW_ENABLE_EXAMPLES:BOOL=%s" % variant_bool("+examples"), + "-DVTK_MODULE_USE_EXTERNAL_ParaView_cgns=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=OFF", + "-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=OFF", + ] + ) + else: + cmake_args.extend( + [ + "-DPARAVIEW_BUILD_EXAMPLES:BOOL=%s" % variant_bool("+examples"), + "-DVTK_RENDERING_BACKEND:STRING=%s" % rendering, + "-DPARAVIEW_BUILD_QT_GUI:BOOL=%s" % variant_bool("+qt"), + "-DVTK_USE_SYSTEM_LIBRARIES:BOOL=ON", + "-DVTK_USE_SYSTEM_CGNS:BOOL=OFF", + "-DVTK_USE_SYSTEM_DIY2:BOOL=OFF", + "-DVTK_USE_SYSTEM_GL2PS:BOOL=OFF", + "-DVTK_USE_SYSTEM_ICET:BOOL=OFF", + "-DVTK_USE_SYSTEM_LIBHARU:BOOL=OFF", + "-DVTK_USE_SYSTEM_NETCDFCPP:BOOL=OFF", + "-DVTK_USE_SYSTEM_UTF8:BOOL=OFF", + "-DVTK_USE_SYSTEM_XDMF2:BOOL=OFF", + "-DVTK_USE_SYSTEM_XDMF3:BOOL=OFF", + ] + ) + + if "+adios2" in spec: + cmake_args.extend(["-DPARAVIEW_ENABLE_ADIOS2:BOOL=ON"]) + + # The assumed qt version changed to QT5 (as of paraview 5.2.1), + # so explicitly specify which QT major version is actually being used + if "+qt" in spec: + cmake_args.extend(["-DPARAVIEW_QT_VERSION=%s" % spec["qt"].version[0]]) + + if "+fortran" in spec: + cmake_args.append("-DPARAVIEW_USE_FORTRAN:BOOL=ON") + + # CMake flags for python have changed with newer ParaView versions + # Make sure Spack uses the right cmake flags + if "+python" in spec: + py_use_opt = "USE" if spec.satisfies("@5.8:") else "ENABLE" + py_ver_opt = "PARAVIEW" if spec.satisfies("@5.7:") else "VTK" + py_ver_val = 3 + cmake_args.extend( + [ + "-DPARAVIEW_%s_PYTHON:BOOL=ON" % py_use_opt, + "-DPYTHON_EXECUTABLE:FILEPATH=%s" % spec["python"].command.path, + "-D%s_PYTHON_VERSION:STRING=%d" % (py_ver_opt, py_ver_val), + ] + ) + if spec.satisfies("@:5.6"): + cmake_args.append("-DVTK_USE_SYSTEM_MPI4PY:BOOL=%s" % variant_bool("+mpi")) + + else: + cmake_args.append("-DPARAVIEW_ENABLE_PYTHON:BOOL=OFF") + + if "+mpi" in spec: + mpi_args = [ + "-DPARAVIEW_USE_MPI:BOOL=ON", + "-DMPIEXEC:FILEPATH=%s/bin/mpiexec" % spec["mpi"].prefix, + ] + if not sys.platform == "win32": + mpi_args.extend( + [ + "-DMPI_CXX_COMPILER:PATH=%s" % spec["mpi"].mpicxx, + "-DMPI_C_COMPILER:PATH=%s" % spec["mpi"].mpicc, + "-DMPI_Fortran_COMPILER:PATH=%s" % spec["mpi"].mpifc, + ] + ) + cmake_args.extend(mpi_args) + + cmake_args.append("-DPARAVIEW_BUILD_SHARED_LIBS:BOOL=%s" % variant_bool("+shared")) + + # VTK-m added to ParaView in 5.3.0 and up + if spec.satisfies("@5.3.0:") and spec.variants["use_vtkm"].value != "default": + cmake_args.append( + "-DPARAVIEW_USE_VTKM:BOOL=%s" % spec.variants["use_vtkm"].value.upper() + ) + + if spec.satisfies("@5.8:"): + cmake_args.append("-DPARAVIEW_USE_CUDA:BOOL=%s" % variant_bool("+cuda")) + elif spec.satisfies("@5.7:"): + cmake_args.append("-DVTK_USE_CUDA:BOOL=%s" % variant_bool("+cuda")) + else: + cmake_args.append("-DVTKm_ENABLE_CUDA:BOOL=%s" % variant_bool("+cuda")) + + # VTK-m expects cuda_arch to be the arch name vs. the arch version. + if spec.satisfies("+cuda"): + supported_cuda_archs = { + # VTK-m and transitively ParaView does not support Tesla Arch + "20": "fermi", + "21": "fermi", + "30": "kepler", + "32": "kepler", + "35": "kepler", + "37": "kepler", + "50": "maxwel", + "52": "maxwel", + "53": "maxwel", + "60": "pascal", + "61": "pascal", + "62": "pascal", + "70": "volta", + "72": "volta", + "75": "turing", + "80": "ampere", + "86": "ampere", + } + + cuda_arch_value = "native" + requested_arch = spec.variants["cuda_arch"].value + + # ParaView/VTK-m only accepts one arch, default to first element + if requested_arch[0] != "none": + try: + cuda_arch_value = supported_cuda_archs[requested_arch[0]] + except KeyError: + raise InstallError("Incompatible cuda_arch=" + requested_arch[0]) + + cmake_args.append(self.define("VTKm_CUDA_Architecture", cuda_arch_value)) + + if "darwin" in spec.architecture: + cmake_args.extend( + ["-DVTK_USE_X:BOOL=OFF", "-DPARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON"] + ) + + if "+kits" in spec: + if spec.satisfies("@5.0:5.6"): + cmake_args.append("-DVTK_ENABLE_KITS:BOOL=ON") + elif spec.satisfies("@5.7"): + # cmake_args.append('-DPARAVIEW_ENABLE_KITS:BOOL=ON') + # Kits are broken with 5.7 + cmake_args.append("-DPARAVIEW_ENABLE_KITS:BOOL=OFF") + else: + cmake_args.append("-DPARAVIEW_BUILD_WITH_KITS:BOOL=ON") + + if "+pagosa" in spec: + cmake_args.append("-DPARAVIEW_BUILD_PAGOSA_ADAPTOR:BOOL=ON") + + if "+eyedomelighting" in spec: + cmake_args.append("-DPARAVIEW_BUILD_PLUGIN_EyeDomeLighting:BOOL=ON") + + if "+tbb" in spec: + cmake_args.append("-DVTK_SMP_IMPLEMENTATION_TYPE=TBB") + + # Hide git from Paraview so it will not use `git describe` + # to find its own version number + if spec.satisfies("@5.4.0:5.4.1"): + cmake_args.extend(["-DGIT_EXECUTABLE=FALSE"]) + + # A bug that has been found in vtk causes an error for + # intel builds for version 5.6. This should be revisited + # with later versions of Paraview to see if the issues still + # arises. + if "%intel" in spec and spec.version >= Version("5.6"): + cmake_args.append("-DPARAVIEW_ENABLE_MOTIONFX:BOOL=OFF") + + # Encourage Paraview to use the correct Python libs + if spec.satisfies("+python"): + pylibdirs = spec["python"].libs.directories + cmake_args.append("-DCMAKE_INSTALL_RPATH={0}".format(":".join(self.rpath + pylibdirs))) + + if "+advanced_debug" in spec: + cmake_args.append("-DVTK_DEBUG_LEAKS:BOOL=ON") + + if spec.satisfies("@5.11:"): + cmake_args.append("-DPARAVIEW_USE_HIP:BOOL=%s" % variant_bool("+rocm")) + if "+rocm" in spec: + archs = spec.variants["amdgpu_target"].value + if archs != "none": + arch_str = ",".join(archs) + cmake_args.append("-DCMAKE_HIP_ARCHITECTURES=%s" % arch_str) + cmake_args.append("-DKokkos_CXX_COMPILER=%s" % spec["hip"].hipcc) + + if "+catalyst" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_Catalyst=YES") + if "+python" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_PythonCatalyst=YES") + + if "+libcatalyst" in spec: + cmake_args.append("-DVTK_MODULE_ENABLE_ParaView_InSitu=YES") + cmake_args.append("-DPARAVIEW_ENABLE_CATALYST=YES") + + cmake_args.append(self.define_from_variant("PARAVIEW_ENABLE_RAYTRACING", "raytracing")) + # Currently only support OSPRay ray tracing + cmake_args.append(self.define_from_variant("VTK_ENABLE_OSPRAY", "raytracing")) + cmake_args.append(self.define_from_variant("VTKOSPRAY_ENABLE_DENOISER", "raytracing")) + + return cmake_args From e2b5e6402fd1f61bfd2d9149d857961d6bc94bae Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 25 Aug 2023 16:03:25 +0200 Subject: [PATCH 12/71] Add stackinator build and paraview client config and pvserver launch scripts These scripts will need to be further customized for use with stackinator based installations of paraview. --- .../paraview/scripts/job-build-clariden.sh | 42 +++++ recipes/paraview/scripts/job-build-hohgant.sh | 44 +++++ recipes/paraview/scripts/job-build-oryx.sh | 38 ++++ .../scripts/rc-submit-pvserver-clariden.sh | 98 ++++++++++ recipes/paraview/scripts/servers.pvsc | 175 ++++++++++++++++++ 5 files changed, 397 insertions(+) create mode 100755 recipes/paraview/scripts/job-build-clariden.sh create mode 100755 recipes/paraview/scripts/job-build-hohgant.sh create mode 100755 recipes/paraview/scripts/job-build-oryx.sh create mode 100644 recipes/paraview/scripts/rc-submit-pvserver-clariden.sh create mode 100644 recipes/paraview/scripts/servers.pvsc diff --git a/recipes/paraview/scripts/job-build-clariden.sh b/recipes/paraview/scripts/job-build-clariden.sh new file mode 100755 index 00000000..21743e81 --- /dev/null +++ b/recipes/paraview/scripts/job-build-clariden.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +SRC=/users/biddisco/src +CLUSTER=clariden +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/a100 +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER +BUILD_DIR=/dev/shm/biddisco + +echo "Setup/clean build dir" +#rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug + +# if using develop branch of spack, add --develop +#$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug --develop + +# build the squashfs image - bubblewrap is used inside the makefile +echo "Trigger build" +cd /dev/shm/biddisco +env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile + diff --git a/recipes/paraview/scripts/job-build-hohgant.sh b/recipes/paraview/scripts/job-build-hohgant.sh new file mode 100755 index 00000000..36331f7f --- /dev/null +++ b/recipes/paraview/scripts/job-build-hohgant.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +CLUSTER=hohgant +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER +BUILD_DIR=/dev/shm/biddisco + +unalias cp + +echo "Setup/clean build dir" +rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug + +echo "Trigger build" +cd ${BUILD_DIR} + +# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder +cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ + +# build the squashfs image - bubblewrap is used inside the makefile +env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config SPACK_USER_CACHE_PATH=$BUILD_DIR/cache /bin/bash --norc --noprofile + diff --git a/recipes/paraview/scripts/job-build-oryx.sh b/recipes/paraview/scripts/job-build-oryx.sh new file mode 100755 index 00000000..5f36fc96 --- /dev/null +++ b/recipes/paraview/scripts/job-build-oryx.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +#SBATCH --job-name=stackinator-paraview +#SBATCH --time=04:00:00 +#SBATCH --nodes=1 +#SBATCH --partition=nvgpu +#SBATCH --account=csstaff +#SBATCH --output=/users/biddisco/stackinator-output.txt +#SBATCH --error=/users/biddisco/stackinator-error.txt + +CLUSTER=oryx +STACKI_DIR=$SRC/alps-vcluster/stackinator +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/turing +SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER +BUILD_DIR=/dev/shm/biddisco + +echo "Setup/clean build dir" +#rm -rf ${BUILD_DIR}/* +mkdir -p ${BUILD_DIR} +mkdir -p ${BUILD_DIR}/tmp + +echo "Execute stackinator" +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug + +# build the squashfs image - bubblewrap is used inside the makefile +echo "Trigger build" +cd /dev/shm/biddisco +env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 + +echo "Copy generated squashfs file" +DATE=$(date +%F) +cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs + +# ----------------------------------------- +# debug : create a shell using the spack setup used to create the squashfs +# ----------------------------------------- +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile + diff --git a/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh b/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh new file mode 100644 index 00000000..f5f0b1b6 --- /dev/null +++ b/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh @@ -0,0 +1,98 @@ +#!/bin/bash -l +# updated Thu Dec 1 02:29:09 PM CET 2022 to add v5.11 for Eiger +# updated Tue Nov 15 03:46:08 PM CET 2022 to add v5.11 for daint-gpu +# updated Tue Jun 7 10:26:45 PM CEST 2022 to use generic hostname command +# updated Thu Feb 17 08:49:14 AM CET 2022 for Eiger, version 5.10 +# updated Thu Feb 17 15:56:49 CET 2022 for Daint (GPU version), version 5.10 +# updated Thu Feb 17 04:06:33 PM CET 2022: Removed version 5.9 + +# usage +echo "" +echo "Usage : %1:Session name ($1)" +echo " %2:Job Wall Time ($2)" +echo " %3:server-num-nodes ($3)" +echo " %4:server-num-tasks-per-node ($4)" +echo " %5:server-port ($5)" +echo " %6:login node ($6)" +echo " %7:Version number ($7)" +echo " %8:Queue's name (normal/debug) ($8)" +echo " %9:Memory per Node (standard or high) ($9)" +echo " %10:Account (csstaff or other) ($10)" +echo " %11:Reservation ("" or other) ($11)" + +# Create a temporary filename to write our launch script into +TEMP_FILE=`mktemp` + +# this enables us to connect to the generic name "daint.cscs.ch" from the client +HOST_NAME=`hostname`.cscs.ch +# HOST_NAME=148.187.134.95 + +echo "Temporary FileName is :" $TEMP_FILE + +nservers=$[$3 * $4] + +# Create a job script +echo "#!/bin/bash -l" >> $TEMP_FILE +echo "#SBATCH --job-name=$1" >> $TEMP_FILE +echo "#SBATCH --nodes=$3" >> $TEMP_FILE +echo "#SBATCH --ntasks-per-node=$4" >> $TEMP_FILE +echo "#SBATCH --ntasks=$nservers" >> $TEMP_FILE +echo "#SBATCH --time=$2" >> $TEMP_FILE +echo "#SBATCH --account=${10}" >> $TEMP_FILE +echo "#SBATCH --partition=$8" >> $TEMP_FILE +#echo "#SBATCH --cpus-per-task=256" >> $TEMP_FILE +#echo "#SBATCH --ntasks-per-core=2" >> $TEMP_FILE +#echo "#SBATCH --threads-per-core=2" >> $TEMP_FILE +#echo "#SBATCH --hint=multithread" >> $TEMP_FILE +# if [ "$9" = "high" ]; then +# echo "#SBATCH --mem=497G" >> $TEMP_FILE +# fi + +# only ask for a reservation if in the normal queue and no greater than 5 nodes +if [ "$8" = "normal" ];then + if [ ! -z "${11}" ]; then + if [ ! "$3" -gt "5" ]; then + echo "#SBATCH --reservation=${11}" >> $TEMP_FILE + fi + fi +fi + +MACHINE_NAME=clariden +export SPACK_ROOT=$SCRATCH/spack-$MACHINE_NAME +export SPACK_USER_CONFIG_PATH=~/.spack-$MACHINE_NAME +export SPACK_SYSTEM_CONFIG_PATH=/user-environment/config +export SPACK_USER_CACHE_PATH=/user-environment/cache +source $SPACK_ROOT/share/spack/setup-env.sh + +# Which rendering backend are we using +if [ "$7" = "clariden-5.11-NVIDIA" ]; then + # paraview 5.11 nvidia EGL + SQUASH_IMG=/scratch/aistor/biddisco/clariden-paraview-EGL-2023-08-23.squashfs + SQUASH_CMD="squashfs-mount $SQUASH_IMG:/user-environment" + PV_HASH="/sqd4oxb" + PV_SERVER=$($SQUASH_CMD -- spack location -i paraview $PV_HASH)/bin/pvserver + echo "Using hash $PV_HASH from squashfs $SQUASH_IMG" + echo "pvserver : $PV_SERVER" + +elif [ "$7" = "clariden-5.11-osmesa" ]; then + # paraview 5.11 osmesa + PV_HASH="/ltilqh4" + PV_SERVER=$($SQUASH_CMD spack location -i paraview $PV_HASH)/bin/pvserver + OSMESA_PATH=$($SQUASH_CMD spack location -i /qadzwvd)/lib + echo "export LD_LIBRARY_PATH=$OSMESA_PATH:\$LD_LIBRARY_PATH" >> $TEMP_FILE + echo "echo Library path is \$LD_LIBRARY_PATH" >> $TEMP_FILE + +fi + +echo "" >> $TEMP_FILE +echo "srun -n $nservers -N $3 --cpu_bind=sockets --uenv-file=$SQUASH_IMG $PV_SERVER --reverse-connection --client-host=$HOST_NAME --server-port=$5" >> $TEMP_FILE + +cat $TEMP_FILE + +# submit the job + +sbatch $TEMP_FILE + +# wipe the temp file +#rm $TEMP_FILE + diff --git a/recipes/paraview/scripts/servers.pvsc b/recipes/paraview/scripts/servers.pvsc new file mode 100644 index 00000000..582f9f16 --- /dev/null +++ b/recipes/paraview/scripts/servers.pvsc @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 894297e68a5e7e0e667513664fa69ab72c3ea9a0 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Tue, 5 Sep 2023 09:49:33 +0200 Subject: [PATCH 13/71] Paraview build recipe updated with EGL, experimental plugin support Lots of utility scripts and other ancillary files also commmitted in scripts/ dir --- recipes/paraview/repo/packages/glew/copy.yaml | 1 - .../glew/remove-pkgconfig-glu-dep.patch | 18 + ...at-ncurses-zlib-are-system-libraries.patch | 28 + .../ispc/fix-linking-against-llvm-10.patch | 26 + .../paraview/repo/packages/ispc/package.py | 108 ++++ .../paraview/FindFreetype.cmake.patch | 35 ++ .../adios2-remove-deprecated-functions.patch | 31 ++ .../paraview/catalyst-etc_oneapi_fix.patch | 45 ++ .../paraview/repo/packages/paraview/copy.yaml | 1 - .../paraview/gcc-compiler-pv501.patch | 22 + .../packages/paraview/h5part-parallel.patch | 11 + .../paraview/paraview-gcc11-limits.patch | 49 ++ .../packages/paraview/stl-reader-pv440.patch | 11 + .../paraview/ui_pqExportStateWizard.patch | 11 + .../paraview/vtk-adios2-module-no-kit.patch | 24 + .../paraview/vtk-xdmf2-hdf51.13.1.patch | 61 +++ .../paraview/vtk-xdmf2-hdf51.13.2.patch | 36 ++ .../paraview/vtkm-catalyst-pv551.patch | 510 ++++++++++++++++++ .../paraview/vtkm-findmpi-downstream.patch | 51 ++ .../paraview/xlc-compilation-pv590.patch | 39 ++ .../paraview/scripts/job-build-clariden.sh | 4 +- recipes/paraview/scripts/job-build-hohgant.sh | 24 +- recipes/paraview/scripts/job-build-oryx.sh | 2 + recipes/paraview/scripts/upalps.sh | 2 + 24 files changed, 1135 insertions(+), 15 deletions(-) delete mode 100644 recipes/paraview/repo/packages/glew/copy.yaml create mode 100644 recipes/paraview/repo/packages/glew/remove-pkgconfig-glu-dep.patch create mode 100644 recipes/paraview/repo/packages/ispc/don-t-assume-that-ncurses-zlib-are-system-libraries.patch create mode 100644 recipes/paraview/repo/packages/ispc/fix-linking-against-llvm-10.patch create mode 100644 recipes/paraview/repo/packages/ispc/package.py create mode 100644 recipes/paraview/repo/packages/paraview/FindFreetype.cmake.patch create mode 100644 recipes/paraview/repo/packages/paraview/adios2-remove-deprecated-functions.patch create mode 100644 recipes/paraview/repo/packages/paraview/catalyst-etc_oneapi_fix.patch delete mode 100644 recipes/paraview/repo/packages/paraview/copy.yaml create mode 100644 recipes/paraview/repo/packages/paraview/gcc-compiler-pv501.patch create mode 100644 recipes/paraview/repo/packages/paraview/h5part-parallel.patch create mode 100644 recipes/paraview/repo/packages/paraview/paraview-gcc11-limits.patch create mode 100644 recipes/paraview/repo/packages/paraview/stl-reader-pv440.patch create mode 100644 recipes/paraview/repo/packages/paraview/ui_pqExportStateWizard.patch create mode 100644 recipes/paraview/repo/packages/paraview/vtk-adios2-module-no-kit.patch create mode 100644 recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.1.patch create mode 100644 recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.2.patch create mode 100644 recipes/paraview/repo/packages/paraview/vtkm-catalyst-pv551.patch create mode 100644 recipes/paraview/repo/packages/paraview/vtkm-findmpi-downstream.patch create mode 100644 recipes/paraview/repo/packages/paraview/xlc-compilation-pv590.patch create mode 100755 recipes/paraview/scripts/upalps.sh diff --git a/recipes/paraview/repo/packages/glew/copy.yaml b/recipes/paraview/repo/packages/glew/copy.yaml deleted file mode 100644 index 6f211bd8..00000000 --- a/recipes/paraview/repo/packages/glew/copy.yaml +++ /dev/null @@ -1 +0,0 @@ -patches: true diff --git a/recipes/paraview/repo/packages/glew/remove-pkgconfig-glu-dep.patch b/recipes/paraview/repo/packages/glew/remove-pkgconfig-glu-dep.patch new file mode 100644 index 00000000..74710e02 --- /dev/null +++ b/recipes/paraview/repo/packages/glew/remove-pkgconfig-glu-dep.patch @@ -0,0 +1,18 @@ +diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt +index 419c243..339617f 100644 +--- a/build/cmake/CMakeLists.txt ++++ b/build/cmake/CMakeLists.txt +@@ -215,12 +215,7 @@ set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) + set (version ${GLEW_VERSION}) + set (libname ${GLEW_LIB_NAME}) + set (cflags) +-set (requireslib glu) +- +-# Mac OSX has no glu.pc unless optional X11/GLX is installed +-if (APPLE) +- set (requireslib) +-endif () ++set (requireslib) + + configure_file (${GLEW_DIR}/glew.pc.in ${CMAKE_CURRENT_BINARY_DIR}/glew.pc @ONLY) + diff --git a/recipes/paraview/repo/packages/ispc/don-t-assume-that-ncurses-zlib-are-system-libraries.patch b/recipes/paraview/repo/packages/ispc/don-t-assume-that-ncurses-zlib-are-system-libraries.patch new file mode 100644 index 00000000..3e28049c --- /dev/null +++ b/recipes/paraview/repo/packages/ispc/don-t-assume-that-ncurses-zlib-are-system-libraries.patch @@ -0,0 +1,28 @@ +From 44250379632ace94b08ff2dba17c69d3f36d5ffb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Aumu=CC=88ller?= +Date: Sun, 27 Sep 2020 20:23:42 +0200 +Subject: [PATCH] don't assume that ncurses & zlib are system libraries + +--- + CMakeLists.txt | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2bb4a7e6..53239a88 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -473,7 +473,10 @@ else() + if (ISPC_STATIC_LINK) + target_link_libraries(${PROJECT_NAME} pthread z.a tinfo.a curses.a) + else() +- target_link_libraries(${PROJECT_NAME} pthread z tinfo curses) ++ find_package(Curses REQUIRED) ++ find_package(ZLIB REQUIRED) ++ find_library(NCURSES_TINFO_LIBRARY tinfo) ++ target_link_libraries(${PROJECT_NAME} pthread ${ZLIB_LIBRARIES} ${NCURSES_TINFO_LIBRARY} ${CURSES_LIBRARIES}) + endif() + endif() + endif() +-- +2.29.0 + diff --git a/recipes/paraview/repo/packages/ispc/fix-linking-against-llvm-10.patch b/recipes/paraview/repo/packages/ispc/fix-linking-against-llvm-10.patch new file mode 100644 index 00000000..4ae7d157 --- /dev/null +++ b/recipes/paraview/repo/packages/ispc/fix-linking-against-llvm-10.patch @@ -0,0 +1,26 @@ +From 0b68b43ec71130e1167d9ff59d5f874be47a9414 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Aumu=CC=88ller?= +Date: Sun, 18 Oct 2020 21:02:32 +0200 +Subject: [PATCH] fix linking against llvm 10 + +--- + CMakeLists.txt | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68759c14..f4499c8f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -401,6 +401,9 @@ target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST}) + if (WIN32) + target_link_libraries(${PROJECT_NAME} version.lib shlwapi.lib odbc32.lib odbccp32.lib) + else() ++ if (CMAKE_DL_LIBS) ++ target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) ++ endif() + if (APPLE) + target_link_libraries(${PROJECT_NAME} pthread z curses) + else() +-- +2.28.0 + diff --git a/recipes/paraview/repo/packages/ispc/package.py b/recipes/paraview/repo/packages/ispc/package.py new file mode 100644 index 00000000..a627b2ee --- /dev/null +++ b/recipes/paraview/repo/packages/ispc/package.py @@ -0,0 +1,108 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + +import re + +from spack.package import * + +# ispc requires , e.g. from +# glibc-devel.i686 (CentoOS) or libc6-dev-i386 and g++-multilib (Ubuntu) + + +class Ispc(CMakePackage): + """Intel Implicit SPMD Program Compiler + + An open-source compiler for high-performance SIMD programming on the CPU""" + + homepage = "https://ispc.github.io" + url = "https://github.com/ispc/ispc/tarball/v1.14.1" + git = "https://github.com/ispc/ispc" + maintainers("aumuell") + + executables = ["^ispc$"] + + version("main", branch="main") + version("1.20.0", sha256="8bd30ded7f96859451ead1cecf6f58ac8e937288fe0e5b98c56f6eba4be370b4") + version("1.19.0", sha256="c1aeae4bdfb28004a6949394ea1b3daa3fdf12f646e17fcc0614861077dc8b6a") + version("1.18.1", sha256="fee76d42fc0129f81489b7c2b9143e22a44c281940693c1c13cf1e3dd2ab207f") + version("1.18.0", sha256="ecf1fc6ad5e39242e555b8e0ac539489939a9e475722eaa9da5caa4651cecf05") + version("1.17.0", sha256="1d47365febd2e17c84c22501aa63b1eafbc1ef826d6f5deadafe14783b8388a5") + version("1.16.1", sha256="b32dbd374eea5f1b5f535bfd79c5cc35591c0df2e7bf1f86dec96b74e4ebf661") + version("1.16.0", sha256="12db1a90046b51752a65f50426e1d99051c6d55e30796ddd079f7bc97d5f6faf") + version("1.15.0", sha256="3b634aaa10c9bf0e82505d1af69cb307a3a00182d57eae019680ccfa62338af9") + version("1.14.1", sha256="ca12f26dafbc4ef9605487d03a2156331c1351a4ffefc9bab4d896a466880794") + version("1.14.0", sha256="1ed72542f56738c632bb02fb0dd56ad8aec3e2487839ebbc0def8334f305a4c7") + version("1.13.0", sha256="aca595508b51dd1ff065c406a3fd7c93822320c510077dd4d97a2b98a23f097a") + + depends_on("python", type="build") + depends_on("bison", type="build") + depends_on("flex", type="build") + depends_on("ncurses", type="link") + depends_on("zlib", type="link") + depends_on("tbb", type="build", when="platform=linux @1.20:") + depends_on("llvm+clang") + #depends_on("llvm libcxx=none", when="platform=darwin") + depends_on("llvm@13:15", when="@1.19:") + depends_on("llvm@11.0:14.0", when="@1.18") + depends_on("llvm@11:14", when="@1.17") + depends_on("llvm@:12", when="@:1.16") + depends_on("llvm@11:", when="@1.16") + depends_on("llvm@10:11", when="@1.15.0:1.15") + depends_on("llvm@10.0:10", when="@1.13:1.14") + depends_on("llvm targets=arm,aarch64", when="target=arm:") + depends_on("llvm targets=arm,aarch64", when="target=aarch64:") + + patch( + "don-t-assume-that-ncurses-zlib-are-system-libraries.patch", + when="@1.14.0:1.14", + sha256="d3ccf547d3ba59779fd375e10417a436318f2200d160febb9f830a26f0daefdc", + ) + + patch( + "fix-linking-against-llvm-10.patch", + when="@1.13.0:1.13", + sha256="d3ccf547d3ba59779fd375e10417a436318f2200d160febb9f830a26f0daefdc", + ) + + def setup_build_environment(self, env): + if self.spec.satisfies("@1.18.0:"): + env.append_flags("LDFLAGS", "-lcurses") + env.append_flags("LDFLAGS", "-ltinfo") + env.append_flags("LDFLAGS", "-lz") + + def patch(self): + with open("check-m32.c", "w") as f: + f.write("#include ") + try: + Executable(self.compiler.cc)("-m32", "-shared", "check-m32.c", error=str) + except ProcessError: + filter_file("bit 32 64", "bit 64", "cmake/GenerateBuiltins.cmake") + + def cmake_args(self): + spec = self.spec + args = [] + args.append("-DISPC_NO_DUMPS=ON") # otherwise, LLVM needs patching + args.append("-DCURSES_NEED_NCURSES=TRUE") + args.append("-DISPC_INCLUDE_EXAMPLES=OFF") + args.append("-DISPC_INCLUDE_TESTS=OFF") + args.append("-DISPC_INCLUDE_UTILS=OFF") + if spec.satisfies("target=x86_64:") or spec.satisfies("target=x86:"): + args.append("-DARM_ENABLED=OFF") + elif spec.satisfies("target=aarch64:"): + args.append("-DARM_ENABLED=ON") + return args + + @run_after("install") + def check_install(self): + with working_dir(self.stage.source_path): + ispc = Executable(join_path(self.prefix, "bin", "ispc")) + ispc("--version") + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"^Intel.*[iI][sS][pP][cC]\),\s+(\S+)\s+\(build.*\)", output) + return match.group(1) if match else None diff --git a/recipes/paraview/repo/packages/paraview/FindFreetype.cmake.patch b/recipes/paraview/repo/packages/paraview/FindFreetype.cmake.patch new file mode 100644 index 00000000..ebb5f7c2 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/FindFreetype.cmake.patch @@ -0,0 +1,35 @@ +diff --git a/VTK/CMake/FindFreetype.cmake b/VTK/CMake/FindFreetype.cmake +index b4532735c2..f06d32327e 100644 +--- a/VTK/CMake/FindFreetype.cmake ++++ b/VTK/CMake/FindFreetype.cmake +@@ -63,6 +63,30 @@ directory of a Freetype installation. + # I'm going to attempt to cut out the middleman and hope + # everything still works. + ++find_package(freetype CONFIG) # foward `QUIET`, version, and components here, but not `REQUIRED` ++if (freetype_FOUND) ++ if (NOT TARGET Freetype::Freetype) ++ # make target chain to target from config mode ++ get_target_property(freetype_library_type freetype TYPE) ++ get_target_property(freetype_location freetype LOCATION) ++ if (freetype_library_type STREQUAL STATIC_LIBRARY) ++ set(freetype_library_type STATIC) ++ endif() ++ get_target_property(freetype_interface_include_directories freetype INTERFACE_INCLUDE_DIRECTORIES) ++ get_target_property(freetype_interface_link_libraries freetype INTERFACE_LINK_LIBRARIES) ++ add_library(Freetype::Freetype "${freetype_library_type}" IMPORTED) ++ set_target_properties(Freetype::Freetype PROPERTIES ++ INTERFACE_INCLUDE_DIRECTORIES "${freetype_interface_include_directories}" ++ INTERFACE_LINK_LIBRARIES "${freetype_interface_link_libraries}" ++ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" ++ IMPORTED_LOCATION "${freetype_location}") ++ endif () ++ set(FREETYPE_INCLUDE_DIRS "${freetype_interface_include_directories}") ++ set(FREETYPE_LIBRARIES "${freetype_interface_link_libraries}") ++ set(Freetype_FOUND 1) # might need to also forward the version found ++ return () ++endif () ++ + set(FREETYPE_FIND_ARGS + HINTS + ENV FREETYPE_DIR diff --git a/recipes/paraview/repo/packages/paraview/adios2-remove-deprecated-functions.patch b/recipes/paraview/repo/packages/paraview/adios2-remove-deprecated-functions.patch new file mode 100644 index 00000000..d90b8402 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/adios2-remove-deprecated-functions.patch @@ -0,0 +1,31 @@ +From fdb93d3e9d447b9dd6ce5c77aca18396cf9b6aa3 Mon Sep 17 00:00:00 2001 +From: Vicente Bolea +Date: Mon, 3 Apr 2023 12:58:58 -0400 +Subject: [PATCH] Update /VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx + +--- + VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx b/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx +index 5d58905a88..3ce039345a 100644 +--- a/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx ++++ b/VTK/IO/ADIOS2/vtkADIOS2CoreImageReader.cxx +@@ -361,12 +361,12 @@ bool vtkADIOS2CoreImageReader::OpenAndReadMetaData() + vtkMPICommunicator* comm = + static_cast(this->Controller->GetCommunicator()); + +- this->Impl->Adios.reset(new adios2::ADIOS(*comm->GetMPIComm()->GetHandle(), adios2::DebugON)); ++ this->Impl->Adios.reset(new adios2::ADIOS(*comm->GetMPIComm()->GetHandle())); + #else + // Make sure the ADIOS subsystem is initialized before processing any + // sort of request. + +- this->Impl->Adios.reset(new adios2::ADIOS(adios2::DebugON)); ++ this->Impl->Adios.reset(new adios2::ADIOS()); + // Before processing any request, read the meta data first + #endif + } +-- +2.35.3 + diff --git a/recipes/paraview/repo/packages/paraview/catalyst-etc_oneapi_fix.patch b/recipes/paraview/repo/packages/paraview/catalyst-etc_oneapi_fix.patch new file mode 100644 index 00000000..18f015f5 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/catalyst-etc_oneapi_fix.patch @@ -0,0 +1,45 @@ +diff --git a/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h b/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h +index f0902169..86eb72e7 100644 +--- a/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h ++++ b/ThirdParty/catalyst/vtkcatalyst/catalyst/thirdparty/conduit/fmt/conduit_fmt/format.h +@@ -1726,7 +1726,7 @@ OutputIt write_nonfinite(OutputIt out, bool isinf, + auto str = + isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan"); + constexpr size_t str_size = 3; +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + auto size = str_size + (sign ? 1 : 0); + using iterator = remove_reference_t; + return write_padded(out, specs, size, [=](iterator it) { +@@ -1807,7 +1807,7 @@ OutputIt write_float(OutputIt out, const DecimalFP& fp, + auto significand = fp.significand; + int significand_size = get_significand_size(fp); + static const Char zero = static_cast('0'); +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + size_t size = to_unsigned(significand_size) + (sign ? 1 : 0); + using iterator = remove_reference_t; + + +diff --git a/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h b/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h +index 5398a23a..108b4f90 100644 +--- a/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h ++++ b/VTK/ThirdParty/fmt/vtkfmt/vtkfmt/format.h +@@ -1587,7 +1587,7 @@ auto write_nonfinite(OutputIt out, bool isinf, basic_format_specs specs, + auto str = + isinf ? (fspecs.upper ? "INF" : "inf") : (fspecs.upper ? "NAN" : "nan"); + constexpr size_t str_size = 3; +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + auto size = str_size + (sign ? 1 : 0); + // Replace '0'-padding with space for non-finite values. + const bool is_zero_fill = +@@ -1673,7 +1673,7 @@ auto write_float(OutputIt out, const DecimalFP& fp, + auto significand = fp.significand; + int significand_size = get_significand_size(fp); + static const Char zero = static_cast('0'); +- auto sign = fspecs.sign; ++ auto sign = static_cast(fspecs.sign); + size_t size = to_unsigned(significand_size) + (sign ? 1 : 0); + using iterator = reserve_iterator; + diff --git a/recipes/paraview/repo/packages/paraview/copy.yaml b/recipes/paraview/repo/packages/paraview/copy.yaml deleted file mode 100644 index 6f211bd8..00000000 --- a/recipes/paraview/repo/packages/paraview/copy.yaml +++ /dev/null @@ -1 +0,0 @@ -patches: true diff --git a/recipes/paraview/repo/packages/paraview/gcc-compiler-pv501.patch b/recipes/paraview/repo/packages/paraview/gcc-compiler-pv501.patch new file mode 100644 index 00000000..bb3be183 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/gcc-compiler-pv501.patch @@ -0,0 +1,22 @@ +--- ParaView-5.0.1.orig/VTK/CMake/vtkCompilerExtras.cmake 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/vtkCompilerExtras.cmake 2016-12-13 17:21:25.382720945 +0100 +@@ -32,7 +32,7 @@ + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) + +- string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + if(NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).*([34]\\.[0-9]).*" "\\1.0" +--- ParaView-5.0.1.orig/VTK/CMake/GenerateExportHeader.cmake 2016-03-28 17:07:10.000000000 +0200 ++++ ParaView-5.0.1/VTK/CMake/GenerateExportHeader.cmake 2016-12-13 17:21:25.382720945 +0100 +@@ -166,7 +166,7 @@ + execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version + OUTPUT_VARIABLE _gcc_version_info + ERROR_VARIABLE _gcc_version_info) +- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*" ++ string(REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]*" + _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the + # patch level, handle this here: diff --git a/recipes/paraview/repo/packages/paraview/h5part-parallel.patch b/recipes/paraview/repo/packages/paraview/h5part-parallel.patch new file mode 100644 index 00000000..7146fffc --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/h5part-parallel.patch @@ -0,0 +1,11 @@ +--- a/VTK/ThirdParty/h5part/vtkh5part/src/H5PartTypes.h 2020-10-12 17:56:08.942848601 -0400 ++++ b/VTK/ThirdParty/h5part/vtkh5part/src/H5PartTypes.h 2020-10-12 17:56:50.656772295 -0400 +@@ -19,7 +19,7 @@ + #endif + ; + +-#ifndef PARALLEL_IO ++#if !(defined(PARALLEL_IO) || defined(H5_HAVE_PARALLEL)) + typedef unsigned long MPI_Comm; + #endif + diff --git a/recipes/paraview/repo/packages/paraview/paraview-gcc11-limits.patch b/recipes/paraview/repo/packages/paraview/paraview-gcc11-limits.patch new file mode 100644 index 00000000..30103620 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/paraview-gcc11-limits.patch @@ -0,0 +1,49 @@ +Index: ParaView-v5.9.1/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h ++++ ParaView-v5.9.1/VTK/Common/Core/vtkGenericDataArrayLookupHelper.h +@@ -25,6 +25,7 @@ + #include "vtkIdList.h" + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Rendering/Core/vtkColorTransferFunction.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Rendering/Core/vtkColorTransferFunction.cxx ++++ ParaView-v5.9.1/VTK/Rendering/Core/vtkColorTransferFunction.cxx +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Common/DataModel/vtkPiecewiseFunction.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Common/DataModel/vtkPiecewiseFunction.cxx ++++ ParaView-v5.9.1/VTK/Common/DataModel/vtkPiecewiseFunction.cxx +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include + +Index: ParaView-v5.9.1/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +=================================================================== +--- ParaView-v5.9.1.orig/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx ++++ ParaView-v5.9.1/VTK/Filters/HyperTree/vtkHyperTreeGridThreshold.cxx +@@ -27,6 +27,7 @@ + #include "vtkHyperTreeGridNonOrientedCursor.h" + + #include ++#include + + vtkStandardNewMacro(vtkHyperTreeGridThreshold); + + diff --git a/recipes/paraview/repo/packages/paraview/stl-reader-pv440.patch b/recipes/paraview/repo/packages/paraview/stl-reader-pv440.patch new file mode 100644 index 00000000..06907fd8 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/stl-reader-pv440.patch @@ -0,0 +1,11 @@ +--- ParaView-4.4.0.orig/VTK/IO/Geometry/vtkSTLReader.cxx 2015-09-11 19:59:24.000000000 +0200 ++++ ParaView-4.4.0/VTK/IO/Geometry/vtkSTLReader.cxx 2016-06-19 12:59:50.769770143 +0200 +@@ -448,7 +448,7 @@ + done = done || (fscanf(fp,"%s", line)==EOF); + } + } +- if (!done) ++ else if (!done) + { + done = (fgets(line, 255, fp) == 0); + lineCount++; diff --git a/recipes/paraview/repo/packages/paraview/ui_pqExportStateWizard.patch b/recipes/paraview/repo/packages/paraview/ui_pqExportStateWizard.patch new file mode 100644 index 00000000..2983af56 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/ui_pqExportStateWizard.patch @@ -0,0 +1,11 @@ +--- ParaView-5.0.1.orig/Qt/Components/CMakeLists.txt 2016-03-28 17:07:03.000000000 +0200 ++++ ParaView-5.0.1/Qt/Components/CMakeLists.txt 2016-12-13 17:38:42.713553032 +0100 +@@ -656,7 +656,7 @@ + #the pqSGExportStateWizard has subclasses that directly access + #the UI file, and currently we don't have a clean way to break this hard + #dependency, so for no we install this ui file. +-if(PARAVIEW_INSTALL_DEVELOPMENT_FILES) ++if(PARAVIEW_INSTALL_DEVELOPMENT_FILES AND PARAVIEW_ENABLE_PYTHON) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ui_pqExportStateWizard.h" + DESTINATION "${VTK_INSTALL_INCLUDE_DIR}") + endif() diff --git a/recipes/paraview/repo/packages/paraview/vtk-adios2-module-no-kit.patch b/recipes/paraview/repo/packages/paraview/vtk-adios2-module-no-kit.patch new file mode 100644 index 00000000..ab30e9f8 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/vtk-adios2-module-no-kit.patch @@ -0,0 +1,24 @@ +From 19cd0302104e94421813427071351aa5326e4dbb Mon Sep 17 00:00:00 2001 +From: Ryan Krattiger +Date: Thu, 2 Dec 2021 16:58:10 -0600 +Subject: [PATCH] ADIOS2: Move IOADIOS2 to StandAlone kit + +--- + IO/ADIOS2/vtk.module | 2 - + 1 files changed, 0 insertions(+), 2 deletions(-) + +diff --git a/VTK/IO/ADIOS2/vtk.module b/VTK/IO/ADIOS2/vtk.module +index 5ee89b9a65e..b89e54d7683 100644 +--- a/VTK/IO/ADIOS2/vtk.module ++++ b/VTK/IO/ADIOS2/vtk.module +@@ -3,7 +3,5 @@ NAME + LIBRARY_NAME + vtkIOADIOS2 +-KIT +- VTK::IO + DEPENDS + VTK::CommonCore + VTK::CommonExecutionModel +-- +GitLab + diff --git a/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.1.patch b/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.1.patch new file mode 100644 index 00000000..bfeeb9c0 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.1.patch @@ -0,0 +1,61 @@ +From 3a536a3c6b949cb1c9dd147c3a395c3ff31856e8 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Thu, 14 Apr 2022 12:53:36 -0400 +Subject: [PATCH 1/6] xdmf2: install `XdmfExport.h` + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt +index 274dbc4423c..a47bf4ee4d9 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/CMakeLists.txt +@@ -276,6 +276,7 @@ vtk_module_add_module(VTK::xdmf2 + ${XdmfModelSource} + SOURCES ${XdmfExtraSource} + HEADERS Xdmf.h ++ XdmfExport.h + "${CMAKE_CURRENT_BINARY_DIR}/XdmfConfig.h" + HEADERS_SUBDIR "vtkxdmf2/libsrc") + set_target_properties(xdmf2 +-- +GitLab + + +From 1456c9e6ab2b244d225dcfc0a7f985933c09d5f3 Mon Sep 17 00:00:00 2001 +From: Ben Boeckel +Date: Thu, 14 Apr 2022 15:20:13 -0400 +Subject: [PATCH 6/6] xdmf2: support HDF5 1.13.1 + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +index 6a4966bb231..1a412b56d02 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +@@ -156,6 +156,9 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd + } + + static const H5FD_class_t H5FD_dsm_g = { ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ H5_VFD_RESERVED + 0xd3f2, /*value */ ++#endif + "dsm", /*name */ + MAXADDR, /*maxaddr */ + H5F_CLOSE_WEAK, /*fc_degree */ +@@ -193,6 +196,10 @@ static const H5FD_class_t H5FD_dsm_g = { + #endif + NULL, /*lock */ + NULL, /*unlock */ ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ NULL, /*del */ ++ NULL, /*ctl */ ++#endif + H5FD_FLMAP_SINGLE /*fl_map */ + }; + +-- +GitLab diff --git a/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.2.patch b/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.2.patch new file mode 100644 index 00000000..54186671 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/vtk-xdmf2-hdf51.13.2.patch @@ -0,0 +1,36 @@ +From 2cc0d020359f714587d14b2f25a2c5f235f829c9 Mon Sep 17 00:00:00 2001 +From: Ryan Krattiger +Date: Tue, 15 Nov 2022 15:00:36 -0600 +Subject: [PATCH] Xdmf2: Update HDF5 driver for 1.13.2 + +--- + VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +index 1a412b56d02..ff4427d0265 100644 +--- a/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx ++++ b/VTK/ThirdParty/xdmf2/vtkxdmf2/libsrc/XdmfH5Driver.cxx +@@ -157,6 +157,7 @@ static herr_t H5FD_dsm_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd + + static const H5FD_class_t H5FD_dsm_g = { + #if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ 0, /*version */ + H5_VFD_RESERVED + 0xd3f2, /*value */ + #endif + "dsm", /*name */ +@@ -190,6 +191,12 @@ static const H5FD_class_t H5FD_dsm_g = { + NULL, /*get_handle */ + H5FD_dsm_read, /*read */ + H5FD_dsm_write, /*write */ ++#if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=13)) ++ NULL, /*read_vector */ ++ NULL, /*write_vector */ ++ NULL, /*read_selection */ ++ NULL, /*write_selection */ ++#endif + NULL, /*flush */ + #if (H5_VERS_MAJOR>1)||((H5_VERS_MAJOR==1)&&(H5_VERS_MINOR>=8)) + NULL, /* truncate */ +-- +GitLab diff --git a/recipes/paraview/repo/packages/paraview/vtkm-catalyst-pv551.patch b/recipes/paraview/repo/packages/paraview/vtkm-catalyst-pv551.patch new file mode 100644 index 00000000..8c888374 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/vtkm-catalyst-pv551.patch @@ -0,0 +1,510 @@ +# The VTK-m changes are slated for paraview-5.5.x +# +# The catalyst changes (the working directory for output) are slated for +# paraview-5.6. +# They are API-compatible with paraview-5.5 but not ABI compatible. +# +# https://gitlab.kitware.com/vtk/vtk-m/merge_requests/1166 +# https://gitlab.kitware.com/paraview/paraview/merge_requests/2433 +# https://gitlab.kitware.com/paraview/paraview/merge_requests/2436 +# +--- ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/VTK/ThirdParty/vtkm/vtk-m/CMake/VTKmDetermineVersion.cmake 2018-04-23 12:00:23.708544206 +0200 +@@ -51,6 +51,8 @@ + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE) ++ else() ++ set(output) + endif() + else() + set(result 0) +@@ -75,7 +77,7 @@ + + # Extracts components from a version string. See determine_version() for usage. + function(extract_version_components version_string var_prefix) +- string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" ++ string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)$" + version_matches "${version_string}") + if(CMAKE_MATCH_0) + set(full ${CMAKE_MATCH_0}) +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.cxx 2018-05-11 12:02:26.894772713 +0200 +@@ -38,6 +38,7 @@ + #include "vtkStringArray.h" + + #include ++#include + + struct vtkCPProcessorInternals + { +@@ -47,12 +48,13 @@ + }; + + vtkStandardNewMacro(vtkCPProcessor); +-vtkMultiProcessController* vtkCPProcessor::Controller = NULL; ++vtkMultiProcessController* vtkCPProcessor::Controller = nullptr; + //---------------------------------------------------------------------------- + vtkCPProcessor::vtkCPProcessor() + { + this->Internal = new vtkCPProcessorInternals; +- this->InitializationHelper = NULL; ++ this->InitializationHelper = nullptr; ++ this->WorkingDirectory = nullptr; + } + + //---------------------------------------------------------------------------- +@@ -61,14 +63,15 @@ + if (this->Internal) + { + delete this->Internal; +- this->Internal = NULL; ++ this->Internal = nullptr; + } + + if (this->InitializationHelper) + { + this->InitializationHelper->Delete(); +- this->InitializationHelper = NULL; ++ this->InitializationHelper = nullptr; + } ++ this->SetWorkingDirectory(nullptr); + } + + //---------------------------------------------------------------------------- +@@ -95,7 +98,7 @@ + { + if (which < 0 || which >= this->GetNumberOfPipelines()) + { +- return NULL; ++ return nullptr; + } + int counter = 0; + vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin(); +@@ -108,7 +111,7 @@ + counter++; + iter++; + } +- return NULL; ++ return nullptr; + } + + //---------------------------------------------------------------------------- +@@ -130,17 +133,41 @@ + } + + //---------------------------------------------------------------------------- +-int vtkCPProcessor::Initialize() ++int vtkCPProcessor::Initialize(const char* workingDirectory) + { +- if (this->InitializationHelper == NULL) ++ if (this->InitializationHelper == nullptr) + { + this->InitializationHelper = this->NewInitializationHelper(); + } ++ // make sure the directory exists here so that we only do it once ++ if (workingDirectory) ++ { ++ vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController(); ++ int success = 1; ++ if (controller == nullptr || controller->GetLocalProcessId() == 0) ++ { ++ success = vtksys::SystemTools::MakeDirectory(workingDirectory) == true ? 1 : 0; ++ if (success == 0) ++ { ++ vtkWarningMacro("Could not make " ++ << workingDirectory << " directory. " ++ << "Results will be generated in current working directory instead."); ++ } ++ } ++ if (controller) ++ { ++ controller->Broadcast(&success, 1, 0); ++ } ++ if (success) ++ { ++ this->SetWorkingDirectory(workingDirectory); ++ } ++ } + return 1; + } + + //---------------------------------------------------------------------------- +-int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm) ++int vtkCPProcessor::Initialize(vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory) + { + #ifdef PARAVIEW_USE_MPI + if (vtkCPProcessor::Controller) +@@ -148,7 +175,7 @@ + vtkErrorMacro("Can only initialize with a communicator once per process."); + return 0; + } +- if (this->InitializationHelper == NULL) ++ if (this->InitializationHelper == nullptr) + { + vtkMPICommunicator* communicator = vtkMPICommunicator::New(); + communicator->InitializeExternal(&comm); +@@ -157,12 +184,12 @@ + this->Controller = controller; + this->Controller->SetGlobalController(controller); + communicator->Delete(); +- return this->Initialize(); ++ return this->Initialize(workingDirectory); + } + return 1; + #else + static_cast(&comm); // get rid of variable not used warning +- return this->Initialize(); ++ return this->Initialize(workingDirectory); + #endif + } + +@@ -225,6 +252,13 @@ + input->GetFieldData()->AddArray(catalystChannel); + } + } ++ ++ std::string originalWorkingDirectory; ++ if (this->WorkingDirectory) ++ { ++ originalWorkingDirectory = vtksys::SystemTools::GetCurrentWorkingDirectory(); ++ vtksys::SystemTools::ChangeDirectory(this->WorkingDirectory); ++ } + for (vtkCPProcessorInternals::PipelineListIterator iter = this->Internal->Pipelines.begin(); + iter != this->Internal->Pipelines.end(); iter++) + { +@@ -248,6 +282,10 @@ + } + } + } ++ if (originalWorkingDirectory.empty() == false) ++ { ++ vtksys::SystemTools::ChangeDirectory(originalWorkingDirectory); ++ } + // we want to reset everything here to make sure that new information + // is properly passed in the next time. + dataDescription->ResetAll(); +@@ -259,7 +297,7 @@ + { + if (this->Controller) + { +- this->Controller->SetGlobalController(NULL); ++ this->Controller->SetGlobalController(nullptr); + this->Controller->Finalize(1); + this->Controller->Delete(); + } +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPProcessor.h 2018-05-11 12:02:26.894772713 +0200 +@@ -76,14 +76,16 @@ + virtual void RemoveAllPipelines(); + + /// Initialize the co-processor. Returns 1 if successful and 0 +- /// otherwise. + /// otherwise. If Catalyst is built with MPI then Initialize() + /// can also be called with a specific MPI communicator if + /// MPI_COMM_WORLD isn't the proper one. Catalyst is initialized +- /// to use MPI_COMM_WORLD by default. +- virtual int Initialize(); ++ /// to use MPI_COMM_WORLD by default. Both methods have an optional ++ /// workingDirectory argument which will set *WorkingDirectory* so ++ /// that files will be put relative to this directory. ++ virtual int Initialize(const char* workingDirectory = nullptr); + #ifndef __WRAP__ +- virtual int Initialize(vtkMPICommunicatorOpaqueComm& comm); ++ virtual int Initialize( ++ vtkMPICommunicatorOpaqueComm& comm, const char* workingDirectory = nullptr); + #endif + + /// The Catalyst input field data string array name. This array will +@@ -111,6 +113,13 @@ + /// implementation an opportunity to clean up, before it is destroyed. + virtual int Finalize(); + ++ /// Get the current working directory for outputting Catalyst files. ++ /// If not set then Catalyst output files will be relative to the ++ /// current working directory. This will not affect where Catalyst ++ /// looks for Python scripts. *WorkingDirectory* gets set through ++ /// the *Initialize()* methods. ++ vtkGetStringMacro(WorkingDirectory); ++ + protected: + vtkCPProcessor(); + virtual ~vtkCPProcessor(); +@@ -118,6 +127,11 @@ + /// Create a new instance of the InitializationHelper. + virtual vtkObject* NewInitializationHelper(); + ++ /// Set the current working directory for outputting Catalyst files. ++ /// This is a protected method since simulation code adaptors should ++ /// set this through the *Initialize()* methods. ++ vtkSetStringMacro(WorkingDirectory); ++ + private: + vtkCPProcessor(const vtkCPProcessor&) = delete; + void operator=(const vtkCPProcessor&) = delete; +@@ -125,6 +139,7 @@ + vtkCPProcessorInternals* Internal; + vtkObject* InitializationHelper; + static vtkMultiProcessController* Controller; ++ char* WorkingDirectory; + }; + + #endif +--- ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/CoProcessing/Catalyst/vtkCPXMLPWriterPipeline.cxx 2018-05-11 12:02:26.894772713 +0200 +@@ -31,6 +31,7 @@ + #include + #include + ++#include + #include + #include + +@@ -174,7 +175,7 @@ + + for (unsigned int i = 0; i < dataDescription->GetNumberOfInputDescriptions(); i++) + { +- const char* inputName = dataDescription->GetInputDescriptionName(i); ++ std::string inputName = dataDescription->GetInputDescriptionName(i); + vtkCPInputDataDescription* idd = dataDescription->GetInputDescription(i); + vtkDataObject* grid = idd->GetGrid(); + if (grid == nullptr) +@@ -206,6 +207,8 @@ + vtkSMStringVectorProperty* fileName = + vtkSMStringVectorProperty::SafeDownCast(writer->GetProperty("FileName")); + ++ // If we have a / in the channel name we take it out of the filename we're going to write to ++ inputName.erase(std::remove(inputName.begin(), inputName.end(), '/'), inputName.end()); + std::ostringstream o; + if (this->Path.empty() == false) + { +--- ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py.orig 2018-04-06 22:03:33.000000000 +0200 ++++ ParaView-v5.5.0/Wrapping/Python/paraview/coprocessing.py 2018-05-11 12:02:27.038772408 +0200 +@@ -11,22 +11,12 @@ + from paraview.vtk.vtkPVVTKExtensionsCore import * + import math + +-# ----------------------------------------------------------------------------- +-def IsInModulo(timestep, frequencyArray): +- """ +- Return True if the given timestep is in one of the provided frequency. +- This can be interpreted as follow:: +- +- isFM = IsInModulo(timestep, [2,3,7]) +- +- is similar to:: ++# If the user created a filename in a location that doesn't exist by default we'll ++# make the directory for them. This can be changed though by setting createDirectoriesIfNeeded ++# to False. ++createDirectoriesIfNeeded = True + +- isFM = (timestep % 2 == 0) or (timestep % 3 == 0) or (timestep % 7 == 0) +- """ +- for frequency in frequencyArray: +- if frequency > 0 and (timestep % frequency == 0): +- return True +- return False ++# ----------------------------------------------------------------------------- + + class CoProcessor(object): + """Base class for co-processing Pipelines. +@@ -68,6 +58,9 @@ + self.__CinemaTracks = {} + self.__InitialFrequencies = {} + self.__PrintEnsightFormatString = False ++ self.__TimeStepToStartOutputAt=0 ++ self.__ForceOutputAtFirstCall=False ++ self.__FirstTimeStepIndex = None + + def SetPrintEnsightFormatString(self, enable): + """If outputting ExodusII files with the purpose of reading them into +@@ -87,6 +80,17 @@ + "Incorrect argument type: %s, must be a dict" % type(frequencies)) + self.__InitialFrequencies = frequencies + ++ def SetInitialOutputOptions(self, timeStepToStartOutputAt, forceOutputAtFirstCall): ++ """Set the frequencies at which the pipeline needs to be updated. ++ Typically, this is called by the subclass once it has determined what ++ timesteps co-processing will be needed to be done. ++ frequencies is a map, with key->string name of for the simulation ++ input, and value is a list of frequencies. ++ """ ++ ++ self.__TimeStepToStartOutputAt=timeStepToStartOutputAt ++ self.__ForceOutputAtFirstCall=forceOutputAtFirstCall ++ + def EnableLiveVisualization(self, enable, frequency = 1): + """Call this method to enable live-visualization. When enabled, + DoLiveVisualization() will communicate with ParaView server if possible +@@ -115,7 +119,7 @@ + # if this is a time step to do live then all of the inputs + # must be made available. note that we want the pipeline built + # before we do the actual first live connection. +- if self.__EnableLiveVisualization and timestep % self.__LiveVisualizationFrequency == 0 \ ++ if self.__EnableLiveVisualization and self.NeedToOutput(timestep, self.__LiveVisualizationFrequency) \ + and self.__LiveVisualizationLink: + if self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()): + num_inputs = datadescription.GetNumberOfInputDescriptions() +@@ -132,13 +136,13 @@ + # hasn't been set up yet). If we don't have live enabled + # we know that the output frequencies aren't changed and can + # just use the initial frequencies. +- if self.__InitialFrequencies or not self.__EnableLiveVisualization: ++ if self.__ForceOutputAtFirstCall or self.__InitialFrequencies or not self.__EnableLiveVisualization: + num_inputs = datadescription.GetNumberOfInputDescriptions() + for cc in range(num_inputs): + input_name = datadescription.GetInputDescriptionName(cc) + + freqs = self.__InitialFrequencies.get(input_name, []) +- if self.__EnableLiveVisualization or ( self and IsInModulo(timestep, freqs) ): ++ if self.__EnableLiveVisualization or ( self and self.IsInModulo(timestep, freqs) ): + datadescription.GetInputDescription(cc).AllFieldsOn() + datadescription.GetInputDescription(cc).GenerateMeshOn() + else: +@@ -149,15 +153,14 @@ + for writer in self.__WritersList: + frequency = writer.parameters.GetProperty( + "WriteFrequency").GetElement(0) +- if (timestep % frequency) == 0 or \ +- datadescription.GetForceOutput() == True: ++ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True: + writerinputs = cpstate.locate_simulation_inputs(writer) + for writerinput in writerinputs: + datadescription.GetInputDescriptionByName(writerinput).AllFieldsOn() + datadescription.GetInputDescriptionByName(writerinput).GenerateMeshOn() + + for view in self.__ViewsList: +- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \ ++ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \ + datadescription.GetForceOutput() == True: + viewinputs = cpstate.locate_simulation_inputs_for_view(view) + for viewinput in viewinputs: +@@ -192,8 +195,7 @@ + for writer in self.__WritersList: + frequency = writer.parameters.GetProperty( + "WriteFrequency").GetElement(0) +- if (timestep % frequency) == 0 or \ +- datadescription.GetForceOutput() == True: ++ if self.NeedToOutput(timestep, frequency) or datadescription.GetForceOutput() == True: + fileName = writer.parameters.GetProperty("FileName").GetElement(0) + paddingamount = writer.parameters.GetProperty("PaddingAmount").GetElement(0) + helperName = writer.GetXMLName() +@@ -203,6 +205,23 @@ + else: + ts = str(timestep).rjust(paddingamount, '0') + writer.FileName = fileName.replace("%t", ts) ++ if '/' in writer.FileName and createDirectoriesIfNeeded: ++ oktowrite = [1.] ++ import vtk ++ comm = vtk.vtkMultiProcessController.GetGlobalController() ++ if comm.GetLocalProcessId() == 0: ++ import os ++ newDir = writer.FileName[0:writer.FileName.rfind('/')] ++ try: ++ os.makedirs(newDir) ++ except OSError: ++ if not os.path.isdir(newDir): ++ print ("ERROR: Cannot make directory for", writer.FileName, ". No data will be written.") ++ oktowrite[0] = 0. ++ comm.Broadcast(oktowrite, 1, 0) ++ if oktowrite[0] == 0: ++ # we can't make the directory so no reason to update the pipeline ++ return + writer.UpdatePipeline(datadescription.GetTime()) + + def WriteImages(self, datadescription, rescale_lookuptable=False, +@@ -240,7 +259,7 @@ + + cinema_dirs = [] + for view in self.__ViewsList: +- if (view.cpFrequency and timestep % view.cpFrequency == 0) or \ ++ if (view.cpFrequency and self.NeedToOutput(timestep, view.cpFrequency)) or \ + datadescription.GetForceOutput() == True: + fname = view.cpFileName + ts = str(timestep).rjust(padding_amount, '0') +@@ -267,6 +286,24 @@ + if dirname: + cinema_dirs.append(dirname) + else: ++ if '/' in fname and createDirectoriesIfNeeded: ++ oktowrite = [1.] ++ import vtk ++ comm = vtk.vtkMultiProcessController.GetGlobalController() ++ if comm.GetLocalProcessId() == 0: ++ import os ++ newDir = fname[0:fname.rfind('/')] ++ try: ++ os.makedirs(newDir) ++ except OSError: ++ if not os.path.isdir(newDir): ++ print ("ERROR: Cannot make directory for", fname, ". No image will be output.") ++ oktowrite[0] = 0. ++ comm.Broadcast(oktowrite, 1, 0) ++ if oktowrite[0] == 0: ++ # we can't make the directory so no reason to update the pipeline ++ return ++ + if image_quality is None and fname.endswith('png'): + # for png quality = 0 means no compression. compression can be a potentially + # very costly serial operation on process 0 +@@ -307,7 +344,7 @@ + + + timeStep = datadescription.GetTimeStep() +- if self.__EnableLiveVisualization and timeStep % self.__LiveVisualizationFrequency == 0: ++ if self.__EnableLiveVisualization and self.NeedToOutput(timeStep, self.__LiveVisualizationFrequency): + if not self.__LiveVisualizationLink.Initialize(servermanager.ActiveConnection.Session.GetSessionProxyManager()): + return + +@@ -412,7 +449,7 @@ + """ + controller = servermanager.ParaViewPipelineController() + # assume that a client only proxy with the same name as a writer +- # is available in "insitu_writer_paramters" ++ # is available in "insitu_writer_parameters" + + # Since coprocessor sometimes pass writer as a custom object and not + # a proxy, we need to handle that. Just creating any arbitrary writer +@@ -666,3 +703,42 @@ + #restore what we showed + pv_introspect.restore_visibility(pxystate) + return os.path.basename(vfname) ++ ++ def IsInModulo(self, timestep, frequencies): ++ """ ++ Return True if the given timestep is in one of the provided frequency. ++ This can be interpreted as follow:: ++ ++ isFM = IsInModulo(timestep-timeStepToStartOutputAt, [2,3,7]) ++ ++ is similar to:: ++ ++ isFM = (timestep-timeStepToStartOutputAt % 2 == 0) or (timestep-timeStepToStartOutputAt % 3 == 0) or (timestep-timeStepToStartOutputAt % 7 == 0) ++ ++ The timeStepToStartOutputAt is the first timestep that will potentially be output. ++ """ ++ if timestep < self.__TimeStepToStartOutputAt and not self.__ForceOutputAtFirstCall: ++ return False ++ for frequency in frequencies: ++ if frequency > 0 and self.NeedToOutput(timestep, frequency): ++ return True ++ ++ return False ++ ++ ++ def NeedToOutput(self, timestep, frequency): ++ """ ++ Return True if we need to output based on the input timestep and frequency. Checks based ++ __FirstTimeStepIndex, __FirstTimeStepIndex, __ForceOutputAtFirstCall and __TimeStepToStartOutputAt ++ member variables. ++ """ ++ if self.__FirstTimeStepIndex == None: ++ self.__FirstTimeStepIndex = timestep ++ ++ if self.__ForceOutputAtFirstCall and self.__FirstTimeStepIndex == timestep: ++ return True ++ ++ if self.__TimeStepToStartOutputAt <= timestep and (timestep-self.__TimeStepToStartOutputAt) % frequency == 0: ++ return True ++ ++ return False diff --git a/recipes/paraview/repo/packages/paraview/vtkm-findmpi-downstream.patch b/recipes/paraview/repo/packages/paraview/vtkm-findmpi-downstream.patch new file mode 100644 index 00000000..31356ea5 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/vtkm-findmpi-downstream.patch @@ -0,0 +1,51 @@ +From 5bf0eff1563820d7c997649da372ab003fd4af81 Mon Sep 17 00:00:00 2001 +From: Chuck Atkins +Date: Mon, 15 Feb 2021 13:59:50 -0500 +Subject: [PATCH] CMake: Fix FindMPI getting consumed by newer CMake versions + +--- + CMake/patches/FindMPI.cmake | 11 +++++++++++ + CMakeLists.txt | 7 ++++++- + 2 files changed, 17 insertions(+), 1 deletion(-) + create mode 100644 CMake/patches/FindMPI.cmake + +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake +new file mode 100644 +index 000000000..a4ed44f04 +--- /dev/null ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake/patches/FindMPI.cmake +@@ -0,0 +1,11 @@ ++#------------------------------------------------------------------------------# ++# Distributed under the OSI-approved Apache License, Version 2.0. See ++# accompanying file Copyright.txt for details. ++#------------------------------------------------------------------------------# ++ ++# This module is already included in new versions of CMake ++if(CMAKE_VERSION VERSION_LESS 3.15) ++ include(${CMAKE_CURRENT_LIST_DIR}/3.15/FindMPI.cmake) ++else() ++ include(${CMAKE_ROOT}/Modules/FindMPI.cmake) ++endif() +diff --git a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt +index e907495f3..fa464ab8d 100644 +--- a/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt ++++ b/VTK/ThirdParty/vtkm/vtkvtkm/vtk-m/CMakeLists.txt +@@ -277,9 +277,14 @@ if(NOT VTKm_INSTALL_ONLY_LIBRARIES) + FILES + ${VTKm_SOURCE_DIR}/CMake/VTKmCMakeBackports.cmake + ${VTKm_SOURCE_DIR}/CMake/FindTBB.cmake +- ${VTKm_SOURCE_DIR}/CMake/patches/3.15/FindMPI.cmake ++ ${VTKm_SOURCE_DIR}/CMake/patches/FindMPI.cmake + DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR} + ) ++ install( ++ FILES ++ ${VTKm_SOURCE_DIR}/CMake/patches/3.15/FindMPI.cmake ++ DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}/3.15 ++ ) + + # Install support files. + install( +-- +2.24.2 + diff --git a/recipes/paraview/repo/packages/paraview/xlc-compilation-pv590.patch b/recipes/paraview/repo/packages/paraview/xlc-compilation-pv590.patch new file mode 100644 index 00000000..8105b201 --- /dev/null +++ b/recipes/paraview/repo/packages/paraview/xlc-compilation-pv590.patch @@ -0,0 +1,39 @@ +diff --git a/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx b/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx +index 514c0ee..66edca2 100644 +--- a/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx ++++ b/VTK/Common/DataModel/vtkStaticCellLinksTemplate.txx +@@ -356,7 +356,7 @@ void vtkStaticCellLinksTemplate::ThreadedBuildLinks( + + // Create an array of atomics with initial count=0. This will keep + // track of point uses. Count them in parallel. +- std::atomic* counts = new std::atomic[numPts] {}; ++ std::atomic* counts = new std::atomic[numPts] (); + CountUses count(cellArray, counts); + vtkSMPTools::For(0, numCells, count); + +diff --git a/VTK/Filters/Core/vtkBinnedDecimation.cxx b/VTK/Filters/Core/vtkBinnedDecimation.cxx +index 0736c56..8403908 100644 +--- a/VTK/Filters/Core/vtkBinnedDecimation.cxx ++++ b/VTK/Filters/Core/vtkBinnedDecimation.cxx +@@ -632,7 +632,7 @@ void BinPointsDecimate(int genMode, vtkIdType numPts, PointsT* pts, vtkPointData + // is a problem because a ptId can == zero; as a workaround, we'll + // initially use negative ids, and convert to positive ids in the + // final composition. +- std::atomic* ptMap = new std::atomic[numBins] {}; ++ std::atomic* ptMap = new std::atomic[numBins] (); + + // Is the triangle output? And eventually the offset into the output cell array. + TIds* triMap = new TIds[numTris + 1]; +diff --git a/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx b/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx +index 15e47a1..7baef33 100644 +--- a/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx ++++ b/VTK/Filters/Core/vtkWindowedSincPolyDataFilter.cxx +@@ -348,7 +348,7 @@ struct PointConnectivity : PointConnectivityBase + // accommodate more smoothing edges (although after a certain point, + // additional edges make little difference, especially at the cost of + // memory and speed). +- this->Offsets = new std::atomic[this->NumPts + 1] {}; // Initialized to zero ++ this->Offsets = new std::atomic[this->NumPts + 1] (); // Initialized to zero + this->Edges = nullptr; // initially until constructed + this->EdgeCounts = new EDGE_COUNT_TYPE[this->NumPts]; // values set later + } diff --git a/recipes/paraview/scripts/job-build-clariden.sh b/recipes/paraview/scripts/job-build-clariden.sh index 21743e81..8daf73e9 100755 --- a/recipes/paraview/scripts/job-build-clariden.sh +++ b/recipes/paraview/scripts/job-build-clariden.sh @@ -8,6 +8,8 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt +export PYTHONUNBUFFERED=1 + SRC=/users/biddisco/src CLUSTER=clariden STACKI_DIR=$SRC/alps-vcluster/stackinator @@ -31,8 +33,8 @@ echo "Trigger build" cd /dev/shm/biddisco env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 -echo "Copy generated squashfs file" DATE=$(date +%F) +echo "Copy generated squashfs file to $SCRATCH/$CLUSTER-paraview-$DATE.squashfs" cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs # ----------------------------------------- diff --git a/recipes/paraview/scripts/job-build-hohgant.sh b/recipes/paraview/scripts/job-build-hohgant.sh index 36331f7f..e58c08b0 100755 --- a/recipes/paraview/scripts/job-build-hohgant.sh +++ b/recipes/paraview/scripts/job-build-hohgant.sh @@ -8,30 +8,30 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt +export PYTHONUNBUFFERED=1 + +SRC=/users/biddisco/src CLUSTER=hohgant STACKI_DIR=$SRC/alps-vcluster/stackinator -RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview +RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/a100 SYSTEM_DIR=$SRC/alps-vcluster/alps-cluster-config/$CLUSTER BUILD_DIR=/dev/shm/biddisco -unalias cp - echo "Setup/clean build dir" -rm -rf ${BUILD_DIR}/* +#rm -rf ${BUILD_DIR}/* mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}/tmp echo "Execute stackinator" -$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR --debug +$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug -echo "Trigger build" -cd ${BUILD_DIR} - -# copy the spack build-cache gpg key to place where bubblewrap will map /tmp folder -cp $HOME/.ssh/gpg-spack-paraview* ${BUILD_DIR}/tmp/ +# if using develop branch of spack, add --develop +#$STACKI_DIR/bin/stack-config -s $SYSTEM_DIR -b ${BUILD_DIR} -r $RECIPE_DIR -c $RECIPE_DIR/cache-config.yaml --debug --develop # build the squashfs image - bubblewrap is used inside the makefile -env --ignore-environment LC_ALL=en_US.UTF-8 PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin make store.squashfs -j32 +echo "Trigger build" +cd /dev/shm/biddisco +env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin make store.squashfs -j32 echo "Copy generated squashfs file" DATE=$(date +%F) @@ -40,5 +40,5 @@ cp /dev/shm/biddisco/store.squashfs $SCRATCH/$CLUSTER-paraview-$DATE.squashfs # ----------------------------------------- # debug : create a shell using the spack setup used to create the squashfs # ----------------------------------------- -# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:${BUILD_DIR}/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config SPACK_USER_CACHE_PATH=$BUILD_DIR/cache /bin/bash --norc --noprofile +# $BUILD_DIR/bwrap-mutable-root.sh --tmpfs ~ --bind $BUILD_DIR/tmp /tmp --bind $BUILD_DIR/store /user-environment env --ignore-environment PATH=/usr/bin:/bin:`pwd`/spack/bin SPACK_SYSTEM_CONFIG_PATH=/user-environment/config /bin/bash --norc --noprofile diff --git a/recipes/paraview/scripts/job-build-oryx.sh b/recipes/paraview/scripts/job-build-oryx.sh index 5f36fc96..3dfb9be5 100755 --- a/recipes/paraview/scripts/job-build-oryx.sh +++ b/recipes/paraview/scripts/job-build-oryx.sh @@ -8,6 +8,8 @@ #SBATCH --output=/users/biddisco/stackinator-output.txt #SBATCH --error=/users/biddisco/stackinator-error.txt +export PYTHONUNBUFFERED=1 + CLUSTER=oryx STACKI_DIR=$SRC/alps-vcluster/stackinator RECIPE_DIR=$SRC/alps-vcluster/alps-spack-stacks/recipes/paraview/turing diff --git a/recipes/paraview/scripts/upalps.sh b/recipes/paraview/scripts/upalps.sh new file mode 100755 index 00000000..fb6a725c --- /dev/null +++ b/recipes/paraview/scripts/upalps.sh @@ -0,0 +1,2 @@ +/home/biddisco/update-rsync.sh ~/src/alps-vcluster/ clariden:/users/biddisco/src/alps-vcluster +/home/biddisco/update-rsync.sh ~/src/alps-vcluster/ hohgant:/users/biddisco/src/alps-vcluster From fbf32356b6f18d7d506f1b46f8abd66685720e88 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Tue, 5 Sep 2023 10:01:43 +0200 Subject: [PATCH 14/71] Sync paraview package with current EGL branch in spack --- .../repo/packages/paraview/package.py | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/recipes/paraview/repo/packages/paraview/package.py b/recipes/paraview/repo/packages/paraview/package.py index 8c15b2a6..a8d35eb1 100644 --- a/recipes/paraview/repo/packages/paraview/package.py +++ b/recipes/paraview/repo/packages/paraview/package.py @@ -112,7 +112,6 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): ' "default" lets the build_edition make the decision.' ' "on" or "off" will always override the build_edition.', ) - variant("ospray", default=False, description="Enable raytracing using osrpray library") conflicts("~hdf5", when="+visitbridge") conflicts("+adios2", when="@:5.10 ~mpi") @@ -141,9 +140,6 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): msg="Use paraview@5.9.0 with %xl_r. Earlier versions are not able to build with xl.", ) - # Newer abseil-cpp requires C++14, but paraview uses C++11 by default - conflicts("^abseil-cpp@2023:") - # We only support one single Architecture for _arch, _other_arch in itertools.permutations(CudaPackage.cuda_arch_values, 2): conflicts( @@ -233,10 +229,13 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): depends_on("protobuf@3.4:3.18", when="@:5.10%intel@2021:") depends_on("protobuf@3.4:3.18", when="@:5.10%xl") depends_on("protobuf@3.4:3.18", when="@:5.10%xl_r") + # protobuf requires newer abseil-cpp, which in turn requires C++14, + # but paraview uses C++11 by default + depends_on("protobuf@3.4:3.21", when="@:5.11") depends_on("libxml2") depends_on("lz4") depends_on("xz") - depends_on("zlib") + depends_on("zlib-api") depends_on("libcatalyst@2:", when="+libcatalyst") depends_on("hip@5.2:", when="+rocm") for target in ROCmPackage.amdgpu_targets: @@ -259,10 +258,9 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): depends_on("nlohmann-json", when="@5.11:") # ParaView depends on proj@8.1.0 due to changes in MR + # v8.1.0 is required for VTK::GeoVis # https://gitlab.kitware.com/vtk/vtk/-/merge_requests/8474 - depends_on("proj@9: +curl", when="@5.11:") - - depends_on("ospray@2.8:", when="+ospray") + depends_on("proj@8.1.0", when="@5.11:") patch("stl-reader-pv440.patch", when="@4.4.0") @@ -434,16 +432,11 @@ def use_x11(): "-DVTK_USE_X:BOOL=%s" % use_x11(), "-DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=%s" % includes, "-DBUILD_TESTING:BOOL=OFF", - "-DPARAVIEW_PLUGIN_ENABLE_pvNVIDIAIndeX:BOOL=ON", + "-DOpenGL_GL_PREFERENCE:STRING=LEGACY", self.define_from_variant("PARAVIEW_ENABLE_VISITBRIDGE", "visitbridge"), self.define_from_variant("VISIT_BUILD_READER_Silo", "visitbridge"), ] - if "+ospray" in spec: - cmake_args.extend( - ["-DPARAVIEW_ENABLE_RAYTRACING:BOOL=ON", "-DVTKOSPRAY_ENABLE_DENOISER:BOOL=ON"] - ) - if "+egl" in spec: cmake_args.append("-DVTK_OPENGL_HAS_EGL:BOOL=ON") @@ -470,7 +463,7 @@ def use_x11(): "-DPARAVIEW_BUILD_EDITION:STRING=%s" % spec.variants["build_edition"].value.upper(), "-DPARAVIEW_USE_QT:BOOL=%s" % variant_bool("+qt"), - "-DPARAVIEW_BUILD_WITH_EXTERNAL=OFF", + "-DPARAVIEW_BUILD_WITH_EXTERNAL=ON", ] ) if spec.satisfies("%cce"): From 1d0396c79e6df1613d3407fa7bcc75421f5f8181 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Thu, 19 Oct 2023 11:28:02 +0200 Subject: [PATCH 15/71] Bump paraview to latest 5.11.2 version --- .../paraview/repo/packages/paraview/package.py | 5 +++-- .../scripts/rc-submit-pvserver-clariden.sh | 8 ++++---- recipes/paraview/scripts/servers.pvsc | 16 ++++++++-------- recipes/paraview/scripts/upalps.sh | 1 + 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/recipes/paraview/repo/packages/paraview/package.py b/recipes/paraview/repo/packages/paraview/package.py index a8d35eb1..bde2e8c8 100644 --- a/recipes/paraview/repo/packages/paraview/package.py +++ b/recipes/paraview/repo/packages/paraview/package.py @@ -29,10 +29,11 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): version("master", branch="master", submodules=True) version( - "5.11.1", - sha256="5cc2209f7fa37cd3155d199ff6c3590620c12ca4da732ef7698dec37fa8dbb34", + "5.11.2", + sha256="5c5d2f922f30d91feefc43b4a729015dbb1459f54c938896c123d2ac289c7a1e", preferred=True, ) + version("5.11.1", sha256="5cc2209f7fa37cd3155d199ff6c3590620c12ca4da732ef7698dec37fa8dbb34") version("5.11.0", sha256="9a0b8fe8b1a2cdfd0ace9a87fa87e0ec21ee0f6f0bcb1fdde050f4f585a25165") version("5.10.1", sha256="520e3cdfba4f8592be477314c2f6c37ec73fb1d5b25ac30bdbd1c5214758b9c2") version("5.10.0", sha256="86d85fcbec395cdbc8e1301208d7c76d8f48b15dc6b967ffbbaeee31242343a5") diff --git a/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh b/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh index f5f0b1b6..b04d2d3c 100644 --- a/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh +++ b/recipes/paraview/scripts/rc-submit-pvserver-clariden.sh @@ -65,8 +65,8 @@ export SPACK_USER_CACHE_PATH=/user-environment/cache source $SPACK_ROOT/share/spack/setup-env.sh # Which rendering backend are we using -if [ "$7" = "clariden-5.11-NVIDIA" ]; then - # paraview 5.11 nvidia EGL +if [ "$7" = "clariden-5.11.2-NVIDIA" ]; then + # paraview 5.11.2 nvidia EGL SQUASH_IMG=/scratch/aistor/biddisco/clariden-paraview-EGL-2023-08-23.squashfs SQUASH_CMD="squashfs-mount $SQUASH_IMG:/user-environment" PV_HASH="/sqd4oxb" @@ -74,8 +74,8 @@ if [ "$7" = "clariden-5.11-NVIDIA" ]; then echo "Using hash $PV_HASH from squashfs $SQUASH_IMG" echo "pvserver : $PV_SERVER" -elif [ "$7" = "clariden-5.11-osmesa" ]; then - # paraview 5.11 osmesa +elif [ "$7" = "clariden-5.11.2-osmesa" ]; then + # paraview 5.11.2 osmesa PV_HASH="/ltilqh4" PV_SERVER=$($SQUASH_CMD spack location -i paraview $PV_HASH)/bin/pvserver OSMESA_PATH=$($SQUASH_CMD spack location -i /qadzwvd)/lib diff --git a/recipes/paraview/scripts/servers.pvsc b/recipes/paraview/scripts/servers.pvsc index 582f9f16..36f25220 100644 --- a/recipes/paraview/scripts/servers.pvsc +++ b/recipes/paraview/scripts/servers.pvsc @@ -46,10 +46,10 @@