roualdes / bridgestan

BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.
https://roualdes.github.io/bridgestan
BSD 3-Clause "New" or "Revised" License
87 stars 12 forks source link

Fix Sundials `make` config #152

Closed aseyboldt closed 1 year ago

aseyboldt commented 1 year ago

Previously there was no test that needed correct linking of sundials (the ode test was only using the Runge Kutta solver). This fails locally for me, but I would like to see if it also does so in the CI, or if this is just an issue on my machine.

It is possible that the makefile config that leads to incorrect sunidals linking is also responsible for the compile times in #151.

Update: It also fails in the CI. Here it looks like the linux tests might pass, but locally they fails for me when the module is loaded (for instance in the python tests).

WardBrian commented 1 year ago

This was caused by https://github.com/stan-dev/math/pull/2885#pullrequestreview-1356896247, the fix is to change LIBSUNDIALS to SUNDIALS_TARGETS in our makefile

aseyboldt commented 1 year ago

That does seem to fix the issue :-) I had to manually set CXXFLAGS_SUNDIALS += -fPIC, is it expected that CXXFLAGS is not used in the sundials build commands?

WardBrian commented 1 year ago

Let me look into CXXFLAGS. We inherit all that from the stan-dev/math makefiles, and they can be a bit opaque.

I think we can delete the existing RK45 ode test - I didn't check that the solver was actually from sundials, which is my bad.