stdio icon indicating copy to clipboard operation
stdio copied to clipboard

cannot build tcp benchmarks

Open andrewthad opened this issue 7 years ago • 6 comments

I can build stdio, but when I cd into bench/tcp and run:

cabal new-build --constraint='primitive==0.6.4.0' -w /opt/ghc/8.6.3/bin/ghc

I get the following error:

Linking /home/amartin/Development/stdio/bench/tcp/dist-newstyle/build/x86_64-linux/ghc-8.6.3/tcp-0.1.0.0/x/libuv/build/libuv/libuv ...
/home/amartin/Development/stdio/bench/tcp/dist-newstyle/build/x86_64-linux/ghc-8.6.3/tcp-0.1.0.0/x/libuv/build/libuv/libuv-tmp/../../cbits/hs_uv_stream.o:hs_uv_stream.c:function hs_set_socket_reuse: error
: undefined reference to 'uv_translate_sys_error'
/home/amartin/Development/stdio/bench/tcp/dist-newstyle/build/x86_64-linux/ghc-8.6.3/tcp-0.1.0.0/x/libuv/build/libuv/libuv-tmp/../../cbits/hs_uv_stream.o:hs_uv_stream.c:function hs_uv_listen_resume: error: undefined reference to 'uv__io_start'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build exe:libuv from tcp-0.1.0.0.

I have installed libuv1 and libuv1-dev with apt.

andrewthad avatar Dec 21 '18 19:12 andrewthad

Can you tell me what's the version of your libuv1 and libuv1-dev installation?

winterland1989 avatar Dec 23 '18 07:12 winterland1989

I think it's 1.0.0:

/usr/lib/x86_64-linux-gnu/libuv.so.1.0.0

andrewthad avatar Dec 23 '18 13:12 andrewthad

I think it's a bit of too old, uv_translate_sys_error is declared public in version 1.10.0. Can you try a newer version of libuv and try again? BTW. Which OS are you using?

winterland1989 avatar Dec 24 '18 02:12 winterland1989

Ubuntu 18.04. I guess the libuv in its repo is just outdated.

andrewthad avatar Dec 24 '18 12:12 andrewthad

Strange, I'm running Ubuntu 18.04 too and the repo version is 1.18.0 which is OK. Let me check again.

winterland1989 avatar Dec 25 '18 09:12 winterland1989

@andrewthad I have changed the benchmark's cabal file to use stdio as a dependency, you should first install stdio into global or benchmark's sandbox. I have no problem running tcp benchmark in my Ubuntu 18.04 machine, please give me feedbacks if you're still not be able to get it running.

winterland1989 avatar Feb 10 '19 15:02 winterland1989