Chrono Installation on M2 ARM MacOS

126 views
Skip to first unread message

Baptiste PILLET

unread,
Jan 30, 2024, 11:16:41 AM1/30/24
to ProjectChrono
Hello,

After spending a lot of time on internet to find a solution and after several unsuccessful attempts, I'm trying my luck here.
As I have a GPU based on ARM architecture, installing Chrono isn't easy.
When I try to configure Chrono with CMake, it needs CUDA. After disabling it, CMake succeeds in configuring but the build with "make" informs me that Thrust needs CUDA in most of its files. I saw that one solution would be to rewrite the CUDA-dependent files using the Metal language (which replaces CUDA on ARM Mac GPUs).
I tried to disable Thurst from the CMake configuration as well and the "make" build succeeded. However, I find that the "build" directory lacks some files, such as Chrono.sln. I can't build a project requiring chrono either.
Is there a step-by-step process for installing Chrono correctly on an ARM Mac architecture?
Thanks in advance

Dan Negrut

unread,
Jan 30, 2024, 1:29:20 PM1/30/24
to Baptiste PILLET, ProjectChrono

Baptiste – out of curiosity, what do you want to simulate in Chrono?

If you plan to run granular dynamics sims, or fluid-solid interaction, or terramechanics with CRM, you’ll need an NVIDIA GPU. Rewriting the CUDA stuff in Metal language would be a monumental task…

Dan

---------------------------------------------

Bernard A. and Frances M. Weideman Professor

NVIDIA CUDA Fellow

Department of Mechanical Engineering

Department of Computer Science

University of Wisconsin - Madison

4150ME, 1513 University Avenue

Madison, WI 53706-1572

608 772 0914

http://sbel.wisc.edu/

http://projectchrono.org/

---------------------------------------------

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/e37f4e1a-35bc-4e50-956d-1aab75168021n%40googlegroups.com.

Baptiste PILLET

unread,
Jan 31, 2024, 3:07:33 AM1/31/24
to ProjectChrono
Hi, 

Thank you for your reply.
No, fortunately I don't need its features. And the rewriting with Metal is not planned yes !
Fluid-solid interaction maybe one day, but not right now.
It would mainly be for solid-solid interaction (contact) with beams, shells (I thought I saw some difficulties with beam/shell contacts), 3D deformable and 3D non-deformable elements. Some boundary conditions to apply of course, ... 

dr.ratz...@gmail.com

unread,
Feb 1, 2024, 4:46:05 AM2/1/24
to ProjectChrono
Hi Baptiste,

I also work on a Mac with ARM architecture, so there is a chance for help. First question: do you use cmake-gui or cmake commandline?

Rainer

Baptiste PILLET

unread,
Feb 1, 2024, 9:18:59 AM2/1/24
to ProjectChrono
Hi, 

Glad to know there's a solution!
I've installed and tried both, without success.
If you have the procedure you did, I can try to reproduce it. 

Baptiste

dr.ratz...@gmail.com

unread,
Feb 1, 2024, 12:23:07 PM2/1/24
to ProjectChrono
Ok, let's try the commandline version of cmake. 

Some preparation:
  1. Install Xcode from the AppStore (maybe already done)
  2. Install Homebrew package manager from https://brew.sh
  3. Install Eigen3 with 'brew eigen'
  4. Install Gnuplot with 'brew gnuplot'
  5. Install Irrlicht with 'brew irrlicht'
Having the preparation part done, you can try to configure chrono:

CHRONO_SOURCE_DIR=${HOME}/Documents/GitHub/chrono
rm -rf build
cmake -S ${CHRONO_SOURCE_DIR} -B build -G Xcode \
    -DENABLE_MODULE_POSTPROCESS:BOOL=ON \
    -DENABLE_MODULE_IRRLICHT:BOOL=ON \
    -DIRRLICHT_INSTALL_DIR:PATH=/opt/homebrew/Cellar/irrlicht/1.8.5_1

You can have your directories where you want them, so take your own settings, if you want.
The slanted commands can should be run from a shell script. When it was running successful, 
you will find your Xcode project file in the build directory. The best way to start is:
cd build
open Chrono.xcodeproj
to keep the program path of gnuplot.

Rainer

Baptiste PILLET

unread,
Feb 5, 2024, 8:50:51 AM2/5/24
to ProjectChrono
Hi Rainer, 

First of all, thank you for your support which has helped me a lot.
I managed to run the cmake command without error. Once in Xcode, I was able to build Chrono. I was also able to compile a demo file like 'FEA_basic' too.
Surprisingly, during the cmake command, I saw that it couldn't find OpenMP :
"
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
"
So I tried to add paths to OpenMP installed with Homebrew :
"
-DCMAKE_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix llvm)/include" \
-DCMAKE_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix llvm)/include" \
-DCMAKE_EXE_LINKER_FLAGS="-L$(brew --prefix llvm)/lib -Wl,-rpath,$(brew --prefix llvm)/lib" \
-DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix llvm)/include" \
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix llvm)/include" \
-DOpenMP_C_LIB_NAMES="omp" \
-DOpenMP_CXX_LIB_NAMES="omp" \
-DOpenMP_omp_LIBRARY=$(brew --prefix llvm)/lib/libomp.dylib
-DCMAKE_C_COMPILER=$(brew --prefix llvm)/bin/clang \
-DCMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++ \
"

But when building with Xcode, it couldn't find "omp.h"... So I left that idea aside and since I was able to compile FEA_basic, I figured everything must be ok.
From now on, I'll try to compile a project that's been hanging around with Chrono to see if everything's okay. It was created with Chrono version 5.0, so there may be some changes in the libraries I suppose?

I'll keep you posted !

dr.ratz...@gmail.com

unread,
Feb 5, 2024, 10:28:35 AM2/5/24
to ProjectChrono
Missing omp.h means libomp is not installed. Try 'brew libomp'.
Reply all
Reply to author
Forward
0 new messages