Skip to content

Commit 09f4b8d

Browse files
authored
Merge pull request #476 from bluescarni/pr/more_models
Additional models
2 parents 0288aa6 + 7373fde commit 09f4b8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+14805
-284
lines changed

.github/workflows/gha_ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build
4040
shell: pwsh
4141
run: |
42-
conda install -y cmake llvmdev tbb-devel tbb libboost-devel xtensor xtensor-blas blas blas-devel fmt spdlog sleef zlib libzlib mppp
42+
conda install -y cmake llvmdev tbb-devel tbb libboost-devel xtensor xtensor-blas blas blas-devel fmt spdlog sleef zlib libzlib mppp openssl
4343
mkdir build
4444
cd build
4545
cmake ../ -G "Visual Studio 17 2022" -A x64 -DHEYOKA_BUILD_TESTS=yes -DHEYOKA_WITH_MPPP=yes -DHEYOKA_BUILD_TUTORIALS=ON -DHEYOKA_ENABLE_IPO=yes -DHEYOKA_WITH_SLEEF=yes
@@ -68,13 +68,13 @@ jobs:
6868
runs-on: ubuntu-latest
6969
steps:
7070
- uses: actions/checkout@v4
71-
with:
72-
# NOTE: this is needed by codecov
73-
# apparently:
74-
# https://github.com/codecov/codecov-action/issues/190
75-
fetch-depth: 2
7671
- name: Build
7772
run: bash tools/gha_conda_coverage.sh
73+
- uses: codecov/codecov-action@v4
74+
with:
75+
fail_ci_if_error: true
76+
files: ./build/coverage.info
77+
token: ${{ secrets.CODECOV_TOKEN }}
7878
conda_ubsan:
7979
runs-on: ubuntu-latest
8080
steps:

CMakeLists.txt

+27-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
1111
FORCE)
1212
endif()
1313

14-
project(heyoka VERSION 7.2.2 LANGUAGES CXX C)
14+
project(heyoka VERSION 7.3.0 LANGUAGES CXX C)
1515

1616
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")
1717

