Skip to content

cope with xtensor include files move#251

Closed
KrisThielemans wants to merge 2 commits intomicrosoft:mainfrom
KrisThielemans:xtensor_move
Closed

cope with xtensor include files move#251
KrisThielemans wants to merge 2 commits intomicrosoft:mainfrom
KrisThielemans:xtensor_move

Conversation

@KrisThielemans
Copy link

Fixes #216

@KrisThielemans
Copy link
Author

@johnstairs @naegelejd could you please check this? There are now MacOS compilation problems with older xtensor 0.25, and using yardl is becoming awkward.

@KrisThielemans
Copy link
Author

This doesn't work yet as the version macros aren't defined yet, so we cannot test on them.

@KrisThielemans
Copy link
Author

It does works now, but it's a bit ugly as xtensor.hpp actually includes pretty much all of xtensor. So , the easiest might be to just include that file, which presumably would be more future proof anyway.

@naegelejd
Copy link
Contributor

I don't think including xtensor/xtensor.hpp up front is the best solution. The version macros are actually defined in xtensor_config.hpp.

It looks like other xtensor users have chosen to use __has_include to check for existence of xtensor_config.hpp, then pull in the correct header locations based on version.

Example: https://github.com/fastscape-lem/fastscapelib/pull/174/files

@KrisThielemans
Copy link
Author

So we require c++17? If so, fine for me! It'd be great if you could do this. We had to rely on a hand-compiled version.

@KrisThielemans
Copy link
Author

So we require c++17?

I cannot see this is the generated CMakeLists.txt.

It's fine for PETSIRD to require this, but not sure in general.

Whatever choice you make, this issue is causing loads of trouble I'm afraid.

@naegelejd
Copy link
Contributor

Yes, Yardl only supports C++17 or newer (docs).

I opened #254 to fix this and update documentation.

@KrisThielemans
Copy link
Author

Yes, Yardl only supports C++17 or newer (docs).

Is it in the exported CMakeLists.txt? (I don't think so)

I opened #254 to fix this and update documentation.

excellent. thanks!

@naegelejd
Copy link
Contributor

Thanks Kris. No, the yardl-generated CMakeLists.txt does not specify any C++ version requirements. That's because it's not a standalone CMake file (it must be included by another CMakeLists.txt), thus it should not prescribe the C++ version for the "parent" codebase.

What we should do is specify a "minimum supported C++ version" in the generated CMakeLists.txt, but I'm not aware of any such mechanisms in CMake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xtensor moved its include files

2 participants