Setting up your environment this way avoids most errors on this page.
| Practice | What happens if you skip it |
|---|---|
| Run install_requirements.sh before the toolchain to install compilers and system development packages. | OpenBLAS, the first package built, fails with stdio.h not found or a non-zero exit. |
| Set the MPI type explicitly with --mpi-mode and match the MPI your system actually uses. | ScaLAPACK and ELPA compile or link against the wrong MPI, and the logs rarely make that obvious. |
| Make sure there is enough memory before libint builds, and limit parallel jobs with -j. | The script compiles on all cores by default, and libint is killed when memory runs out. |
| When something fails, open make.log for the failing package and start from the first error. | The final install_successful error is only a consequence of an earlier failure, so fixing it directly fixes the wrong thing. |
| If you only need to run CP2K, prefer prebuilt packages from conda-forge or your Linux distribution. | A full source build takes hours and has to be repeated on every new machine. |
Troubleshooting by error message
Find your exact error message. Each entry gives the cause, the fix, and what may come up after the fix.
getarch.c:80:10: fatal error: stdio.h: No such file or directory
Cause: The toolchain cannot find the C standard headers while building OpenBLAS, usually because the compiler or system development packages are incomplete.
Fix: Run which gcc to see which compiler is used; on Ubuntu install build-essential and rerun the toolchain.
What may come next: The make: *** No rule to make target 'Makefile.' error that follows in the same log is a consequence and disappears once the header problem is fixed.
ERROR: (.../install_openblas.sh, line 72) Non-zero exit code detected.
Cause: The OpenBLAS build failed, most often because system dependencies are missing.
Fix: Run sudo ./install_requirements.sh in the toolchain folder, then rerun install_cp2k_toolchain.sh.
What may come next: Once OpenBLAS builds, ScaLAPACK, ELPA and later packages may still fail and need fixing one by one.
ERROR: (./scripts/install_scalapack.sh, line 47) Non-zero exit code detected. (ELPA, libint and others use the same format)
Cause: This is the toolchain's generic message: a package failed to build, and the real cause is in that package's build log.
Fix: Open make.log for that package under the build folder, find the first error, and handle that error.
What may come next: ScaLAPACK and ELPA failures are often tied to MPI compiler settings, and changing MPI may mean rebuilding every package built so far.
make[2]: *** [CMakeFiles/libint_f.dir/build.make:117: CMakeFiles/libint_f.dir/depend] Killed
Cause: libint needs a lot of memory to compile, and the script compiles on all cores by default, so the system kills it when memory runs out. On clusters you will usually also see an oom-kill message.
Fix: Request more memory, or reduce parallel jobs by passing something like -j 10 to the toolchain.
What may come next: With all cores in use, peak memory can reach about 181 GB, and fewer parallel jobs make the build much slower.
install_successful: No such file or directory
Cause: An earlier package failed before writing its success marker, so the script cannot find it.
Fix: Scroll up to the first package that failed, fix it, and rerun the toolchain.
error: call to undeclared function 'BI_ivmcopy'; ISO C99 and later do not support implicit function declarations
Cause: When building ScaLAPACK with Intel icx, the newer compiler enforces the C standard more strictly and the old ScaLAPACK code fails.
Fix: Use icx, icpx and ifx as compilers instead of the MPI wrappers mpiicc, mpiicpc and mpiifort.
What may come next: After switching compilers, every package already built with the Intel compilers must be rebuilt.
Geometry optimization hangs after the first force evaluation (with toolchain-built ELPA)
Cause: The ELPA built by the toolchain hangs during diagonalization.
Fix: Add PREFERRED_DIAG_LIBRARY SL to the GLOBAL section of the input so ScaLAPACK does the diagonalization.
What may come next: This only bypasses ELPA, and diagonalization may be slower for large systems.
Scientify is a cloud computer with research software installed and AI agents such as Codex and Claude Code built in. Describe what you need in one sentence, for example "optimize the structure of this water cluster with the PBE functional and a DZVP basis set", and the agent uses the preinstalled CP2K to do the modeling and computation, with no software to install and no code to write.
Compared with installing more on your own computer, the cloud computer already has CP2K 2026.1 (OpenMPI parallel build) with PLUMED 2.10.1, so there is no toolchain to run and no hours spent compiling libint, and runs continue after you close your laptop.
The cloud computer comes with more computing power: CPU and GPU clusters can be called on demand for large-scale scientific computing. Compute is billed by the minutes you actually use, so nothing is wasted.
- Cloud computer
- 4 vCPU · 8 GB
- Top configuration, for data processing and small to medium jobs
- Callable GPU
- 96 GB VRAM
- Up to an RTX PRO 6000 per GPU; H800 80 GB and up to 8 × A10G also available
- Callable CPU
- 224 cores · 3 TB
- Largest spec, for large parallel computations
References
- CP2K toolchain README — --install-all, --mpi-mode, -j and log locations
- CP2K manual: build from source — Official build procedure
- cp2k-user: stdio.h missing in OpenBLAS — The getarch.c and Makefile. errors
- cp2k-user: reply on stdio.h — Checking the compiler path
- CP2K Google Group: OpenBLAS, ScaLAPACK and ELPA failures — install_requirements.sh
- cp2k-user: libint build failure — install_libint.sh non-zero exit
- CP2K Google Group: libint build Killed — Out of memory and oom-kill
- cp2k-user: libint memory and parallel jobs — Suggests more memory or -j 10
- cp2k-user: building ScaLAPACK with icx — BI_ivmcopy and install_successful
- CP2K Google Group: ELPA hang — PREFERRED_DIAG_LIBRARY SL