How to install chronos on mac?

592 views
Skip to first unread message

Anthony Sifuentes

unread,
Nov 9, 2016, 2:42:50 PM11/9/16
to ProjectChrono
Hello i am new to project chronos and i would like to install on my mac. Can anyone help?

Thank you ahead of time.

Rainer Gericke

unread,
Nov 13, 2016, 4:00:15 AM11/13/16
to ProjectChrono
Hi Anthony,

I am a Mac user too and I can give you some general recommendations:

  1. You should have MacOS 10.11.x (El Capitan) or 10.12.x (Sierra) with Xcode installed, earlier versions don't support c++11 too well. The command line tools have also to be installed. The whole process of building is based on these tools usable via the terminal app.
  2. Download CMake form http://www.cmake.org. It looks pretty much like the windows version you find in the documentation sit of the chrono project. CMake allows you to configure chrono for the mac. For MacOS you have to configure Unix Makefiles, Xcode project files are actually not supported.
  3. Install SourceTree for Mac. With SourceTree you can download the actual sources of chrono.
  4. Download the chrono sources with SourceTree
  5. Configure your chrono version with CMake. Build it by call of make in the terminal app. If the build was successful, install it to the CMAKE_INSTALL_PREFIX directory you have configured. Type 'cd 'where_ever_your_installed_chrono/bin' and try to start the example programs. Maybe the programs don't work because the dynamic linked libraries con not be found. This happens, if you installed chrono for example in $HOME/Chrono to avoid to fiddle around with administrator rights. This is the way I do. Type 'export DYLD_LIBRARY_PATH=$HOME/Chrono/lib64' in the terminal app and try to start the example programs again. Now it should work. When you quit the terminal app the information about the dyld path is lost. The best way is to generate a file named $HOME/.profile or to open it if it already exists with a text editor, I use TextWrangler for this purpose or 'vi' in terminal app. But be warned: vi is not everybody's darling. Insert the line  'export DYLD_LIBRARY_PATH=$HOME/Chrono/lib64' without the (')!! in .profile and save it. After the next start for the terminal app the dylibs can be found automatically. All test programs should work now and give you textual infomation in your terminal app, some generate data files too. Up to no 3D-graphics examples have been built. But you can already use chrono in side your own software.
  6. Which modules can be built on the Mac? It is ChronoEngine, ChronoEngine_FEA, ChronoEngine_irrlicht, ChronoEngine_vehicle and ChronoEngine_postprocess.
  7. To make 3D graphics available download irrlicht-1.8.4 and build the Mac libIrllicht.a and repeat the configuration process with the irrlicht stuff activated. Build the whole thing and try the examples. It might happen, that the resource data con not be found. One possible reason is that the data dir is in $HOME/Chrono/share/data but the the example search the data in $HOME/Chrono/data because they have not been updated. The quick and dirty solution is 'cd $HOME/Chrono; ln -s share/data data'. The generates a symbolic link allowing to cheat the examples progs. 
  8. Actually the chrono sources contain a bug relevant for MacOS. I have posted a patch file in the forum, if the build process breaks, you should apply it to the source directory. I hope the patch will be applied officially soon.
Good luck

Rainer

Refaat Yakoub

unread,
Nov 26, 2016, 5:55:53 PM11/26/16
to ProjectChrono
I am having some problem building the irrlicht lib for Mac.  I tried using make from irrlicht-1.8.4/source/Irrlicht but it is complaining about a number of missing header files and other syntax errors, for example:

c++ -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -MM -MF Irrlicht.d Irrlicht.cpp

In file included from Irrlicht.cpp:22:

./MacOSX/CIrrDeviceMacOSX.h:17:10: fatal error: 'CIrrDeviceStub.h' file not found

#include "CIrrDeviceStub.h"

         ^

1 error generated.

c++ -I../../include -Izlib -Ijpeglib -Ilibpng -DIRRLICHT_EXPORTS=1 -MM -MF COpenGLDriver.d COpenGLDriver.cpp

In file included from COpenGLDriver.cpp:21:

./MacOSX/CIrrDeviceMacOSX.h:17:10: fatal error: 'CIrrDeviceStub.h' file not found

#include "CIrrDeviceStub.h"


....

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:7:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1: error: 

      expected unqualified-id

@class NSString, Protocol;

^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:494:9: error: 

      unknown type name 'NSString'

typedef NSString * NSExceptionName NS_EXTENSIBLE_STRING_ENUM;

....

Rainer Gericke

unread,
Nov 27, 2016, 5:26:55 AM11/27/16
to ProjectChrono
Hi Refaat,

