shadowsocks-libev icon indicating copy to clipboard operation
shadowsocks-libev copied to clipboard

不能编译ss-libev

Open Sherlock-Holo opened this issue 9 years ago • 70 comments

Please answer these questions before submitting your issue. Thanks!

What version of shadowsocks-libev are you using?

2017.1.18 17:00的版本

What operating system are you using?

centos 7.2 with 4.10.0 rc2

What did you do?

./autogen.sh

What did you expect to see?

What did you see instead?

libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'auto'.
libtoolize: copying file 'auto/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:10: installing 'auto/compile'
configure.ac:12: installing 'auto/missing'
configure.ac:309: error: required file 'libcork/Makefile.in' not found
configure.ac:309: error: required file 'libipset/Makefile.in' not found
src/Makefile.am: installing 'auto/depcomp'
autoreconf: automake failed with exit status: 1

What is your config in detail (with all sensitive info masked)?

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

并且如果继续运行

./configure

会提示

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for pcre-config... pcre-config
checking for pcre headers in ... not found
checking for library containing pcre_exec... -lpcre
checking pcre.h usability... yes
checking pcre.h presence... yes
checking for pcre.h... yes
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
checking for asciidoc... /usr/bin/asciidoc
checking for xmlto... /usr/bin/xmlto
checking for gzip... /usr/bin/gzip
checking for mv... /usr/bin/mv
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for thread local storage (TLS) class... __thread
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for compress2 in -lz... yes
checking for dlopen... (cached) no
checking for dlopen in -ldl... (cached) yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking openssl/rsa.h usability... yes
checking openssl/rsa.h presence... yes
checking for openssl/rsa.h... yes
checking openssl/rand.h usability... yes
checking openssl/rand.h presence... yes
checking for openssl/rand.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking openssl/sha.h usability... yes
checking openssl/sha.h presence... yes
checking for openssl/sha.h... yes
checking openssl/pem.h usability... yes
checking openssl/pem.h presence... yes
checking for openssl/pem.h... yes
checking openssl/engine.h usability... yes
checking openssl/engine.h presence... yes
checking for openssl/engine.h... yes
checking for EVP_EncryptInit_ex in -lcrypto... yes
checking for RAND_pseudo_bytes... yes
checking for EVP_EncryptInit_ex... yes
checking whether OpenSSL_add_all_algorithms is declared... yes
checking for C/C++ restrict keyword... __restrict
checking for netdb.h... yes
checking for library containing inet_ntop... none required
checking whether inet_ntop is declared... yes
checking for what kind of host... Linux
checking if compiler needs -Werror to reject unknown flags... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking if -fstack-protector and -fstack-protector-all are supported.... yes
configure: -fstack-protector enabled in CFLAGS
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for netdb.h... (cached) yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for net/if.h... yes
checking for linux/if.h... yes
checking for linux/netfilter_ipv4.h... yes
checking for linux/netfilter_ipv6/ip6_tables.h... yes
checking whether byte ordering is bigendian... no
checking for inline... inline
checking for ssize_t... yes
checking whether to enable assertions... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... (cached) yes
checking for uint16_t... yes
checking for uint8_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking return type of signal handlers... void
checking for memset... yes
checking for select... yes
checking for setresuid... yes
checking for setreuid... yes
checking for strerror... yes
checking for getpwnam_r... yes
checking for setrlimit... yes
checking for connect in -lsocket... no
checking for malloc... yes
checking for memset... (cached) yes
checking for socket... yes
checking for sodium_init in -lsodium... no
configure: error: Couldn't find libsodium. Try installing libsodium-dev[el].

但是libsodium-devel已经安装了,看到这个也就不敢make下去了

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

已测试,Arch Linux同样会出现这个问题

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

Try ls /usr/local/lib/libsodium.* and ls /usr/lib/libsodimu.* and post your output here.

madeye avatar Jan 18 '17 09:01 madeye

+1 debian8.0同样的问题。

baggiogogo avatar Jan 18 '17 09:01 baggiogogo

Arch

ls /usr/local/lib/libsodium.*

[root@HostUS ~]# ls /usr/local/lib/
./  ../  libshadowsocks-libev.a  libshadowsocks-libev.la*  pkgconfig/
[root@HostUS ~]# ls /usr/local/lib/libsodium.*
ls: cannot access '/usr/local/lib/libsodium.*': No such file or directory

