devsisters / goquic

QUIC support for Go
http://devsisters.github.io/goquic/
BSD 3-Clause "New" or "Revised" License
944 stars 100 forks source link

Build error #6

Closed alexandrestein closed 8 years ago

alexandrestein commented 9 years ago

Hello,

I tried your package but I block at the "go get github.com/devsisters/goquic" call.

It respond to me:

$ go get github.com/devsisters/goquic
# github.com/devsisters/goquic
progSolo/proto/src/github.com/devsisters/goquic/init.go:6:28: fatal error: openssl/thread.h: No such file or directory
 #include <openssl/thread.h>
                            ^
compilation terminated.

How can I solve this?

I'm on:

hodduc commented 9 years ago

GoQuic currently depends on boringssl (or openssl) header. (There was problem with openssl, so i fixed at 77afd711)

By the way, go get will try to build something after downloading all files. So when you run go get, you need to set proper LDFLAGS (CGO_LDFLAGS) env variable or you will see another error.

My suggestion is

  1. Install libssl-dev or clone boringssl or libquic (which contains boringssl)
  2. Try go get with -d option, which instructs to just download it and not to build and install anything.
  3. run go build with CGO_CFLAGS and CGO_LDFLAGS, as mentioned here. If you installed openssl headers on the system path (i.e. /usr/local/include or somewhere ...) CGO_CFLAGS is not needed. Otherwise, CGO_CFLAGS should provide path to openssl/boringssl include headers.
alexandrestein commented 9 years ago

Hello, thank you. I made it.

But it looks like the lib is not compatible with Chrome 44 or Chromium 43. It switch from HTTP1.1 to HTTP2 but not to QUIC/1+SPDY.

Is it normal?

l2dy commented 8 years ago

Have a look at chrome://net-internals/#quic. Some versions of Chrome disable QUIC by default.

gripedthumbtacks commented 8 years ago

@alexandreStein fyi here is a test URL at Google that has QUIC+SPDY enabled on it. Should be a good test. If this helps, feel free to close this issue. Cheers...

https://developer.chrome.com/multidevice

liudanking commented 8 years ago

Meet the same problem.

Hello, thank you.
I made it.

But it looks like the lib is not compatible with Chrome 44 or Chromium 43.
It switch from HTTP1.1 to HTTP2 but not to QUIC/1+SPDY.

Is it normal?
ngoduykhanh commented 8 years ago

Hi @hodduc ,

I am trying to build goquic with your instruction but I got the error, can you help to solve this?

root@ubuntu-1604:/opt/go/src/github.com/devsisters/goquic# CGO_CFLAGS="-I$GOPATH/src/github.com/devsisters/goquic/libquic/boringssl/include" CGO_LDFLAGS="-L$GOPATH/src/github.com/devsisters/goquic/lib/linux_amd64" go build $GOPATH/src/github.com/devsisters/goquic/example/
server.go
# github.com/devsisters/goquic
/usr/bin/ld: cannot find -lgoquic
/usr/bin/ld: cannot find -lquic
collect2: error: ld returned 1 exit status
serialx commented 8 years ago

You should invoke ./build_libs.sh first.

ngoduykhanh commented 8 years ago

Thanks @serialx for the reply,

I tried to run ./build_libs.sh but I got issue as well. My output

root@ubuntu-1604:/opt/go/src/github.com/devsisters/goquic# ./build_libs.sh
GOARCH: amd64
GOOS: linux
OPTION:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler using: Ninja
CMake Error:
  The detected version of Ninja (log: ninja version 0.1.3 initializing

  log: magic group: gid=0 (root)

  log: entering main loop

  log: generating initial pid array..

  log: now monitoring process activity) is less than the version of Ninja
  required by CMake (1.3).

CMake Error: Internal CMake error, TryCompile generation of cmake failed
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
See also "/opt/go/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/CMakeOutput.log".
See also "/opt/go/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/CMakeError.log".

CMakeOutput.log:

The system is: Linux - 4.4.0-28-generic - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:

The output was:
0

CMakeError.log:

Determining if the C compiler works failed with the following output:

The log doesn't show much information that I can debug and fix the issue.

Do we have any requirement about ninja version?

serialx commented 8 years ago

I think there's some kind of race condition causing error log to be seperated. If you look carefully You can see this line:

  The detected version of Ninja (log: ninja version 0.1.3 initializing

  log: magic group: gid=0 (root)

  log: entering main loop

  log: generating initial pid array..

  log: now monitoring process activity) is less than the version of Ninja
  required by CMake (1.3).

I guess the error you are looking for is this: The detected version of Ninja (log: ninja version 0.1.3) is less than the version of Ninja required by CMake (1.3). Hope this helps.

ngoduykhanh commented 8 years ago

I switched to build on Mac which has proper Ninja version successfully. Thanks @serialx

shockcao commented 7 years ago

`ubuntu@VM-103-7-ubuntu:~/gopath/src/github.com/devsisters/goquic$ sudo ./build_libs.sh GOARCH: amd64 GOOS: linux OPTION: -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc CMake Error: The detected version of Ninja () is less than the version of Ninja required by CMake (1.3).

CMake Error: Internal CMake error, TryCompile generation of cmake failed -- Check for working C compiler: /usr/bin/cc -- broken CMake Error at /home/ubuntu/cmake/cmake-3.7.2-Linux-x86_64/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message): The C compiler "/usr/bin/cc" is not able to compile a simple test program.

It fails with the following output:

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred! See also "/home/ubuntu/gopath/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/CMakeOutput.log". See also "/home/ubuntu/gopath/src/github.com/devsisters/goquic/libquic/build/debug/CMakeFiles/CMakeError.log".`

I also got this error on my ubuntu linux but I've updated ninja to the latest version 1.7.2, but it seems that the ninja cannot be recgonized by cmake

ubuntu@VM-103-7-ubuntu:~$ ninja --version 1.7.2

`ubuntu@VM-103-7-ubuntu:~$ cmake --version cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).`

shockcao commented 7 years ago

i've resolved this problem by delete libquic dir and git submodule update the libquic

nickdesaulniers commented 6 years ago

fwiw, I saw the same error as @ngoduykhanh and the issue was that I had installed sudo apt install ninja and not sudo apt install ninja-build which is some other unrelated tool that cmake is happy to invoke.