diegoferigo / development-iit

Docker-based isolated development environment for my activities @ Italian Institute of Technology
https://github.com/diegoferigo/devenv
7 stars 4 forks source link

Docker build not working #6

Closed fjandrad closed 3 years ago

fjandrad commented 3 years ago

Trying to use the development master image but it is failing. I was not able to get it to compile. I wonder if I am missing something or something changed. I saw that the CI is also failing. @diegoferigo Commit :

commit 704aca5ce77cf95a99a0fcfd0d6a72ff2c230d0b (HEAD -> master, origin/master, origin/HEAD)
Author: Diego Ferigo <diego.ferigo@iit.it>
Date:   Thu Apr 29 10:44:44 2021 +0200

    Fix fish history resource

Error message:

---> Running in 4665b3315e2d
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
stty: 'standard input': Inappropriate ioctl for device
mkdir: created directory 'build'
Warn about uninitialized values.
-- The CXX compiler identification is Clang 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/clang++-11
-- Check for working CXX compiler: /usr/bin/clang++-11 - broken
CMake Error at /usr/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message):
  The C++ compiler

    "/usr/bin/clang++-11"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /iit/sources/Catch2/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_ef40c && [1/2] Building CXX object CMakeFiles/cmTC_ef40c.dir/testCXXCompiler.cxx.o
    [2/2] Linking CXX executable cmTC_ef40c
    FAILED: cmTC_ef40c 
    : && /usr/bin/clang++-11   CMakeFiles/cmTC_ef40c.dir/testCXXCompiler.cxx.o -o cmTC_ef40c   && :
    /usr/bin/ld: cannot find -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:17 (project)

-- Configuring incomplete, errors occurred!
See also "/iit/sources/Catch2/build/CMakeFiles/CMakeOutput.log".
See also "/iit/sources/Catch2/build/CMakeFiles/CMakeError.log".
The command '/bin/bash -i -c cd ${IIT_SOURCES}/Catch2 &&    mkdir -p build && cd build &&    cmake -GNinja -DCMAKE_INSTALL_PREFIX=${IIT_INSTALL}         -DBUILD_TESTING:BOOL=OFF -DCATCH_BUILD_TESTING:BOOL=OFF -DCATCH_INSTALL_DOCS:BOOL=OFF .. &&    ninja install &&    find . -type f -not -name 'CMakeCache.txt' -delete &&    find ${IIT_SOURCES} -not -group runtimeusers -exec chgrp runtimeusers {} \; -exec chmod g+rw {} \+ &&    find ${IIT_INSTALL} -not -group runtimeusers -exec chgrp runtimeusers {} \; -exec chmod g+rw {} \+' returned a non-zero code: 1
Makefile:21: recipe for target 'development-master' failed
make: *** [development-master] Error 1

logMakeDevMaster.txt

diegoferigo commented 3 years ago

Mmh, CMake 3.20 created some problems and I suspect this one could be related. I'm not sure that clang 11 is the responsible of this problem, it's enabled for few months now and these error didn't show up.

@fjandrad Could you try to downgrade CMake in the Tools image to 3.19 and check if it solves the problem?

More info in https://github.com/robotology/community/discussions/364#discussioncomment-534809.

fjandrad commented 3 years ago

Mmh, CMake 3.20 created some problems and I suspect this one could be related. I'm not sure that clang 11 is the responsible of this problem, it's enabled for few months now and these error didn't show up.

@fjandrad Could you try to downgrade CMake in the Tools image to 3.19 and check if it solves the problem?

More info in robotology/community#364 (comment).

I will test and let you know.

fjandrad commented 3 years ago

Attempt summary

I installed cmake 3.19 in the tools image and tried to build upon that in the development image. I did not work but I got a different error. "Unsupported protocol"

Update: By having the openssl dependency installed the installation goes on but it still fails.

Installing cmake 3.19 on tools image

I added this at the end of the dockerfile to install cmake 1.19

# Install cmake 3.19
ARG CMAKE_version=3.19
ARG CMAKE_build=0
RUN apt remove --purge --auto-remove cmake -y &&\
    mkdir temp &&\
    cd temp &&\
    wget https://cmake.org/files/v${CMAKE_version}/cmake-${CMAKE_version}.${CMAKE_build}.tar.gz &&\
    tar -xzvf cmake-${CMAKE_version}.${CMAKE_build}.tar.gz &&\
    cd cmake-${CMAKE_version}.${CMAKE_build}/ &&\
    ./bootstrap -- -DCMAKE_USE_OPENSSL=OFF &&\
    make &&\
    make install

cmake 3.19 would not install without putting the option openssl off. This might be the reason. I will double check.

Error message on development build

 8c4ac0f883d4
Step 20/28 : RUN cd ${IIT_SOURCES}/robotology-superbuild &&    mkdir -p build && cd build &&    export CC=gcc && export CXX=g++ &&    cmake           -GNinja           -DCMAKE_BUILD_TYPE=Release           -DROBOTOLOGY_ENABLE_CORE:BOOL=ON           -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON           -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=ON           -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=ON           -DROBOTOLOGY_ENABLE_HUMAN_DYNAMICS:BOOL=ON           -DROBOTOLOGY_USES_GAZEBO:BOOL=ON           -DROBOTOLOGY_USES_OCTAVE:BOOL=${ROBOTOLOGY_USES_OCTAVE}           -DROBOTOLOGY_USES_MATLAB:BOOL=${ROBOTOLOGY_USES_MATLAB}           -DNON_INTERACTIVE_BUILD:BOOL=ON           -DBUILD_TESTING:BOOL=OFF           -DYCM_DISABLE_SYSTEM_PACKAGES:BOOL=ON           -DROBOTOLOGY_PROJECT_TAGS=${ROBOTOLOGY_PROJECT_TAGS}           .. &&    ninja &&    ln -s ${IIT_SOURCES}/robotology-superbuild/build/install ${IIT_INSTALL} &&    echo "source ${IIT_INSTALL}/share/robotology-superbuild/setup.sh" >> /etc/bash.bashrc &&    ln -s ${IIT_SOURCES}/robotology-superbuild/src/YARP/scripts/yarp_completion /etc/bash_completion.d/yarp_completion &&    find src/ -type f -not -name 'CMakeCache.txt' -delete &&    find ${IIT_SOURCES}/robotology-superbuild -not -group runtimeusers -exec chgrp runtimeusers {} \; -exec chmod g+rw {} \+
 ---> Running in 15dfe8362e22
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
stty: 'standard input': Inappropriate ioctl for device
mkdir: created directory 'build'
Warn about uninitialized values.
-- The C compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 9.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- YCM not found. Bootstrapping it.
-- Downloading YCMEPHelper.cmake - Attempt 1 of 3
-- Downloading YCMEPHelper.cmake - ERROR 1: "Unsupported protocol"
-- Downloading YCMEPHelper.cmake - Attempt 2 of 3
-- Downloading YCMEPHelper.cmake - ERROR 1: "Unsupported protocol"
-- Downloading YCMEPHelper.cmake - Attempt 3 of 3
CMake Error at cmake/IncludeUrl.cmake:339 (message):
  Downloading YCMEPHelper.cmake - ERROR 1: "Unsupported protocol"
Call Stack (most recent call first):
  cmake/YCMBootstrap.cmake:113 (include_url)
  CMakeLists.txt:55 (include)

