Platform Notes

OS-specific requirements for compiling the native C backends.

The hidden-attractors-fo library uses highly optimized C backends to accelerate fractional-order integration (EFORK and ABM solvers) and integer-order integration (RK4). These backends are automatically compiled via ctypes on first run, which requires a working C compiler on your system.

Platform Support Matrix

OSPythonCompiler RequirementOpenMP Support
Linux (Ubuntu/Debian)3.11+gcc (build-essential)Native (libgomp)
macOS (Apple Silicon/Intel)3.11+clang (Xcode Command Line Tools)Via Homebrew (libomp)
Windows3.11+gcc (via MinGW-w64 / MSYS2)Native (libgomp)

Linux Setup

Most Linux distributions come with gcc pre-installed or easily available.

sudo apt update
sudo apt install build-essential

No extra configuration is needed. The library will automatically detect gcc and compile with OpenMP support.


macOS Setup

macOS uses Apple’s clang, which does not ship with OpenMP support by default.

  1. Install Command Line Tools:

    xcode-select --install
  2. Install OpenMP via Homebrew:

    brew install libomp

The library’s compiler scripts (native/compile.py) are configured to automatically search for Homebrew’s libomp paths on macOS.


Windows Setup

Windows requires a GCC-compatible compiler. We strongly recommend MinGW-w64 via MSYS2.

  1. Install MSYS2 from msys2.org.
  2. Install the toolchain: Open the MSYS2 terminal and run:
    pacman -S mingw-w64-ucrt-x86_64-gcc
  3. Add to PATH: Ensure that the C:\msys64\ucrt64\bin directory is in your Windows system PATH environment variable.

You can verify the installation in a normal command prompt or PowerShell:

gcc --version

Fallback Mode and Disabling OpenMP

If compilation fails, the library will automatically fall back to pure-Python/NumPy implementations of the solvers. You will see a warning in the console:

Warning

Failed to compile C backend. Falling back to Python implementation. Integration will be significantly slower.

Disabling OpenMP

If you have a working C compiler but are facing issues with OpenMP (e.g., missing library headers), you can force the compiler to skip OpenMP by setting an environment variable before running your Python script:

Linux/macOS:

export ALLOW_NO_OPENMP=1
python my_script.py

Windows (PowerShell):

$env:ALLOW_NO_OPENMP="1"
python my_script.py

The C backend will still compile and run, but multi-threaded parallel loops (like evaluating multiple initial conditions simultaneously) will run sequentially on a single core.