Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
aa6dce5
Initial plan
Copilot Oct 24, 2025
b6833b8
Fix hpic2 build failures by adding missing iterator includes
Copilot Oct 24, 2025
0b1eabe
Don't actually want to modify the Deprecated update scripts folder.
Stephen-Armstrong Oct 24, 2025
324f27a
Add documentation for hpic2 build fix
Copilot Oct 24, 2025
cdb3588
Fix documentation to reflect actual files modified
Copilot Oct 24, 2025
fe3ace9
icc ran out of memory on the dtra storage so set to just the most bas…
Stephen-Armstrong Oct 24, 2025
28004db
Add log file for first SUCCESSFUL build of hPIC2 Module files and hpi…
Stephen-Armstrong Oct 24, 2025
4fcd5e6
Add unused compilers configuration for GCC 13.3.0 and 12.4.0
Stephen-Armstrong Oct 24, 2025
568751d
Move unused_compilers.yaml to prevent Spack duplicate spec error
Copilot Oct 24, 2025
3d278c3
Remove gcc package dependency to fix duplicate spec error
Copilot Oct 24, 2025
6b91028
Add back gcc external specs for all referenced versions
Copilot Oct 24, 2025
a5dc26d
Clean up user-level Spack compiler configs to prevent duplicates
Copilot Oct 24, 2025
1675205
needs to delete packages.yaml now, not just compilers.yaml
Stephen-Armstrong Oct 24, 2025
687d4fa
changed a spec thing in pakages.yaml
Stephen-Armstrong Oct 24, 2025
ada14d0
setting gcc file locations in package.py
Stephen-Armstrong Oct 24, 2025
90a6441
The lines need to be strings?
Stephen-Armstrong Oct 24, 2025
34eb59c
paths should have been compilers
Stephen-Armstrong Oct 24, 2025
3b6de4d
removing redundant packages of the most important packages.
Stephen-Armstrong Oct 24, 2025
40c0359
removing fftw old packages
Stephen-Armstrong Oct 24, 2025
2304389
commenting out module that doesn't exist on the icc
Stephen-Armstrong Oct 24, 2025
fe3f5c9
Removing old python versions
Stephen-Armstrong Oct 24, 2025
097cb7f
need gcc dependency i think so no conflicts
Stephen-Armstrong Oct 24, 2025
66ba4da
Now only getting errors that look like they are because all of the va…
Stephen-Armstrong Oct 24, 2025
bed8d3b
The last set of variants worked so expand to a few more
Stephen-Armstrong Oct 25, 2025
e036cf6
New log file.
Stephen-Armstrong Oct 26, 2025
c7e1b19
Fix mfem git checkout to run in correct directory
Copilot Oct 26, 2025
573587f
Forgot to put the generation date on the log file.
Stephen-Armstrong Oct 26, 2025
740afe9
Have to also use a specific verion of hypre, v 2.29.0
Stephen-Armstrong Oct 26, 2025
5a5a1d6
Add missing cstdint include patch for mfem
Copilot Oct 26, 2025
f3b9f33
Just going to do a set of builds with openmp and CUDA 70
Stephen-Armstrong Oct 26, 2025
88a3f88
patching out tags on mfem cause I think changing the version is actua…
Stephen-Armstrong Oct 26, 2025
b0b605f
Going to do a run with +openmp, CUDA=None,70
Stephen-Armstrong Oct 26, 2025
e580c65
adding most recent log files related to the cmake gpu error.
Stephen-Armstrong Oct 26, 2025
4c02650
Add cublas library linking for CUDA-enabled hpic2 builds
Copilot Oct 26, 2025
7737d07
New error log
Stephen-Armstrong Oct 26, 2025
b08b26a
Add HDF5_DIR to hpic2 cmake configuration
Copilot Oct 26, 2025
042e82e
Same error new log
Stephen-Armstrong Oct 26, 2025
f1c38e2
Fix cublas linking using CMAKE_EXE_LINKER_FLAGS
Copilot Oct 26, 2025
7debf7e
I think this code needs to also be enabled to get it to find cublas?
Copilot Oct 24, 2025
06535a1
Add disown to background process in update script
Stephen-Armstrong Oct 27, 2025
fb5c0ce
New Log file
Stephen-Armstrong Oct 27, 2025
71dfff9
New log file, minor change to update.sh.
Stephen-Armstrong Oct 28, 2025
aa7f889
Add CUDA library path to cublas linker flags
Copilot Oct 28, 2025
94863c4
Josh needs the No-OpenMP, No CUDA build real quick.
Stephen-Armstrong Oct 28, 2025
a76d11e
New-ish log file same issue.
Stephen-Armstrong Oct 28, 2025
9421057
Manually setting CUDA_HOME environment variable.
Stephen-Armstrong Oct 28, 2025
79e85eb
Add SLURM sbatch script for running campuscluster_update.py
Copilot Oct 28, 2025
cdc135a
Fix AI's mistakes in the sbatch file.
Stephen-Armstrong Oct 28, 2025
b7813ca
Was missing some other SBATCH params.
Stephen-Armstrong Oct 28, 2025
b76c847
Combining Output and errors into one file.
Stephen-Armstrong Oct 29, 2025
8f43d6d
Setting CUDA_HOME in a few more places to see if that helps.
Stephen-Armstrong Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions HPIC2_BUILD_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# hpic2 Build Fix

