[SOLVED] Build failure on source install


#1

Hello everyone,
I’m installing NRP on Ubuntu 18.04 following the bitbucket instruction (https://bitbucket.org/hbpneurorobotics/neurorobotics-platform/src/master/).

During the final build step (./update_nrp build all) everything goes well until it reaches the end of the GazeboRosPackages install. This is the terminal output right before the process fails:

Scanning dependencies of target controller_ros_gazebo_icub
Scanning dependencies of target avatar_control_plugin
Scanning dependencies of target gazebo_ros_muscle_interface
[ 97%] Building CXX object gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/src/gazebo_ros_muscle_interface.cpp.o
[ 97%] Building CXX object controller_ros_gazebo_icub/CMakeFiles/controller_ros_gazebo_icub.dir/src/controller_ros_gazebo_icub.cpp.o
[ 97%] Building CXX object avatar_control_plugin/CMakeFiles/avatar_control_plugin.dir/src/avatar_control_plugin.cpp.o
[ 97%] Built target gazebo_ros_camera_utils
Scanning dependencies of target gazebo_version_helpers
[ 97%] Building CXX object

Then it throws an error on the gazebo::MuscleInterfacePlugin::MuscleInterfacePlugin():

gazebo_version_helpers/CMakeFiles/gazebo_version_helpers.dir/src/GazeboVersionHelpers.cpp.o
/home/nrp/Documents/NRP/GazeboRosPackages/src/gazebo_ros_muscle_interface/src/gazebo_ros_muscle_interface.cpp: In constructor ‘gazebo::MuscleInterfacePlugin::MuscleInterfacePlugin()’:
/home/nrp/Documents/NRP/GazeboRosPackages/src/gazebo_ros_muscle_interface/src/gazebo_ros_muscle_interface.cpp:21:18: error: ‘make_unique’ is not a member of ‘std’
rosNode = std::make_unique<ros::NodeHandle>("gazebo_muscle_interface"); ^~~~~~~~~~~
/home/nrp/Documents/NRP/GazeboRosPackages/src/gazebo_ros_muscle_interface/src/gazebo_ros_muscle_interface.cpp:21:18: note: suggested alternative: ‘__unique’ rosNode = std::make_unique<ros::NodeHandle>("gazebo_muscle_interface"); ^~~~~~~~~~~ __unique
/home/nrp/Documents/NRP/GazeboRosPackages/src/gazebo_ros_muscle_interface/src/gazebo_ros_muscle_interface.cpp:21:45: error: expected primary-expression before ‘>’ token rosNode = std::make_unique<ros::NodeHandle>("gazebo_muscle_interface"); ^
gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/build.make:62: recipe for target 'gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/src/gazebo_ros_muscle_interface.cpp.o' failed
make[2]: *** [gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/src/gazebo_ros_muscle_interface.cpp.o] Error 1
CMakeFiles/Makefile2:11349: recipe for target 'gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/all' failed
make[1]: *** [gazebo_ros_muscle_interface/CMakeFiles/gazebo_ros_muscle_interface.dir/all] Error 2

Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4" failed
GAZEBO_ROSPACKAGES BUILD ERROR


By reading the NRP troubleshooting, I think the issue is that I installed the ros-melodic-desktop-full package since I kept finding apt errors in previous build attempts.
The instructions only tell to make sure the path contains $HOME/.local/lib/x86_64-linux-gnu/cmake/gazebo/, and in my case it does:

CMAKE_PREFIX_PATH=/home/nrp/Documents/NRP/GazeboRosPackages/devel:/opt/ros/melodic:/home/nrp/.local/lib/x86_64-linux-gnu/cmake/gazebo/

Can someone help me solving this?


#2

Hi, I would assume the error is coming from this line, and is not related to ros. This error might point to the fact that your compiler is not detecting the latest C++ features. One way to enforce the compiler to try to build the code with the right C++ version is to change the lines 5-14 in $HBP/GazeboRosPackages/src/gazebo_ros_muscle_interface/CMakeLists.txt to the following

include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX14)
    message(STATUS "Compiler supports cxx14")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
elseif(COMPILER_SUPPORTS_CXX0X)
    message(STATUS "Compiler supports c++0x")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()

