diff --git a/scripts/custom/install_boost.sh b/scripts/custom/install_boost.sh index 4ae2a5d7..92d47a49 100755 --- a/scripts/custom/install_boost.sh +++ b/scripts/custom/install_boost.sh @@ -100,7 +100,7 @@ install_dir=${base_dir}/opt/boost/${version} mkdir -p ${install_dir} cd ${src_dir} -./bootstrap.sh --prefix=${install_dir} && \ +./bootstrap.sh --prefix=${install_dir} ./b2 -j ${parallel} toolset=gcc cxxflags=-w install # Add modulefile diff --git a/scripts/custom/install_cmake.sh b/scripts/custom/install_cmake.sh index a0847abc..ddf6f5f9 100755 --- a/scripts/custom/install_cmake.sh +++ b/scripts/custom/install_cmake.sh @@ -67,8 +67,8 @@ mkdir -p ${install_dir} cd cmake-${version} ./bootstrap \ --prefix=${install_dir} \ - --parallel=${parallel} && \ -make -j ${parallel} && \ + --parallel=${parallel} +make -j ${parallel} make install # Add modulefile diff --git a/scripts/custom/install_hdf5.sh b/scripts/custom/install_hdf5.sh index e2b61064..f308c4a6 100755 --- a/scripts/custom/install_hdf5.sh +++ b/scripts/custom/install_hdf5.sh @@ -115,24 +115,25 @@ if version_lt "${version}" '2.0.0'; then # HDF5 < 2.0.0 CPPFLAGS=-fPIC \ CXXFLAGS=-fPIC \ CC=mpicc \ - CXX=mpic++ && - make -j ${parallel} all && - make install + CXX=mpic++ + make -j ${parallel} all + make install else # HDF5 >= 2.0.0 # Check cmake version (HDF5 2.0+ requires cmake >= 3.26) cmake --version - mkdir -p build && cd build + mkdir -p build + cd build CC=mpicc CXX=mpic++ cmake \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=${install_dir} \ -DHDF5_BUILD_HL_LIB=ON \ -DHDF5_BUILD_TOOLS=ON \ - -DHDF5_ENABLE_PARALLEL=ON .. && - make -j ${parallel} && - make install + -DHDF5_ENABLE_PARALLEL=ON .. + make -j ${parallel} + make install fi # Add modulefile diff --git a/scripts/custom/install_petsc.sh b/scripts/custom/install_petsc.sh index d0098b26..0f6b3ce3 100755 --- a/scripts/custom/install_petsc.sh +++ b/scripts/custom/install_petsc.sh @@ -115,7 +115,7 @@ case ${arch} in --with-fc=0 \ --with-shared-libraries \ --with-ssl=false \ - --with-x=false && \ + --with-x=false make -j ${parallel} all ;; @@ -132,7 +132,7 @@ case ${arch} in --with-fc=0 \ --with-shared-libraries \ --with-ssl=false \ - --with-x=false && \ + --with-x=false make -j ${parallel} all ;; *) diff --git a/scripts/custom/install_python.sh b/scripts/custom/install_python.sh index 78c498b5..a0ad8475 100755 --- a/scripts/custom/install_python.sh +++ b/scripts/custom/install_python.sh @@ -58,8 +58,8 @@ mkdir -p ${install_dir} cd Python-${version} ./configure \ --enable-optimizations \ - --prefix=${install_dir} && \ -make -j ${parallel} && \ + --prefix=${install_dir} +make -j ${parallel} make install # Add symbolic links diff --git a/scripts/custom/install_sundials.sh b/scripts/custom/install_sundials.sh index 5163751a..6557469c 100755 --- a/scripts/custom/install_sundials.sh +++ b/scripts/custom/install_sundials.sh @@ -75,8 +75,8 @@ cmake \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_MPI=ON \ - -DEXAMPLES_ENABLE=OFF .. && \ -make -j ${parallel} && \ + -DEXAMPLES_ENABLE=OFF .. +make -j ${parallel} make install # Add modulefile diff --git a/scripts/custom/install_vtk.sh b/scripts/custom/install_vtk.sh index 2decb0e3..5f3695f7 100755 --- a/scripts/custom/install_vtk.sh +++ b/scripts/custom/install_vtk.sh @@ -193,6 +193,17 @@ if version_eq "${major}.${minor}" '9.2'; then # VTK == 9.2.x patch -t -p1 < ${patch_dir}/9.2/gcc-13.patch fi +# VTK 9.4.x patches +if version_eq "${major}.${minor}" '9.4'; then # VTK == 9.4.x + # netCDF 4.9.3 replaced the _FillValue macro with NC_FillValue, which the + # bundled exodusII on VTK < 9.5 still uses, so do a rename if applicable. + netcdf_version="$(pkg-config --modversion netcdf 2>/dev/null || true)" + if [ -n "${netcdf_version}" ] && version_ge "${netcdf_version}" '4.9.3'; then + cd ${src_dir} + patch -t -p1 < ${patch_dir}/9.4/netcdf-fillvalue.patch + fi +fi + # Build and install install_dir=${base_dir}/opt/vtk/${version} mkdir -p ${install_dir} @@ -231,8 +242,8 @@ cmake \ -DVTK_MODULE_USE_EXTERNAL_VTK_utf8=ON \ -DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON \ -DHDF5_IS_PARALLEL=ON \ - ${src_dir} && \ -make -j ${parallel} && \ + ${src_dir} +make -j ${parallel} make install # Add modulefile diff --git a/scripts/custom/install_xercesc.sh b/scripts/custom/install_xercesc.sh index 3172dbb6..0a2d41e1 100755 --- a/scripts/custom/install_xercesc.sh +++ b/scripts/custom/install_xercesc.sh @@ -69,15 +69,15 @@ if [ ${major} -le 2 ]; then cd xerces-c-src_${ver_si_on} export XERCESCROOT=$(pwd) cd src/xercesc - ./runConfigure -plinux -cgcc -xg++ -P${install_dir} && \ - make -j ${parallel} && \ + ./runConfigure -plinux -cgcc -xg++ -P${install_dir} + make -j ${parallel} make install else wget -nc https://archive.apache.org/dist/xerces/c/${major}/sources/xerces-c-${version}.tar.gz tar -xzf xerces-c-${version}.tar.gz cd xerces-c-${version} - ./configure --enable-netaccessor-socket --prefix=${install_dir} && \ - make -j ${parallel} && \ + ./configure --enable-netaccessor-socket --prefix=${install_dir} + make -j ${parallel} make install fi diff --git a/scripts/custom/patches/vtk/9.4/netcdf-fillvalue.patch b/scripts/custom/patches/vtk/9.4/netcdf-fillvalue.patch new file mode 100644 index 00000000..93c88483 --- /dev/null +++ b/scripts/custom/patches/vtk/9.4/netcdf-fillvalue.patch @@ -0,0 +1,39 @@ +Subject: Use NC_FillValue instead of _FillValue in bundled exodusII +Origin: vendor, https://github.com/Unidata/netcdf-c/blob/main/include/netcdf.h + +netCDF 4.9.3 removed the _FillValue macro, which used a reserved identifier, +and replaced it with NC_FillValue. VTK's bundled exodusII still refers to +_FillValue, so it fails to compile against netCDF >= 4.9.3 when VTK is built +with VTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON: + + ex_put_prop.c:246:54: error: '_FillValue' undeclared (first use in this + function); did you mean 'NC_FillValue'? + +Both macros expand to the string "_FillValue", so the attribute name written +to file is unchanged. + +This patch is only applied when building against netCDF >= 4.9.3; +see install_vtk.sh. +--- +--- vtk9.orig/ThirdParty/exodusII/vtkexodusII/src/ex_put_prop.c ++++ vtk9/ThirdParty/exodusII/vtkexodusII/src/ex_put_prop.c +@@ -243,7 +243,7 @@ + vals[0] = 0; /* fill value */ + /* create attribute to cause variable to fill with zeros per routine spec + */ +- if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) { ++ if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != NC_NOERR) { + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to create property name fill attribute in file id %d", exoid); + ex_err_fn(exoid, __func__, errmsg, status); +--- vtk9.orig/ThirdParty/exodusII/vtkexodusII/src/ex_put_prop_names.c ++++ vtk9/ThirdParty/exodusII/vtkexodusII/src/ex_put_prop_names.c +@@ -172,7 +172,7 @@ + + /* create attribute to cause variable to fill with zeros per routine spec + */ +- if ((status = nc_put_att_longlong(exoid, propid, _FillValue, int_type, 1, vals)) != NC_NOERR) { ++ if ((status = nc_put_att_longlong(exoid, propid, NC_FillValue, int_type, 1, vals)) != NC_NOERR) { + snprintf(errmsg, MAX_ERR_LENGTH, + "ERROR: failed to create property name fill attribute in file id %d", exoid); + ex_err_fn(exoid, __func__, errmsg, status); diff --git a/scripts/custom/setup_ubuntu_2204.sh b/scripts/custom/setup_ubuntu_2204.sh index d7d2066a..a1ffcbc6 100755 --- a/scripts/custom/setup_ubuntu_2204.sh +++ b/scripts/custom/setup_ubuntu_2204.sh @@ -24,6 +24,8 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + patch \ + pkg-config \ python-is-python3 \ python3 \ python3-dev \ diff --git a/scripts/custom/setup_ubuntu_2404.sh b/scripts/custom/setup_ubuntu_2404.sh index 35f65595..2f90c515 100755 --- a/scripts/custom/setup_ubuntu_2404.sh +++ b/scripts/custom/setup_ubuntu_2404.sh @@ -26,6 +26,8 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + patch \ + pkg-config \ python-is-python3 \ python3 \ python3-dev \ diff --git a/scripts/custom/setup_ubuntu_2604.sh b/scripts/custom/setup_ubuntu_2604.sh index ba0b4875..823517bd 100755 --- a/scripts/custom/setup_ubuntu_2604.sh +++ b/scripts/custom/setup_ubuntu_2604.sh @@ -26,6 +26,8 @@ apt-get install -y --no-install-recommends \ doxygen \ git \ lcov \ + patch \ + pkg-config \ python-is-python3 \ python3 \ python3-dev \