GithubHelp home page GithubHelp logo

bluescarni / heyoka Goto Github PK

View Code? Open in Web Editor NEW
190.0 7.0 11.0 465.9 MB

C++ library for ODE integration via Taylor's method and LLVM

Home Page: https://bluescarni.github.io/heyoka/

License: Mozilla Public License 2.0

CMake 0.01% C++ 99.93% Shell 0.01% Jupyter Notebook 0.06% Julia 0.01%
ode ode-solver differential-equations cpp cpp17 llvm just-in-time multiprecision extended-precision astronomy

heyoka's Introduction

heyoka

Build Status Build Status

language Code Coverage

Anaconda-Server Badge


Logo

Modern Taylor's method via just-in-time compilation
Explore the docs »

Report bug · Request feature · Discuss

The heyókȟa [...] is a kind of sacred clown in the culture of the Sioux (Lakota and Dakota people) of the Great Plains of North America. The heyoka is a contrarian, jester, and satirist, who speaks, moves and reacts in an opposite fashion to the people around them.

heyoka is a C++ library for the integration of ordinary differential equations (ODEs) via Taylor's method, based on automatic differentiation techniques and aggressive just-in-time compilation via LLVM. Notable features include:

  • support for single-precision, double-precision, extended-precision (80-bit and 128-bit), and arbitrary-precision floating-point types,
  • high-precision zero-cost dense output,
  • accurate and reliable event detection,
  • builtin support for analytical mechanics - bring your own Lagrangians/Hamiltonians and let heyoka formulate and solve the equations of motion,
  • builtin support for machine learning applications via neural network models,
  • the ability to maintain machine precision accuracy over tens of billions of timesteps,
  • batch mode integration to harness the power of modern SIMD instruction sets (including AVX/AVX2/AVX-512/Neon/VSX),
  • ensemble simulations and automatic parallelisation.

If you prefer using Python rather than C++, heyoka can be used from Python via heyoka.py, its Python bindings.

If you are using heyoka as part of your research, teaching, or other activities, we would be grateful if you could star the repository and/or cite our work. For citation purposes, you can use the following BibTex entry, which refers to the heyoka paper (arXiv preprint):

