Closed aledbf closed 7 years ago
It looks like it might be missing the pthreads library. Could you try replacing this file with
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
macro(_zipkin_ot_test TEST_NAME)
add_executable(${TEST_NAME} ${ARGN})
target_link_libraries(${TEST_NAME} Threads::Threads)
target_link_libraries(${TEST_NAME} ${CURL_LIBRARIES}
${OPENTRACING_LIB}
zipkin
zipkin_opentracing)
add_test(${TEST_NAME} ${TEST_NAME})
endmacro()
_zipkin_ot_test(ot_tracer_test ot_tracer_test.cc)
(I might need to add it for some other targets as well, but just want to see if that fixes it for the ot_tracer_test
target)
@rnburn here
-- 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
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.47.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
CMake Error at zipkin_opentracing/test/CMakeLists.txt:2 (add_executable):
add_executable cannot create target "ot_tracer_test" because another target
with the same name already exists. The existing target is an executable
created in source directory
"/tmp/build/zipkin-cpp-opentracing-bba123a37147a2da6ce861cfd7984ad53d794739/zipkin/test".
See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
zipkin_opentracing/test/CMakeLists.txt:10 (_zipkin_ot_test)
-- Configuring incomplete, errors occurred!
See also "/tmp/build/zipkin-cpp-opentracing-bba123a37147a2da6ce861cfd7984ad53d794739/.build/CMakeFiles/CMakeOutput.log".
See also "/tmp/build/zipkin-cpp-opentracing-bba123a37147a2da6ce861cfd7984ad53d794739/.build/CMakeFiles/CMakeError.log".
The command '/bin/sh -c /tmp/build.sh' returned a non-zero code: 1
Makefile:61: recipe for target '.container-amd64' failed
make[1]: *** [.container-amd64] Error 1
make[1]: Leaving directory '/home/aledbf/go/src/k8s.io/ingress/images/nginx-slim'
Makefile:49: recipe for target 'sub-container-amd64' failed
make: *** [sub-container-amd64] Error 2
I was able to reproduce it running on ubuntu. I put in a PR that should fix it. Could you check to see if it works for you? Thanks.
@rnburn it works now but when I try to compile nginx I get
/usr/bin/ld: //usr/local/lib/libzipkin_opentracing.a(opentracing.cc.o): relocation R_X86_64_32 against `_ZTIN6zipkin13OtSpanContextE' can not be used when making a shared object; recompile with -fPIC
//usr/local/lib/libzipkin_opentracing.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Could you try rebuilding the zipkin-opentracing-cpp library, but use
cmake -DBUILD_SHARED_LIBS=1 ..
that will have it make a shared library instead of a static one.
cmake -DBUILD_SHARED_LIBS=1 ..
Solves the issue. @rnburn thanks!
Any idea what could be the issue? Thanks