WarpX icon indicating copy to clipboard operation
WarpX copied to clipboard

CMake: Replace `FetchContent_Populate`

Open ax3l opened this issue 1 year ago • 6 comments

In CMake superbuilds, FetchContent_Populate is now deprecated. Use FetchContent_MakeAvailable instead.

Bump CMake to 2.24+ to have the latest behavioral changes in it. We anyway need a bump as we will soon rework the CUDA/HIP language support from AMReX to downstream.

  • [ ] Wait for HPC3 users
  • [x] Wait for Taurus users

ax3l avatar Aug 27 '24 22:08 ax3l

@burlen @utkarshayachit @c-wetterer-nelson is there a way to bump the packages for our SENSEI container up or use a newer container than the current senseiinsitu/ci:fedora35-amrex-20220613? We would like to use a newer CMake in particular right now.

Update: I might have found a way to pull in a newer CMake inside the container itself.

ax3l avatar Aug 27 '24 23:08 ax3l

@ChristosT @c-wetterer-nelson is there a way to bump the packages for our Catalyst container up or use a newer container than the current kitware/paraview:ci-catalyst-amrex-warpx-20240701? We would like to use a newer CMake in particular right now.

ax3l avatar Aug 27 '24 23:08 ax3l

@ChristosT @c-wetterer-nelson is there a way to bump the packages for our Catalyst container up or use a newer container than the current kitware/paraview:ci-catalyst-amrex-warpx-20240701? We would like to use a newer CMake in particular right now.

I bumped cmake to 3.26 in kitware/paraview:ci-catalyst-amrex-warpx-20240828 For reference I am using this to build the images

ChristosT avatar Aug 28 '24 14:08 ChristosT

Thank you for the quick update, @ChristosT. The new image works well and I added the link to your build scripts now inline to document it - perfect! :pray:

ax3l avatar Aug 28 '24 18:08 ax3l

@erny123 @floresv299 @Aquios7 @jinze-liu is there a CMake 3.24 or newer module on HPC3? We currently document CMake 3.22 there, but would like to bump it up.

Update: @floresv299 opened a ticket to request a newer CMake module.

ax3l avatar Aug 28 '24 18:08 ax3l

@tmiethlinger @BrianMarre is there a CMake module in version 3.24 or newer on Taurus? We currently document 3.22 and would like to update to a newer version :)

Update: done via email.

ax3l avatar Aug 28 '24 19:08 ax3l

Here are a few alternative and super easy ways how to install the latest CMake on a system.

pipx (any OS, laptop to HPC)

Great if you want to install only for yourself as a user and have no root access.

python -m pip install -U pipx
pipx install cmake

APT (Ubuntu/Debian)

Great if you are admin (root) on a system and want to have the latest CMake for all users:

Via the Kitware apt repo, e.g., for Ubuntu 22.04:

sudo apt-get update
sudo apt-get install ca-certificates gpg wget
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null

echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy-rc main' | sudo tee -a /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update

Conda (any OS, NOT HPC)

Great if you like to develop WarpX and have all dependencies in a virtual environment, that does not interact with other software stacks on the system: https://warpx.readthedocs.io/en/latest/install/dependencies.html#conda-linux-macos-windows

Spack (Linux/macOS, experimental windows, good for HPC, too)

Great if you like to develop WarpX and have all dependencies in a virtual environment, can optionally reuse HPC dependencies/modules https://warpx.readthedocs.io/en/latest/install/dependencies.html#spack-linux-macos

Homebrew (macOS/Linux, NOT HPC)

Great if you like to develop WarpX and have all dependencies in a virtual environment, that does not interact with other software stacks on the system: https://warpx.readthedocs.io/en/latest/install/dependencies.html#brew-macos-linux

GitHub Action

https://github.com/marketplace/actions/actions-setup-cmake

Download

Just download the pre-compiled binaries, extract them and add the directory in which the cmake binary resides to your PATH environment variable. https://cmake.org/download/

ax3l avatar Sep 04 '24 20:09 ax3l

Is the upgrade from Ubuntu 20.04 to 22.04 in .github/workflows/insitu.yml needed here or is it sort of a separate upgrade (as in, something that could go into a separate PR)? I'm asking because I think we wanted to move to Ubuntu 22.04 in all GitHub Actions workflows, at some point.

EZoni avatar Sep 04 '24 23:09 EZoni

This test uses a docker container, and the host update does not matter - but I did it already to not have to do it later.

Yes, we could generally go to Ubuntu 22.04 in CI now.

ax3l avatar Sep 04 '24 23:09 ax3l