## Problem

The hpic2 build was failing with compilation errors due to missing `#include <iterator>` in several source files:
- `core/magnetic_field/BFromFile.cpp`
- `core/utils/hpic_utils.cpp`
- `core/species/FullOrbitICFromFile.cpp`
- `core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp`

## Error Message

```
error: 'istream_iterator' is not a member of 'std'
note: 'std::istream_iterator' is defined in header '<iterator>'; did you forget to '#include <iterator>'?
```

## Root Cause

The hpic2 source code uses `std::istream_iterator` but does not include the `<iterator>` header. With newer versions of GCC (13.3.0), this header is no longer implicitly included by other standard library headers like `<fstream>`.

## Solution

All update scripts now patch the hpic2 source code after cloning to add the missing `#include <iterator>` directive:

```bash
cd hpic2
sed -i '2a #include <iterator>' core/magnetic_field/BFromFile.cpp
sed -i '2a #include <iterator>' core/utils/hpic_utils.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitICFromFile.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp
cd ..
```

This adds `#include <iterator>` after line 2 (after the existing `#include <fstream>` or similar) in each file.

## Files Modified

The following update scripts have been patched:
- `campuscluster_update.py`
- `campus_cluster_update_2.py`
- `campus_cluster_update_3_fixing_mpi_errors.py`
- `campus_cluster_update_3_hypre_cuda.py`

## Impact

This fix allows hpic2 to build successfully on the Illinois Campus Cluster with GCC 13.3.0. The patch is applied automatically during the build process, so no manual intervention is required.

## Future Work

This is a temporary workaround. The proper solution is to submit a pull request to the upstream hpic2 repository to add the missing includes directly in the source code.
20,503 changes: 20,503 additions & 0 deletions Log and install outputs/output_update_spack_py_10_11_10_28_2025.log

Large diffs are not rendered by default.

30,900 changes: 30,900 additions & 0 deletions Log and install outputs/output_update_spack_py_10_26_2025.log

Large diffs are not rendered by default.

20,501 changes: 20,501 additions & 0 deletions Log and install outputs/output_update_spack_py_11_52_10_28_2025.log

Large diffs are not rendered by default.

70,113 changes: 70,113 additions & 0 deletions Log and install outputs/output_update_spack_py_4_00_10_26_2025.log

Large diffs are not rendered by default.