@article{10.1093/mnras/stab1032,
    author = {Biscani, Francesco and Izzo, Dario},
    title = "{Revisiting high-order Taylor methods for astrodynamics and celestial mechanics}",
    journal = {Monthly Notices of the Royal Astronomical Society},
    volume = {504},
    number = {2},
    pages = {2614-2628},
    year = {2021},
    month = {04},
    issn = {0035-8711},
    doi = {10.1093/mnras/stab1032},
    url = {https://doi.org/10.1093/mnras/stab1032},
    eprint = {https://academic.oup.com/mnras/article-pdf/504/2/2614/37750349/stab1032.pdf}
}

heyoka's novel event detection system is described in the following paper (arXiv preprint):

@article{10.1093/mnras/stac1092,
    author = {Biscani, Francesco and Izzo, Dario},
    title = "{Reliable event detection for Taylor methods in astrodynamics}",
    journal = {Monthly Notices of the Royal Astronomical Society},
    volume = {513},
    number = {4},
    pages = {4833-4844},
    year = {2022},
    month = {04},
    issn = {0035-8711},
    doi = {10.1093/mnras/stac1092},
    url = {https://doi.org/10.1093/mnras/stac1092},
    eprint = {https://academic.oup.com/mnras/article-pdf/513/4/4833/43796551/stac1092.pdf}
}

Quick example

As a simple example, here's how the ODE system of the pendulum is defined and numerically integrated in heyoka:

#include <iostream>

#include <heyoka/heyoka.hpp>

using namespace heyoka;

int main()
{
    // Create the symbolic variables x and v.
    auto [x, v] = make_vars("x", "v");

    // Create the integrator object
    // in double precision.
    auto ta = taylor_adaptive<double>{// Definition of the ODE system:
                                      // x' = v
                                      // v' = -9.8 * sin(x)
                                      {prime(x) = v, prime(v) = -9.8 * sin(x)},
                                      // Initial conditions
                                      // for x and v.
                                      {0.05, 0.025}};

    // Integrate for 10 time units.
    ta.propagate_for(10.);

    // Print the state vector.
    std::cout << "x(10) = " << ta.get_state()[0] << '\n';
    std::cout << "v(10) = " << ta.get_state()[1] << '\n';
}

Output:

x(10) = 0.0487397
y(10) = 0.0429423

Documentation

The full documentation can be found here.

Authors

  • Francesco Biscani (European Space Agency)
  • Dario Izzo (European Space Agency)

License

heyoka is released under the MPL-2.0 license.

heyoka's People

Contributors

bluescarni avatar darioizzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

heyoka's Issues

Partial Derivative with respect to system parameter not implemented in .diff utility [BUG]

Describe the bug
Tried to compute the variational/sensitivity equations of a system - of the form dx/dt = f(x,p) - but the following error shows up:
ValueError: Cannot differentiate an expression with respect to the non-variable expression

To Reproduce
Write a system like:

x, v = hy.make_vars("x", "v")
p = hk.par[0]

state = [x,v]
sys = [x, v, hy.cos( p ) - .1 * v - hy.sin( p ))]

And then compute the partial derivatives of the system with respect to the parameter p

for i in range(len(sys))
for j in range(len(p))
varsys[i][j] = hk.diff(sys[i],p[j])

Expected behavior
In principle the automatic differentiation engine would perform similar operations as those used to compute the partial derivatives with respect to system variables...

Environment (please complete the following information):

  • OS: Windows 10
  • Installation method: conda
  • Version: 0.11

it appears heyoka also has a implicit dependency on zlib but its not on the main page of pre-reqs[BUG]

Describe the bug
When building heyoka from github source via CMake, cmake cannot find the zlib library.

To Reproduce
Steps to reproduce the behavior:

  1. Downloaded llvm 10. Built using cmake -DLLVM_TARGETS_TO_BUILD=X86
  2. Installed llvm.
  3. run heyoka cmake ..
  4. Error cmake find_package cannot find zlib.

Expected behavior
Since I download boost, fmt, spdlog, and llvm I expected the cmake generation build system step to work.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows 10
  • Installation method: [source]
  • Version: [0.10]

Additional context
Add any other context about the problem here.

[BUG] The test taylor_adaptive_batch fails on FreeBSD

$ ./work/.build/test/taylor_adaptive_batch
[2022-01-27 10:29:22.749] [heyoka] [info] heyoka logger initialised
Tolerance               : 2.2204460492503131e-16
High accuracy           : false
Compact mode            : false
Taylor order            : 20
Dimension               : 2
Batch size              : 2
Time                    : [0.0000000000000000, 0.0000000000000000]
State                   : [0.0000000000000000, 0.010000000000000000, 0.50000000000000000, 0.51000000000000001]
Parameters              : [0.0000000000000000, 0.0000000000000000, 0.0000000000000000, 0.0000000000000000]
N of terminal events    : 1
N of non-terminal events: 1

Tolerance               : 1.08420217248550443401e-19
High accuracy           : false
Compact mode            : false
Taylor order            : 23
Dimension               : 2
Batch size              : 2
Time                    : [0.00000000000000000000, 0.00000000000000000000]
State                   : [0.00000000000000000000, 0.0100000000000000002082, 0.500000000000000000000, 0.510000000000000008882]
Parameters              : [0.00000000000000000000, 0.00000000000000000000, 0.00000000000000000000, 0.00000000000000000000]
N of terminal events    : 1
N of non-terminal events: 1


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
taylor_adaptive_batch is a Catch v2.12.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
get_set_dtime
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/taylor_adaptive_batch.cpp:1453
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/taylor_adaptive_batch.cpp:1477: FAILED:
  REQUIRE( ta.get_dtime_data().second[1] != 0 )
with expansion:
  0.0 != 0

===============================================================================
test cases:    23 |    22 passed | 1 failed
assertions: 32776 | 32775 passed | 1 failed

Cleaning up global MPFR caches.

Version: 0.17.0
clang-12
FreeBSD 13

Issue on page /index.html

I just built heyoka from source and the pendulum example. I ran it and saw the following screen output:
x(10) = 0.0487397
y(10) = 0.0429423

does this look accurate and if so perhaps adding the sample output to your main page would help others

thanks!

cmake and VS2017 msvc 15.9.24 fail to build[BUG]

Describe the bug
VS2017 15.9.24 msvc fails to build heyoka source during build phase due to numerous errors such as
'warning treated as error',
'noexcept is not a special member function that can be defaulted'

To Reproduce
Steps to reproduce the behavior:

  1. cmake build and install all pre-reqs llvm 10, fmt 7.1.3, spdlog 1.8.5, boost 1.73
  2. cmake -G "Visual Studio 15 2017 Win64" ..
  3. cmake --build .
  4. numerous errors

Expected behavior
github homepage says msvc is supported...perhaps only VS2019?

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [Windows 10
  • Installation method: [source]
  • Version: [0.10]

Additional context
Add any other context about the problem here.

Partial derivative with respect to time not implemented in .diff utility [BUG]

Describe the bug
Tried to compute the variational equations of a non-autonomous system - of the form dx/dt = f(x,t) - but the following error shows up:
NotImplementedError: The derivative is not implemented for the function 'time'

To Reproduce
Write a non-autonomous system like:

x, v = hy.make_vars("x", "v")
state = [x,v]
sys = [x, v, hy.cos(hy.time) - .1 * v - hy.sin(x))]

And then compute the partial derivatives of the system with respect to the state variables

for i in range(sys)
for j in range(state)
varsys[i][j] = hk.diff(sys[i],state[j])

Expected behavior
Partial derivative of time with respect to any state variable should be zero as far as I understand... (Given we adopt a Newtonian approach)

Environment (please complete the following information):

  • OS: Windows 10
  • Installation method: conda
  • Version: 0.10

[BUG] The test taylor_time fails on FreeBSD

$ ./work/.build/test/taylor_time
[2022-01-27 10:50:04.047] [heyoka] [info] heyoka logger initialised

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
taylor_time is a Catch v2.12.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
ode test
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/taylor_time.cpp:96
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/taylor_time.cpp:111: FAILED:
  REQUIRE( ta.get_state()[0] == approximately(sin(100.) + .5, 10000.) )
with expansion:
  -0.0063656411 == -0.0063656411097587906

===============================================================================
test cases:    4 |    3 passed | 1 failed
assertions: 5382 | 5381 passed | 1 failed

Cleaning up global MPFR caches.

[FEATURE] Consider submitting heyoka package to spack

First off, thank you for developing this excellent library!

heyoka has some pretty hefty dependencies (LLVM!), so it would be nice to have more options for obtaining binaries. For example, on one of the clusters I use I don't have anaconda available to install the prebuilt binaries, and the LLVM version available is too old. I'd need to compile a more recent version of LLVM which is not exactly trivial...

However, on many HPC systems it is now common to use spack to simplify this process, since it automates obtaining and compiling dependencies.

heyoka doesn't yet have an entry in the spack package database, and I realise this would be extra work to maintain, but if you would consider submitting a package recipe to spack it might simplify the installation process for users.

Spack has great documentation on putting together a package recipe (see here).

As a starting point, I was able to put together a package recipe (here) using the heyoka build documentation. This seems to work well; installing heyoka (and all required dependencies) becomes as simple as running spack install heyoka.

[BUG] The test ensemble_propagate fails on FreeBSD

$ ./work/.build/test/ensemble_propagate
[2022-01-27 10:50:51.631] [heyoka] [info] heyoka logger initialised

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ensemble_propagate is a Catch v2.12.1 host application.
Run with -? for options

-------------------------------------------------------------------------------
scalar propagate until
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:47
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:95: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.408082 }
  ==
  { 0.912945, 0.408082 }

-------------------------------------------------------------------------------
scalar propagate for
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:138
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:187: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.408082 }
  ==
  { 0.912945, 0.408082 }

-------------------------------------------------------------------------------
scalar propagate grid
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:231
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:285: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.408082 }
  ==
  { 0.912945, 0.408082 }

