安装Z线程失败

我试图在Ubuntu上安装Z线程,但遇到了一个问题。 我已经安装了几十次Z线程,但这是第一次发生这种情况。 我通常使用这些来安装它:

wget http://voxel.dl.sourceforge.net/sourceforge/zthread/ZThread-2.3.2.tar.gz tar -xzf ZThread-2.3.2.tar.gz cd ZThread-2.3.2 ./configure CXXFLAGS="-fpermissive" --prefix=/usr/ make && make install 

它在上面的configuration命令上出现错误:

 root@Rx:~/ZThread-2.3.2# ./configure CXXFLAGS="-fpermissive" --prefix=/usr/ checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes Loading m4 macros from share checking for g++... g++ checking for C++ compiler default output file name... a.out checking whether the C++ compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for style of include used by make... GNU checking dependency style of g++... gcc3 checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking for egrep... 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 pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for linker option -pthread... no checking for linker option -lpthread... yes checking for sched_get_priority_max in -lrt... yes checking for sched_yield... yes checking for pthread_yield... yes checking for pthread_key_create... yes checking for doxygen... no detecting for ftime() function checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for _ftime()... no checking sys/timeb.h usability... yes checking sys/timeb.h presence... yes checking for sys/timeb.h... yes checking for ftime()... yes checking how to run the C++ preprocessor... g++ -E checking for ANSI C header files... (cached) yes checking errno.h usability... yes checking errno.h presence... yes checking for errno.h... yes checking for target implementation... compile-time guess checking for sigsetjmp()... yes checking for _beginthreadex()... no checking for a sed that does not truncate output... /bin/sed checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for f77... no checking for xlf... no checking for frt... no checking for pgf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for f90... no checking for xlf90... no checking for pgf90... no checking for epcf90... no checking for f95... no checking for fort... no checking for xlf95... no checking for ifc... no checking for efc... no checking for pgf95... no checking for lf95... no checking for gfortran... no checking whether we are using the GNU Fortran 77 compiler... no checking whether accepts -g... no checking the maximum length of command line arguments... 32768 checking command to parse /usr/bin/nm -B output from gcc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for correct ltmain.sh version... grep: character class syntax is [[:space:]], not [:space:] no *** Gentoo sanity check failed! *** *** libtool.m4 and ltmain.sh have a version mismatch! *** *** (libtool.m4 = 1.5.10, ltmain.sh = ) *** Please run: libtoolize --copy --force if appropriate, please contact the maintainer of this package (or your distribution) for help. root@Rx:~/ZThread-2.3.2# 

在运行libtoolize --copy --force

 root@Rx:~/ZThread-2.3.2# libtoolize --copy --force libtoolize: putting auxiliary files in `.'. libtoolize: copying file `./ltmain.sh' libtoolize: You should add the contents of the following files to `aclocal.m4': libtoolize: `/usr/share/aclocal/libtool.m4' libtoolize: `/usr/share/aclocal/ltoptions.m4' libtoolize: `/usr/share/aclocal/ltversion.m4' libtoolize: `/usr/share/aclocal/ltsugar.m4' libtoolize: `/usr/share/aclocal/lt~obsolete.m4' libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. root@Rx:~/ZThread-2.3.2# 

这是甚么build议我呢? 这也许是一个更大的问题的一部分?

我刚刚在Ubuntu上安装了ZThread,并发布了如何在https://stackoverflow.com/a/33060825/4455221上解决此问题。 答案的内容按要求复制如下:

ltmain.sh具有空白版本的原因是由于./configure文件中的语法错误。 *** Gentoo sanity check failed! ***之前,您应该有以下错误*** Gentoo sanity check failed! *** *** Gentoo sanity check failed! ***

 checking for correct ltmain.sh version... grep: character class syntax is [[:space:]], not [:space:] no 

该错误位于./configure文件的以下行中:

 gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'` 

[:space:]更改为[[:space:]] ,它变成以下内容并应解决问题:

 gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'` 

在这之后,您可能会遇到编译错误,因为ZThread使用了不赞成使用的语法,您可以通过将以下行添加到./configure来解决此问题。

 CXXFLAGS="$CXXFLAGS -fpermissive" 

如果这确实和Ubuntu安装,你只是作为根login乐趣..(提示,你应该总是使用sudo)。

为什么不只是做sudo apt-get install libzthread-2.3-2 libzthread-dev ,让包pipe理子系统为你做出聪明的事情。