118,641 changes: 118,641 additions & 0 deletions Log and install outputs/output_update_spack_py_4_47_10_26_2025.log

Large diffs are not rendered by default.

20,053 changes: 20,053 additions & 0 deletions Log and install outputs/output_update_spack_py_5_52_10_27_2025.log

Large diffs are not rendered by default.

Large diffs are not rendered by default.

118,639 changes: 118,639 additions & 0 deletions Log and install outputs/output_update_spack_py_FAILURE_True_None_70_10_26_2025.log

Large diffs are not rendered by default.

52,909 changes: 52,909 additions & 0 deletions Log and install outputs/output_update_spack_py_SUCCESS_False_None_10_24_2025.log

Large diffs are not rendered by default.

18 changes: 17 additions & 1 deletion campus_cluster_update_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ def update():
# install mfem
mkdir mfem_dev && cd mfem_dev
git clone https://github.com/mfem/mfem.git #git@github.com:mfem/mfem.git

# Patch mfem source to add missing #include <cstdint>
cd mfem
sed -i '27a #include <cstdint>' general/mem_manager.cpp
cd ..

mkdir build && cd build
{mfem_cmake_cmd}
make -j{num_build_cores}
Expand Down Expand Up @@ -447,9 +453,19 @@ def update():
cd {dir_name}

git clone --recurse-submodules https://github.com/lcpp-org/hpic2.git #git@github.com:lcpp-org/hpic2.git

# Patch hpic2 source files to add missing #include <iterator>
cd hpic2
sed -i '2a #include <iterator>' core/magnetic_field/BFromFile.cpp
sed -i '2a #include <iterator>' core/utils/hpic_utils.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitICFromFile.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp

cd ..

mkdir build && cd build
#cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DWITH_MFEM=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DHDF5_DIR=../../hdf5_dev/install -DCMAKE_EXE_LINKER_FLAGS="-L\$CUDA_HOME/lib64 -lcublas"
make -j{num_build_cores}

"""
Expand Down
18 changes: 17 additions & 1 deletion campus_cluster_update_3_fixing_mpi_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ def build_dependent(openmp_option, cuda_arch_option, build_type):
cd {top_level_dir}/builds/{dir_name}
mkdir mfem_dev && cd mfem_dev
git clone https://github.com/mfem/mfem.git #git@github.com:mfem/mfem.git

# Patch mfem source to add missing #include <cstdint>
cd mfem
sed -i '27a #include <cstdint>' general/mem_manager.cpp
cd ..

mkdir build && cd build
{mfem_cmake_cmd}
make -j{num_build_cores}
Expand Down Expand Up @@ -463,9 +469,19 @@ def build_release_version_hpic2(openmp_option, cuda_arch_option):
cd {dir_name}

git clone --recurse-submodules https://github.com/lcpp-org/hpic2.git #git@github.com:lcpp-org/hpic2.git

# Patch hpic2 source files to add missing #include <iterator>
cd hpic2
sed -i '2a #include <iterator>' core/magnetic_field/BFromFile.cpp
sed -i '2a #include <iterator>' core/utils/hpic_utils.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitICFromFile.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp

cd ..

mkdir build && cd build
#cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DWITH_MFEM=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DHDF5_DIR=../../hdf5_dev/install -DCMAKE_EXE_LINKER_FLAGS="-L\$CUDA_HOME/lib64 -lcublas"
make -j{num_build_cores}

"""
Expand Down
18 changes: 17 additions & 1 deletion campus_cluster_update_3_hypre_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ def update():
# install mfem
mkdir mfem_dev && cd mfem_dev
git clone https://github.com/mfem/mfem.git #git@github.com:mfem/mfem.git

# Patch mfem source to add missing #include <cstdint>
cd mfem
sed -i '27a #include <cstdint>' general/mem_manager.cpp
cd ..

mkdir build && cd build
{mfem_cmake_cmd}
make -j{num_build_cores}
Expand Down Expand Up @@ -416,9 +422,19 @@ def update():
cd {dir_name}

git clone --recurse-submodules https://github.com/lcpp-org/hpic2.git #git@github.com:lcpp-org/hpic2.git

# Patch hpic2 source files to add missing #include <iterator>
cd hpic2
sed -i '2a #include <iterator>' core/magnetic_field/BFromFile.cpp
sed -i '2a #include <iterator>' core/utils/hpic_utils.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitICFromFile.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp

cd ..

mkdir build && cd build
#cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DWITH_MFEM=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DHDF5_DIR=../../hdf5_dev/install -DCMAKE_EXE_LINKER_FLAGS="-L\$CUDA_HOME/lib64 -lcublas"
make -j{num_build_cores}

"""
Expand Down
44 changes: 37 additions & 7 deletions campuscluster_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
python_module = "python/3.13.2"
cmake_version = "3.26.5"

openmp_options = [True, False]
cuda_arch_options = [None, 70, 86, 90]
openmp_options = [False, True] # [True, False]
cuda_arch_options = [None, 70] #[None, 70, 86, 90]
build_types = ["Debug", "Release"] #["Debug", "Release"]


Expand Down Expand Up @@ -67,6 +67,7 @@ def update():
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
export CUDA_HOME=`which nvcc | sed 's:/bin/nvcc::'`
echo CMAKE Changed CC compiler $CC C++ $CXX Fortran $FC mpicc `which mpicc` mpicxx `which mpicxx` mpif90 `which mpif90`

mkdir cmake && cd cmake
Expand Down Expand Up @@ -95,6 +96,7 @@ def update():
prepend-path --delim {{:}} PATH {{{top_level_dir}/cmake/install/bin}}
prepend-path --delim {{:}} ACLOCAL_PATH {{{top_level_dir}/cmake/install/share/aclocal}}
prepend-path --delim {{:}} CMAKE_PREFIX_PATH {{{top_level_dir}/cmake/install/.}}
setenv CUDA_HOME {{/sw/apps/{cuda_module}}}

"""
if not os.path.exists(f'{top_level_dir}/modulefiles/cmake'):
Expand All @@ -113,7 +115,7 @@ def update():
num_build_cores = len(os.sched_getaffinity(0))

# Delete old versions of builds if the number exceeds this
num_versions_kept = 3
num_versions_kept = 1

current_datetime = datetime.datetime.now()
datetime_format = '%Y-%m-%d'
Expand Down Expand Up @@ -160,7 +162,7 @@ def update():
mfem_cmake_cmd += f" -DMFEM_USE_OPENMP=YES"

if cuda_enabled:
module('load', cuda_module)
module('--ignore_cache', 'load', cuda_module)
else:
module('unload', cuda_module)

Expand All @@ -176,6 +178,7 @@ def update():
export CC=`which gcc`
export CXX=`which g++`
export FC=`which gfortran`
{"export CUDA_HOME=`which nvcc | sed 's:/bin/nvcc::'`" if cuda_enabled else ''}
echo Build Script Changed CC compiler $CC C++ $CXX Fortran $FC mpicc `which mpicc` mpicxx `which mpicxx` mpif90 `which mpif90`

cd builds
Expand All @@ -199,6 +202,9 @@ def update():
mkdir hypre_dev
cd hypre_dev
git clone https://github.com/hypre-space/hypre.git #git@github.com:hypre-space/hypre.git
cd hypre
git checkout tags/v2.29.0
cd ..
cd hypre/src
./configure
make -j{num_build_cores}
Expand Down Expand Up @@ -236,7 +242,13 @@ def update():
# install mfem
mkdir mfem_dev && cd mfem_dev
git clone https://github.com/mfem/mfem.git #git@github.com:mfem/mfem.git
git checkout tags/v4.5.2

#cd mfem
#git checkout tags/v4.5.2
# Patch mfem source to add missing #include <cstdint>
#sed -i '27a #include <cstdint>' general/mem_manager.cpp
#cd ..

