[alibaba/tengine]tengine2.2.1 在centOS7.4 编译失败

2024-01-30 870 views
9

错误日志如下

make[4]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k/engines/ccgost'
make[3]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k/engines'
making install in apps...
make[3]: Entering directory `/root/oneinstack/src/openssl-1.0.2k/apps'
make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
installing openssl
installing CA.sh
installing CA.pl
installing tsget
make[3]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k/apps'
making install in test...
make[3]: Entering directory `/root/oneinstack/src/openssl-1.0.2k/test'
make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[3]: Nothing to be done for `install'.
make[3]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k/test'
making install in tools...
make[3]: Entering directory `/root/oneinstack/src/openssl-1.0.2k/tools'
make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[3]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k/tools'
installing libcrypto.a
installing libssl.a
cp libcrypto.pc /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig
chmod 644 /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig/libcrypto.pc
cp libssl.pc /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig
chmod 644 /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig/libssl.pc
cp openssl.pc /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig
chmod 644 /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig/openssl.pc
make[2]: Leaving directory `/root/oneinstack/src/openssl-1.0.2k'
make[1]: *** [../openssl-1.0.2k/.openssl/include/openssl/ssl.h] Error 2
make[1]: Leaving directory `/root/oneinstack/src/tengine-2.2.1'
make: *** [build] Error 2
Tengine install failed, Please Contact the author! 

编译参数如下

pushd ${oneinstack_dir}/src

  id -u $run_user >/dev/null 2>&1
  [ $? -ne 0 ] && useradd -M -s /sbin/nologin $run_user

  tar xzf pcre-$pcre_version.tar.gz
  tar xzf tengine-$tengine_version.tar.gz
  tar xzf openssl-$openssl_version.tar.gz
  pushd tengine-$tengine_version
  # Modify Tengine version
  #sed -i 's@TENGINE "/" TENGINE_VERSION@"Tengine/unknown"@' src/core/nginx.h

  # close debug
  sed -i 's@CFLAGS="$CFLAGS -g"@#CFLAGS="$CFLAGS -g"@' auto/cc/gcc

  [ ! -d "$tengine_install_dir" ] && mkdir -p $tengine_install_dir
  ./configure --prefix=$tengine_install_dir --user=$run_user --group=$run_user --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_concat_module=shared --with-http_sysguard_module=shared --with-openssl=../openssl-$openssl_version --with-pcre=../pcre-$pcre_version --with-pcre-jit --with-jemalloc $nginx_modules_options
  make -j ${THREAD} && make install

@taoyuanyuan

回答

0

日志中还出现一段类似这样等错误

making all in crypto...
Cannot create directory /root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl: File exists
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/bin'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/engines'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/lib/pkgconfig'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/include'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/include/openssl'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/ssl'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/ssl/misc'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/ssl/certs'
created directory `/root/oneinstack/src/tengine-2.2.1/../openssl-1.0.2k/.openssl/ssl/private'
make[2]: *** [install_docs] Error 17
make[2]: *** Waiting for unfinished jobs....
make[3]: Entering directory `/root/oneinstack/src/openssl-1.0.2k/crypto'
make[3]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
making all in crypto/objects...

是openssl 版本的问题吗?

1

@davidtall 这个问题,主要是openssl源码目录没有做简单的./config 然后根据提示make depend后 回到tengine的源码目录重新编译就可以了

0

去掉 -j ${TH·READ} 可以正常编译