the Makefile use used is not functional for MacOSX. It is better to go to the 'MacOSX' subdirectory and type 'xcodebuild'. The builds the release version of libIrrlicht.a. You find it in builds/Release. You can use it from here or copy it to irrlicht-1.8.4/lib/MacOSX.

Unfortunately with Xcode 8.1 a new error occurred:
/Users/rainerge/Soft/Packs/irrlicht-1.8.4/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm:499:23: 
Cannot initialize a parameter of type 'id<NSApplicationDelegate> _Nullable' with an rvalue 
of type 'id<NSFileManagerDelegate>'
I found a workaround in the irrlicht forum: look at the attached file.

Good luck

Rainer
Irrlicht Engine • View topic - irrlicht 1.8.4 build failure on macOS.pdf

Refaat Yakoub

unread,
Nov 28, 2016, 8:09:30 PM11/28/16
to ProjectChrono
Hi Rainer,

Thank you.  It built but I am unable to run any demo that uses irrlicht.  I get:

2016-11-28 19:08:06.899 demo_bricks[6190:113253] +[NSApplication setDelegate:]: unrecognized selector sent to class 0x7fffe64e1278

2016-11-28 19:08:06.901 demo_bricks[6190:113253] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSApplication setDelegate:]: unrecognized selector sent to class 0x7fffe64e1278'

*** First throw call stack:

(

0   CoreFoundation                      0x00007fffcc22b48b __exceptionPreprocess + 171

1   libobjc.A.dylib                     0x00007fffe098dcad objc_exception_throw + 48

2   CoreFoundation                      0x00007fffcc2acbd4 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132

3   CoreFoundation                      0x00007fffcc19db55 ___forwarding___ + 1061

4   CoreFoundation                      0x00007fffcc19d6a8 _CF_forwarding_prep_0 + 120

5   libChronoEngine_irrlicht.dylib      0x000000010a4ea2f0 _ZN3irr16CIrrDeviceMacOSXC1ERKNS_27SIrrlichtCreationParametersE + 432

6   libChronoEngine_irrlicht.dylib      0x000000010a483661 createDeviceEx + 49

7   libChronoEngine_irrlicht.dylib      0x000000010a2ca822 _ZN6chrono8irrlicht17ChIrrAppInterfaceC2EPNS_8ChSystemEPKwN3irr4core11dimension2dIjEEbbbNS6_5video13E_DRIVER_TYPEE + 322

8   libChronoEngine_irrlicht.dylib      0x000000010a2c4c70 _ZN6chrono8irrlicht8ChIrrAppC1EPNS_8ChSystemEPKwN3irr4core11dimension2dIjEEbbbNS6_5video13E_DRIVER_TYPEE + 48

9   demo_bricks                         0x000000010a29c3d3 main + 115

10  libdyld.dylib                       0x00007fffe126c255 start + 1

11  ???                                 0x0000000000000001 0x0 + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

Abort trap: 6

Rainer Gericke

unread,
Nov 29, 2016, 2:53:19 AM11/29/16
to ProjectChrono
Hi Rafaat,

a few chrono_irrlicht examples don't work at all an the mac, but I think it is not an irrlicht issue but a chrono issue. I cannot run demo_bricks also. chrono_irrlicht is a bit tricky to use because the examples are built as simple unix-exe files. When you start e. g. demo_earthquake it should open an irrlicht window with something moving, but also missing resources and you don't have a mac menu for the process. It is possible to convert the unix executable file into a complete application bundle. You can do it by hand, but it is cumbersome. I made a shell script for this purpose. I can post it, if you want.

The more important problem is that your irrlicht library does not work at all. Can you run the original   irrlicht examples ('HelloWorld')? You can build them with 'xcodebuild -alltargets'. Before you do you have to modify the main.cpp files so that video::EDT_OPENGL is set as fixed input and every interactive questioning of the device driver is removed. This a stupid work, but you can use my attached patch file.

If you want to try it, do the following steps:
1) go to a directory where you want to keep your irrlicht directory
2) unzip -a /where/your/zip/is/irrlicht-1.8.4.zip
3) cd Irrlicht-1.8.4
4) patch -p1 < /where/your/patchfile/is/irrlicht_xcode8.1_err.diff
5) cd source/Irrlicht/MacOSX
6) xcodebuild -alltargets

You will hopefully find your example apps in irrlicht-1.8.4/bin/MacOSX they are doubleclickable from the finder. The most examples work.

If this does not help, we have to look at hardware differences between our macs.

Best Regards

Rainer
irrlicht_xcode8.1_err.diff
Reply all
Reply to author
Forward
0 new messages