Hi Akthem,
beginning the work with a complex project is always a challenge and one
problem is: macOS does not support all chrono modules!
It helps to begin with a minimal configuration:
rm -rf build
cmake -S /where/your/chrono/source/is -B build
my chrono sources are in ${HOME}/Documents/GitHub/chrono but this is not a
law of nature, just take the path of your installation.
'build' is the directory, where the configuration and the build take place.
The build directory must be empty! The configuration should work.
cmake --build build
or
cd build
make
This should run without errors. What you get is a basic configuration with
a couple of demos in build/bin
Try the demos. Unfortunately we have to generate Mac Bundles, so to start
an example you must write
cd bin
./demo_CH_EulerAngles.app/Content/MacOS/demo_CH_EulerAngles
or
run_app.sh demo_CH_EulerAngles.app
if you have installed the convenience script from
*chronoSRC/contrib/appbundle-macosx*
I am a vehicle simulation guy and I want to have the vehicle module
enabled. Also necessary is postprocessing and 3d graphics:
rm -rf build
cmake -S /where/your/chrono/source/is -B build \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_MODULE_POSTPROCESS:BOOL=ON \
-DENABLE_MODULE_VEHICLE:BOOL=ON \
-DENABLE_MODULE_IRRLICHT:BOOL=ON \
-DIRRLICHT_INSTALL_DIR:PATH=/opt/homebrew
cmake generates Unix Makefiles by default, a faster alternative is ninja
(cmake -G Ninja ....) or even better with and IDE (cmake -G Xcode ...).
ninja can be installed with homebrew. You also need gnuplot, can also be
installed with homebrew.
Some modules in chrono can only work with Nvidia hardware and require cuda.
Cuda is not available for macOS as well as OptiX.
Alternative for Irrlicht is VSG. It also works well, but some functionality
is lacking actually. The configuration for OpenGL is messed up for macOS,
so don't try it, or better try it and repair it. Generally spoken: activate
only the modules that you ar willing to use!
Good Start!
Rainer
[email protected] schrieb am Mittwoch, 26. April 2023 um 00:56:59 UTC+2:
> Hi Project Chrono Team,
> I spent the day trying to Cmake project chrono. I followed the Mac OS
> instructions in Chrono tutorial install
> <https://api.projectchrono.org/tutorial_install_chrono.html>. I used the
> preset "macOS CI Configuration" and generator "Unix Makefiles" in the cmake
> GUI.
>
> This succeeds in building and generating project chrono after making sure
> the value for "THRUST_INCLUDE_DIR" is empty. However it was built and
> generated with Sensor, Distributed, GPU, FSI, and Multicore disabled.
> Multicore requires Thrust while the other modules require Cuda. Both were
> not found.
>
> I failed to install Thrust without Cuda in a Mac Silicon. *Question 1: Am
> I missing something or did I follow the steps correctly and none of these
> modules can be run on a Mac Silicon?*
>
> Moving forward, I attempted to make from the generated build using:
>
>
> make CXXFLAGS="-Xpreprocessor -fopenmp" LDFLAGS="-lomp"
>
>
> This was based on the MacOS clang++ issues highlighted in step 8. This
> results in 8 warnings and 1 error. The error being:
>
>
> */opt/homebrew/include/eigen3/Eigen/Core:70:10: **fatal error: **'omp.h'
> file not found*
>
> #include <omp.h>
>
> * ^~~~~~~*
>
> 8 warnings and 1 error generated.
>
> make[2]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/core/ChFilePS.cpp.o]
> Error 1
>
> make[1]: *** [src/chrono/CMakeFiles/ChronoEngine.dir/all] Error 2
>
> make: *** [all] Error 2
>
>
> *Question 2: Again, where did I go wrong here?*
>
>
> I am new to the macOS, shell, and cmake and the learning curve was steep
> getting to this point. So, I hope you cut me some slack if any/all of my
> questions are basic/naive and I hope you can help me get over this hurdle
> and successfully run Chrono. Of course running the additional modules and
> parallelization would be an amazing bonus after successful installation.
>
>
> From what I read, Chrono sounds solid in multi-body dynamics. I hope I can
> make it run on my mac and start benefiting from it.
>
>
> Thank you,
>
> Akthem
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/projectchrono/2d29e499-6fde-4727-9a26-2a2331b4c0a5n%40googlegroups.com.