-------------------------------------------------------------------------------
batch propagate until
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:297
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:355: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.912945, 0.408082, 0.408082 }
  ==
  { 0.912945, 0.912945, 0.408082, 0.408082 }

-------------------------------------------------------------------------------
batch propagate for
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:396
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:456: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.912945, 0.408082, 0.408082 }
  ==
  { 0.912945, 0.912945, 0.408082, 0.408082 }

-------------------------------------------------------------------------------
batch propagate grid
-------------------------------------------------------------------------------
/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:499
...............................................................................

/disk-samsung/freebsd-ports/math/heyoka/work/heyoka-0.17.0/test/ensemble_propagate.cpp:568: FAILED:
  REQUIRE( std::get<0>(res[i]).get_state() == ta.get_state() )
with expansion:
  { 0.912945, 0.912945, 0.408082, 0.408082 }
  ==
  { 0.912945, 0.912945, 0.408082, 0.408082 }

===============================================================================
test cases:    6 |    0 passed | 6 failed
assertions: 7403 | 7397 passed | 6 failed

Cleaning up global MPFR caches.

[BUG] 4.0.2 fails to complile: error: missing 'typename' prior to dependent type name 'i_data::step_f_e_t'

Describe the bug

FAILED: CMakeFiles/heyoka.dir/src/taylor_adaptive_batch.cpp.o 
/usr/local/llvm15/bin/clang++ -DBOOST_ALLOW_DEPRECATED_HEADERS -DFMT_SHARED -DHEYOKA_BUILD_LIBRARY -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Dheyoka_EXPORTS -I/usr/ports/math/heyoka/work/heyoka-4.0.2/include -I/usr/ports/math/heyoka/work/.build/include -isystem /usr/local/llvm15/include -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -std=c++20 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -ftemplate-depth=1024 -fdiagnostics-show-template-tree -pthread -MD -MT CMakeFiles/heyoka.dir/src/taylor_adaptive_batch.cpp.o -MF CMakeFiles/heyoka.dir/src/taylor_adaptive_batch.cpp.o.d -o CMakeFiles/heyoka.dir/src/taylor_adaptive_batch.cpp.o -c /usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:248:37: error: missing 'typename' prior to dependent type name 'i_data::step_f_e_t'
        m_step_f = reinterpret_cast<i_data::step_f_e_t>(m_llvm.jit_lookup("step_e"));
                                    ^~~~~~~~~~~~~~~~~~
                                    typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:250:37: error: missing 'typename' prior to dependent type name 'i_data::step_f_t'
        m_step_f = reinterpret_cast<i_data::step_f_t>(m_llvm.jit_lookup("step"));
                                    ^~~~~~~~~~~~~~~~
                                    typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:254:34: error: missing 'typename' prior to dependent type name 'i_data::d_out_f_t'
    m_d_out_f = reinterpret_cast<i_data::d_out_f_t>(m_llvm.jit_lookup("d_out_f"));
                                 ^~~~~~~~~~~~~~~~~
                                 typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:326:47: error: missing 'typename' prior to dependent type name 'i_data::step_f_e_t'
        m_i_data->m_step_f = reinterpret_cast<i_data::step_f_e_t>(m_i_data->m_llvm.jit_lookup("step_e"));
                                              ^~~~~~~~~~~~~~~~~~
                                              typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:328:47: error: missing 'typename' prior to dependent type name 'i_data::step_f_t'
        m_i_data->m_step_f = reinterpret_cast<i_data::step_f_t>(m_i_data->m_llvm.jit_lookup("step"));
                                              ^~~~~~~~~~~~~~~~
                                              typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:378:51: error: missing 'typename' prior to dependent type name 'i_data::step_f_e_t'
            m_i_data->m_step_f = reinterpret_cast<i_data::step_f_e_t>(m_i_data->m_llvm.jit_lookup("step_e"));
                                                  ^~~~~~~~~~~~~~~~~~
                                                  typename 
/usr/ports/math/heyoka/work/heyoka-4.0.2/src/taylor_adaptive_batch.cpp:380:51: error: missing 'typename' prior to dependent type name 'i_data::step_f_t'
            m_i_data->m_step_f = reinterpret_cast<i_data::step_f_t>(m_i_data->m_llvm.jit_lookup("step"));
                                                  ^~~~~~~~~~~~~~~~
                                                  typename 
7 errors generated.

Environment (please complete the following information):

  • OS: FreeBSD 14.0
  • Installation method: from source
  • Version: 4.0.2
  • clang-16.0.6

[BUG] since v4.0.0: mem_cache_mutex' does not have a constant initializer

Issue
Since version 4.0.0 heyoka no longer builds with MinGW-w64 / GCC 13.2.0.
The build fails with the following error:

src/llvm_state_mem_cache.cpp:51:29: error: call to non-'constexpr' function 'std::mutex::mutex()'

The complete output when building 4.0.1 is:

[117/142] Building CXX object CMakeFil...a.dir/src/llvm_state_mem_cache.cpp.obj
FAILED: CMakeFiles/heyoka.dir/src/llvm_state_mem_cache.cpp.obj
D:\Prog\winlibs-gcc13.2.0-posix-msvcrt-11.0.1\mingw64\bin\c++.exe -DBOOST_ALLOW_DEPRECATED_HEADERS -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_SERIALIZATION_DYN_LINK -DBOOST_SERIALIZATION_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DBOOST_THREAD_USE_DLL -DHEYOKA_BUILD_LIBRARY -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -D_FILE_OFFSET_BITS="64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" -IR:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/include -IR:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/build_static/include -isystem D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/custombuilt64/share/llvm/include -isystem D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/custombuilt64/include -O3 -DNDEBUG -std=c++20 -flto=auto -fno-fat-lto-objects -fdiagnostics-color=auto -ftemplate-depth=1024
-fdiagnostics-show-template-tree -Wno-attributes -MD -MT CMakeFiles/heyoka.dir/src/llvm_state_mem_cache.cpp.obj -MF CMakeFiles\heyoka.dir\src\llvm_state_mem_cache.cpp.obj.d -o CMakeFiles/heyoka.dir/src/llvm_state_mem_cache.cpp.obj -c R:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/src/llvm_state_mem_cache.cpp
R:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/src/llvm_state_mem_cache.cpp:51:29: error: 'constinit' variable 'heyoka::v27::detail::{anonymous}::mem_cache_mutex' does not have a constant initializer
   51 | HEYOKA_CONSTINIT std::mutex mem_cache_mutex;
      |                             ^~~~~~~~~~~~~~~
R:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/src/llvm_state_mem_cache.cpp:51:29: error: call to non-'constexpr' function 'std::mutex::mutex()'
In file included from D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/mingw64/include/c++/13.2.0/mutex:45,
                 from R:/winlibs-gcc13.2.0-posix-msvcrt-11.0.1_64/heyoka-4.0.1/src/llvm_state_mem_cache.cpp:15:
D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/mingw64/include/c++/13.2.0/bits/std_mutex.h:104:5: note: 'std::mutex::mutex()' is not usable as a 'constexpr' function because:
  104 |     mutex() noexcept = default;
      |     ^~~~~
D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/mingw64/include/c++/13.2.0/bits/std_mutex.h:71:5: note: defaulted constructor calls non-'constexpr' 'std::__mutex_base::__mutex_base()'
   71 |     __mutex_base() noexcept
      |     ^~~~~~~~~~~~
D:/Prog/winlibs-gcc13.2.0-posix-msvcrt-11.0.1/mingw64/include/c++/13.2.0/bits/std_mutex.h:71:5: note: 'std::__mutex_base::__mutex_base()' declared here
[140/142] Building CXX object CMakeFiles/heyoka.dir/src/step_callback.cpp.obj
ninja: build stopped: subcommand failed.

The CMake flags I used were:

-DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=OFF -DHEYOKA_ENABLE_IPO:BOOL=ON -DHEYOKA_BUILD_STATIC_LIBRARY:BOOL=ON -DHEYOKA_ENABLE_IPO:BOOL=ON -DHEYOKA_WITH_MPPP:BOOL=ON -DHEYOKA_WITH_SLEEF:BOOL=ON -DLLVM_DIR:PATH=$MINGWPREFIX/share/llvm/lib/cmake/llvm -DHEYOKA_BUILD_TUTORIALS:BOOL=OFF -DHEYOKA_BUILD_BENCHMARKS:BOOL=OFF -DHEYOKA_BUILD_TESTS:BOOL=OFF 

My environment

  • OS: Windows 11
  • Shell: MSYS2 shelll
  • Build tools: GCC 13.2.0 from https://winlibs.com/
  • Version: 4.0.0 + 4.0.1

[BUG] 1.0.0: The test step_callback fails

Describe the bug

108/123 Test #108: step_callback ....................***Failed    0.63 sec

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
step_callback is a Catch v2.13.10 host application.
Run with -? for options

-------------------------------------------------------------------------------
step_callback basics
-------------------------------------------------------------------------------
/usr/ports/math/heyoka/work/heyoka-1.0.0/test/step_callback.cpp:49
...............................................................................

/usr/ports/math/heyoka/work/heyoka-1.0.0/test/step_callback.cpp:58: FAILED:
  REQUIRE_THROWS_AS( step_cb(ta), std::bad_function_call )
due to unexpected exception with message:
  std::exception

===============================================================================
test cases:  3 |  2 passed | 1 failed
assertions: 31 | 30 passed | 1 failed

Environment (please complete the following information):

  • OS: FreeBSD 13.2
  • Installation method: port
  • Version: 1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.