1. OpenSourceRoboticsFoundation
  2. Simulation
  3. gazebo
  4. Issues
Issue #1304 closed

Build issue on OSX

Rachel Hwang
created an issue

Hi all,

Source build is failing for me, despite installing and launching gazebo successfully with homebrew (as per OSX instructions ).

'cmake .' yields:

-- BUILD ERRORS: These must be resolved before compiling.
--  Invalid FreeImage Version. Requires 
-- END BUILD ERRORS

This is strange because freeimage (version 3.16.0, the latest) installed successfully with the brew formula, and there seems to be no required version number in this error message.

Acquired the source code by cloning my fork of the repo https://rahwang@bitbucket.org/rahwang/gazebo commit: 1aab770

Full Cmake output

CMakeError.log

CMakeOutput.log

Anyone have any idea what's going on? Please let me know if I'm doing something wrong or missing a step. Thanks!

Comments (24)

  1. Steven Peters

    I assume you added /usr/local/bin to your PATH. I also have the following in my .bash_profile, which may help:

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
    

    If that doesn't help, can you paste the output of brew config?

  2. Rachel Hwang reporter

    I did indeed update my PATH. Unfortunately, the line above doesn't seem to help. Thank you for the tip though.

    $ brew config
    
    HOMEBREW_VERSION: 0.9.5
    ORIGIN: https://github.com/Homebrew/homebrew
    HEAD: e38447776a0665fbb5511de3568b3d7d73684bae
    Last commit: 15 hours ago
    HOMEBREW_PREFIX: /usr/local
    HOMEBREW_CELLAR: /usr/local/Cellar
    CPU: quad-core 64-bit sandybridge
    OS X: 10.9.5-x86_64
    Xcode: 6.0.1
    Clang: 6.0 build 600
    X11: 2.7.7 => /opt/X11
    System Ruby: 2.0.0-481
    Perl: /usr/bin/perl
    Python: /usr/bin/python
    Ruby: /usr/bin/ruby
    
  3. Rachel Hwang reporter

    How strange. I reinstalled freeimage, to no avail.

    $ brew info freeimage
    freeimage: stable 3.16.0
    http://sf.net/projects/freeimage
    /usr/local/Cellar/freeimage/3.16.0 (7 files, 20M) *
      Built from source
    From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/freeimage.rb
    ==> Options
    --universal
        Build a universal binary
    
  4. James Townsend

    Interestingly, I have attempted this on my Mavericks machine and not reproduced this error. Rather, gazebo cannot seem to locate curl... (I am using the version that comes packaged with OS X, and do not have a second version installed via homebrew or anything silly like that)

    -- BUILD ERRORS: These must be resolved before compiling.
    --  Missing: libcurl. Required for connection to model database.
    -- END BUILD ERRORS
    

    So yeah. Dunno what's up with that.

  5. Steven Peters

    James Townsend I had that same problem with finding libcurl a while ago. The default OSX version of libcurl doesn't provide a pkg-config file, but homebrew kindly provides one in ${prefix}/Library/ENV/pkgconfig/10.X, i.e. for Mountain Lion in /usr/local:

    /usr/local/Library/ENV/pkgconfig/10.8
    

    Note that this is in addition to the libcurl formula, it just makes it easier to find the system version of libcurl.

    I can't remember where it was recommended to me, but I have the following in my .bash_profile which I believe is helping:

    export PKG_CONFIG_LIBDIR=\
    $PKG_CONFIG_LIBDIR:\
    /usr/lib/pkgconfig:\
    /usr/local/Library/ENV/pkgconfig/10.8
    
  6. James Townsend

    Steven Peters Thanks for the advice and sorry about the long lag in comments here. So, I came back to this whole thing after upgrading to Yosemite the other week. Your suggestions rid me of my libcurl problems but once that was done, I found myself replicating Rachel Hwang 's original issue with FreeImage.

    Taking a cue from this post, I added the following lines to deps/opende/CMakeLists.txt

    SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "/usr/local/include/")
    SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "/usr/local/lib/")
    

    Which seemed to fix the issue.

    However, after running cmake again in a clean build directory, I got the following beguiling set of messages at the end of the build process...

    -- BUILD WARNINGS
    --  CEGUI not found, opengl GUI will be disabled.
    --  Simbody not found, for simbody physics engine option, please install libsimbody-dev.
    --  DART not found, for dart physics engine option, please install libdart-core4-dev.
    --  libswscale not found. Audio-video capabilities will be disabled.
    --  libavformat not found. Audio-video capabilities will be disabled.
    --  libavcodec not found. Audio-video capabilities will be disabled.
    --  libavutil not found. Audio-video capabilities will be disabled.
    --  Player not found, gazebo plugin for player will not be built.
    --  GNU Triangulation Surface library not found - Gazebo will not have CSG support.
    --  GDAL not found, Digital elevation terrains support will be disabled.
    --  libusb-1.0 not found. USB peripherals support will be disabled.
    --  Oculus Rift support will be disabled.
    --  ronn not found, manpages won't be generated
    -- END BUILD WARNINGS
    
    -- Custom CFlags: -g -O2 -mssse3 -msse3 -msse -msse2   -Wall -Wextra -Wno-long-long -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic
    -- Build Type: RelWithDebInfo
    -- Install path: /usr/local
    -- Configuration successful. Type make to compile gazebo
    -- Configuring incomplete, errors occurred!
    See also "/Users/james/gazebo/build/CMakeFiles/CMakeOutput.log".
    See also "/Users/james/gazebo/build/CMakeFiles/CMakeError.log".
    

    Somewhat confused about whether it worked or not, it seems. For the record...

    james-MBP:build james$ make
    make: *** No targets specified and no makefile found.  Stop.
    

    Dang.

    Checking out CMakeFiles/CMakeError.log, I find some confusing errors. Full text of it at the end of this message. But like, in short, it seems like some of these errors are OSX specific, such as not finding Q_WS_[anything but MAC], or not having isnanf() defined. Not sure how to handle this. Thoughts?

    Determining if the Q_WS_X11 exist failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec2947050361/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec2947050361.dir/build.make CMakeFiles/cmTryCompileExec2947050361.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building CXX object CMakeFiles/cmTryCompileExec2947050361.dir/CheckSymbolExists.cxx.o
    /usr/bin/c++    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/usr/local/Cellar/qt/4.8.6/include -F/usr/local/Cellar/qt/4.8.6/lib    -o CMakeFiles/cmTryCompileExec2947050361.dir/CheckSymbolExists.cxx.o -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: use of undeclared identifier 'Q_WS_X11'
      return ((int*)(&Q_WS_X11))[argc];
                      ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec2947050361.dir/CheckSymbolExists.cxx.o] Error 1
    make: *** [cmTryCompileExec2947050361/fast] Error 2
    
    File /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
    /* */
    #include <QtCore/qglobal.h>
    
    int main(int argc, char** argv)
    {
      (void)argv;
    #ifndef Q_WS_X11
      return ((int*)(&Q_WS_X11))[argc];
    #else
      (void)argc;
      return 0;
    #endif
    }
    
    Determining if the Q_WS_WIN exist failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec4118353185/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec4118353185.dir/build.make CMakeFiles/cmTryCompileExec4118353185.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building CXX object CMakeFiles/cmTryCompileExec4118353185.dir/CheckSymbolExists.cxx.o
    /usr/bin/c++    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/usr/local/Cellar/qt/4.8.6/include -F/usr/local/Cellar/qt/4.8.6/lib    -o CMakeFiles/cmTryCompileExec4118353185.dir/CheckSymbolExists.cxx.o -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: use of undeclared identifier 'Q_WS_WIN'
      return ((int*)(&Q_WS_WIN))[argc];
                      ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec4118353185.dir/CheckSymbolExists.cxx.o] Error 1
    make: *** [cmTryCompileExec4118353185/fast] Error 2
    
    File /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
    /* */
    #include <QtCore/qglobal.h>
    
    int main(int argc, char** argv)
    {
      (void)argv;
    #ifndef Q_WS_WIN
      return ((int*)(&Q_WS_WIN))[argc];
    #else
      (void)argc;
      return 0;
    #endif
    }
    
    Determining if the Q_WS_QWS exist failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec1745505960/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec1745505960.dir/build.make CMakeFiles/cmTryCompileExec1745505960.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building CXX object CMakeFiles/cmTryCompileExec1745505960.dir/CheckSymbolExists.cxx.o
    /usr/bin/c++    -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -I/usr/local/Cellar/qt/4.8.6/include -F/usr/local/Cellar/qt/4.8.6/lib    -o CMakeFiles/cmTryCompileExec1745505960.dir/CheckSymbolExists.cxx.o -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:8:19: error: use of undeclared identifier 'Q_WS_QWS'
      return ((int*)(&Q_WS_QWS))[argc];
                      ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec1745505960.dir/CheckSymbolExists.cxx.o] Error 1
    make: *** [cmTryCompileExec1745505960/fast] Error 2
    
    File /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx:
    /* */
    #include <QtCore/qglobal.h>
    
    int main(int argc, char** argv)
    {
      (void)argv;
    #ifndef Q_WS_QWS
      return ((int*)(&Q_WS_QWS))[argc];
    #else
      (void)argc;
      return 0;
    #endif
    }
    
    Performing C++ SOURCE FILE Test HAVE_ISNANF failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec2856366910/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec2856366910.dir/build.make CMakeFiles/cmTryCompileExec2856366910.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building CXX object CMakeFiles/cmTryCompileExec2856366910.dir/src.cxx.o
    /usr/bin/c++    -g -O2 -mssse3 -msse3 -msse -msse2   -Wall -Wextra -Wno-long-long -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic -DHAVE_ISNANF -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk   -o CMakeFiles/cmTryCompileExec2856366910.dir/src.cxx.o -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/src.cxx
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/src.cxx:2:13: error: use of undeclared identifier 'isnanf'; did you mean 'nanf'?
    int main() {isnanf(0); return 1;}
                ^~~~~~
                nanf
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/math.h:529:14: note: 'nanf' declared here
    extern float nanf(const char *);
                 ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec2856366910.dir/src.cxx.o] Error 1
    make: *** [cmTryCompileExec2856366910/fast] Error 2
    
    Source file was:
    #include <math.h> 
    int main() {isnanf(0); return 1;}
    Performing C++ SOURCE FILE Test HAVE_BOOST_SHARED_ARRAY_HPP failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec1340899411/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec1340899411.dir/build.make CMakeFiles/cmTryCompileExec1340899411.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building CXX object CMakeFiles/cmTryCompileExec1340899411.dir/src.cxx.o
    /usr/bin/c++    -g -O2 -mssse3 -msse3 -msse -msse2   -Wall -Wextra -Wno-long-long -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic -DHAVE_BOOST_SHARED_ARRAY_HPP -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk   -o CMakeFiles/cmTryCompileExec1340899411.dir/src.cxx.o -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/src.cxx
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/src.cxx:1:10: fatal error: 'boost/shared_array.hpp' file not found
    #include <boost/shared_array.hpp> 
             ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec1340899411.dir/src.cxx.o] Error 1
    make: *** [cmTryCompileExec1340899411/fast] Error 2
    
    Source file was:
    #include <boost/shared_array.hpp> 
    int main() {return 1;}
    Determining if files malloc.h exist failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec2842212734/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec2842212734.dir/build.make CMakeFiles/cmTryCompileExec2842212734.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building C object CMakeFiles/cmTryCompileExec2842212734.dir/CheckIncludeFiles.c.o
    /usr/bin/cc   -g -O2 -mssse3 -msse3 -msse -msse2   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk   -o CMakeFiles/cmTryCompileExec2842212734.dir/CheckIncludeFiles.c.o   -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:10: fatal error: 'malloc.h' file not found
    #include <malloc.h>
             ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec2842212734.dir/CheckIncludeFiles.c.o] Error 1
    make: *** [cmTryCompileExec2842212734/fast] Error 2
    
    Source:
    /* */
    #include <malloc.h>
    
    
    int main(){return 0;}
    
    Determining if files obstack.h exist failed with the following output:
    Change Dir: /Users/james/gazebo/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTryCompileExec4211722124/fast"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec4211722124.dir/build.make CMakeFiles/cmTryCompileExec4211722124.dir/build
    /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_report /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CMakeFiles 1
    Building C object CMakeFiles/cmTryCompileExec4211722124.dir/CheckIncludeFiles.c.o
    /usr/bin/cc   -g -O2 -mssse3 -msse3 -msse -msse2   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk   -o CMakeFiles/cmTryCompileExec4211722124.dir/CheckIncludeFiles.c.o   -c /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
    /Users/james/gazebo/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:10: fatal error: 'obstack.h' file not found
    #include <obstack.h>
             ^
    1 error generated.
    make[1]: *** [CMakeFiles/cmTryCompileExec4211722124.dir/CheckIncludeFiles.c.o] Error 1
    make: *** [cmTryCompileExec4211722124/fast] Error 2
    
    Source:
    /* */
    #include <obstack.h>
    
    
    int main(){return 0;}
    
  7. James Townsend

    Steven Peters I think I found a workaround for this issue using the python supporting version of protobuf, cf. my comments on github.

    Edit: that is to say, I now officially can install gazebo from homebrew but the cmake build for 5.0.0 does not work.

  8. James Townsend

    Update: Reinstalling protobuf with brew install --with-python protobuf as I described on the issue page magically fixes the cmake build issue as well. (in concert with the manual setting of the FreeImage paths in FindFreeImage.cmake file as described earlier)

    What a journey.

  9. Rachel Hwang reporter

    I've made exactly the edits that James suggested, but I'm still getting the same freeimage error as before.

    -- BUILD ERRORS: These must be resolved before compiling.
    --  Invalid FreeImage Version. Requires 
    -- END BUILD ERRORS
    

    It looks like cmake is still having trouble finding the free image include files, even though it finds the libraries just fine.

    -- checking for module 'freeimage>='
    Must specify package names on the command line
    --   package 'freeimage>=' not found
    --   freeimage.pc not found, trying freeimage_include_dir and freeimage_library_dir flags.
    --  Invalid FreeImage Version. Requires 
    --   Looking for libfreeimage - found
    

    I'm not sure why the updated cmake flags find the lib files but not the include. James and I have compared, and we have the same freeimage files in the same places (/usr/local/include and /usr/local/lib), and the same version of freeimage via Homebrew. Any ideas on why this might be?

  10. Log in to comment