Hi, This is a mini how-to install the SVN version of gazebo on OSX. I sent a patch yesterday but it didn't make it through, so I'm going to put everything here. This assumes you know what you need to do if something goes wrong or if you don't have a program or path setup correctly.
First, you may need to have OSX developer tools installed. Second, you'll need to get the precompiled Ogre SDK for OSX and install it. You'll also need scons, boost_python, player, etc. Get the svn gazebo: >> svn export https://playerstage.svn.sourceforge.net/svnroot/ playerstage/code/gazebo gazebo Go into the directory: >> cd gazebo Parse the files to ensure that they work with the OSX frameworks and the SConstruct file. Python, >> for i in $(find . -not -name "*svn*" -exec grep -q "python2.4" '{}' \; -print); do sed -e '[EMAIL PROTECTED] <[EMAIL PROTECTED] <[EMAIL PROTECTED]' $i > $i.tmp; mv $i.tmp $i; done Now Ogre, >> for i in $(find . -not -name "*svn*" -exec grep -q "Ogre*" '{}' \; -print); do sed -e '[EMAIL PROTECTED] <[EMAIL PROTECTED] <Ogre/[EMAIL PROTECTED]' $i > $i.tmp; mv $i.tmp $i; done For OIS, two different includes are used, <OIS/OIS*.h> and <OIS*.h>, so we'll normalize the calls. >> for i in $(find . -not -name "*svn*" -exec grep -q "OIS*" '{}' \; -print); do sed -e '[EMAIL PROTECTED] <OIS/[EMAIL PROTECTED] <[EMAIL PROTECTED]' $i > $i.tmp; mv $i.tmp $i; done Now set it to work with the SConstruct file. >> for i in $(find . -not -name "*svn*" -exec grep -q "OIS*" '{}' \; -print); do sed -e '[EMAIL PROTECTED] <[EMAIL PROTECTED] <OIS/[EMAIL PROTECTED]' $i > $i.tmp; mv $i.tmp $i; done Now its time to tweak the source. Edit libgazebo/Server.cc (begin line 47) to read: #ifndef HAS_SEMUN union semun { int val; struct semid_ds *buf; unsigned short *array; }; #endif Change libgazebo/SConscript to read: Import('env prefix sharedObjs') sources = Split('Server.cc Client.cc Iface.cc IfaceFactory.cc') headers = Split('gazebo.h IfaceFactory.hh') sharedLib = env.SharedLibrary('gazebo', sources + sharedObjs) staticLib = env.StaticLibrary('gazebo', sources) env.Install(prefix+'/lib', sharedLib) env.Install(prefix+'/lib', staticLib) env.Install(prefix+'/include/gazebo', headers) Change player/SConscript sources line to read: sources = ['GazeboDriver.cc', 'GazeboClient.cc', 'GazeboInterface.cc', 'GazeboTime.cc', 'SimulationInterface.cc', 'Position2dInterface.cc', 'LaserInterface.cc', 'CameraInterface.cc', 'Graphics3dInterface.cc' ] Change server/rendering/OgreAdapter.cc (begin line 310) to read (courtesy of David): #ifdef __APPLE__ pluginStr = pluginNode->GetValue(); #else pluginStr = pathStr + "/" + pluginNode->GetValue(); #endif Create a new SConstruct file based on the text below in the source base. This SConstruct should work for both linux and OSX but I've only tested it on OSX. >> scons >> sudo scons install prefix=/prefix/path where prefix path is whatever you choose. Now you will need to change the world file for OSX. For the plugins, use this: <plugins path="/Library/Frameworks/Ogre.framework/Resources"> <plugin>RenderSystem_GL.bundle</plugin> <plugin>Plugin_ParticleFX.bundle</plugin> <plugin>Plugin_BSPSceneManager.bundle</plugin> <plugin>Plugin_OctreeSceneManager.bundle</plugin> </plugins> For the resources, you only need to change the path (with same prefix path): <resources path="/prefix/path/share/gazebo"> leave the rest the same. Now, assuming your environment variables (namely PATH and DYLD_FALLBACK_LIBRARY_PATH), you should be able run the simpleshapes world file. As of right now you may not see very much and you won't be able to interact with the window, but you should see a window with text in the upper left corner. Nate *********SConstruct file (to replace existing)********************** import os # OS varying messages # A warning so it is clear the osx installs assume something osx_message = "Warning: This build process assumes you installed the precompiled Ogre SDK\n" + \ "If you did not use the default install, you will need to export both CPATH and LDFLAGS\n" + \ "variables to point to OIS and ensure that the necessary frameworks are in your framework path.\n" +\ "For example:\n" +\ ">> export LDFLAGS='-L/Developer/Ogre/Dependencies/lib/ release -lois'\n" +\ ">> export CPATH=$CPATH:/Developer/Ogre/Dependencies/ include/OIS\n" +\ "It is also possible ode-config does not point to the correct header location.\n" +\ "If so, do the same as above:\n" +\ ">> export CPATH=$CPATH:/path/to/ode/base/include" linux_message = 'Building for a Linux environment' # Check the operating system type get = os.popen('uname') os_type = get.readline() get.close() if os_type.startswith('Darwin'): print osx_message os_type = 'osx' elif os_type.startswith('Linux'): print linux_message os_type = 'linux' # Function to check if path variables are good and if so add them to a dictionary # Scons doesn't like when the values in the ENV dictionary are null def CheckEnvVariables(list_in): dict_out = { } for entry in list_in: if os.environ.has_key(entry): dict_out[entry]=os.environ[entry] return dict_out version = '0.8' prefix = ARGUMENTS.get('prefix','/usr/local') base_config=['xml2-config --cflags --libs', 'pkg-config --cflags -- libs playercore', \ 'pkg-config --cflags --libs playerxdr', 'ode-config -- cflags --libs'] #'pkg-config --cflags --libs CEGUI-OGRE', #'pkg-config --cflags --libs CEGUI', # OS varying config options linux_config=['pkg-config --cflags --libs OIS', 'pkg-config --cflags --libs OGRE', \ 'python-config --cflags --libs' ] osx_config=[] if os_type == 'linux': parseConfigs = base_config + linux_config elif os_type == 'osx': parseConfigs = base_config + osx_config # This is the base environment. All different environments inherit/ overwrite base base_env = Environment ( CC = 'g++', CPPPATH = [ '#.', '#server', '#server/models', '#libgazebo', '#server/rendering', '#server/sensors', '#server/sensors/camera', '#server/sensors/ray', '#server/physics', '#server/physics/ode', '#server/controllers', '#server/controllers/position2d', '#server/controllers/position2d/pioneer2dx', ], LIBPATH=Split('#libgazebo'), LIBS=Split('gazebo boost_python') ) # The linux environment linux_env = base_env.Clone ( CCFLAGS = Split ('-pthread -pipe') ) # The OSX environment osx_env = base_env.Clone ( CCFLAGS = Split ('-pipe -DHAS_SEMUN -I/Developer/Ogre/Dependencies/ include'), LIBPATH=['#libgazebo','/Developer/Ogre/Dependencies/lib/Release'], LIBS=Split('gazebo boost_python ois'), FRAMEWORKS=Split('Ogre Python ApplicationServices Carbon'), ENV=CheckEnvVariables(['PATH', 'CPATH', 'LDFLAGS']) ) config_messages = { 'player': 'Install Player (http:// playerstage.sourceforge.net)', \ 'OIS':'Install Open Input System (http:// sourceforge.net/projects/wgois)', \ 'OGRE':'Install Ogre3d (http://www.ogre3d.org/)', \ 'CEGUI':'Install CEGUI (http://www.cegui.org.uk/ wiki/index.php/Main_Page)'} base_config_check = ['player'] linux_config_check = ['OIS', 'OGRE', 'CEGUI'] osx_config_check = [] #Nothing for right now # Clone the environment based on the os_type and set the config checks if os_type == 'linux': env = linux_env.Clone() config_check = base_config_check + linux_config_check elif os_type == 'osx': env = osx_env.Clone() config_check = base_config_check + osx_config_check # Parse all the pacakge configurations for cfg in parseConfigs: try: env.ParseConfig(cfg) except OSError: print "Unable to parse config ["+cfg+"]" # Iterate through the message dictionary and find which config option threw the error for e in config_check: if cfg.find(e) >= 0: if config_messages.has_key(e): print config_messages[e] else: print 'Unable to locate an import package: %s' % e Exit(1) conf = Configure(env) # Check for the necessary headers #if not conf.CheckHeader('boost/python.hpp'): # print 'Did not find boost/python.hpp exiting' # Exit(1) env = conf.Finish() staticObjs = [] sharedObjs = [] Export('env prefix version staticObjs sharedObjs') for subdir in ['server', 'libgazebo', 'player']: SConscript('%s/SConscript' % subdir) gazebo = env.Program('gazebo',staticObjs) libgazeboServerStatic = env.StaticLibrary('gazeboServer',staticObjs) libgazeboServerShared = env.SharedLibrary('gazeboServer',sharedObjs) env.Install(prefix+'/bin',gazebo) env.Install(prefix+'/share/gazebo','Media') env.Alias('install', prefix) env.Install(prefix+'/lib',libgazeboServerStatic ) env.Install(prefix+'/lib',libgazeboServerShared ) ***************End file******************** ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Playerstage-gazebo mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
