I am trying to install openmc from source code on mac m2, following the Quick Install Guide ,but failed when execute the make
command. I chekced github llvm issue #91504, seems like llvm problem, but i failed to build using llvm@18, how can i fix this?
[ 0%] Building CXX object vendor/pugixml/CMakeFiles/pugixml.dir/src/pugixml.cpp.o
[ 0%] Linking CXX static library ../../lib/libpugixml.a
[ 0%] Built target pugixml
[ 0%] Building CXX object CMakeFiles/libopenmc.dir/src/bank.cpp.o
[ 0%] Building CXX object CMakeFiles/libopenmc.dir/src/boundary_condition.cpp.o
[ 1%] Building CXX object CMakeFiles/libopenmc.dir/src/bremsstrahlung.cpp.o
[ 1%] Building CXX object CMakeFiles/libopenmc.dir/src/cell.cpp.o
[ 2%] Building CXX object CMakeFiles/libopenmc.dir/src/cmfd_solver.cpp.o
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:8:
In file included from /opt/homebrew/include/xtensor/xtensor.hpp:19:
In file included from /opt/homebrew/include/xtensor/xbuffer_adaptor.hpp:21:
In file included from /opt/homebrew/include/xtensor/xstorage.hpp:23:
In file included from /opt/homebrew/include/xtensor/xtensor_simd.hpp:17:
/opt/homebrew/include/xtensor/xutils.hpp:896:31: error: ambiguous partial specializations of 'rebind_container<long, xt::svector<unsigned long>>'
896 | using type = typename rebind_container<std::ptrdiff_t, S>::type;
| ^
/opt/homebrew/include/xtensor/xutils.hpp:924:5: note: in instantiation of template class 'xt::get_strides_type<xt::svector<unsigned long>>' requested here
924 | using get_strides_t = typename get_strides_type<C>::type;
| ^
/opt/homebrew/include/xtensor/xarray.hpp:53:30: note: in instantiation of template type alias 'get_strides_t' requested here
53 | using strides_type = get_strides_t<shape_type>;
| ^
/opt/homebrew/include/xtensor/xcontainer.hpp:36:43: note: in instantiation of template class 'xt::xcontainer_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
36 | using inner_shape_type = typename xcontainer_inner_types<D>::inner_shape_type;
| ^
/opt/homebrew/include/xtensor/xarray.hpp:64:11: note: in instantiation of template class 'xt::xcontainer_iterable_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
64 | : xcontainer_iterable_types<xarray_container<EC, L, SC, Tag>>
| ^
/opt/homebrew/include/xtensor/xiterable.hpp:43:43: note: in instantiation of template class 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
43 | using inner_shape_type = typename iterable_types::inner_shape_type;
| ^
/opt/homebrew/include/xtensor/xiterable.hpp:151:30: note: (skipping 1 context in backtrace; use -ftemplate-backtrace-limit=0 to see all)
151 | class xiterable : public xconst_iterable<D>
| ^
/opt/homebrew/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
311 | class xcontiguous_iterable : private xiterable<D>
| ^
/opt/homebrew/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
71 | class xcontainer : public xcontiguous_iterable<D>,
| ^
/opt/homebrew/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
260 | class xstrided_container : public xcontainer<D>
| ^
/opt/homebrew/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
82 | class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
| ^
/Users/xxx/workspace/openmc/src/cmfd_solver.cpp:90:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
90 | xt::xarray<double> cnt {cnt_shape, 0.0};
| ^
/opt/homebrew/include/xtensor/xutils.hpp:883:12: note: partial specialization matches [with X = long, C = xt::svector, T = unsigned long, N = 4]
883 | struct rebind_container<X, C<T, N>>
| ^
/opt/homebrew/include/xtensor/xstorage.hpp:1415:12: note: partial specialization matches [with X = long, T = unsigned long, N = 4, A = std::allocator<unsigned long>, B = true]
1415 | struct rebind_container<X, svector<T, N, A, B>>
| ^
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:8:
In file included from /opt/homebrew/include/xtensor/xtensor.hpp:20:
In file included from /opt/homebrew/include/xtensor/xcontainer.hpp:23:
/opt/homebrew/include/xtensor/xiterable.hpp:45:50: error: no type named 'stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
45 | using stepper = typename iterable_types::stepper;
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/opt/homebrew/include/xtensor/xiterable.hpp:151:30: note: in instantiation of template class 'xt::xconst_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
151 | class xiterable : public xconst_iterable<D>
| ^
/opt/homebrew/include/xtensor/xiterable.hpp:311:42: note: in instantiation of template class 'xt::xiterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
311 | class xcontiguous_iterable : private xiterable<D>
| ^
/opt/homebrew/include/xtensor/xcontainer.hpp:71:31: note: in instantiation of template class 'xt::xcontiguous_iterable<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
71 | class xcontainer : public xcontiguous_iterable<D>,
| ^
/opt/homebrew/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
260 | class xstrided_container : public xcontainer<D>
| ^
/opt/homebrew/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
82 | class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
| ^
/Users/xxx/workspace/openmc/src/cmfd_solver.cpp:90:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
90 | xt::xarray<double> cnt {cnt_shape, 0.0};
| ^
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:8:
In file included from /opt/homebrew/include/xtensor/xtensor.hpp:20:
In file included from /opt/homebrew/include/xtensor/xcontainer.hpp:23:
/opt/homebrew/include/xtensor/xiterable.hpp:46:56: error: no type named 'const_stepper' in 'xt::xiterable_inner_types<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
46 | using const_stepper = typename iterable_types::const_stepper;
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:8:
In file included from /opt/homebrew/include/xtensor/xtensor.hpp:20:
/opt/homebrew/include/xtensor/xcontainer.hpp:140:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
140 | using accessible_base::at;
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:260:39: note: in instantiation of template class 'xt::xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
260 | class xstrided_container : public xcontainer<D>
| ^
/opt/homebrew/include/xtensor/xarray.hpp:82:37: note: in instantiation of template class 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>' requested here
82 | class xarray_container : public xstrided_container<xarray_container<EC, L, SC, Tag>>,
| ^
/Users/xxx/workspace/openmc/src/cmfd_solver.cpp:90:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
90 | xt::xarray<double> cnt {cnt_shape, 0.0};
| ^
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:8:
In file included from /opt/homebrew/include/xtensor/xtensor.hpp:20:
/opt/homebrew/include/xtensor/xcontainer.hpp:141:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
141 | using accessible_base::shape;
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:142:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
142 | using accessible_base::operator[];
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:143:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
143 | using accessible_base::back;
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:144:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
144 | using accessible_base::front;
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:145:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
145 | using accessible_base::in_bounds;
| ^~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xcontainer.hpp:146:15: error: using declaration refers into 'accessible_base::', which is not a base class of 'xcontainer<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
146 | using accessible_base::periodic;
| ^~~~~~~~~~~~~~~~~
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:14:
In file included from /Users/xxx/workspace/openmc/include/openmc/mesh.h:19:
In file included from /Users/xxx/workspace/openmc/include/openmc/xml_interface.h:9:
In file included from /opt/homebrew/include/xtensor/xadapt.hpp:20:
/opt/homebrew/include/xtensor/xarray.hpp:93:52: error: no type named 'allocator_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
93 | using allocator_type = typename base_type::allocator_type;
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/Users/xxx/workspace/openmc/src/cmfd_solver.cpp:90:22: note: in instantiation of template class 'xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>' requested here
90 | xt::xarray<double> cnt {cnt_shape, 0.0};
| ^
In file included from /Users/xxx/workspace/openmc/src/cmfd_solver.cpp:14:
In file included from /Users/xxx/workspace/openmc/include/openmc/mesh.h:19:
In file included from /Users/xxx/workspace/openmc/include/openmc/xml_interface.h:9:
In file included from /opt/homebrew/include/xtensor/xadapt.hpp:20:
/opt/homebrew/include/xtensor/xarray.hpp:102:54: error: no type named 'backstrides_type' in 'xt::xstrided_container<xt::xarray_container<xt::uvector<double>, xt::layout_type::row_major, xt::svector<unsigned long>>>'
102 | using backstrides_type = typename base_type::backstrides_type;
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/Users/xxx/workspace/openmc/src/cmfd_solver.cpp:139:10: error: no viable conversion from returned value of type 'xt::xarray<double>' (aka 'xarray_container<uvector<double, std::allocator<double>>, (xt::layout_type)1, svector<unsigned long, 4, std::allocator<unsigned long>, true>>') to function return type 'xt::xtensor<double, 1>' (aka 'xtensor_container<uvector<double, allocator<double>>, 1UL, (xt::layout_type)1>')
139 | return counts;
| ^~~~~~
/opt/homebrew/include/xtensor/xtensor.hpp:111:9: note: candidate constructor not viable: no known conversion from 'xt::xarray<double>' (aka 'xarray_container<uvector<double, std::allocator<double>>, (xt::layout_type)1, svector<unsigned long, 4, std::allocator<unsigned long>, true>>') to 'nested_initializer_list_t<value_type, 1UL>' (aka 'initializer_list<double>') for 1st argument
111 | xtensor_container(nested_initializer_list_t<value_type, N> t);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xtensor.hpp:123:9: note: candidate constructor not viable: no known conversion from 'xt::xarray<double>' (aka 'xarray_container<uvector<double, std::allocator<double>>, (xt::layout_type)1, svector<unsigned long, 4, std::allocator<unsigned long>, true>>') to 'const xtensor_container<uvector<double>, 1, xt::layout_type::row_major> &' for 1st argument
123 | xtensor_container(const xtensor_container&) = default;
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xtensor.hpp:126:9: note: candidate constructor not viable: no known conversion from 'xt::xarray<double>' (aka 'xarray_container<uvector<double, std::allocator<double>>, (xt::layout_type)1, svector<unsigned long, 4, std::allocator<unsigned long>, true>>') to 'xtensor_container<uvector<double>, 1, xt::layout_type::row_major> &&' for 1st argument
126 | xtensor_container(xtensor_container&&) = default;
| ^ ~~~~~~~~~~~~~~~~~~~
/opt/homebrew/include/xtensor/xtensor.hpp:135:9: note: candidate template ignored: could not match 'xexpression' against 'xt::xarray_container'
135 | xtensor_container(const xexpression<E>& e);
| ^
/opt/homebrew/include/xtensor/xtensor.hpp:112:18: note: explicit constructor is not a candidate
112 | explicit xtensor_container(const shape_type& shape, layout_type l = L);
| ^
/opt/homebrew/include/xtensor/xtensor.hpp:130:18: note: explicit constructor is not a candidate
130 | explicit xtensor_container(xarray_container<EC, L, SC, Tag>&&);
| ^
13 errors generated.
make[2]: *** [CMakeFiles/libopenmc.dir/src/cmfd_solver.cpp.o] Error 1
make[1]: *** [CMakeFiles/libopenmc.dir/all] Error 2
make: *** [all] Error 2
I tried to use llvm@18, but failed when cmake
-- The C compiler identification is Clang 18.1.8
-- The CXX compiler identification is Clang 18.1.8
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/opt/llvm@18/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/opt/llvm@18/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, defaulting to RelWithDebInfo
CMake Error at /opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
/opt/homebrew/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/share/cmake/Modules/FindOpenMP.cmake:616 (find_package_handle_standard_args)
CMakeLists.txt:84 (find_package)
-- Configuring incomplete, errors occurred!
i manually set veriables, it worked when cmake
but error when make
, i tried to switch to llvm@18, but failed when cmake
.
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
can anyone tell me how to fix it?
mac m2pro arm64, cmake version 3.31.1 llvm 19.1.4 and 18.1.8 ;openmc source v0.15.0 / master