Installing Project Chrono on Mac (macOS High Sierra 10.13.5)

473 views
Skip to first unread message

Juan Vargas-Murillo

unread,
Jun 5, 2018, 4:38:46 PM6/5/18
to ProjectChrono
Hello,


I am trying to install Project Chrono on my Mac, I have Xcode, cmake, the chrono source, an empty chrono_build, irrlicht-1.8.2, but I am unable to get it chrono successfully built. I have a question of what I would need to do to get the correct CH_IRRLICHTLIB for Mac as I just put in the windows lib (which I know is not correct) but the MacOs libs are empty. Any help would be great thanks in advance!

Rainer Gericke

unread,
Jun 6, 2018, 2:34:02 AM6/6/18
to ProjectChrono
Hi Juan,

you cannot use windows libraries on MacOS. We have made an update to the chrono docs, but it has not been updated on the web site. But it is no problem, I can give you some hints at this place also.

I highly recommend not to use irrlicht-1.8.2 but irrlicht-1.8.4 instead. The 1.8.4 is only slightly too old for your Xcode configuration. But you can test the following it on 1.8.2 too, if you want. First you need to expand irrlicht-1.8.4.zip to a place of your choice, let's take your home directory $HOME. Start a terminal session, type in

cd irrlicht-1.8.4/source/Irrlicht/MacOSX

You have to make an important change in the file CIrrDeviceMacOSX.mm with a text editor (CotEdit, BBEdit...). Search for the string NSFileManagerDelegate and replace it by the string NSApplicationDelegate. Save your changes!! The type in the terminal window:

xcodebuild

After a short time you should see the message: ** BUILD SUCCEEDED **

You fill find a new directory called build now. in build/Release there is the library file libIrrlicht.a. The best practice is to copy this file into irrlicht-1.8.4/lib/MacOSX to make in consistent with the windows and linux versions of irrlicht. To be completely correct, type into the terminal window after copying:

cd $HOME/irrlicht-1.8.4/lib/MacOSX
ranlib

When you run cmake as command line utility, you can write:

cmake -DCH_IRRLICHTLIB:FILEPATH=$HOME/irrlicht-1.8.4/lib/MacOSX/libIrrlicht.a (+ other options you need)

in the gui-version cmake.app just point to the library file which should be present now.

Hope that helped you along.

Best

Rainer 

Juan Vargas-Murillo

unread,
Jun 7, 2018, 1:14:56 PM6/7/18
to ProjectChrono
Yes that got me a little closer to being able to use Project Chrono but I am still having difficulties, more specifically, when I open up the Chrono.xcodeproj I have a lot of build errors. Most notably, I have warnings regrading Target Integrity. Here is a picture of the output

Juan Vargas-Murillo

unread,
Jun 7, 2018, 1:16:06 PM6/7/18
to ProjectChrono

Juan Vargas-Murillo

unread,
Jun 7, 2018, 2:09:55 PM6/7/18
to ProjectChrono
Update: I was able to successfully build the Chrono.xcodeproj by manually changing the default compiler for gcc to (Apple LLVM 9.0). Now I just have a simple question, that is, how do I test out one of the Project Chrono demos? Thanks in advance!

Rainer Gericke

unread,
Jun 8, 2018, 12:02:15 PM6/8/18
to ProjectChrono
Hi Juan,

I see, we could add some additional documentation lines. I guess you took cmake to produce Chrono.xcodeproj, that's not a good idea, but it sounds logical for a Mac user. The problem is: cmake does not support Xcode correctly. A good solution is to generate Unix Makefiles with cmake. This is also the standard option on MacOS. After configuration you have to 'cd' to the output directory that you provided via cmake, then just type

make

there. When the build process has finished, you find the chrono examples in the subdirectory 'bin'.
On Mac it is not possible to start any examples successfully by double-click. You have to start them as command line tools from a terminal window. It might sound strange, but it has some advantages. Please give it a try and post again, if you run into troubles.

Best

Rainer

Juan Vargas-Murillo

unread,
Jun 8, 2018, 1:31:59 PM6/8/18
to ProjectChrono
Ok sounds good Rainer, I have now built Project Chrono the ways in which you suggested. I am now running into the issue of when I run the demos in /bin such as ./demo_bricks I get the following output:

Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

This driver is not available in OSX. Try OpenGL or Software renderer.

Error: Could not load built-in Font. Did you compile without the BMP loader?

Cannot use default video driver - fall back to OpenGL 

Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

Using renderer: OpenGL 2.1

NVIDIA GeForce GT 750M OpenGL Engine: NVIDIA Corporation

OpenGL driver version is 1.2 or better.

GLSL version: 1.2

Could not load font because the file does not exist: ../data/fonts/arial8.xml

Could not open file of texture: ../data/logo_chronoengine_alpha.png

Could not open file of texture: ../data/skybox/sky_lf.jpg

Could not open file of texture: ../data/skybox/sky_up.jpg

Could not open file of texture: ../data/skybox/sky_dn.jpg

Could not open file of texture: ../data/cubetexture_borders.png


as well as Pthread problems in multiple lines of the file /chrono/src/chrono/parallel/ChThreadsPOSIX.cpp


trying out another demo ./demo_collisions I get the following output:


Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

