kevinkreiser/prime_server

Test failure on Ubuntu 18.04 running on WSL

rkroelin opened this issue · 4 comments

An interest in routing has brought me back to linux after a very long break so i'm somewhat blindly following this to get Valhalla running.
https://gis-ops.com/valhalla-how-to-build-and-install-on-ubuntu-18-04/

When I make test by running
make -j$(nproc) -k test

I get the following two failures.

Any suggestions would be appreciated.

==========================================
prime_server 0.6.4: ./test-suite.log

TOTAL: 5

PASS: 3

SKIP: 0

XFAIL: 0

FAIL: 2

XPASS: 0

ERROR: 0

.. contents:: :depth: 2

FAIL: test/netstring

=== Testing netstring ===
test_streaming_client [PASS]
test_streaming_server [PASS]
test_entity [PASS]
test_parallel_clients [PASS]
test_malformed [PASS]
test_too_large [PASS]
test_large_requestFAIL test/netstring (exit status: 142)

FAIL: test/http

=== Testing http ===
test_streaming_client [PASS]
test_streaming_server [PASS]
test_request [PASS]
test_request_parsing [PASS]
test_query_parsing [PASS]
test_response [PASS]
test_response_parsing [PASS]
test_chunked_encoding [PASS]
test_parallel_clients [PASS]
test_malformed [PASS]
test_too_large [PASS]
test_large_requestFAIL test/http (exit status: 142)

Interesting! I must admit though I have heard of WSL I have never tried it. What you can do is make a debug build and then run the test with gdb. The problem here is that the test keeps running because it doesnt get what its expecting with the normal amount of time (it fails with 142 which is sigalarm). so debugging this will take some decent effort. the whole WSL thing is non trivial for me at the moment but maybe i could take a look on a free weekend. another thing you can do for the time being is just ignore the test failures and see if it works 😄

Thanks for the help! I'll give the debugging a whirl when I have some time. I tried just following up with
sudo make install
It doesn't generate any errors (I think), but when I try

time prime_serverd 1000000 1

It returns

prime_serverd: error while loading shared libraries: libprime_server.so.0: cannot open shared object file: No such file or directory

Here's the text from the make command:

make[1]: Entering directory '/home/rxkroeli/building_valhalla/prime_server'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c libprime_server.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libprime_server.so.0.0.0 /usr/local/lib/libprime_server.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libprime_server.so.0.0.0 libprime_server.so.0 || { rm -f libprime_server.so.0 && ln -s libprime_server.so.0.0.0 libprime_server.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libprime_server.so.0.0.0 libprime_server.so || { rm -f libprime_server.so && ln -s libprime_server.so.0.0.0 libprime_server.so; }; })
libtool: install: /usr/bin/install -c .libs/libprime_server.lai /usr/local/lib/libprime_server.la
libtool: install: /usr/bin/install -c .libs/libprime_server.a /usr/local/lib/libprime_server.a
libtool: install: chmod 644 /usr/local/lib/libprime_server.a
libtool: install: ranlib /usr/local/lib/libprime_server.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib

Libraries have been installed in:
/usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:

  • add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
    during execution
  • add LIBDIR to the 'LD_RUN_PATH' environment variable
    during linking
  • use the '-Wl,-rpath -Wl,LIBDIR' linker flag
  • have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.

/bin/mkdir -p '/usr/local/bin'
/bin/bash ./libtool --mode=install /usr/bin/install -c prime_serverd prime_httpd prime_proxyd prime_workerd prime_echod prime_filed '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/prime_serverd /usr/local/bin/prime_serverd
libtool: install: /usr/bin/install -c .libs/prime_httpd /usr/local/bin/prime_httpd
libtool: install: /usr/bin/install -c .libs/prime_proxyd /usr/local/bin/prime_proxyd
libtool: install: /usr/bin/install -c .libs/prime_workerd /usr/local/bin/prime_workerd
libtool: install: /usr/bin/install -c .libs/prime_echod /usr/local/bin/prime_echod
libtool: install: /usr/bin/install -c .libs/prime_filed /usr/local/bin/prime_filed
/bin/mkdir -p '/usr/local/include'
/bin/mkdir -p '/usr/local/include/prime_server'
/usr/bin/install -c -m 644 prime_server/prime_server.hpp prime_server/zmq_helpers.hpp prime_server/netstring_protocol.hpp prime_server/http_protocol.hpp prime_server/http_util.hpp prime_server/logging.hpp '/usr/local/include/prime_server'
/bin/mkdir -p '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 libprime_server.pc '/usr/local/lib/pkgconfig'
make[1]: Leaving directory '/home/rxkroeli/building_valhalla/prime_server'

@rkroelin it seems your LD_LIBRARY_PATH is not set. you need to point that at /usr/local/lib among other things to make sure the excecutable can see the libraries it needs to dynamically link when it runs

Oops sorry - thought i had responded to this. I did finally get it running on that WSL thing but ended up switching to an ubuntu instance on amazon AWS. It works like a charm there and i'm thoroughly enjoying tinkering with various costing methodologies.