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

Fail to build cisst with catkin build and cmake versions >= 3.11 on Ubuntu 16.04 #74

Open
vincent-hui opened this issue Jul 9, 2019 · 9 comments

Comments

@vincent-hui
Copy link
Contributor

After I had updated my cmake, when I built dVRK 1.7.1 with catkin build, I found that cisst failed to be built. I tried several cmake versions, I found that when I used cmake 3.11 or higher versions, cisst failed to be built.

Error messages

Errors     << cisst:make /mnt/ramdisk/catkin-jhu/logs_release/cisst/build.make.000.log
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:76: Error: Unable to find 'cisstMultiTask/mtsExecutionResult.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:796: Error: Unable to find 'cisstMultiTask/mtsParameterTypes.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:802: Error: Unable to find 'cisstMultiTask/mtsComponentState.h'
/mnt/ramdisk/catkin-jhu/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:805: Error: Unable to find 'cisstMultiTask/mtsInterfaceCommon.h'
make[2]: *** [cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp] Error 1
make[2]: *** Deleting file 'cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp'
make[1]: *** [cisstMultiTask/codePython/CMakeFiles/gen_cisstMultiTaskPython_cisstMultiTaskPYTHON_wrap.dir/all] Error 2
@adeguet1
Copy link
Collaborator

adeguet1 commented Jul 9, 2019

Just to be sure, are you re-using a build tree generated with an older or different version of CMake? Or are you doing a full catkin clean before building?

@vincent-hui
Copy link
Contributor Author

I tried cloning and building dVRK 1.7.1 from scratch, cisst failed to be built.

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin init
cd ~/catkin_ws/src
git clone https://github.com/jhu-cisst/cisst-saw --recursive
cd ~/catkin_ws
source /opt/ros/kinetic/setup.bash
catkin config --profile release -x _release
catkin profile set release
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build

Feel free to reprodcue this issue after updating cmake

wget https://cmake.org/files/v3.11/cmake-3.11.4.tar.gz
tar -xvzf cmake-3.11.4.tar.gz
cd cmake-3.11.4
./configure
make
sudo make install

@adeguet1
Copy link
Collaborator

I reproduced the issue on Ubuntu 19.04 with CMake 3.13.4 (default) without ROS/Catkin so it's clearly CMake related.

I haven't fixed it yet but it seems there's a dependency missing between the automatically generated header files (cisstDataGenerator) and the Python SWIG wrappers. A temporary work around is to go in the build/cisst directory and run make -j -k a few times. Once the headers have been generated, you can resume the normal build process using catkin build.

@adeguet1
Copy link
Collaborator

@vincent-hui , can you try c83c339?
You will need to checkout branch bug-cdg-swig-dependency: https://github.com/jhu-cisst/cisst/tree/bug-cdg-swig-dependency

@vincent-hui
Copy link
Contributor Author

vincent-hui commented Jul 11, 2019

@adeguet1 I tried c83c339 with cmake 3.11.4, 3.13.5 and 3.14.5
via catkin build, cisst can be built successfully with cmake 3.13.5 and 3.14.5, but fails to be built with cmake 3.11.4.

Error messages from cmake 3.11.4

Errors     << cisst:make /mnt/ramdisk/catkin_ws/logs_release/cisst/build.make.000.log                                                           
/mnt/ramdisk/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:76: Error: Unable to find 'cisstMultiTask/mtsExecutionResult.h'
/mnt/ramdisk/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:796: Error: Unable to find 'cisstMultiTask/mtsParameterTypes.h'
/mnt/ramdisk/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:802: Error: Unable/mnt/ramdisk/catkin_ws/src/cisst-saw/cisst/cisstCommon/cmnGenericObjectProxy.h :101: Warning 362: operator= ignored
to find 'cisstMultiTask/mtsComponentState.h'
/mnt/ramdisk/catkin_ws/src/cisst-saw/cisst/cisstMultiTask/cisstMultiTask.i:805: Error: Unable to find 'cisstMultiTask/mtsInterfaceCommon.h'
make[2]: *** [cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp] Error 1
make[2]: *** Deleting file 'cisstMultiTask/codePython/cisstMultiTaskPYTHON_wrap.stamp'
make[1]: *** [cisstMultiTask/codePython/CMakeFiles/gen_cisstMultiTaskPython_cisstMultiTaskPYTHON_wrap.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

@adeguet1
Copy link
Collaborator

@vincent-hui, do you have a strong requirement for CMake 3.11.4? Or do you just need a recent CMake and version 3.13 or 3.14 would meet your requirements? If 3.11.4 is not required, I'd rather spend my time on dVRK features instead of this :-). To note, it looks like none of the Ubuntu distributions come with 3.11 so users are not too likely to run into this issue.

Also for the record, here is the ideal dependency graph:

  • cisstDataGenerator: .cdg to .h and _cdg.cpp
    • Compiler: .h and _cdg.cpp to .o
      • Linker: .o to .so
    • SWIG: .i and .h files to _swig.cpp (and some Python files)
      • Compiler: .h and _swig.cpp to _swig.o
        • Linker: _swig.o to _swig.so: also depends on .so of wrapped library

In practice, my latest patch ensures that the library (e.g. cisstCommon) is build before SWIG starts. So the current dependency graph looks like:

  • cisstDataGenerator: .cdg to .h and _cdg.cpp
    • Compiler: .h and _cdg.cpp to .o
      • Linker: .o to .so
        • SWIG: .i and .h files to _swig.cpp (and some Python files)
          • Compiler: .h and _swig.cpp to _swig.o
            • Linker: _swig.o to _swig.so

The dependencies are stronger than needed so compilation might be a bit slower (make will not start processes in parallel) but should work.

@vincent-hui
Copy link
Contributor Author

@adeguet1 Thank you, I just need the latest stable cmake.

@gnastacast
Copy link

Had the same problem with cmake 3.13.3 but it was fixed with c83c339

@adnanmunawar
Copy link
Contributor

Got the same issue on Ubuntu 18.04 with Cmake 3.13.4 while building the master branch of cisst-saw. Fixed by modifying cisst/cmake/cisstMacros.cmake from c83c339

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

4 participants