-- Configuring incomplete, errors occurred!
See also "/iit/sources/robotology-superbuild/build/CMakeFiles/CMakeOutput.log".
The command '/bin/bash -i -c cd ${IIT_SOURCES}/robotology-superbuild &&    mkdir -p build && cd build &&    export CC=gcc && export CXX=g++ &&    cmake           -GNinja           -DCMAKE_BUILD_TYPE=Release           -DROBOTOLOGY_ENABLE_CORE:BOOL=ON           -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON           -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=ON           -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=ON           -DROBOTOLOGY_ENABLE_HUMAN_DYNAMICS:BOOL=ON           -DROBOTOLOGY_USES_GAZEBO:BOOL=ON           -DROBOTOLOGY_USES_OCTAVE:BOOL=${ROBOTOLOGY_USES_OCTAVE}           -DROBOTOLOGY_USES_MATLAB:BOOL=${ROBOTOLOGY_USES_MATLAB}           -DNON_INTERACTIVE_BUILD:BOOL=ON           -DBUILD_TESTING:BOOL=OFF           -DYCM_DISABLE_SYSTEM_PACKAGES:BOOL=ON           -DROBOTOLOGY_PROJECT_TAGS=${ROBOTOLOGY_PROJECT_TAGS}           .. &&    ninja &&    ln -s ${IIT_SOURCES}/robotology-superbuild/build/install ${IIT_INSTALL} &&    echo "source ${IIT_INSTALL}/share/robotology-superbuild/setup.sh" >> /etc/bash.bashrc &&    ln -s ${IIT_SOURCES}/robotology-superbuild/src/YARP/scripts/yarp_completion /etc/bash_completion.d/yarp_completion &&    find src/ -type f -not -name 'CMakeCache.txt' -delete &&    find ${IIT_SOURCES}/robotology-superbuild -not -group runtimeusers -exec chgrp runtimeusers {} \; -exec chmod g+rw {} \+' returned a non-zero code: 1
Makefile:21: recipe for target 'development-master' failed
make: *** [development-master] Error 1
fjandrad commented 3 years ago

I add here the new command line messages from trying to build development image, with cmake 3.19 there are some messages about gcc failing.

