Compiling Perple_X from Source¶
Compiling Perple_X from its source code is the most robust way to ensure that the executables are compatible with your system. Compiling is recommended if the release executables do not run or if maximum reproducibility and/or optimization is required.
Requirements¶
A Fortran compiler compatible with Fortran 77/90 (
gfortranrecommended)make(or an equivalent build tool)A standard shell environment
Obtaining a Fortran Compiler¶
Linux¶
gfortranis typically available via the system package manager (e.g.,apt,dnf,pacman).
macOS¶
gfortranis most easily installed via Homebrew as part of GCC:
Windows¶
gfortranis provided by the MSYS2 MinGW-w64 toolchain:Tip
From within the
MSYS2 MINGW64shell, the following command installs the packages needed to build Perple_X:pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-make
Source Code Location¶
The Perple_X source code and makefile are in the src directory of the release archive.
Basic Procedure¶
Start a command shell and change into the
srcdirectory:cd src
Windows
Compilation must be done in the
MSYS2 MINGW64shell.Verify that a suitable Fortran compiler is available:
gfortran --versionBuild the executables:
make
This will compile all supported executables using the default
makefilesettings.The compiled executables will be in
src. Move them or addsrcto yourPATH(see Adding to PATH).
Optional Build Settings¶
The build can be customized by passing variables to the make command on the command line.
Examples:
# Use a specific Fortran compiler make FC=gfortran-13 # Prefer static Fortran runtime libraries where supported make STATIC=1
Platform-specific Notes¶
Linux¶
Selected runtime libraries are linked statically when
STATIC=1 is used, core system libraries (e.g., libc and libm)
remain dynamically linked.
macOS¶
Static linking is not supported.