Problems compiling SLiM on Ubuntu 21.10

16 views
Skip to first unread message

font...@gmail.com

unread,
Nov 3, 2021, 4:39:56 PM11/3/21
to slim-discuss
Hello Ben and all.

I am trying to compile SLiM on two new machines running Ubuntu 21.10

I have tried to install using the installation script from session 2.2.1 from the manual and compiling from source following sessions 2.2.2

I have all make, cmake, qmake and Qt5 installed in both machines.

Both pathways end up in errors, around 90-91% of the process.

From the script I get the following:

[ 90%] Building CXX object CMakeFiles/SLiMgui.dir/SLiMgui_autogen/UXQW7GK73I/qrc_recipes.cpp.o
make[1]: *** [CMakeFiles/Makefile2:169: CMakeFiles/slim.dir/all] Error 2
[ 90%] Linking CXX executable SLiMgui
[ 90%] Built target SLiMgui
make: *** [Makefile:149: all] Error 2
Build failed. Please see the output and make a post on the slim-discuss mailing list.
The output from this build is stored in '/var/log/' as SLiM-CMakeOutput-2021-11-03T16:11:57-04:00.log.
You may be asked to upload this file during a support request.

(I've attached the log file here).

From the source code, the error is the following:

[ 70%] Building CXX object CMakeFiles/eidos.dir/eidos/eidos_ast_node.cpp.o
In file included from /path/to/SLiM/eidos/eidos_class_Dictionary.h:31,
                 from /path/to/SLiM/eidos/eidos_value.h:46,
                 from /path/to/SLiM/eidos/eidos_ast_node.h:28,
                 from /path/to/SLiM/eidos/eidos_ast_node.cpp:21:
/path/to/SLiM/eidos/robin_hood.h: In member function ‘size_t robin_hood::detail::Table<IsFlat, MaxLoadFactor100, Key, T, Hash, KeyEqual>::calcMaxNumElementsAllowed(size_t) const’:
/path/to/SLiM/eidos/robin_hood.h:2021:52: error: ‘numeric_limits’ is not a member of ‘std’
 2021 |         if (ROBIN_HOOD_LIKELY(maxElements <= (std::numeric_limits<size_t>::max)() / 100)) {
      |                                                    ^~~~~~~~~~~~~~
/path/to/SLiM/eidos/robin_hood.h:179:59: note: in definition of macro ‘ROBIN_HOOD_LIKELY’
  179 | #    define ROBIN_HOOD_LIKELY(condition) __builtin_expect(condition, 1)
      |                                                           ^~~~~~~~~
/path/to/SLiM/eidos/robin_hood.h:2021:73: error: expected primary-expression before ‘>’ token
 2021 | ROBIN_HOOD_LIKELY(maxElements <= (std::numeric_limits<size_t>::max)() / 100)) {
      |                                                             ^

/path/to/SLiM/eidos/robin_hood.h:179:59: note: in definition of macro ‘ROBIN_HOOD_LIKELY’
  179 | #    define ROBIN_HOOD_LIKELY(condition) __builtin_expect(condition, 1)
      |                                                           ^~~~~~~~~
/path/to/SLiM/eidos/robin_hood.h:2021:76: error: ‘::max’ has not been declared; did you mean ‘std::max’?
 2021 | IN_HOOD_LIKELY(maxElements <= (std::numeric_limits<size_t>::max)() / 100)) {
      |                                                             ^~~

/path/to/SLiM/eidos/robin_hood.h:179:59: note: in definition of macro ‘ROBIN_HOOD_LIKELY’
  179 | #    define ROBIN_HOOD_LIKELY(condition) __builtin_expect(condition, 1)
      |                                                           ^~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /path/to/SLiM/eidos/eidos_globals.h:33,
                 from /path/to/SLiM/eidos/eidos_token.h:29,
                 from /path/to/SLiM/eidos/eidos_ast_node.h:27,
                 from /path/to/SLiM/eidos/eidos_ast_node.cpp:21:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [CMakeFiles/eidos.dir/build.make:82: CMakeFiles/eidos.dir/eidos/eidos_ast_node.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/eidos.dir/all] Error 2
make: *** [Makefile:149: all] Error 2


Any ideas?

Thank you very much,

JP
SLiM-CMakeOutput-2021-11-03T16:11:57-04:00.log

Ben Haller

unread,
Nov 3, 2021, 5:16:55 PM11/3/21
to slim-discuss
Hi JP.  It looks like you are probably trying to build the SLiM 3.6 sources.  There is a build problem that was known on Fedora 34, and now Ubuntu 21.10 can be added to that list, where the robin_hood.h header does not correctly include all the things it ought to.  This causes a failure on particular platforms where the needed header doesn't get pulled in by other includes.  Anyway, long story short, it looks like to be able to build on Ubuntu 21.10 you need to build the current GitHub head version of SLiM, following the instructions in chapter 2; the release 3.6 sources won't build for you.  If you would really like to be on SLiM 3.6 apart from this pesky build issue (so you don't get other bleeding-edge changes that might cause you problems), you could use the GitHub commit immediately following the 3.6 release, which fixes this specific problem:

https://github.com/MesserLab/SLiM/tree/7964f7911e1665a1ba0783d9136b3d3bff06d931

If other compile errors still occur for you when using the GitHub head, please let me know off-list; Ubuntu 21.10 is not a platform we have tested on yet, I think, so there might be further problems that need to be fixed to support it.  Good luck!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


font...@gmail.com

unread,
Nov 3, 2021, 5:48:49 PM11/3/21
to slim-discuss
Hi Ben,

Just compiled from git and it works on Ubuntu 21.10

Cheers

JP
Reply all
Reply to author
Forward
0 new messages