ls /usr/lib/libsodimu.*

[root@HostUS ~]# ls /usr/lib/libsodimu.*
ls: cannot access '/usr/lib/libsodimu.*': No such file or directory

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

Fedora

ls /usr/local/lib/libsodium.*

[root@vultr-Fedora ~]# ls /usr/local/lib/libsodium.*
ls: cannot access '/usr/local/lib/libsodium.*': No such file or directory

ls /usr/lib/libsodimu.*

[root@vultr-Fedora ~]# ls /usr/lib/libsodimu.*
ls: cannot access '/usr/lib/libsodimu.*': No such file or directory

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

~# ls /usr/local/lib/libsodium.* ls: cannot access /usr/local/lib/libsodium.*: No such file or directory

~# ls /usr/lib/libsodimu.* ls: cannot access /usr/lib/libsodimu.*: No such file or directory

baggiogogo avatar Jan 18 '17 09:01 baggiogogo

感觉会不会跟Remove embedded libraries这一次commit有关

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

According to your output, there is no libsodium installed on your system.

madeye avatar Jan 18 '17 09:01 madeye

同样的问题,而且系统libsodium已经安装了

cuminlo avatar Jan 18 '17 09:01 cuminlo

是没有安装,但现在Fedora和Arch都安装了libsodium,但是autogen.sh和configure出现同样报错,而且

ls /usr/local/lib/libsodium.* ls /usr/lib/libsodimu.*

两者同样是no such file or directory

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

经排查在我这确实libsodium-dev没有安装,装好之后 ./autogen.sh继续报错 configure.ac:309: error: required file 'libcork/Makefile.in' not found configure.ac:309: error: required file 'libipset/Makefile.in' not found

./configure继续报错 configure: error: Couldn't find libudns. Try installing libudns-dev or udns-deve

baggiogogo avatar Jan 18 '17 09:01 baggiogogo

在Arch上只有libsodium,并没有dev后缀的,而Fedora上是devel后缀,而有无后缀两种都安装了

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

udns-devel libev-devel这两者需要手动安装,最后会报

config.status: error: cannot find input file: `Makefile.in' 

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

Clone a clean repo and try again.

madeye avatar Jan 18 '17 09:01 madeye

@Sherlock-Holo

git submodule init && git submodule update

Windendless avatar Jan 18 '17 09:01 Windendless

The best way to verify the building process is check here: https://travis-ci.org/shadowsocks/shadowsocks-libev

madeye avatar Jan 18 '17 09:01 madeye

已经尝试了删除了整个目录重新clone下来,但是还是这个问题

Sherlock-Holo avatar Jan 18 '17 09:01 Sherlock-Holo

Try git submodule init && git submodule update

madeye avatar Jan 18 '17 09:01 madeye

手动安装了所需,删除了整个目录,运行了git submodule init && git submodule update 前面都通过了,make报错,上面我打错了,是debian8.2 make all-recursive make[1]: Entering directory '/shadowsocks-libev' Making all in libcork make[2]: Entering directory '/shadowsocks-libev/libcork' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/shadowsocks-libev/libcork' Making all in libipset make[2]: Entering directory '/shadowsocks-libev/libipset' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/shadowsocks-libev/libipset' Making all in src make[2]: Entering directory '/shadowsocks-libev/src' CC libshadowsocks_libev_la-encrypt.lo encrypt.c: In function 'crypto_stream_xor_ic': encrypt.c:296:9: error: implicit declaration of function 'crypto_stream_chacha20_ietf_xor_ic' [-Werror=implicit-function-declaration] return crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, n, (uint32_t)ic, k); ^ cc1: all warnings being treated as errors Makefile:811: recipe for target 'libshadowsocks_libev_la-encrypt.lo' failed make[2]: *** [libshadowsocks_libev_la-encrypt.lo] Error 1 make[2]: Leaving directory '/shadowsocks-libev/src' Makefile:463: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/shadowsocks-libev' Makefile:371: recipe for target 'all' failed make: *** [all] Error 2

baggiogogo avatar Jan 18 '17 09:01 baggiogogo