ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Autoware compilation failed. building from source

asked 2019-10-31 03:13:57 -0500

JohnBT gravatar image

Trying to build Autoware from source according to this. The version I want to install is 1.12.0.

My system is ubuntu 16 with ros kinetic.
g++ and gcc version is 5.4.0.
Python version is 2.7 and 3.5.

After I run

colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

error occurs:

$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Starting >>> autoware_build_flags
Starting >>> autoware_msgs
Starting >>> vector_map_msgs
Starting >>> autoware_config_msgs
[Processing: autoware_build_flags, autoware_config_msgs, autoware_msgs, vector_map_msgs]
Finished <<< autoware_build_flags [32.7s]                                      
Starting >>> tablet_socket_msgs
Finished <<< autoware_config_msgs [42.5s]                                      
Starting >>> autoware_system_msgs
Finished <<< tablet_socket_msgs [12.4s]                                        
Starting >>> autoware_can_msgs
Finished <<< autoware_msgs [49.7s]                                       
Starting >>> amathutils_lib
Finished <<< vector_map_msgs [55.5s]                                           
Starting >>> vector_map
Finished <<< autoware_can_msgs [11.6s]                                      
Starting >>> gnss
Finished <<< autoware_system_msgs [14.3s]
Starting >>> autoware_health_checker
--- stderr: amathutils_lib                                                     
/home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp: In member function ‘bool KalmanFilter::update(const MatrixXd&, const MatrixXd&, const MatrixXd&, const MatrixXd&)’:
/home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:113:22: error: ‘isnan’ was not declared in this scope
   if (isnan(K.array()).any() || isinf(K.array()).any())
                      ^
/home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:113:22: note: suggested alternative:
In file included from /usr/include/c++/5/complex:44:0,
                 from /usr/local/include/eigen3/Eigen/Core:28,
                 from /home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/include/amathutils_lib/kalman_filter.hpp:19,
                 from /home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:17:
/usr/include/c++/5/cmath:641:5: note:   ‘std::isnan’
     isnan(_Tp __x)
     ^
/home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:113:48: error: ‘isinf’ was not declared in this scope
   if (isnan(K.array()).any() || isinf(K.array()).any())
                                                ^
/home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:113:48: note: suggested alternative:
In file included from /usr/include/c++/5/complex:44:0,
                 from /usr/local/include/eigen3/Eigen/Core:28,
                 from /home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/include/amathutils_lib/kalman_filter.hpp:19,
                 from /home/igs/bty_code/autoware/autoware.ai/src/autoware/common/amathutils_lib/src/kalman_filter.cpp:17:
/usr/include/c++/5/cmath:621:5: note:   ‘std::isinf’
     isinf(_Tp __x)
     ^
make[2]: *** [CMakeFiles/amathutils_lib.dir/src/kalman_filter.cpp.o] Error 1
make[1]: *** [CMakeFiles/amathutils_lib.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< amathutils_lib [ Exited with code 2 ]
Aborted  <<< vector_map
Aborted  <<< autoware_health_checker
Aborted  <<< gnss
[69.325s] ERROR:colcon.colcon_core.event_reactor:Exception in event handler extension 'log': write to closed file
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/colcon_core/event_reactor.py", line 78, in _notify_observers
    retval = observer(event)
  File "/usr/lib/python3/dist-packages/colcon_output/event_handler/log.py", line 110, in __call__
    h.write(line)
ValueError: write to closed file

[69.325s] ERROR:colcon.colcon_core.event_reactor:Exception in event handler extension 'status': <colcon_core.executor.Job object at 0x7f9191548898> ...
(more)
edit retag flag offensive close merge delete

Comments

You are using Eigen3 in /usr/local/include/eigen3, but usually in kinetic, /usr/include/eigen3 should be used. I guess this is causing the error. Though I've installed Eigen 3.3.7 and compiled Autoware, I couldn't get the exact same error.

So, could you give me the results of two commands?

  1. pkg-config --cflags eigen3
  2. pkg-config --modversion eigen3
Kenji Miyake gravatar image Kenji Miyake  ( 2019-10-31 07:28:51 -0500 )edit

@Kenji Miyake the first result is blank. the second is 3.2.8

JohnBT gravatar image JohnBT  ( 2019-10-31 20:14:10 -0500 )edit

@JohnBT In Autoware docker environment, the following is the result, so there is a difference.

autoware@KM-DAIV:~$ pkg-config --cflags eigen3
-I/usr/include/eigen3
autoware@KM-DAIV:~$ pkg-config --modversion eigen3
3.2.92

How did you install Eigen3? I'll try to install Eigen 3.2.8 in the same way and to reproduce the problem.

Kenji Miyake gravatar image Kenji Miyake  ( 2019-10-31 20:46:33 -0500 )edit

@Kenji Miyake eigen3.2.8 seems to be downloaded from http://eigen.tuxfamily.org/index.php?....

$ mkdir build
$ cd build
$ cmake ..
$ make -j8 -l8
$ sudo make install

add export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/eigen3 to .profile

JohnBT gravatar image JohnBT  ( 2019-10-31 21:01:35 -0500 )edit

Did you try this step? I guess you are missing it.

cd autoware.ai
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

The output should be like this.

autoware@KM-DAIV:~/Autoware$ rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
#All required rosdeps installed successfully
Kenji Miyake gravatar image Kenji Miyake  ( 2019-10-31 21:51:10 -0500 )edit

I could reproduce the error, so will write an answer soon.

Kenji Miyake gravatar image Kenji Miyake  ( 2019-10-31 22:01:30 -0500 )edit

@Kenji Miyake thanks a lot . I will try your solution later.

JohnBT gravatar image JohnBT  ( 2019-11-01 20:28:17 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-31 22:08:57 -0500

Kenji Miyake gravatar image

updated 2019-11-01 00:13:03 -0500

The problem is you are using the non-supported version of Eigen.

The solution is:

# Build eigen in order to remove it correctly
cd && wget http://bitbucket.org/eigen/eigen/get/3.2.8.tar.gz #Download Eigen
mkdir eigen && tar --strip-components=1 -xzvf 3.2.8.tar.gz  -C eigen
cd eigen && mkdir build && cd build && cmake .. && make

# Option1 to remove eigen: To check what are installed and remove them
sudo make install
sudo rm -rf /usr/local/include/eigen3 /usr/local/share/pkgconfig/eigen3.pc /usr/local/include/eigen3

# Option2 to remove eigen: To remove all files listed in install_manifest.txt
sudo xargs rm < install_manifest.txt

# Install dependency using rosdep
cd autoware.ai
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO

# Clean build files and rebuild Autoware
rm -rf build/ install/ log/
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
edit flag offensive delete link more

Comments

1

By the way, Autoware.AI will release a new version(v1.13) soon, and 16.04 will be not supported.
I recommend you to upgrade to 18.04 as soon as possible.

Kenji Miyake gravatar image Kenji Miyake  ( 2019-10-31 22:10:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-10-31 03:13:57 -0500

Seen: 1,282 times

Last updated: Nov 01 '19