Skip to content

Commit 08cd0cb

Browse files
255 organize odeint as stand alone library (#256)
+ fixing golden record tag fetch in case of CI pipeline shallow clone of repo
2 parents 882aeb6 + 2b30d1f commit 08cd0cb

5 files changed

Lines changed: 22 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ add_subdirectory(extra/MyMPILib)
214214
add_subdirectory(src/hdf5_tools)
215215
add_subdirectory(src/polylag)
216216
add_subdirectory(src/interpolate)
217+
add_subdirectory(src/odeint)
217218
add_subdirectory(src/field)
218219
add_subdirectory(src/collisions)
219220
add_subdirectory(src/transport)

CMakeSources.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ add_library(neo STATIC
66
src/arnoldi.f90
77
src/libneo_kinds.f90
88
src/math_constants.f90
9-
src/odeint_allroutines.f90
109
src/poincare.f90
1110
src/rusage_type.f90
1211
src/system_utility.f90
@@ -48,6 +47,7 @@ target_link_libraries(neo PUBLIC
4847
interpolate
4948
hdf5_tools
5049
neo_field
50+
odeint
5151
)
5252

5353
target_link_libraries(neo PRIVATE

src/odeint/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
add_library(odeint STATIC
2+
odeint_allroutines.f90)
3+
4+
if(ENABLE_OPENMP)
5+
find_package(OpenMP COMPONENTS Fortran)
6+
if(OpenMP_Fortran_FOUND)
7+
target_link_libraries(odeint PUBLIC OpenMP::OpenMP_Fortran)
8+
endif()
9+
endif()
10+
11+
set_target_properties(odeint PROPERTIES
12+
Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
13+
target_include_directories(odeint PUBLIC
14+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
15+
add_library(LIBNEO::odeint ALIAS odeint)

test/odeint/fetch_golden_record.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ fi
1616

1717
echo "Fetching golden record from latest tag..."
1818

19-
# Get the latest tag
20-
LATEST_TAG=$(git tag --sort=-v:refname | head -1)
19+
# Get the latest tag from remote (works even on shallow clones)
20+
LATEST_TAG=$(git ls-remote --tags --sort=-v:refname origin | head -1 | sed 's|.*refs/tags/||')
2121
echo "Latest tag: $LATEST_TAG"
2222

23+
# Fetch only that tagged commit (no-op if already available locally)
24+
git fetch origin tag "$LATEST_TAG" --no-tags
25+
2326
# Fetch the old implementation
2427
echo "Fetching odeint_allroutines.f90 from $LATEST_TAG..."
2528
git show "$LATEST_TAG:src/odeint_allroutines.f90" > "$GOLDEN_FILE"

0 commit comments

Comments
 (0)