FAILED: src/GazeboYARPPlugins/CMakeFiles/YCMStamp/GazeboYARPPlugins-build 
cd /iit/sources/robotology-superbuild/build/src/GazeboYARPPlugins && /usr/local/bin/cmake --build . && /usr/local/bin/cmake -E touch /iit/sources/robotology-superbuild/build/src/GazeboYARPPlugins/CMakeFiles/YCMStamp/GazeboYARPPlugins-build
[1/104] Building CXX object thrift/worldinterface/CMakeFiles/gazebo_yarp_rpc_worldinterface.dir/autogenerated/src/Pose.cpp.o
[2/104] Building CXX object thrift/worldinterface/CMakeFiles/gazebo_yarp_rpc_worldinterface.dir/autogenerated/src/Color.cpp.o
[3/104] Building CXX object thrift/linkattacher/CMakeFiles/gazebo_yarp_rpc_linkattacher.dir/autogenerated/src/LinkAttacherServer.cpp.o
[4/104] Linking CXX shared library lib/libgazebo_yarp_rpc_linkattacher.so.3.6.0
[5/104] Creating library symlink lib/libgazebo_yarp_rpc_linkattacher.so
[6/104] Building CXX object thrift/clock/CMakeFiles/gazebo_yarp_rpc_clock.dir/autogenerated/src/ClockServer.cpp.o
[7/104] Linking CXX shared library lib/libgazebo_yarp_rpc_clock.so.3.6.0
[8/104] Creating library symlink lib/libgazebo_yarp_rpc_clock.so
[9/104] Building CXX object thrift/worldinterface/CMakeFiles/gazebo_yarp_rpc_worldinterface.dir/autogenerated/src/WorldInterfaceServer.cpp.o
[10/104] Linking CXX shared library lib/libgazebo_yarp_rpc_worldinterface.so.3.6.0
[11/104] Creating library symlink lib/libgazebo_yarp_rpc_worldinterface.so
[12/104] Building CXX object plugins/clock/CMakeFiles/gazebo_yarp_clock.dir/src/ClockServerImpl.cpp.o
[13/104] Building CXX object plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/CameraDriver.cpp.o
FAILED: plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/CameraDriver.cpp.o 
/usr/bin/g++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_TEST_DYN_LINK -DBOOST_THREAD_DYN_LINK -DLIBBULLET_VERSION=2.88 -DLIBBULLET_VERSION_GT_282 -Dgazebo_yarp_camera_EXPORTS -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/camera/include/gazebo -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/camera/include/yarp/dev -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/camera/include -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/libraries/common/include -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/libraries/singleton/include -isystem /usr/include/gazebo-11 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-9.5 -isystem /usr/include/ignition/math6 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport8 -isystem /usr/include/ignition/msgs5 -isystem /usr/include/ignition/common3 -isystem /usr/include/ignition/fuel_tools4 -isystem /iit/sources/robotology-superbuild/build/install/include -isystem /usr/include/eigen3 -isystem /usr/include/sdformat-9.5/sdf/.. -isystem /usr/include/ignition/cmake2 -isystem /usr/include/uuid -isystem /usr/include/opencv4 -O3 -DNDEBUG -fPIC -I/usr/include/uuid -std=gnu++17 -MD -MT plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/CameraDriver.cpp.o -MF plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/CameraDriver.cpp.o.d -o plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/CameraDriver.cpp.o -c /iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/camera/src/CameraDriver.cpp
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[14/104] Building CXX object plugins/linkattacher/CMakeFiles/gazebo_yarp_linkattacher.dir/src/linkattacher.cc.o
FAILED: plugins/linkattacher/CMakeFiles/gazebo_yarp_linkattacher.dir/src/linkattacher.cc.o 
/usr/bin/g++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_TEST_DYN_LINK -DBOOST_THREAD_DYN_LINK -DLIBBULLET_VERSION=2.88 -DLIBBULLET_VERSION_GT_282 -Dgazebo_yarp_linkattacher_EXPORTS -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/linkattacher/include/gazebo -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/linkattacher/include/GazeboYarpPlugins -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/linkattacher/include -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/thrift/linkattacher/autogenerated/include -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/libraries/common/include -I/iit/sources/robotology-superbuild/src/GazeboYARPPlugins/libraries/singleton/include -isystem /usr/include/gazebo-11 -isystem /usr/include/bullet -isystem /usr/include/simbody -isystem /usr/include/sdformat-9.5 -isystem /usr/include/ignition/math6 -isystem /usr/include/OGRE -isystem /usr/include/OGRE/Terrain -isystem /usr/include/OGRE/Paging -isystem /usr/include/ignition/transport8 -isystem /usr/include/ignition/msgs5 -isystem /usr/include/ignition/common3 -isystem /usr/include/ignition/fuel_tools4 -isystem /iit/sources/robotology-superbuild/build/install/include -isystem /usr/include/opencv4 -isystem /usr/include/eigen3 -isystem /usr/include/sdformat-9.5/sdf/.. -isystem /usr/include/ignition/cmake2 -isystem /usr/include/uuid -O3 -DNDEBUG -fPIC -I/usr/include/uuid -std=gnu++17 -MD -MT plugins/linkattacher/CMakeFiles/gazebo_yarp_linkattacher.dir/src/linkattacher.cc.o -MF plugins/linkattacher/CMakeFiles/gazebo_yarp_linkattacher.dir/src/linkattacher.cc.o.d -o plugins/linkattacher/CMakeFiles/gazebo_yarp_linkattacher.dir/src/linkattacher.cc.o -c /iit/sources/robotology-superbuild/src/GazeboYARPPlugins/plugins/linkattacher/src/linkattacher.cc
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[15/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriverInteractionMode.cpp.o
[16/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriverControlMode.cpp.o
[17/104] Building CXX object libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/Handler.cc.o
[18/104] Building CXX object plugins/inertialmtb/CMakeFiles/gazebo_yarp_inertial.dir/src/inertialMTB.cc.o
[19/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriverDeviceDriver.cpp.o
[20/104] Building CXX object plugins/clock/CMakeFiles/gazebo_yarp_clock.dir/src/Clock.cc.o
[21/104] Building CXX object libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/ConfHelpers.cc.o
[22/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoard.cc.o
[23/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriverEncoders.cpp.o
[24/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriver.cpp.o
[25/104] Building CXX object plugins/controlboard/CMakeFiles/gazebo_yarp_controlboard.dir/src/ControlBoardDriverOthers.cpp.o
[26/104] Building CXX object plugins/camera/CMakeFiles/gazebo_yarp_camera.dir/src/Camera.cc.o
ninja: build stopped: subcommand failed.

dev_build.log

diegoferigo commented 3 years ago

I'm not really sure what's going on. Right now I'm not going often to IIT and I'm working with a limited data plan, I cannot re-build the entire RL image just for a test. I'll give it a try as soon as I go to the lab.

Few comments:

fjandrad commented 3 years ago

I might test again later if I get some time. For now, I am using the built image form dockerhub.

diegoferigo commented 3 years ago

Should be fixed in current master. I temporarily worked around clang problems by switching to gcc as default compiler.

diegoferigo commented 3 years ago

The last build of the master branch succeeds. Closing.