lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.94k stars 548 forks source link

Compilation fails on CentOS 7 #251

Closed vstath closed 5 years ago

vstath commented 6 years ago

Hi, trying to compile in CentOS 7 I get failure.

I installed zlib-devel but not sqlite. I later installed lua-devel. Compilation error details below

[root@server-a build]# cmake .. -DCMAKE_BUILD_TYPE=Release
-- Running CMake for lwan (Scalable, high performance, experimental web server)
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7") 
-- Looking for include file pthread.h
-- Looking for include file 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  
-- checking for modules 'luajit>=2.0;luajit<=2.0.999'
--   package 'luajit>=2.0' not found
--   package 'luajit<=2.0.999' not found
-- checking for modules 'lua>=5.1.0;lua<=5.1.999'
--   package 'lua>=5.1.0' not found
--   package 'lua<=5.1.999' not found
-- checking for modules 'lua51>=5.1.0;lua51<=5.1.999'
--   package 'lua51>=5.1.0' not found
--   package 'lua51<=5.1.999' not found
-- checking for modules 'lua5.1>=5.1.0;lua5.1<=5.1.999'
--   package 'lua5.1>=5.1.0' not found
--   package 'lua5.1<=5.1.999' not found
-- checking for modules 'lua-5.1>=5.1.0;lua-5.1<=5.1.999'
--   package 'lua-5.1>=5.1.0' not found
--   package 'lua-5.1<=5.1.999' not found
-- Disabling Lua support
-- Looking for linux/capability.h
-- Looking for linux/capability.h - found
-- Looking for sys/auxv.h
-- Looking for sys/auxv.h - found
-- Looking for sys/epoll.h
-- Looking for sys/epoll.h - found
-- Looking for 3 include files sys/time.h, ..., sys/event.h
-- Looking for 3 include files sys/time.h, ..., sys/event.h - not found
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for getauxval
-- Looking for getauxval - found
-- Looking for rawmemchr
-- Looking for rawmemchr - found
-- Looking for get_current_dir_name
-- Looking for get_current_dir_name - found
-- Looking for reallocarray
-- Looking for reallocarray - not found
-- Looking for mempcpy
-- Looking for mempcpy - found
-- Looking for memrchr
-- Looking for memrchr - found
-- Looking for pipe2
-- Looking for pipe2 - found
-- Looking for accept4
-- Looking for accept4 - found
-- Looking for readahead
-- Looking for readahead - found
-- Looking for mkostemp
-- Looking for mkostemp - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for pthread_barrier_init
-- Looking for pthread_barrier_init - found
-- Looking for pthread_set_name_np
-- Looking for pthread_set_name_np - not found
-- Looking for eventfd
-- Looking for eventfd - found
-- Looking for posix_fadvise
-- Looking for posix_fadvise - found
-- Looking for getentropy
-- Looking for getentropy - not found
-- Looking for dladdr
-- Looking for dladdr - not found
-- Performing Test HAVE_STD_GNU99
-- Performing Test HAVE_STD_GNU99 - Success
-- 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_FPCLASSIFY
-- Performing Test HAVE_BUILTIN_FPCLASSIFY - Success
-- Performing Test HAVE_BUILTIN_MUL_OVERFLOW
-- Performing Test HAVE_BUILTIN_MUL_OVERFLOW - Failed
-- Performing Test HAVE_BUILTIN_ADD_OVERFLOW
-- Performing Test HAVE_BUILTIN_ADD_OVERFLOW - Failed
-- Performing Test HAVE_STATIC_ASSERT
-- Performing Test HAVE_STATIC_ASSERT - Success
-- Valgrind headers not found -- disabling valgrind support
-- Performing Test HAVE_MTUNE_NATIVE
-- Performing Test HAVE_MTUNE_NATIVE - Success
-- Performing Test HAVE_MARCH_NATIVE
-- Performing Test HAVE_MARCH_NATIVE - Success
-- Performing Test HAVE_STACK_PROTECTOR_EXPLICIT
-- Performing Test HAVE_STACK_PROTECTOR_EXPLICIT - Failed
-- Performing Test HAVE_IMMEDIATE_BINDING
-- Performing Test HAVE_IMMEDIATE_BINDING - Success
-- Performing Test HAVE_READ_ONLY_GOT
-- Performing Test HAVE_READ_ONLY_GOT - Success
-- Performing Test HAVE_NO_PLT
-- Performing Test HAVE_NO_PLT - Failed
-- Performing Test HAVE_ALIGN_DATA
-- Performing Test HAVE_ALIGN_DATA - Failed
-- Performing Test HAVE_NO_ASYNC_UNWIND_TABLES
-- Performing Test HAVE_NO_ASYNC_UNWIND_TABLES - Success
-- Performing Test HAVE_LTO_JOBSERVER
-- Performing Test HAVE_LTO_JOBSERVER - Success
-- Performing Test HAVE_LTO_FAT_OBJS
-- Performing Test HAVE_LTO_FAT_OBJS - Success
-- Performing Test HAVE_BUILTIN_IA32_CRC32
-- Performing Test HAVE_BUILTIN_IA32_CRC32 - Success
-- Performing Test supports -Wduplicated-cond
-- Performing Test supports -Wduplicated-cond - Failed
-- Performing Test supports -Wduplicated-branches
-- Performing Test supports -Wduplicated-branches - Failed
-- Performing Test supports -Wlogical-op
-- Performing Test supports -Wlogical-op - Success
-- Performing Test supports -Wrestrict
-- Performing Test supports -Wrestrict - Failed
-- Performing Test supports -Wdouble-promotion
-- Performing Test supports -Wdouble-promotion - Success
-- Performing Test supports -Wno-unused-parameter
-- Performing Test supports -Wno-unused-parameter - Success
-- Performing Test supports -Wstringop-truncation
-- Performing Test supports -Wstringop-truncation - Failed
-- Performing Test supports -Wvla
-- Performing Test supports -Wvla - Success
-- Could NOT find PythonInterp: Found unsuitable version "2.7.5", but required is at least "3" (found /usr/bin/python)
-- Using zlib (/usr/lib64/libz.so) for mimegen
-- checking for module 'sqlite3>=3.6.20'
--   package 'sqlite3>=3.6.20' not found
-- Freegeoip sample application not being built: SQLite not found
-- checking for module 'sqlite3>=3.6.20'
--   package 'sqlite3>=3.6.20' not found
-- Not building benchmark suite: database libraries not found.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/lwan/lwan/build
[root@server-a build]# make
Scanning dependencies of target bin2hex
[  1%] Building C object src/bin/tools/CMakeFiles/bin2hex.dir/bin2hex.c.o
Linking C executable bin2hex
[  1%] Built target bin2hex
Scanning dependencies of target generate_auto_index_icons
[  3%] Bundling auto-index icons
[  3%] Built target generate_auto_index_icons
Scanning dependencies of target mimegen
[  5%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/mimegen.c.o
[  7%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/hash.c.o
/root/lwan/lwan/src/lib/hash.c: In function ‘hash_add_entry_hashed’:
/root/lwan/lwan/src/lib/hash.c:278:9: warning: implicit declaration of function ‘__builtin_add_overflow’ [-Wimplicit-function-declaration]
         if (__builtin_add_overflow(bucket->total, STEPS, &new_total)) {
         ^
[  9%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/murmur3.c.o
[ 11%] Building C object src/bin/tools/CMakeFiles/mimegen.dir/__/__/lib/missing.c.o
Linking C executable mimegen
/tmp/ccVoaIyW.ltrans0.ltrans.o: In function `hash_add_entry_hashed.2547.2535':
<artificial>:(.text+0x1ed): undefined reference to `__builtin_add_overflow'
collect2: error: ld returned 1 exit status
make[2]: *** [src/bin/tools/mimegen] Error 1
make[1]: *** [src/bin/tools/CMakeFiles/mimegen.dir/all] Error 2
make: *** [all] Error 2
MarlonMrN commented 6 years ago

GCC version should be at least 7.

Which version is yours? (if not 7+, update it and try again)

lpereira commented 6 years ago

This can be fixed without a lot of work; I just need to find some time to do it. (I accept PRs, too! Ideally, this would be in some header in src/lib/missing.)