ZHaskell / stdio

Haskell Standard Input and Output
104 stars 5 forks source link

cannot build tcp benchmarks #11

Open andrewthad opened 5 years ago

andrewthad commented 5 years ago

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.

winterland1989 commented 5 years ago

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

andrewthad commented 5 years ago

I think it's 1.0.0:

/usr/lib/x86_64-linux-gnu/libuv.so.1.0.0
winterland1989 commented 5 years ago

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?

andrewthad commented 5 years ago

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

winterland1989 commented 5 years ago

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

winterland1989 commented 5 years ago

@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.