If this doesn’t build the code, maybe the compiler has to be updated. Let me know if that works else we can further debug.

Best regards,
Manos


#3

Thank you Manos, the fix solved the building issue!

The problem now is in starting the platform; after running cle-nginx and cle-start I get these two error repeatedly:

--- no python application found, check your startup logs for errors ---
--- no python application found, check your startup logs for errors ---
2020-07-20 12:56:46 GMT+0200 Failed to execute request http://localhost:8080/health/errors. ERROR: Error: Status code: 500 Internal Server Error
2020-07-20 12:56:46 GMT+0200 Failed to execute request http://localhost:8080/simulation. ERROR: Error: Status code: 500 Internal Server Error

Where do I find the startup logs?


#4

Sorry I didn’t give you all the information that you needed: the python error in starting the platform is:

*** Operational MODE: threaded ***
Traceback (most recent call last):
File “/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_backend/hbp_nrp_backend/runserver.py”, line 32, in
from hbp_nrp_backend.rest_server import app
File “./hbp_nrp_backend/rest_server/init.py”, line 83, in
from hbp_nrp_backend.rest_server.__SimulationResources import SimulationResources
File “./hbp_nrp_backend/rest_server/__SimulationResources.py”, line 34, in
from hbp_nrp_backend.rest_server.__SimulationControl import _get_simulation_or_abort
File “./hbp_nrp_backend/rest_server/__SimulationControl.py”, line 34, in
from hbp_nrp_commons.bibi_functions import docstring_parameter
File “/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/bibi_functions.py”, line 27, in
from hbp_nrp_commons.generated import bibi_api_gen
ImportError: cannot import name bibi_api_gen
unable to load app 0 (mountpoint=’’) (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
dropping root privileges after application loading

By checking other similar topics on the forum, I can confirm to have the /.bashrc set properly (my PYTHONPATH is empty and I added the . $HBP/user-scripts/nrp_variables and . $HBP/user-scripts/nrp_aliases)

If I run echo $PYTHONPATH I get:

/home/nrp/Documents/NRP/retina/build/lib:/home/nrp/Documents/NRP/GazeboRosPackages/devel/lib/python2.7/dist-packages:/opt/ros/melodic/lib/python2.7/dist-packages:/home/nrp/.local/lib/python2.7/site-packages:/home/nrp/.local/lib/x86_64-linux-gnu/python2.7/site-packages:/home/nrp/Documents/NRP/GazeboRosPackages/devel/lib/python2.7/dist-packages:/home/nrp/Documents/NRP/CLE/hbp_nrp_cle:/home/nrp/Documents/NRP/ExperimentControl/hbp_nrp_excontrol:/home/nrp/Documents/NRP/ExperimentControl/hbp_nrp_scxml:/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_backend:/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_cleserver:/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_commons:/home/nrp/Documents/NRP/ExDBackend/hbp_nrp_watchdog:/home/nrp/Documents/NRP/ExDBackend/hbp-flask-restful-swagger-master:/home/nrp/Documents/NRP/VirtualCoach/hbp_nrp_virtual_coach:/home/nrp/Documents/NRP/BrainSimulation/hbp_nrp_distributed_nest


#5

Hi Francesco,

This means that the NRP services didn’t start properly. There should be more logs a bit above in the terminal, could you provide these as well? One think that you can check is whether you added the NRP related lines in your ~/.bashrc file. They should look like:

export HBP=$HOME/Documents/NRP # or wherever you installed the NRP
. $HBP/user-scripts/nrp_variables
. $HBP/user-scripts/nrp_aliases

Hope it helps!

Best,
Manos


#6

Ah ok with the new information, I see that the problem is that the configure part did not work. Could you try the following:

cd $HBP/user-scripts
./configure_nrp

If this works error-free then you should be good to go, else we continue debugging.

Best,
Manos


#7

Thank you very much Manos,
after running ./configure_nrp I was able to start the platform, clone and run a simple experiment and it seems to work like a charm.

Thanks again for the quick replies!

Best regards,
Francesco


#8

that’s good to hear, have fun with the NRP then!

Best,
Manos