Running on Windows#
Running KCOCAL on Windows takes a few extra steps, but it is still manageable. The main constraints are:
CUDA 13.4 is not compatible with MSVC 2026, so you must use MSVC 14.50.
Kokkos can be built natively on Windows, but the project scripts are Bash-based, so either WSL2 or Git Bash is needed for the normal shell workflow.
Requirements#
Before starting, make sure you have the following installed:
MSVC 14.50 (Visual Studio 2022)
CMake 3.27 or later
Git Bash or WSL2
CUDA 13.4 for Blackwell GPU support, or an older supported CUDA version for Hopper and Ada
Ninja (required; the Visual Studio generator is not supported for Kokkos)
A Kokkos download, if you do not want the build scripts to fetch one automatically
Preparing the MSVC toolchain#
Open a Visual Studio x64 developer shell and configure the compatible toolchain:
"C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.50
Then confirm that the compiler resolves to the 14.50 toolchain:
where cl
The output should end in something like:
...\VC\Tools\MSVC\14.50.35717\bin\Hostx64\x64\cl.exe
Check that it is the 14.50 path and that it is the x64 host toolchain (Hostx64x64, not Hostx86x86) before continuing.
Configuring and building Kokkos + KCOCAL#
From the KCOCAL source directory, configure the project with Ninja and the MSVC compiler:
cd \path\to\KCOCAL
cmake -B build -G Ninja -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release
Once configured, use Git Bash or WSL2 to follow the normal Linux flow for the rest of the build and run workflow.
Building without SLURM#
If you are on a local machine, WSL2 box, or laptop without SLURM, the usual submit wrapper is not available. In that case, you must prepare the environment and drive the run yourself.
You need two things first:
A Kokkos install for your backend. There is no
install-ada89in the standard tree by default; usescripts/cocal_kokkos.sbatchas a recipe, or pointCOCAL_KOKKOS_DIRat an existing install.gfortranon yourPATH. A small Fortran helper is compiled as part of the staging step.
Example local CUDA Ada setup:
export COCAL_KOKKOS_VARIANT=ada89
export COCAL_CUDA_HOME=/usr/local/cuda
export COCAL_KOKKOS_DIR=/path/to/your/install-ada89/lib/cmake/Kokkos
source scripts/cocal_build_env.sh
Important shell note:
Use export on its own line rather than VAR=x source .... Bash clears
temporary assignments when source returns, so the build is configured
correctly but the variable reads back empty afterwards. This only affects
source.
For a manual run, set up the same things that cocal_run.sbatch would have
performed for you:
# 1. RNS_WLpeos.sh deletes its own output on exit unless this is set.
export COCAL_KEEP_RUN_DIR=1
# 2. .gitignore excludes work_area_RNS*, so a fresh clone lacks the directory
# that staging copies parameter files into.
mkdir -p reference/legacy-fortran/Cocal/work_area_RNS
# 3. These are cocal_run.sbatch defaults, not RNS_WLpeos.sh defaults.
export COCAL_ITER_MAX=2000 COCAL_PARAM_FLAG=H3
export COCAL_ROT_LAW=UR COCAL_NUM_SOL_SEQ=3
./RNS_WLpeos.sh serial
If you forget COCAL_KEEP_RUN_DIR, the run will still appear to succeed and
print results, but it will delete the run directory as it exits.
The Linux guide and Windows guide are therefore the same workflow once you are in Git Bash or WSL2: configure the toolchain, point at a matching Kokkos install, source the build environment, and then run the model manually without SLURM.