aurora-multiphysics / aurora

Aurora is A Unified Resource for OpenMC (fusion) Reactor Applications.
https://aurora-multiphysics.github.io/aurora/
GNU Lesser General Public License v2.1
36 stars 11 forks source link

Compilation error #35

Open leeczway opened 1 year ago

leeczway commented 1 year ago

Hi developers,

I am trying to compile aurora on Ubuntu. MOOSE environment was installed via mamba. Then both MOOSE and OPENMC were successfully compiled with no errors under the virtual environment. But there is a c++ error while compiling AURORA.:

OpenMCExecutioner.C:734:31: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string'} and 'openmc::FilterType') 734 | f_info.type = filter.type();

/home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits:2554:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string&>' 2554 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;

Thanks !

Regards, Wei

Below please see the detailed information.

lsb_release -a: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.5 LTS Release: 20.04 Codename: focal

gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

error: Checking if header needs updating: /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/include/base/MooseRevision.h... Compiling C++ (in opt mode) /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/unity_src/executioners_Unity.C... In file included from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/unity_src/executioners_Unity.C:2: /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/src/executioners/OpenMCExecutioner.C: In member function 'bool OpenMCExecutioner::setFilterInfo(openmc::Tally&, std::map<int, OpenMCExecutioner::FilterInfo>&, int32_t&, int32_t&)': /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/src/executioners/OpenMCExecutioner.C:734:31: error: no match for 'operator=' (operand types are 'std::string' {aka 'std::cxx11::basic_string'} and 'openmc::FilterType') 734 | f_info.type = filter.type(); | ^ In file included from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/string:55, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/locale_classes.h:40, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/ios_base.h:41, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/ios:42, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/istream:38, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/sstream:38, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/complex:45, from /home/ubuntu/miniconda3/envs/moopenmc/libmesh/include/libmesh/libmesh_common.h:46, from /home/ubuntu/miniconda3/envs/moopenmc/libmesh/include/libmesh/threads.h:24, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/HashMap.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/MooseUtils.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/InputParameters.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/MooseObject.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/Executioner.h:12, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/Transient.h:12, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/header_symlinks/OpenMCExecutioner.h:5, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/src/executioners/OpenMCExecutioner.C:2, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/unity_src/executioners_Unity.C:2: /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:678:7: note: candidate: 'std::cxx11::basic_string<_CharT, _Traits, _Alloc>& std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 678 | operator=(const basic_string& str) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:678:37: note: no known conversion for argument 1 from 'openmc::FilterType' to 'const std::cxx11::basic_string&' 678 | operator=(const basic_string& str) | ~~~~^~~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:688:7: note: candidate: 'std::cxx11::basic_string<_CharT, _Traits, _Alloc>& std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 688 | operator=(const _CharT s) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:688:31: note: no known conversion for argument 1 from 'openmc::FilterType' to 'const char' 688 | operator=(const _CharT s) | ~~~~^ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:699:7: note: candidate: 'std::cxx11::basic_string<_CharT, _Traits, _Alloc>& std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 699 | operator=(_CharT c) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:699:24: note: no known conversion for argument 1 from 'openmc::FilterType' to 'char' 699 | operator=(_CharT c) | ~^ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:716:7: note: candidate: 'std::cxx11::basic_string<_CharT, _Traits, _Alloc>& std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 716 | operator=(basic_string&& str) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:716:32: note: no known conversion for argument 1 from 'openmc::FilterType' to 'std::cxx11::basic_string&&' 716 | operator=(basic_string&& str) | ~~~^~~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:779:7: note: candidate: 'std::cxx11::basic_string<_CharT, _Traits, _Alloc>& std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 779 | operator=(initializer_list<_CharT> l) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:779:42: note: no known conversion for argument 1 from 'openmc::FilterType' to 'std::initializer_list' 779 | operator=(initializer_list<_CharT> l) | ~~~~~^~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:793:8: note: candidate: 'template std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _Tp&) [with _Tp = _Tp; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' 793 | operator=(const _Tp& svt) | ^~~~ /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:793:8: note: template argument deduction/substitution failed: In file included from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/move.h:57, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_pair.h:59, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/stl_algobase.h:64, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/specfun.h:45, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/cmath:1935, from /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/complex:44, from /home/ubuntu/miniconda3/envs/moopenmc/libmesh/include/libmesh/libmesh_common.h:46, from /home/ubuntu/miniconda3/envs/moopenmc/libmesh/include/libmesh/threads.h:24, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/HashMap.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/MooseUtils.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/InputParameters.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/MooseObject.h:13, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/Executioner.h:12, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build/header_symlinks/Transient.h:12, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/header_symlinks/OpenMCExecutioner.h:5, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/src/executioners/OpenMCExecutioner.C:2, from /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/unity_src/executioners_Unity.C:2: /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits: In substitution of 'template<bool _Cond, class _Tp> using enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::cxx11::basic_string&]': /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:125:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using _If_sv = std::enable_if_t<std::and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::not_<std::is_convertible<const _Tp, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>> >, std::_not<std::is_convertible<const _Tp&, const _CharT*> > >::value, _Res> [with _Tp = openmc::FilterType; _Res = std::cxx11::basic_string&; _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator]' /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/bits/basic_string.h:793:8: required by substitution of 'template std::cxx11::basic_string::_If_sv<_Tp, std::cxx11::basic_string&> std::cxx11::basic_string::operator=<_Tp>(const _Tp&) [with _Tp = openmc::FilterType]' /home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/src/executioners/OpenMCExecutioner.C:734:31: required from here /home/ubuntu/miniconda3/envs/moopenmc/x86_64-conda-linux-gnu/include/c++/10.4.0/type_traits:2554:11: error: no type named 'type' in 'struct std::enable_if<false, std::cxx11::basic_string&>' 2554 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~ make: *** [/home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/moose/framework/build.mk:145:/home/ubuntu/miniconda3/envs/moopenmc/openmc_packages/aurora/openmc/build/unity_src/executioners_Unity.x86_64-conda-linux-gnu.opt.lo] 错误 1

helen-brooks commented 1 year ago

Hello, thank you for opening your first issue with us! This is a new one for me, I'll try and take a look.

leeczway commented 1 year ago

Hi Brooks, thanks for your reply. Looking forward to a solution!

helen-brooks commented 1 year ago

Could you please provide me with the git sha for the versions of OpenMC and MOOSE?

leeczway commented 1 year ago

for MOOSE: git rev-parse HEAD: 959b97cbc802e4ffc7bcbadefdc9dce9cf34c32f

for OpenMC: 4e49f69f02c8efa5822b66834a28f3e156204836

Thanks!

helen-brooks commented 1 year ago

OK, I've managed to reproduce those errors with those versions. It appears to be coming from a breaking change in OpenMC, where the type of a public method was changed from a std::string to an enum. I'm working on a patch.

helen-brooks commented 1 year ago

Patch is in progress at the branch 35_openmc_filter_type_patch ; some tests fail for unrelated reasons, but it should build at least, which might get you unblocked.

leeczway commented 1 year ago

With this branch the build process is OK now. Thanks a lot for your help!

helen-brooks commented 1 year ago

Glad it works to your satisfaction, however please don't close the issue - I'll do that when the patch is merged into main.

leeczway commented 1 year ago

Sure, I am not so familar with Git, :)