Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcl_visualization build failure on Mac OS X #712

Closed
asmaloney opened this issue May 28, 2014 · 18 comments
Closed

pcl_visualization build failure on Mac OS X #712

asmaloney opened this issue May 28, 2014 · 18 comments

Comments

@asmaloney
Copy link

I was excited to see that #363 was finally merged, so I updated all the support libs and of pcl using git to try to compile on Mac OS X 10.8.

I configured pcl like this:

    cmake -DCMAKE_BUILD_TYPE:STRING=Release \
        -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
        -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.8" \
        -DCMAKE_OSX_SYSROOT:PATH="<path to 10.8 SDK>" \
        -DQT_QMAKE_EXECUTABLE:FILEPATH="<path to Qt 5>" \
        -DQVTK_LIBRARY:FILEPATH="<path>/libvtkGUISupportQt-6.2.dylib" \
        -DBoost_INCLUDE_DIR:PATH="<path>" \
        -DEIGEN_INCLUDE_DIR:PATH="<path>" \
        -DBUILD_OPENNI:BOOL=OFF \
        pcl

I am using the VTK git master branch which I configured using this:

    cmake -DCMAKE_BUILD_TYPE:STRING=Release \
        -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
        -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING="10.8" \
        -DCMAKE_OSX_SYSROOT:PATH="<path to 10.8 SDK>" \
        -DBUILD_TESTING:BOOL=OFF \
        -DVTK_QT_VERSION:STRING=5 \
        -DQT_QMAKE_EXECUTABLE:FILEPATH="<path to Qt 5>" \
        -DCMAKE_PREFIX_PATH:PATH="<path to Qt 5>"/lib/cmake \
        -DModule_vtkGUISupportQt:BOOL=ON \
        -DModule_vtkGUISupportQtOpenGL:BOOL=ON \
        -DModule_vtkRenderingQt:BOOL=ON \
        -DModule_vtkViewsQt:BOOL=ON \
     vtk

When compiling, I get the following errors:

[ 37%] Building CXX object visualization/CMakeFiles/pcl_visualization.dir/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm.o
PCL/pcl/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm:188:77: error: 
      no member named 'GetCocoaServer' in 'vtkCocoaRenderWindowInteractorFix'
    vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (this->GetCocoaServer ());
                                                                      ~~~~  ^
/PCL/pcl/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm:189:16: error: 
      no member named 'GetCocoaServer' in 'vtkCocoaRenderWindowInteractorFix'
    if (!this->GetCocoaServer ())
         ~~~~  ^
/PCL/pcl/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm:192:13: error: 
      no member named 'SetCocoaServer' in 'vtkCocoaRenderWindowInteractorFix'
      this->SetCocoaServer (reinterpret_cast<void*> (server));
      ~~~~  ^
/PCL/pcl/visualization/include/pcl/visualization/vtk/vtkRenderWindowInteractorFix.mm:206:77: error: 
      no member named 'GetCocoaServer' in 'vtkCocoaRenderWindowInteractorFix'
    vtkCocoaServerFix *server = reinterpret_cast<vtkCocoaServerFix*> (this->GetCocoaServer ());

Is this something that needs to be fixed for the new VTK integration or is it something I need to change in my configuration?

Thank you for your help.

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

@jspricke
Copy link
Member

Hi Francisco, so you don't get this bug? Do you have any idea why?

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

I'm going to test it, I have seen this type of issues when trying to build directly.

@asmaloney
Copy link
Author

@fran6co Thanks, but I need to compile it independently.

@jspricke Could be because I don't have things configured properly? Or because I'm using the latest-and-greatest VTK & PCL?

@jspricke
Copy link
Member

@asmaloney I was referring to @fran6co ;).

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

@asmaloney you don't have much choice about PCL, 1.7.1 doesn't work on Mavericks. About VTK not sure, I'm using 6.1.0 build by homebrew with QT4.

This is the command homebrew generates for PCL:

cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/pcl/HEAD
-DCMAKE_BUILD_TYPE=None
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev
-DGLEW_INCLUDE_DIR=/usr/local/include/GL
-DQHULL_ROOT=/usr/local/Cellar/qhull2011/2011.1
-DBUILD_SHARED_LIBS:BOOL=ON
-DBUILD_simulation:BOOL=AUTO_OFF
-DBUILD_outofcore:BOOL=AUTO_OFF
-DBUILD_people:BOOL=AUTO_OFF
-DBUILD_OPENNI2:BOOL=ON
-DWITH_CUDA:BOOL=OFF
-DWITH_TUTORIALS:BOOL=OFF
-DWITH_DOCS:BOOL=OFF
-DBUILD_apps=AUTO_OFF
-DBUILD_apps_3d_rec_framework=AUTO_OFF
-DBUILD_apps_cloud_composer=AUTO_OFF
-DBUILD_apps_in_hand_scanner=AUTO_OFF
-DBUILD_apps_modeler=AUTO_OFF
-DBUILD_apps_optronic_viewer=AUTO_OFF
-DBUILD_apps_point_cloud_editor=AUTO_OFF
-DBUILD_examples:BOOL=OFF -DBUILD_global_tests:BOOL=OFF
-DOPENNI_INCLUDE_DIR=/usr/local/include/ni
..

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

