-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecation of is_literal_type. #4
base: master
Are you sure you want to change the base?
Conversation
is_literal_type was deprecated in C++-17 and is causing build errors along the lines of (openmc) nick@lemur:~/code/NJOY21/bin$ make [ 58%] Built target njoy [ 63%] Built target njoy_c_bindings [ 85%] Built target utility Consolidate compiler generated dependencies of target njoy21 [ 86%] Building CXX object CMakeFiles/njoy21.dir/src/main.cpp.o In file included from /home/nick/code/NJOY21/bin/_deps/hana-adapter-src/src/include/boost/hana.hpp:191, from /home/nick/code/NJOY21/bin/_deps/endftk-src/src/ENDFtk/section/6.hpp:8, from /home/nick/code/NJOY21/bin/_deps/endftk-src/src/ENDFtk.hpp:19, from /home/nick/code/NJOY21/src/njoy21.hpp:16, from /home/nick/code/NJOY21/src/main.cpp:1: /home/nick/code/NJOY21/bin/_deps/hana-adapter-src/src/include/boost/hana/traits.hpp:71:62: error: ‘template<class _Tp> struct std::is_literal_type’ is deprecated [-Werror=deprecated-declarations] 71 | constexpr auto is_literal_type = detail::hana_trait<std::is_literal_type>{}; | ^~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/variant:36, from /home/nick/code/NJOY21/src/njoy21.hpp:4, from /home/nick/code/NJOY21/src/main.cpp:1: /usr/include/c++/11/type_traits:746:5: note: declared here 746 | is_literal_type | ^~~~~~~~~~~~~~~ The fix for this was made upstream in boostorg/hana@9cd5744 and this change just brings in that fix into this branch.
@whaeck Alternatively, I think you can just delete those two lines instead of adding a preprocessor guard.
|
I think it is better to update the hana-adapter with a more recent version, or just change the dependency to point to a specific hana release instead. This is something that we started doing in the NJOY components that are currently under development (although I assume that things like ENDFtk and ACEtk might be suffering from this issues as well). Do any of you see this when compiling ENDFtk and/or ACEtk python bindings or unit tests? |
Seeing how out of date the hana-adapter repository was with hana and also not wanting to go through the commits on the hana-adapter or resolve merge conflicts, I was proposing a simple solution to a silly problem (something deprecated causing a build failure that wasn't even used anyway). I was just trying to build NJOY21 on Ubuntu-22.04. At this point I am going to give up trying to solve the various warnings, errors, and out-of-date repository dependencies that gcc-11.2 is squawking about :) Having looked through some of the other posts, I am given the impression that it is better to embrace NJOY2016 for now and begin the NJOY2021 adventure anew in the future :) |
I understand trying to use a simple fix but in the end it could give us more headache when we actually update the dependency to a more recent one. My stance on a lot of these things is often to do it right the first time ;-) Updating the dependency will take a lot of time though - since it impacts the other components that depend on it as well. And yes, we do advice to continue to use NJOY2016 instead of NJOY21 since NJOY21 does not offer any relevant feature that NJOY2016 cannot do. Our current development approach involves prioritising NJOY2016 maintenance and developing NJOY components like ENDFtk, ACEtk and resonance reconstruction with python bindings that can be deployed to users more quickly than actual modernised modules (ENDFtk and ACEtk are good examples here). These components also allow us to achieve more objectives than just modernise NJOY (e.g. ACEtk is being used for ACE file testing and perturbation - something that NJOY's ACER module cannot do). |
I hope I get to see the day where any of us (myself included) can accomplish this 😝 Sounds like a good development plan, thanks Wim! |
I forgot to mention this: deprecation warnings get turned into errors due to the -Werror flag while compiling. You can actually switch that off in the NJOY21 CMakeLists.txt file. Removing the -Werror will revert to warnings again, and allow for compilation to continue. Either way, I'm testing ENDFtk right now with gcc 11.2 and I do see that deprecation warning so I will have to address it there. |
is_literal_type was deprecated in C++-17 and is causing build errors
along the lines of
The fix for this was made upstream in
boostorg/hana@9cd5744
and this change just brings in that fix into this branch.
Fixes njoy/NJOY21#168