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 (gfortran recommended)

  • make (or an equivalent build tool)

  • A standard shell environment


Obtaining a Fortran Compiler

Linux

gfortran is typically available via the system package manager (e.g., apt, dnf, pacman).

macOS

gfortran is most easily installed via Homebrew as part of GCC:

Windows

gfortran is provided by the MSYS2 MinGW-w64 toolchain:

Tip

From within the MSYS2 MINGW64 shell, 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

  1. Start a command shell and change into the src directory:

    cd src
    

    Windows

    Compilation must be done in the MSYS2 MINGW64 shell.

  2. Verify that a suitable Fortran compiler is available:

    gfortran --version
    
  3. Build the executables:

    make
    

    This will compile all supported executables using the default makefile settings.

  4. The compiled executables will be in src. Move them or add src to your PATH (see Adding to PATH).

  5. Verify that the executables run correctly.


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.