Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
required: false
default: ''
full:
description: run the full suite (fast + slow + regression); nightly only
description: run the full suite (fast + slow + regression); set by the libneo full-ci gate
required: false
default: 'false'

Expand All @@ -23,9 +23,6 @@ permissions:
checks: write
actions: read

env:
LIBNEO_BRANCH: ${{ inputs.libneo_ref || github.head_ref || github.ref_name }}

jobs:
test:
name: Build and Test
Expand Down Expand Up @@ -83,7 +80,12 @@ jobs:
- name: Build SIMPLE (deterministic FP for reproducibility)
run: |
make clean
make build-deterministic
REF="${{ inputs.libneo_ref }}"
if [ -n "$REF" ]; then
make build-deterministic LIBNEO_REF="$REF"
else
make build-deterministic
fi

# libneo-gate dispatch (no full) runs only the sub-minute smoke set;
# push, PR and full=true run the complete suite below.
Expand Down Expand Up @@ -165,9 +167,13 @@ jobs:
- name: Run CGAL Wall Unit Tests (CGAL enabled, minimal)
run: |
make clean
REF="${{ inputs.libneo_ref }}"
LIBNEO_ARG=""
if [ -n "$REF" ]; then LIBNEO_ARG="LIBNEO_REF=$REF"; fi
make test-fast CONFIG=Fast \
FLAGS='-DSIMPLE_ENABLE_CGAL=ON -DENABLE_PYTHON_INTERFACE=OFF -DSIMPLE_ENABLE_PYTHON_TOOLS=OFF' \
TEST='test_chartmap_metadata|test_stl_wall_intersection'
TEST='test_chartmap_metadata|test_stl_wall_intersection' \
$LIBNEO_ARG

build-docs:
name: Build Documentation
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,18 @@ else()
message(STATUS "Fortplot disabled for NVHPC compiler (compatibility issues)")
endif()

# fortnum provides the multidimensional root finder (multiroot_hybrids) that
# replaced the bundled MINPACK hybrd1 in orbit_symplectic_quasi.
if(NOT TARGET fortnum)
include(FetchContent)
FetchContent_Declare(
fortnum
GIT_REPOSITORY https://github.com/lazy-fortran/fortnum.git
GIT_TAG 92de6e949a772cfffc73bb5295fe5e2b056b9c18
)
FetchContent_MakeAvailable(fortnum)
endif()

if (SIMPLE_TESTING)
message(STATUS "Unit Tests enabled!")
endif()
Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
CONFIG ?= Release
FLAGS ?=
BUILD_DIR := build

# Prevent ambient shell env from silently changing which libneo is fetched.
# Pass the ref explicitly via: make ... LIBNEO_REF=<branch|tag|sha>
# $(origin) distinguishes a command-line assignment from an env import.
unexport LIBNEO_REF LIBNEO_PATH LIBNEO_BRANCH
ifeq ($(origin LIBNEO_REF),command line)
FLAGS += -DLIBNEO_REF=$(LIBNEO_REF)
endif
ifeq ($(origin LIBNEO_PATH),command line)
FLAGS += -DLIBNEO_SOURCE_DIR=$(LIBNEO_PATH)
endif
BUILD_NINJA := $(BUILD_DIR)/build.ninja
PYTHON_FOR_TESTS := $(if $(wildcard .venv/bin/python),$(CURDIR)/.venv/bin/python,python)
SIMPLE_GVEC_QA_CACHE_ROOT ?= $(HOME)/data/SIMPLE/gvec_qa_roundtrip
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ The code is free to use and modify under the MIT License and links to Runge-Kutt
Run `make` to produce a `build` directory including the main executable
`simple.x`, main library `libsimple.so` and Python module `pysimple`.

To build against a specific libneo branch, tag, or commit SHA, pass it
explicitly; the ambient shell environment is intentionally ignored:

```bash
make LIBNEO_REF=my-branch # via make
cmake -DLIBNEO_REF=my-branch ... # via cmake directly
```

To use a local libneo checkout instead of fetching from GitHub:

```bash
make LIBNEO_PATH=/path/to/libneo
cmake -DLIBNEO_SOURCE_DIR=/path/to/libneo ...
```

Required build tools:
* CMake (>= 3.22)
* Ninja
Expand Down
14 changes: 5 additions & 9 deletions cmake/Util.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,10 @@ function(find_or_fetch DEPENDENCY)
if("${_dep_lower}" STREQUAL "libneo")
set(_repo_url "https://github.com/itpplasma/libneo.git")
set(_branch "")
set(_branch_source "")
if(DEFINED LIBNEO_BRANCH AND NOT "${LIBNEO_BRANCH}" STREQUAL "")
string(STRIP "${LIBNEO_BRANCH}" _branch)
set(_branch_source "cache")
elseif(DEFINED ENV{LIBNEO_BRANCH} AND NOT "$ENV{LIBNEO_BRANCH}" STREQUAL "")
string(STRIP "$ENV{LIBNEO_BRANCH}" _branch)
set(_branch_source "env")

# Override via -DLIBNEO_REF=<branch|tag|sha>; never read from $ENV.
if(DEFINED LIBNEO_REF AND NOT "${LIBNEO_REF}" STREQUAL "")
string(STRIP "${LIBNEO_REF}" _branch)
endif()

if(NOT _branch STREQUAL "")
Expand All @@ -93,8 +90,7 @@ function(find_or_fetch DEPENDENCY)
set(_branch_valid TRUE)
endif()
if(NOT _branch_valid)
message(WARNING "LIBNEO branch '${_branch}' (source: ${_branch_source}) not found; falling back to main")
set(_branch "")
message(WARNING "LIBNEO_REF='${_branch}' not found as a branch; treating as tag or SHA")
endif()
endif()

Expand Down
11 changes: 4 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
set(SOURCES
${CMAKE_BINARY_DIR}/version.f90
lapack_interfaces.f90
contrib/minpack_interfaces.f90
contrib/minpack.f90
sorting_mod.f90
wall/chartmap_metadata.f90
wall/stl_wall_intersection.F90
Expand Down Expand Up @@ -99,11 +97,6 @@ target_link_libraries(simple PUBLIC pyplot)
# Apply SIMPLE-specific compile options
target_compile_options(simple PRIVATE ${SIMPLE_COMPILE_OPTIONS})

if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set_source_files_properties(contrib/minpack.f90 PROPERTIES
COMPILE_FLAGS "-Wno-compare-reals -Wno-implicit-interface -Wno-maybe-uninitialized")
endif()

# Apply trampoline error flags only to SIMPLE library (not subprojects like fortplot)
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
target_compile_options(simple PRIVATE
Expand All @@ -120,6 +113,10 @@ target_link_libraries(simple PUBLIC
LIBNEO::neo
)

target_link_libraries(simple PUBLIC
fortnum
)

# For NVHPC: add built deps includes first to avoid gfortran-compiled modules in /usr/include
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
target_include_directories(simple BEFORE PUBLIC
Expand Down
52 changes: 0 additions & 52 deletions src/contrib/LICENSE.minpack

This file was deleted.

Loading
Loading