This driver is not available in OSX. Try OpenGL or Software renderer.

Error: Could not load built-in Font. Did you compile without the BMP loader?

Cannot use default video driver - fall back to OpenGL 

Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

Using renderer: OpenGL 2.1

NVIDIA GeForce GT 750M OpenGL Engine: NVIDIA Corporation

OpenGL driver version is 1.2 or better.

GLSL version: 1.2

Could not load font because the file does not exist: ../data/fonts/arial8.xml

Could not open file of texture: ../data/logo_chronoengine_alpha.png

Could not open file of texture: ../data/skybox/sky_lf.jpg

Could not open file of texture: ../data/skybox/sky_up.jpg

Could not open file of texture: ../data/skybox/sky_dn.jpg

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/bluwhite.png

Could not open file of texture: ../data/cubetexture_bluwhite.png

Could not open file of texture: ../data/pinkwhite.png

Could not open file of texture: ../data/concrete.jpg

Could not open file of texture: ../data/concrete.jpg

Could not open file of texture: ../data/concrete.jpg

Could not open file of texture: ../data/concrete.jpg

Could not open file of texture: ../data/concrete.jpg


and the following output when I try to run ./demo_tire


Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

This driver is not available in OSX. Try OpenGL or Software renderer.

Error: Could not load built-in Font. Did you compile without the BMP loader?

Cannot use default video driver - fall back to OpenGL 

Irrlicht Engine version 1.8.4

Darwin Kernel Version 17.6.0: Tue May  8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64

Using renderer: OpenGL 2.1

NVIDIA GeForce GT 750M OpenGL Engine: NVIDIA Corporation

OpenGL driver version is 1.2 or better.

GLSL version: 1.2

Could not load font because the file does not exist: ../data/fonts/arial8.xml

Could not open file of texture: ../data/logo_chronoengine_alpha.png

Could not open file of texture: ../data/skybox/sky_lf.jpg

Could not open file of texture: ../data/skybox/sky_up.jpg

Could not open file of texture: ../data/skybox/sky_dn.jpg

Could not open file of texture: ../data/concrete.jpg

Could not open file of texture: ../data/rock.jpg

libc++abi.dylib: terminating with uncaught exception of type chrono::ChException: Cannot open stream

Abort trap: 6


Thanks in advance.

Juan Vargas-Murillo

unread,
Jun 8, 2018, 2:05:47 PM6/8/18
to ProjectChrono
update; I ran sudo make install still have same problems though.

Rainer Gericke

unread,
Jun 9, 2018, 5:48:45 AM6/9/18
to ProjectChrono
Hi Juan,

first some general remarks. You only need sudo, if you want to install chrono to a place where you don't have access normally - like /usr/local. If you keep everything in your user owned directories it is better to avoid sudo because you loose your rights and need sudo again to remove or change it. Chrono is a living work in progress and will be often be rebuild due to enhancements of different kinds. It is ok to keep the chrono directories in the user file space. The install process is optional - you can make the tests also in the build directory.

You saw some errors from the Irrlicht library after program start, this is harmless and can be ignored.

No we come to the real problems: the resource files can not be found. The strange thing about this is that they are present and in the right place. You can test it, go to the bin directory and type in the terminal window:

ls ../data

you should see not an error but the listing of the data content. I found out that Irlicht programs on the Mac need a special treatment, the have to be converted from a simple executable file to a Mac application bundle. For my personal use I wrote a converter script called 'irrAppS', you get it as attachment. It is a shell script and you have to edit it - the irrlicht directory might be on a different path on your machine. After editing copy it to a diectory, where it is found automatically, the type in the terminal window

chmod +x irrAppS

From this moment you can use it like a shell command. Be sure not to use TextEdit! It will probably mess up the script. You can get CotEdit or Bbedit for free, they will do it. Here is a usage example:

Actually we get:

./demo_IRR_crank

Could not load font because the file does not exist: ../data/fonts/arial8.xml

Could not open file of texture: ../data/logo_chronoengine_alpha.png

Could not open file of texture: ../data/skybox/sky_lf.jpg

Could not open file of texture: ../data/skybox/sky_up.jpg

Could not open file of texture: ../data/skybox/sky_dn.jpg


irrAppS demo_IRR_crank

./demo_IRR_crank

Loaded texture: /Volumes/Ramdisk/build/data/fonts/arial80.bmp

PNG warning: iCCP: known incorrect sRGB profile

Loaded texture: /Volumes/Ramdisk/build/data/logo_chronoengine_alpha.png

Loaded texture: /Volumes/Ramdisk/build/data/skybox/sky_lf.jpg

Loaded texture: /Volumes/Ramdisk/build/data/skybox/sky_up.jpg

Loaded texture: /Volumes/Ramdisk/build/data/skybox/sky_dn.jpg


irrAppS converts the executable into a application bundle named demo_IRR_crank.app and generates a starter script called demo_IRR_crank for your convenience. Without the helper script you would have to type:

./demo_IRR_crank.app/Contents/MacOS/demo_IRR_crank

demo_IRR_crank.app is not double clickable! 

Good luck!

Rainer

PS: I have an idea to get these changes automatically configured by cmake
irrAppS
Reply all
Reply to author
Forward
0 new messages