aldebaran / libqi

NAOqi core framework
http://doc.aldebaran.com/libqi/
BSD 3-Clause "New" or "Revised" License
66 stars 53 forks source link

Failing compilation on Ubuntu 20.04.2 LTS #33

Closed victorpaleologue closed 1 year ago

victorpaleologue commented 3 years ago

Trying to build libQi directly with no toolchain, on Ubuntu 20.04.2 LTS, leads to the following error:

~/Code/qi/libqi on  release-2.9 ⌚ 12:08:52
$ qm -j1
Current build worktree: /home/victor.paleologue/Code/qi
* (1/1) Building libqi in RelWithDebInfo
-- Using qibuild 3.16
-- Library: qi
-- Binary: qipath_example
-- Binary: sharedlibrary_example
-- Binary: log_example
-- Binary: buffer_example
-- Binary: qiconvloc_example
-- Using qibuild 3.16
-- Binary: test_translate
-- Using qibuild 3.16
-- Module: foo
-- Binary: footest
-- Library: qitestutils
-- Library: testsession
-- Configuring done
-- Generating done
-- Build files have been written to: /home/victor.paleologue/Code/qi/libqi/build-sys-linux-x86_64
Scanning dependencies of target qi
[  1%] Building CXX object CMakeFiles/qi.dir/src/dlfcn.cpp.o
[  2%] Building CXX object CMakeFiles/qi.dir/src/path.cpp.o
[  3%] Building CXX object CMakeFiles/qi.dir/src/application.cpp.o
[  4%] Building CXX object CMakeFiles/qi.dir/src/buffer.cpp.o
[  5%] Building CXX object CMakeFiles/qi.dir/src/bufferreader.cpp.o
[  6%] Building CXX object CMakeFiles/qi.dir/src/clock.cpp.o
[  6%] Building CXX object CMakeFiles/qi.dir/src/future.cpp.o
In file included from /home/victor.paleologue/Code/qi/libqi/qi/anyfunction.hpp:295,
                 from /home/victor.paleologue/Code/qi/libqi/qi/type/detail/listtypeinterface.hxx:14,
                 from /home/victor.paleologue/Code/qi/libqi/qi/type/typeinterface.hpp:435,
                 from /home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyreference.hpp:564,
                 from /home/victor.paleologue/Code/qi/libqi/qi/type/detail/futureadapter.hpp:10,
                 from /home/victor.paleologue/Code/qi/libqi/qi/detail/future.hxx:17,
                 from /home/victor.paleologue/Code/qi/libqi/qi/future.hpp:8,
                 from /home/victor.paleologue/Code/qi/libqi/src/future.cpp:5:
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:77:61: error: ‘is_fundamental’ in namespace ‘boost’ does not name a template type
   77 |       using type = typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                             ^~~~~~~~~~~~~~
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:77:75: error: expected template-argument before ‘<’ token
   77 |       using type = typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                                           ^
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:77:75: error: expected ‘>’ before ‘<’ token
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:77:94: error: template argument 1 is invalid
   77 | sing type = typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                                                       ^

/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:78:63: error: ‘is_fundamental’ in namespace ‘boost’ does not name a template type
   78 |       using rType =  typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                               ^~~~~~~~~~~~~~
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:78:77: error: expected template-argument before ‘<’ token
   78 |       using rType =  typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                                             ^
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:78:77: error: expected ‘>’ before ‘<’ token
/home/victor.paleologue/Code/qi/libqi/qi/type/detail/anyfunctionfactory.hxx:78:96: error: template argument 1 is invalid
   78 | ng rType =  typename boost::mpl::if_<typename boost::is_fundamental<T>::type, void*, T>::type;
      |                                                                                       ^

make[2]: *** [CMakeFiles/qi.dir/build.make:158: CMakeFiles/qi.dir/src/future.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:328: CMakeFiles/qi.dir/all] Error 2
make: *** [Makefile:147: all] Error 2
[ERROR]: BuildFailed Error occurred when building project libqi
Traceback (most recent call last):
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qibuild/project.py", line 402, in build
    qisys.command.call(cmd, env=build_env_str)
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qisys/command.py", line 553, in call
    raise CommandFailedException(cmd, returncode, cwd)
qisys.command.CommandFailedException: The following command failed
['/usr/local/bin/cmake', '--build', '/home/victor.paleologue/Code/qi/libqi/build-sys-linux-x86_64', '--config', 'RelWithDebInfo', '--', '-j', '1']
Return code is 2
Working dir was /home/victor.paleologue/Code/qi/libqi

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qisys/script.py", line 139, in main_wrapper
    module.do(args)
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qisys/ui.py", line 367, in res
    ret = func(*args, **kwargs)
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qibuild/actions/make.py", line 35, in do
    cmake_builder.build(rebuild=args.rebuild,
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qibuild/cmake_builder.py", line 92, in new_func
    res = func(self, *args, **kwargs)
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qibuild/cmake_builder.py", line 206, in build
    project.build(**kwargs)
  File "/home/victor.paleologue/.local/lib/python3.8/site-packages/qibuild/project.py", line 404, in build
    raise qibuild.build.BuildFailed(self)
qibuild.build.BuildFailed: Error occurred when building project libqi
victorpaleologue commented 3 years ago

Using std::is_fundamental instead of boost::is_fundamental fixes this compilation error.

victorpaleologue commented 3 years ago

Candidate fix here: https://github.com/victorpaleologue/libqi/commit/cb49149ab9e6262b6302a0749438729e41c09e22 It's in review internally at SBRE.

nyibbang commented 1 year ago

Fixed since libqi v2.0.0