JanWielemaker/rocksdb

Pack RocksDB, build fails on Ubuntu 22.04 LTS on WSL on Windows (reproducible)

EricGT opened this issue · 1 comments

?- pack_install(rocksdb).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install rocksdb@0.8.0 from GIT at https://github.com/JanWielemaker/rocksdb.git Y/n?
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "rocksdb.git" was downloaded 5 times
Package:                rocksdb
Title:                  SWI-Prolog interface to RocksDB
Installed version:      0.8.0
Author:                 Jan Wielemaker <J.Wielemaker@vu.nl>
Maintainer:             Jan Wielemaker <J.Wielemaker@cwi.nl>
Packager:               Jan Wielemaker <J.Wielemaker@cwi.nl>
Home page:              https://github.com/JanWielemaker/rocksdb
Download URL:           https://github.com/JanWielemaker/rocksdb.git
Run post installation scripts for pack "rocksdb" Y/n?Y
% git submodule update --init rocksdb
% Submodule 'rocksdb' (https://github.com/facebook/rocksdb) registered for path 'rocksdb'
% Cloning into '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'...
% Submodule path 'rocksdb': checked out 'bd68bfb41b58dba4332045392cdbda4664b01e81'
% ROCKSDB_DISABLE_JEMALLOC=1 ROCKSDB_DISABLE_TCMALLOC=1 /usr/bin/gmake -j4 -C rocksdb static_lib EXTRA_CXXFLAGS=-fPIC EXTRA_CFLAGS=-fPIC USE_RTTI=1 DEBUG_LEVEL=0
% gmake[1]: Entering directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
%   GEN      util/build_version.cc
% $DEBUG_LEVEL is 0
% Makefile:235: Warning: /usr/lib/swi-prolog/include" does not exist
%   GEN      util/build_version.cc
%   CC       cache/clock_cache.o

...

%   CC       options/options_helper.o
ERROR: options/options_helper.cc: In function ‘rocksdb::Status rocksdb::GetStringFromStruct(const rocksdb::ConfigOptions&, const void*, const std::unordered_map<std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>&, std::string*)’:
ERROR: options/options_helper.cc:767:19: error: loop variable ‘iter’ creates a copy from type ‘const std::pair<const std::__cxx11::basic_string<char>, rocksdb::OptionTypeInfo>’ [-Werror=range-loop-construct]
ERROR:   767 |   for (const auto iter : type_info) {
ERROR:       |                   ^~~~
% options/options_helper.cc:767:19: note: use reference type to prevent copying
%   767 |   for (const auto iter : type_info) {
%       |                   ^~~~
%       |                   &
%   CC       options/options_parser.o

...

%   CC       table/block_based/block_based_filter_block.o
% cc1plus: all warnings being treated as errors
% gmake[1]: *** [Makefile:2258: options/options_helper.o] Error 1
% gmake[1]: *** Waiting for unfinished jobs....
% gmake[1]: Leaving directory '/home/groot/.local/share/swi-prolog/pack/rocksdb/rocksdb'
% gmake: *** [Makefile:20: rocksdb/librocksdb.a] Error 2
ERROR: Process "process(/usr/bin/gmake,[])": exit status: 2
ERROR: In:
ERROR:   [25] throw(error(process_error(...,...),_17810))
ERROR:   [21] build_tools:build_step(build,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17854{bin_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'}) at /usr/lib/swi-prolog/library/build/tools.pl:110
ERROR:   [20] apply:foldl_([build,...|...],build_tools:build_step,_17854{env:[...|...],git:true,inquiry:true,pack:rocksdb,pack_version:1,src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb',url:'https://github.com/JanWielemaker/rocksdb.git'},_17966) at /usr/lib/swi-prolog/library/apply.pl:316
ERROR:   [14] prolog_pack:pack_post_install(rocksdb,'/home/groot/.local/share/swi-prolog/pack/rocksdb',[git(true),...|...]) at /usr/lib/swi-prolog/library/prolog_pack.pl:1102
ERROR:    [9] toplevel_call('<garbage_collected>') at /usr/lib/swi-prolog/boot/toplevel.pl:1162
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
   Exception: (21) build_tools:build_step(build, _14752{env:['PATH'='/usr/lib/swi-prolog/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'SWIPL'='/usr/lib/swi-prolog/bin/x86_64-linux/swipl', 'SWIPL_PACK_VERSION'=1, 'SWIPLVERSION'=80513, 'SWIHOME'='/usr/lib/swi-prolog', ... = ...|...], git:true, inquiry:true, pack:rocksdb, pack_version:1, src_dir:'/home/groot/.local/share/swi-prolog/pack/rocksdb', url:'https://github.com/JanWielemaker/rocksdb.git'}, _15194) ?

More details at on SWI-Prolog Discourse topic.

With the recent updates it now works as expected.

Example of SWI-Prolog RocksDB install and demo working can be found here.