This is the cmake VTK is using:

cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/vtk/6.1.0
-DCMAKE_BUILD_TYPE=None
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
-Wno-dev -DVTK_REQUIRED_OBJCXX_FLAGS=''
-DVTK_USE_CARBON=OFF
-DVTK_USE_TK=OFF
-DBUILD_TESTING=OFF
-DBUILD_SHARED_LIBS=ON
-DIOKit:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/IOKit.framework
-DCMAKE_INSTALL_RPATH:STRING=/usr/local/Cellar/vtk/6.1.0/lib
-DCMAKE_INSTALL_NAME_DIR:STRING=/usr/local/Cellar/vtk/6.1.0/lib
-DVTK_USE_SYSTEM_EXPAT=ON
-DVTK_USE_SYSTEM_LIBXML2=ON
-DVTK_USE_SYSTEM_ZLIB=ON
-DBUILD_EXAMPLES=OFF
-DVTK_Group_Qt=ON
-DVTK_USE_COCOA=ON
-DModule_vtkInfovisBoost=ON
-DModule_vtkInfovisBoostGraphAlgorithms=ON
-DModule_vtkRenderingFreeTypeFontConfig=ON
-DVTK_USE_SYSTEM_HDF5=ON
-DVTK_USE_SYSTEM_JPEG=ON
-DVTK_USE_SYSTEM_PNG=ON
-DVTK_USE_SYSTEM_TIFF=ON
-DVTK_WRAP_PYTHON=ON
-DPYTHON_LIBRARY='/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib'
-DVTK_INSTALL_PYTHON_MODULE_DIR='/usr/local/Cellar/vtk/6.1.0/lib/python2.7/site-packages'
..

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

The main difference is that the homebrew cmake for vtk has -DVTK_USE_COCOA=ON, yours doesn't.

@asmaloney
Copy link
Author

@jspricke Understood - I was just putting forward some possibilities.

you don't have much choice about PCL, 1.7.1 doesn't work on Mavericks

@fran6co Sorry - I'm not sure what you're referring to here - building it without HomeBrew, building it with HomeBrew, or PCL 1.7.1 at all? (I'm trying to build on 10.8, but I'll need it to run on 10.9 obviously.)

Thanks - I'll take a look at the options you have here and see if I can make any progress.

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

10.9 is using libc++ instead of libstdc++, if your build system is 10.9 you are not going to be able to build 1.7.1 there, no matter what build method you use.
It shouldn't be a problem If you are using 10.8 for building it, the binaries should work no problem on 10.9.

@asmaloney
Copy link
Author

Thanks for the clarification. What's the actual problem with building with libc++ vs. libstdc++? Is this going to be addressed soon or am I going to be stuck on 10.8 for development?

-DVTK_USE_COCOA=ON is actually the default for VTK cmake, so that's not the issue. I will continue to investigate...

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

The problem is that libc++ and libstdc++ are not compatible, you have to use one or the other for your app and the dependencies.
The current development version (I think it going to be the 1.7.2) already has all the fixes to make it work with 10.9, worse case scenario you can use the latest version.

@asmaloney
Copy link
Author

Thanks Francisco. And thank you for the work you've put into this!

@asmaloney
Copy link
Author

So it looks like vtkCocoaRenderWindowInteractor::GetCocoaServer() and vtkCocoaRenderWindowInteractor::SetCocoaServer() were removed from vtkCocoaRenderWindowInteractor.h in this VTK commit: Kitware/VTK@a3e9fc9

From their changelog:

Changed of behaviour observing for NSWindow closing. First, moved the
private vtkCocoaServer class from vtkCocoaRenderWindowInteractor to
vtkCocoaRenderWindow. Its job is to observe window closing. Since
vtkCocoaRenderWindow creates the NSWindow, it make more sense there.

I'm not good enough with git to figure out when it was committed to master, but those member functions don't exist in the current "HEAD".

@fran6co Maybe this is a more recent change to VTK than the version you are using? That would explain why I have the error but you don't.

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

@asmaloney, just checked VTK history (https://github.com/Kitware/VTK/blob/v6.1.0/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.h) and confirmed that 6.1.0 doesn't contain that commit.

Not sure what is the versioning policy of VTK, but it would look like is going to be released for 7.x as it would break the API.

Just stick to VTK 6.1.0 + dev version of PCL.

@asmaloney
Copy link
Author

Cool, thanks again.

@fran6co
Copy link
Contributor

fran6co commented May 28, 2014

No prob.

@jspricke
Copy link
Member

jspricke commented Jun 3, 2014

Sounds like this can be closed, please complain otherwise.

@jspricke jspricke closed this as completed Jun 3, 2014
fran6co added a commit to fran6co/pcl that referenced this issue Apr 7, 2015
This is related to PointCloudLibrary#712, they finally merged the patch Kitware/VTK@a3e9fc9 mentioned by @asmaloney.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants