SyneRBI / SIRF-SuperBuild

SIRF CMake SuperBuild
http://www.ccpsynerbi.ac.uk
Apache License 2.0
15 stars 18 forks source link

Error when building Boost on docker #810

Closed paskino closed 7 months ago

paskino commented 1 year ago

On docker, with miniconda we install whatever latest version of python miniconda comes with. I tried to fix it at 3.9 and got a build error regarding system Boost and python which are incompatible. In fact, system python on ubuntu22.04 is 3.10.

So I set USE_SYSTEM_Boost=OFF and I got several build errors on Gadgetron, of this type:

/opt/SIRF-SuperBuild/sources/Gadgetron/core/io/from_string.h:19:24: error: ‘numeric_limits’ is not a member of ‘std’
   19 |         if (tmp < std::numeric_limits<T>::min() || tmp > std::numeric_limits<T>::max())
      |                        ^~~~~~~~~~~~~~
KrisThielemans commented 1 year ago

I don't know what errors you saw with system Boost and python incompatibility. I would only expect that when you install boost.python. Indeed, I see you did that in #718. The question is why though. We don't use it. Gadgetron can, but in the good old days, we disabled that in our build, as we don't use Python gadgets.

The error that you quote has nothing to do with boost itself, but other stuff. That one is likely caused by a Gadgetron bug.of missing headers. I've created https://github.com/gadgetron/gadgetron/issues/1207 As from_string.h includes a boost header, it's possible that that header includes <limits> in some boost versions but not others.

By the way, we install a rather old Boost version when building Gadgetron. https://github.com/SyneRBI/SIRF-SuperBuild/blob/810a98c40bc89ad407e88e3eb4b54f433974f0f7/version_config.cmake#L34-L36 That' s probably a left-over. (Gadgetron's CMake requires boost 1.71.0, but that doesn't mean we should install that version I guess).

paskino commented 1 year ago

I had to add the build of boost python. https://github.com/paskino/SIRF-SuperBuild/blob/9f0636cf67a56f3a4eea228340dca7f64281a553/SuperBuild/External_Boost_configureboost.cmake#L27

KrisThielemans commented 1 year ago

I had to add the build of boost python.

I've raised https://github.com/gadgetron/gadgetron/issues/1211. Maybe you can add more detail if there was anything else, or even do a PR...

paskino commented 1 year ago

Should be fixed by https://github.com/gadgetron/gadgetron/commit/9274e7fd38d43c68dec7bb768b74467df78a17d1