@@ -32,6 +32,7 @@ include(YACMACompilerLinkerSettings)
3232
option(HEYOKA_BUILD_TESTS "Build unit tests." OFF)
3333
option(HEYOKA_BUILD_BENCHMARKS "Build benchmarks." OFF)
3434
option(HEYOKA_BUILD_TUTORIALS "Build tutorials." OFF)
35+
option(HEYOKA_BUILD_UTILS "Build utilities." OFF)
3536
option(HEYOKA_WITH_MPPP "Enable features relying on mp++." OFF)
3637
option(HEYOKA_WITH_SLEEF "Enable features relying on SLEEF." OFF)
3738
option(HEYOKA_BUILD_STATIC_LIBRARY "Build heyoka as a static library, instead of dynamic." OFF)
@@ -205,6 +206,10 @@ set(HEYOKA_SRC_FILES
205206
"${CMAKE_CURRENT_SOURCE_DIR}/src/lagrangian.cpp"
206207
"${CMAKE_CURRENT_SOURCE_DIR}/src/hamiltonian.cpp"
207208
"${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp"
209+
"${CMAKE_CURRENT_SOURCE_DIR}/src/eop_data.cpp"
210+
"${CMAKE_CURRENT_SOURCE_DIR}/src/eop_data_download.cpp"
211+
"${CMAKE_CURRENT_SOURCE_DIR}/src/eop_data_iers_rapid.cpp"
212+
"${CMAKE_CURRENT_SOURCE_DIR}/src/eop_data_iers_long_term.cpp"
208213
# VSOP2013 details.
209214
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/vsop2013/vsop2013_1_1.cpp"
210215
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/vsop2013/vsop2013_1_2.cpp"
@@ -266,6 +271,8 @@ set(HEYOKA_SRC_FILES
266271
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/elp2000/elp2000_10_15.cpp"
267272
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/elp2000/elp2000_16_21.cpp"
268273
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/elp2000/elp2000_22_36.cpp"
274+
# EOP data details.
275+
"${CMAKE_CURRENT_SOURCE_DIR}/src/detail/eop_data/builtin_eop_data.cpp"
269276
# Models.
270277
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/pendulum.cpp"
271278
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/nbody.cpp"
@@ -280,6 +287,9 @@ set(HEYOKA_SRC_FILES
280287
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/nrlmsise00_tn.cpp"
281288
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/jb08_tn.cpp"
282289
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/sgp4.cpp"
290+
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/time_conversions.cpp"
291+
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/frame_transformations.cpp"
292+
"${CMAKE_CURRENT_SOURCE_DIR}/src/model/era.cpp"
283293
# Callbacks.
284294
"${CMAKE_CURRENT_SOURCE_DIR}/src/callback/angle_reducer.cpp"
285295
# Math functions.
@@ -330,7 +340,7 @@ if(HEYOKA_WITH_SLEEF)
330340
endif()
331341

332342
# Setup the heyoka ABI version number.
333-
set(HEYOKA_ABI_VERSION 34)
343+
set(HEYOKA_ABI_VERSION 35)
334344

335345
if(HEYOKA_BUILD_STATIC_LIBRARY)
336346
# Setup of the heyoka static library.
@@ -501,36 +511,26 @@ find_package(TBB REQUIRED CONFIG)
501511
target_link_libraries(heyoka PRIVATE TBB::tbb)
502512

503513
# Mandatory dependency on Boost.
504-
# NOTE: need 1.69 for safe numerics.
505-
set(_HEYOKA_MIN_BOOST_VERSION "1.69")
514+
# NOTE: need 1.85 for charconv.
515+
set(_HEYOKA_MIN_BOOST_VERSION "1.85")
506516
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
507517
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
508518
# MODULE mode as last resort.
509-
find_package(Boost ${_HEYOKA_MIN_BOOST_VERSION} QUIET COMPONENTS serialization CONFIG)
519+
find_package(Boost ${_HEYOKA_MIN_BOOST_VERSION} QUIET COMPONENTS serialization charconv CONFIG)
510520
if(NOT ${Boost_FOUND})
511521
message(STATUS "Boost not found in CONFIG mode, retrying in MODULE mode.")
512-
find_package(Boost ${_HEYOKA_MIN_BOOST_VERSION} QUIET MODULE COMPONENTS serialization)
522+
find_package(Boost ${_HEYOKA_MIN_BOOST_VERSION} QUIET MODULE COMPONENTS serialization charconv)
513523
endif()
514524
if(NOT ${Boost_FOUND})
515525
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
516526
endif()
517527
message(STATUS "Found Boost version ${Boost_VERSION}.")
518528
target_link_libraries(heyoka PUBLIC Boost::boost Boost::serialization)
529+
target_link_libraries(heyoka PRIVATE Boost::charconv)
519530
# NOTE: quench warnings from Boost when building the library.
520531
target_compile_definitions(heyoka PRIVATE BOOST_ALLOW_DEPRECATED_HEADERS)
521-
522-
# NOTE: recent versions of libcxx remove std::unary_function/std::binary_function
523-
# (which have been deprecated since long) in C++17 mode. This breaks, e.g., hashing
524-
# functionality on older Boost versions. See:
525-
# https://github.com/boostorg/container_hash/issues/22
526-
# Note that the better approach here would be to detect libcxx rather than
527-
# just Apple, but at this time it seems like there's no easy way to detect
528-
# the stdlib implementation/version from CMake.
529-
if(APPLE AND Boost_VERSION VERSION_LESS "1.81.0")
530-
# NOTE: make this a PUBLIC definition just to err on the side
531-
# of caution.
532-
target_compile_definitions(heyoka PUBLIC BOOST_NO_CXX98_FUNCTION_BASE)
533-
endif()
532+
# NOTE: make sure we do not use deprecated ASIO bits.
533+
target_compile_definitions(heyoka PRIVATE BOOST_ASIO_NO_DEPRECATED)
534534

535535
# Optional dependency on mp++.
536536
set(_HEYOKA_MIN_SUPPORTED_MPPP_VERSION 2)
@@ -571,6 +571,10 @@ if(HEYOKA_WITH_SLEEF)
571571
target_link_libraries(heyoka PRIVATE heyoka::SLEEF)
572572
endif()
573573

574+
# Mandatory private dependency on openssl.
575+
find_package(OpenSSL REQUIRED CONFIG)
576+
target_link_libraries(heyoka PRIVATE OpenSSL::SSL OpenSSL::Crypto)
577+
574578
# Configure config.hpp.
575579
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/include/heyoka/config.hpp" @ONLY)
576580

@@ -627,3 +631,7 @@ endif()
627631
if(HEYOKA_BUILD_TUTORIALS)
628632
add_subdirectory(tutorial)
629633
endif()
634+
635+
if(HEYOKA_BUILD_UTILS)
636+
add_subdirectory(utils)
637+
endif()

benchmark/CMakeLists.txt

-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
2-
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
3-
# MODULE mode as last resort.
41
# NOTE: don't find a specific version as we already checked
52
# outside that the Boost version is appropriate.
63
find_package(Boost QUIET COMPONENTS program_options CONFIG)
@@ -11,17 +8,6 @@ endif()
118
if(NOT ${Boost_FOUND})
129
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
1310
endif()
14-
if(NOT TARGET Boost::program_options)
15-
message(STATUS "The 'Boost::program_options' imported target is missing, creating it.")
16-
add_library(Boost::program_options UNKNOWN IMPORTED)
17-
set_target_properties(Boost::program_options PROPERTIES
18-
INTERFACE_INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}"
19-
)
20-
set_target_properties(Boost::program_options PROPERTIES
21-
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
22-
IMPORTED_LOCATION "${Boost_PROGRAM_OPTIONS_LIBRARY}"
23-
)
24-
endif()
2511

2612
# Find the xtensor bits.
2713
find_package(xtensor REQUIRED CONFIG)

codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ coverage:
44
- "tutorial/.*"
55
- "src/detail/vsop2013/.*"
66
- "src/detail/elp2000/.*"
7+
- "src/detail/eop_data/.*"
78
- "include/heyoka/detail/tanuki*"
89
- "include/heyoka/detail/mdspan*"
910
- "src/detail/erfa/.*"

doc/changelog.rst

+25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
Changelog
22
=========
33

4+
7.3.0 (unreleased)
5+
------------------
6+
7+
New
8+
~~~
9+
10+
- Add support for LLVM 20
11+
(`#477 <https://github.com/bluescarni/heyoka/pull/477>`__).
12+
- Introduce class to represent, manage and update EOP data
13+
(`#476 <https://github.com/bluescarni/heyoka/pull/476>`__).
14+
- New models: time conversions, frame transformations, Earth
15+
rotation angle
16+
(`#476 <https://github.com/bluescarni/heyoka/pull/476>`__).
17+
18+
Changes
19+
~~~~~~~
20+
21+
- heyoka now requires LLVM >= 16
22+
(`#477 <https://github.com/bluescarni/heyoka/pull/477>`__).
23+
- heyoka now requires Boost >= 1.85
24+
(`#476 <https://github.com/bluescarni/heyoka/pull/476>`__).
25+
- heyoka now depends on OpenSSL
26+
(`#476 <https://github.com/bluescarni/heyoka/pull/476>`__).
27+
28+
429
7.2.1 (2025-01-07)
530
------------------
631

doc/install.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ and several CPU architectures (x86-64, 64-bit ARM and 64-bit PowerPC).
1515
heyoka has the following **mandatory** dependencies:
1616

1717
* the `LLVM <https://llvm.org/>`__ compiler infrastructure library (version >=16 and <=20),
18-
* the `Boost <https://www.boost.org/>`__ C++ libraries (version >=1.69),
18+
* the `Boost <https://www.boost.org/>`__ C++ libraries (version >=1.85),
1919
* the `{fmt} <https://fmt.dev/latest/index.html>`__ library (version >=9 and <=11),
2020
* the `spdlog <https://github.com/gabime/spdlog>`__ library,
21-
* the `TBB <https://github.com/oneapi-src/oneTBB>`__ library.
21+
* the `TBB <https://github.com/oneapi-src/oneTBB>`__ library,
22+
* the `OpenSSL <https://www.openssl.org/>`__ library.
2223

2324
Additionally, heyoka has the following **optional** dependencies:
2425

heyoka-config.cmake.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ endif()
2121
# NOTE: we look for Boost in CONFIG mode first, as that has become the official supported way
2222
# of locating Boost in recent Boost/CMake versions. If we fail, we try again in
2323
# MODULE mode as last resort.
24-
find_package(Boost @_HEYOKA_MIN_BOOST_VERSION@ QUIET COMPONENTS serialization CONFIG)
24+
find_package(Boost @_HEYOKA_MIN_BOOST_VERSION@ QUIET COMPONENTS serialization charconv CONFIG)
2525
if(NOT ${Boost_FOUND})
26-
find_package(Boost @_HEYOKA_MIN_BOOST_VERSION@ QUIET MODULE COMPONENTS serialization)
26+
find_package(Boost @_HEYOKA_MIN_BOOST_VERSION@ QUIET MODULE COMPONENTS serialization charconv)
2727
endif()
2828
if(NOT ${Boost_FOUND})
2929
message(FATAL_ERROR "Could not locate Boost in either CONFIG or MODULE mode.")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2020-2025 Francesco Biscani ([email protected]), Dario Izzo ([email protected])
2+
//
3+
// This file is part of the heyoka library.
4+
//
5+
// This Source Code Form is subject to the terms of the Mozilla
6+
// Public License v. 2.0. If a copy of the MPL was not distributed
7+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
9+
#ifndef HEYOKA_DETAIL_EOP_DATA_BUILTIN_EOP_DATA_HPP
10+
#define HEYOKA_DETAIL_EOP_DATA_BUILTIN_EOP_DATA_HPP
11+
12+
#include <heyoka/config.hpp>
13+
#include <heyoka/eop_data.hpp>
14+
15+
HEYOKA_BEGIN_NAMESPACE
16+
17+
namespace detail
18+
{
19+
20+
extern const char *const builtin_eop_data_ts;
21+
22+
extern const eop_data_row builtin_eop_data[19437];
23+
24+
} // namespace detail
25+
26+
HEYOKA_END_NAMESPACE
27+
28+
#endif

include/heyoka/detail/erfa_decls.hpp

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2020-2025 Francesco Biscani ([email protected]), Dario Izzo ([email protected])
2+
//
3+
// This file is part of the heyoka library.
4+
//
5+
// This Source Code Form is subject to the terms of the Mozilla
6+
// Public License v. 2.0. If a copy of the MPL was not distributed
7+
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
8+
9+
#ifndef HEYOKA_DETAIL_ERFA_DECLS_HPP
10+
#define HEYOKA_DETAIL_ERFA_DECLS_HPP
11+
12+
// NOTE: this header contains declarations of erfa functions used within heyoka.
13+
14+
extern "C" {
15+
int eraUtctai(double, double, double *, double *);
16+
int eraTaitt(double, double, double *, double *);
17+
int eraUtcut1(double, double, double, double *, double *);
18+
int eraTaiutc(double, double, double *, double *);
19+
double eraEra00(double, double);
20+
}
21+
22+
#endif

include/heyoka/detail/fast_unordered.hpp

+2-37
Original file line numberDiff line numberDiff line change
@@ -11,57 +11,22 @@
1111

1212
#include <heyoka/config.hpp>
1313

14-
#include <boost/version.hpp>
15-
16-
#if (BOOST_VERSION / 100000 > 1) || (BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 >= 81)
17-
18-
#define HEYOKA_HAVE_BOOST_UNORDERED_FLAT
19-
20-
#endif
21-
22-
#if defined(HEYOKA_HAVE_BOOST_UNORDERED_FLAT)
23-
2414
#include <boost/unordered/unordered_flat_map.hpp>
2515
#include <boost/unordered/unordered_flat_set.hpp>
2616

27-
#else
28-
29-
#include <unordered_map>
30-
#include <unordered_set>
31-
32-
#endif
33-
3417
HEYOKA_BEGIN_NAMESPACE
3518

3619
namespace detail
3720
{
3821

3922
template <typename... Args>
40-
using fast_uset =
41-
#if defined(HEYOKA_HAVE_BOOST_UNORDERED_FLAT)
42-
boost::unordered_flat_set<Args...>
43-
#else
44-
std::unordered_set<Args...>
45-
#endif
46-
;
23+
using fast_uset = boost::unordered_flat_set<Args...>;
4724

4825
template <typename... Args>
49-
using fast_umap =
50-
#if defined(HEYOKA_HAVE_BOOST_UNORDERED_FLAT)
51-
boost::unordered_flat_map<Args...>
52-
#else
53-
std::unordered_map<Args...>
54-
#endif
55-
;
26+
using fast_umap = boost::unordered_flat_map<Args...>;
5627

5728
} // namespace detail
5829

5930
HEYOKA_END_NAMESPACE
6031

61-
#if defined(HEYOKA_HAVE_BOOST_UNORDERED_FLAT)
62-
63-
#undef HEYOKA_HAVE_BOOST_UNORDERED_FLAT
64-
65-
#endif
66-
6732
#endif

include/heyoka/detail/llvm_helpers.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ HEYOKA_DLL_PUBLIC llvm::Constant *llvm_constantfp(llvm_state &, llvm::Type *, do
140140

141141
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_ult(llvm_state &, llvm::Value *, llvm::Value *);
142142
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_uge(llvm_state &, llvm::Value *, llvm::Value *);
143+
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_ule(llvm_state &, llvm::Value *, llvm::Value *);
143144
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_oge(llvm_state &, llvm::Value *, llvm::Value *);
144145
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_ole(llvm_state &, llvm::Value *, llvm::Value *);
145146
HEYOKA_DLL_PUBLIC llvm::Value *llvm_fcmp_olt(llvm_state &, llvm::Value *, llvm::Value *);
@@ -209,6 +210,10 @@ HEYOKA_DLL_PUBLIC std::pair<llvm::Value *, llvm::Value *> llvm_eft_product(llvm_
209210
HEYOKA_DLL_PUBLIC std::pair<llvm::Value *, llvm::Value *> llvm_dl_add(llvm_state &, llvm::Value *, llvm::Value *,
210211
llvm::Value *, llvm::Value *);
211212

213+
// Subtraction.
214+
HEYOKA_DLL_PUBLIC std::pair<llvm::Value *, llvm::Value *> llvm_dl_sub(llvm_state &, llvm::Value *, llvm::Value *,
215+
llvm::Value *, llvm::Value *);
216+
212217
// Multiplication.
213218
HEYOKA_DLL_PUBLIC std::pair<llvm::Value *, llvm::Value *> llvm_dl_mul(llvm_state &, llvm::Value *, llvm::Value *,
214219
llvm::Value *, llvm::Value *);

include/heyoka/detail/real_helpers.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ llvm::Function *real_nary_op(llvm_state &, llvm::Type *, const std::string &, un
3535
std::pair<llvm::Value *, llvm::Value *> llvm_real_sincos(llvm_state &, llvm::Value *);
3636
llvm::Value *llvm_real_fcmp_ult(llvm_state &, llvm::Value *, llvm::Value *);
3737
llvm::Value *llvm_real_fcmp_uge(llvm_state &, llvm::Value *, llvm::Value *);
38+
llvm::Value *llvm_real_fcmp_ule(llvm_state &, llvm::Value *, llvm::Value *);
3839
llvm::Value *llvm_real_fcmp_oge(llvm_state &, llvm::Value *, llvm::Value *);
3940
llvm::Value *llvm_real_fcmp_ole(llvm_state &, llvm::Value *, llvm::Value *);
4041
llvm::Value *llvm_real_fcmp_olt(llvm_state &, llvm::Value *, llvm::Value *);

0 commit comments

Comments
 (0)