Skip to content
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

Compiling with MacOS arm64 #203

Closed
sblondel opened this issue Nov 12, 2024 · 6 comments
Closed

Compiling with MacOS arm64 #203

sblondel opened this issue Nov 12, 2024 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@sblondel
Copy link
Collaborator

The code is currently not compiling with this architecture, it brakes when PETSc builds Kokkos or Kokkos-kernel.

@sblondel sblondel added the bug Something isn't working label Nov 12, 2024
@PhilipFackler
Copy link
Collaborator

@sblondel gh actions on macos pass. Can we test this again with latest develop?

@sanjoymazumder13
Copy link

sanjoymazumder13 commented Jan 7, 2025

Hi, I am facing issues making Xolotl (stable) with macOS. I have tried macOS systems with both arm64 and x86_64 architecture, but get the same error. I have used the following cmake command to configure.

cmake -DCMAKE_BUILD_TYPE=Release -DKokkos_DIR=$KOKKOS_DIR/install -DPETSC_DIR=$PETSC_DIR
-DPETSC_ARCH=$PETSC_ARCH -DCMAKE_CXX_COMPILER=mpicxx
-DBUILD_SHARED_LIBS=yes -DCMAKE_CXX_FLAGS_RELEASE="-O3 -fPIC" -DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=$XOLOTL_DIR/install ..

The error that I get is:

[ 91%] Linking CXX shared library libxolotlSolver.dylib
Undefined symbols for architecture arm64:
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const**, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver0DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver0DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::updateConcentration(_p_TS*&, _p_Vec*&, _p_Vec*&, double) in PetscSolver1DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver1DHandler.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeAlloy(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeAlphaZr(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
...
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const***, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver2DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver2DHandler.cpp.o
xolotl::solver::handler::PetscSolver2DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver2DHandler.cpp.o
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const****, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver3DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver3DHandler.cpp.o
xolotl::solver::handler::PetscSolver3DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver3DHandler.cpp.o
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const**, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver0DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver0DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::updateConcentration(_p_TS*&, _p_Vec*&, _p_Vec*&, double) in PetscSolver1DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver1DHandler.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeAlloy(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
xolotl::solver::monitor::PetscMonitor0D::computeAlphaZr(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
...
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const***, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver2DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver2DHandler.cpp.o
xolotl::solver::handler::PetscSolver2DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver2DHandler.cpp.o
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double const****, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver3DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver3DHandler.cpp.o
xolotl::solver::handler::PetscSolver3DHandler::computeJacobian(_p_TS*&, _p_Vec*&, _p_Mat*&, double) in PetscSolver3DHandler.cpp.o
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double****, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver3DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver3DHandler.cpp.o
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double***, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver2DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver2DHandler.cpp.o
"PetscErrorCode DMDAVecGetKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double**, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver0DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::updateConcentration(_p_TS*&, _p_Vec*&, _p_Vec*&, double) in PetscSolver1DHandler.cpp.o
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double****, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver3DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver3DHandler.cpp.o
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double***, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver2DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver2DHandler.cpp.o
"PetscErrorCode DMDAVecRestoreKokkosOffsetViewDOFWriteKokkos::HostSpace(_p_DM*, _p_Vec*, Kokkos::Experimental::OffsetView<double**, Kokkos::LayoutRight, Kokkos::HostSpace>)", referenced from:
xolotl::solver::handler::PetscSolver0DHandler::updateConcentration(_p_TS
&, _p_Vec*&, _p_Vec*&, double) in PetscSolver0DHandler.cpp.o
xolotl::solver::handler::PetscSolver1DHandler::updateConcentration(_p_TS*&, _p_Vec*&, _p_Vec*&, double) in PetscSolver1DHandler.cpp.o
"xolotl::core::network::ReactionNetworkxolotl::core::network::NEReactionNetwork::getTotalVolumeRatio(Kokkos::View<double const*, Kokkos::MemoryTraits<1u>>, xolotl::core::network::NESpecies, unsigned int)", referenced from:
xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
"xolotl::core::network::ReactionNetworkxolotl::core::network::NEReactionNetwork::getTotalRatioVariance(Kokkos::View<double const*, Kokkos::MemoryTraits<1u>>, xolotl::core::network::NESpecies, double, unsigned int)", referenced from:
xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o
ld: symbol(s) not found for architecture arm64
arm64-apple-darwin20.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [xolotl/solver/CMakeFiles/xolotlSolver.dir/build.make:318: xolotl/solver/libxolotlSolver.dylib] Error 1
make[1]: *** [CMakeFiles/Makefile2:683: xolotl/solver/CMakeFiles/xolotlSolver.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I felt it would be relevant regarding this open issue. Just wanted to know if it is adifferent problem or related to the same issue. Thanks in advance.

@sblondel
Copy link
Collaborator Author

sblondel commented Jan 8, 2025

@sanjoymazumder13 Thank you for your post. stable doesn't include the commits related to this issue yet. Can you try switching to the latest version of develop ? The README is not up-to-date, Xolotl cmake can now build all the dependencies directly (no need to clone PETSc forehand):
cmake -DCMAKE_BUILD_TYPE=Release -DXolotl_BUILD_PETSC=1 ../xolotl-source/

@sanjoymazumder13
Copy link

sanjoymazumder13 commented Jan 9, 2025

Thanks @sblondel for the information. This was helpful. I am working with the develop branch using Xolotl cmake to build the dependencies. I am getting an error while building the target xolotlSolver. The error is shown below. I get the same error with both x86_64 and arm64 architectures. Is there any specific library that needs to be defined. Thanks in advance.

#---------#

Linking CXX shared library libxolotlSolver.dylib Undefined symbols for architecture x86_64: "xolotl::core::network::ReactionNetwork<xolotl::core::network::NEReactionNetwork>::getTotalVolumeRatio(Kokkos::View<double const*, Kokkos::MemoryTraits<1u>>, xolotl::core::network::NESpecies, unsigned int)", referenced from: xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o "xolotl::core::network::ReactionNetwork<xolotl::core::network::NEReactionNetwork>::getTotalRatioVariance(Kokkos::View<double const*, Kokkos::MemoryTraits<1u>>, xolotl::core::network::NESpecies, double, unsigned int)", referenced from: xolotl::solver::monitor::PetscMonitor0D::computeXenonRetention(_p_TS*, long long, double, _p_Vec*) in PetscMonitor0D.cpp.o ld: symbol(s) not found for architecture x86_64 x86_64-apple-darwin13.4: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [xolotl/solver/CMakeFiles/xolotlSolver.dir/build.make:318: xolotl/solver/libxolotlSolver.dylib] Error 1 make[1]: *** [CMakeFiles/Makefile2:1899: xolotl/solver/CMakeFiles/xolotlSolver.dir/all] Error 2

@PhilipFackler
Copy link
Collaborator

Try using -DXolotl_INCLUDE_RN_TPP_FILES=ON in your cmake command.

@sanjoymazumder13
Copy link

Thanks @PhilipFackler. It worked with both the architectures.

@sblondel sblondel added this to the v3.1 milestone Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants