Closed hnkien closed 8 years ago
You should compile your code with '-DHAS_PTHREADBARRIER'.
This shouldn't happen. What platform and compiler version are you using, @hnkien? Could you please paste the whole output from CMake the first time it's executed (or delete the CMakeCache.txt file and run it again)?
Our OS is Fedora 23
Linux 4.5.7-200.fc23.x86_64+debug #1 SMP Wed Jun 8 17:22:36 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Here are the log of cmake
-- The C compiler identification is GNU 5.3.1
-- 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
-- Running CMake for lwan (Scalable, high performance, experimental web server)
-- No build type selected, defaulting to Debug
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HAVE_BUILTIN_CPU_INIT
-- Performing Test HAVE_BUILTIN_CPU_INIT - Success
-- Performing Test HAVE_BUILTIN_CLZLL
-- Performing Test HAVE_BUILTIN_CLZLL - Success
-- Performing Test HAVE_BUILTIN_MUL_OVERFLOW
-- Performing Test HAVE_BUILTIN_MUL_OVERFLOW - Success
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Looking for pthread_barrier_init
-- Looking for pthread_barrier_init - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- jemalloc found: /usr/lib64/libjemalloc.so
-- Performing Test HAS_MTUNE_NATIVE
-- Performing Test HAS_MTUNE_NATIVE - Success
-- Performing Test HAS_RDYNAMIC
-- Performing Test HAS_RDYNAMIC - Success
-- Performing Test HAS_IMMEDIATE_BINDING
-- Performing Test HAS_IMMEDIATE_BINDING - Success
-- Performing Test HAS_READ_ONLY_GOT
-- Performing Test HAS_READ_ONLY_GOT - Success
-- Performing Test HAVE_FLAG_SANITIZE_UNDEFINED
-- Performing Test HAVE_FLAG_SANITIZE_UNDEFINED - Success
-- Performing Test HAVE_FLAG_CATCH_UNDEFINED_BEHAVIOR
-- Performing Test HAVE_FLAG_CATCH_UNDEFINED_BEHAVIOR - Failed
-- Build with newer undefined behavior sanitizer
-- Building with Valgrind support
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - found
-- Looking for rawmemchr
-- Looking for rawmemchr - found
-- Looking for mempcpy
-- Looking for mempcpy - found
-- Looking for memrchr
-- Looking for memrchr - found
-- Looking for pthread_timedjoin_np
-- Looking for pthread_timedjoin_np - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for accept4
-- Looking for accept4 - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- Checking for modules 'luajit>=2.0;luajit<=2.0.999'
-- Found luajit, version 2.0.4
-- Found luajit, version 2.0.4
-- Building with Lua support using luajit-5.1
-- Checking for module 'sqlite3>=3.6.20'
-- Found sqlite3, version 3.11.0
-- Found MySQL includes at /home/apps/mysql-5.6.24/include
-- Found MySQL client library at /home/apps/mysql-5.6.24/lib/libmysqlclient.so
-- Configuring done
-- Generating done
Here are the make:
Scanning dependencies of target mimegen [ 1%] Creating directories for 'mimegen' [ 3%] No download step for 'mimegen' [ 5%] No patch step for 'mimegen' [ 7%] No update step for 'mimegen' [ 9%] Performing configure step for 'mimegen' -- The C compiler identification is GNU 5.3.1 -- The CXX compiler identification is GNU 5.3.1 -- 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 ZLIB: /usr/lib64/libz.so (found version "1.2.8") -- Using zlib (/usr/lib64/libz.so) for mimegen -- Configuring done -- Generating done -- Build files have been written to: /home/setup/webserver/lwan/build/common/tools/src/mimegen-build [ 11%] Performing build step for 'mimegen' Scanning dependencies of target mimegen [ 20%] Building C object CMakeFiles/mimegen.dir/mimegen.c.o [ 40%] Building C object CMakeFiles/mimegen.dir/home/setup/webserver/lwan/common/hash.c.o [ 60%] Building C object CMakeFiles/mimegen.dir/home/setup/webserver/lwan/common/murmur3.c.o [ 80%] Building C object CMakeFiles/mimegen.dir/home/setup/webserver/lwan/common/reallocarray.c.o [100%] Linking C executable mimegen [100%] Built target mimegen [ 12%] Performing install step for 'mimegen' [ 14%] Completed 'mimegen' [ 14%] Built target mimegen Scanning dependencies of target generate_mime_types_table [ 16%] Generating ../mime-types.h Uncompressed: 27945 bytes; compressed: 7380 bytes (compressed 3.786585x) [ 16%] Built target generate_mime_types_table Scanning dependencies of target lwan-static [ 18%] Building C object common/CMakeFiles/lwan-static.dir/base64.c.o [ 20%] Building C object common/CMakeFiles/lwan-static.dir/hash.c.o [ 22%] Building C object common/CMakeFiles/lwan-static.dir/int-to-str.c.o [ 24%] Building C object common/CMakeFiles/lwan-static.dir/list.c.o [ 25%] Building C object common/CMakeFiles/lwan-static.dir/lwan.c.o [ 27%] Building C object common/CMakeFiles/lwan-static.dir/lwan-cache.c.o [ 29%] Building C object common/CMakeFiles/lwan-static.dir/lwan-config.c.o [ 31%] Building C object common/CMakeFiles/lwan-static.dir/lwan-coro.c.o [ 33%] Building C object common/CMakeFiles/lwan-static.dir/lwan-http-authorize.c.o [ 35%] Building C object common/CMakeFiles/lwan-static.dir/lwan-io-wrappers.c.o [ 37%] Building C object common/CMakeFiles/lwan-static.dir/lwan-job.c.o [ 38%] Building C object common/CMakeFiles/lwan-static.dir/lwan-redirect.c.o [ 40%] Building C object common/CMakeFiles/lwan-static.dir/lwan-request.c.o [ 42%] Building C object common/CMakeFiles/lwan-static.dir/lwan-response.c.o [ 44%] Building C object common/CMakeFiles/lwan-static.dir/lwan-rewrite.c.o [ 46%] Building C object common/CMakeFiles/lwan-static.dir/lwan-serve-files.c.o [ 48%] Building C object common/CMakeFiles/lwan-static.dir/lwan-socket.c.o [ 50%] Building C object common/CMakeFiles/lwan-static.dir/lwan-status.c.o [ 51%] Building C object common/CMakeFiles/lwan-static.dir/lwan-straitjacket.c.o [ 53%] Building C object common/CMakeFiles/lwan-static.dir/lwan-tables.c.o [ 55%] Building C object common/CMakeFiles/lwan-static.dir/lwan-template.c.o [ 57%] Building C object common/CMakeFiles/lwan-static.dir/lwan-thread.c.o [ 59%] Building C object common/CMakeFiles/lwan-static.dir/lwan-trie.c.o [ 61%] Building C object common/CMakeFiles/lwan-static.dir/missing.c.o [ 62%] Building C object common/CMakeFiles/lwan-static.dir/murmur3.c.o [ 64%] Building C object common/CMakeFiles/lwan-static.dir/patterns.c.o [ 66%] Building C object common/CMakeFiles/lwan-static.dir/reallocarray.c.o [ 68%] Building C object common/CMakeFiles/lwan-static.dir/realpathat.c.o [ 70%] Building C object common/CMakeFiles/lwan-static.dir/sd-daemon.c.o [ 72%] Building C object common/CMakeFiles/lwan-static.dir/strbuf.c.o [ 74%] Building C object common/CMakeFiles/lwan-static.dir/lwan-lua.c.o [ 75%] Linking C static library liblwan.a [ 75%] Built target lwan-static Scanning dependencies of target lwan-shared [ 77%] Building C object common/CMakeFiles/lwan-shared.dir/__/empty.c.o [ 79%] Linking C shared library liblwan.so [ 79%] Built target lwan-shared Scanning dependencies of target lwan [ 81%] Building C object lwan/CMakeFiles/lwan.dir/main.c.o [ 83%] Linking C executable lwan [ 83%] Built target lwan Scanning dependencies of target testrunner [ 85%] Building C object testrunner/CMakeFiles/testrunner.dir/main.c.o [ 87%] Linking C executable testrunner [ 87%] Built target testrunner Scanning dependencies of target freegeoip [ 88%] Building C object freegeoip/CMakeFiles/freegeoip.dir/freegeoip.c.o [ 90%] Linking C executable freegeoip [ 90%] Built target freegeoip Scanning dependencies of target techempower [ 92%] Building C object techempower/CMakeFiles/techempower.dir/techempower.c.o [ 94%] Building C object techempower/CMakeFiles/techempower.dir/json.c.o [ 96%] Building C object techempower/CMakeFiles/techempower.dir/array.c.o [ 98%] Building C object techempower/CMakeFiles/techempower.dir/database.c.o [100%] Linking C executable techempower
Here are make install:
[ 14%] Built target mimegen [ 16%] Built target generate_mime_types_table [ 75%] Built target lwan-static [ 79%] Built target lwan-shared [ 83%] Built target lwan [ 87%] Built target testrunner [ 90%] Built target freegeoip [100%] Built target techempower Install the project... -- Install configuration: "Debug" -- Installing: /usr/local/lib/pkgconfig/lwan.pc -- Installing: /usr/local/lib/liblwan.a -- Installing: /usr/local/lib/liblwan.so -- Up-to-date: /usr/local/include/lwan/lwan.h -- Up-to-date: /usr/local/include/lwan/lwan-coro.h -- Up-to-date: /usr/local/include/lwan/lwan-trie.h -- Up-to-date: /usr/local/include/lwan/lwan-status.h -- Up-to-date: /usr/local/include/lwan/strbuf.h -- Up-to-date: /usr/local/include/lwan/hash.h -- Up-to-date: /usr/local/include/lwan/lwan-template.h -- Up-to-date: /usr/local/include/lwan/lwan-serve-files.h -- Up-to-date: /usr/local/include/lwan/lwan-config.h -- Installing: /usr/local/include/lwan/missing.h -- Installing: /usr/local/bin/lwan
Ah, I see the problem now. Follow @LampmanYao's advice for the moment. The missing.h
header should be considered private and no .h
files should include it.
@hnkien It should be fixed now; it would be great if you could test this and report back. Feel free to reopen the issue.
Hello, I got the issue when using with shared library of lwan: /usr/local/include/lwan/missing.h:50:13: error: conflicting types for ‘pthread_barrierattr_t’ typedef int pthread_barrierattr_t; ^ In file included from /usr/include/pthread.h:26:0, from /usr/local/include/lwan/lwan.h:26, from hello.c:2: /usr/include/bits/pthreadtypes.h:249:3: note: previous declaration of ‘pthread_barrierattr_t’ was here } pthread_barrierattr_t;