mkdir build && cd build
{mfem_cmake_cmd}
make -j{num_build_cores}
Expand Down Expand Up @@ -329,6 +341,7 @@ def update():
setenv HDF5_ROOT {{{build_dir_path}/hdf5_dev/install}}
setenv HDF5_DIR {{{build_dir_path}/hdf5_dev/install}}
setenv HDF5_MPI ON
setenv CUDA_HOME {{/sw/apps/{cuda_module}}}

"""

Expand Down Expand Up @@ -391,9 +404,26 @@ def update():
cd {dir_name}

git clone --recurse-submodules https://github.com/lcpp-org/hpic2.git #git@github.com:lcpp-org/hpic2.git

# Patch hpic2 source files to add missing #include <iterator>
cd hpic2
sed -i '2a #include <iterator>' core/magnetic_field/BFromFile.cpp
sed -i '2a #include <iterator>' core/utils/hpic_utils.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitICFromFile.cpp
sed -i '2a #include <iterator>' core/species/FullOrbitVolumetricSourceMinimumMassFromFile.cpp

# Patch CMakeLists.txt to link cublas when CUDA is enabled
if grep -q "find_package(CUDA" CMakeLists.txt; then
echo 'if(CUDA_FOUND)' >> CMakeLists.txt
echo ' target_link_libraries(hpic2 PRIVATE \${{CUDA_CUBLAS_LIBRARIES}})' >> CMakeLists.txt
echo 'endif()' >> CMakeLists.txt
fi

cd ..

mkdir build && cd build
#cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DWITH_MFEM=ON
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_MFEM=ON -DWITH_PUMIMBBL=OFF
cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_PUMIMBBL=ON -DWITH_MFEM=ON -DHDF5_DIR=../../hdf5_dev/install -DCMAKE_EXE_LINKER_FLAGS="-L\$CUDA_HOME/lib64 -lcublas"
#cmake ../hpic2 -DWITH_RUSTBCA=ON -DWITH_MFEM=ON -DWITH_PUMIMBBL=OFF
make -j{num_build_cores}

"""
Expand Down
20 changes: 20 additions & 0 deletions run_update.sbatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
#SBATCH --job-name=DTRA_Campuscluster_Update
#SBATCH --output=/projects/illinois/grants/dtra_ura_msee/share/Outputs/output_update_spack_py_%x_output.txt
#SBATCH --time=4:00:00
#SBATCH --exclude=ccc0465
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
##SBATCH --mem=32G
#SBATCH --partition=IllinoisComputes,dtra,secondary,IllinoisComputes-GPU,eng-research-gpu,eng-instruction,ic-express
#SBATCH --account=dcurreli-npre-eng
#SBATCH --mail-type=END # Type of email notifications to send

# Load required modules
module load python/3.13.2

# Set Python to unbuffered mode for real-time logging
export PYTHON_UNBUFFERED=1

# Run the campuscluster_update.py script
python3 -u campuscluster_update.py update
7 changes: 5 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ cd -
cp spack_repo/spack_config/* ../spack/etc/spack/.
echo "repos:" > ../spack/etc/spack/repos.yaml
echo "- $PWD/spack_repo/lcpp_spack_repo" >> ../spack/etc/spack/repos.yaml
# Remove user-level compiler list. They are almost definitely broken.
rm ~/.spack/packages.yaml
# Remove user-level configuration that might conflict
rm -f ~/.spack/packages.yaml
rm -f ~/.spack/linux/compilers.yaml
rm -f ~/.spack/compilers.yaml
rm -f ~/.spack/packages.yaml
#cp spack_repo/spack_config/compilers.yaml ~/.spack/bootstrap/config/linux/compilers.yaml
sh install_hpic2deps.sh
spack module tcl refresh --delete-tree -y
Expand Down
Loading