我正在尝试在 Slackware64 14.2 的完整安装上从头开始构建一些软件。我按照自述文件中的说明进行操作
./autogen.sh # only needed if building from git repo
CFLAGS="-march=native" ./configure
# Use -march=native if building for a single machine
make
我从 git 克隆了它,然后发出了 autogen,它输出:
configure.ac:16: installing './compile'
configure.ac:4: installing './config.guess'
configure.ac:4: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './depcomp'
然后,当我在一台机器上构建它时,我发出了下一个命令,但它导致了错误:
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/ginstall -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 whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/xtd8865/data/builds/mine/cpuminer-multi/cpuminer-multi':
configure: error: C compiler cannot create executables
See `config.log' for more details
正如我所说,这是一个完整的 slackware 版本:
gcc -v
Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/5.3.0/lto-wrapper
Target: x86_64-slackware-linux
Configured with: ../gcc-5.3.0/configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,go,java,lto,objc --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --with-python-dir=/lib64/python2.7/site-packages --enable-libstdcxx-dual-abi --with-default-libstdcxx-abi=gcc4-compatible --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --disable-install-libiberty --with-gnu-ld --verbose --enable-java-home --with-java-home=/usr/lib64/jvm/jre --with-jvm-root-dir=/usr/lib64/jvm --with-jvm-jar-dir=/usr/lib64/jvm/jvm-exports --with-arch-directory=amd64 --with-antlr-jar=/root/slackware64-current/source/d/gcc/antlr-runtime-3.4.jar --enable-java-awt=gtk --disable-gtktest --disable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
Thread model: posix
gcc version 5.3.0 (GCC)
所以我不确定为什么它无法创建可执行文件。我以标准用户身份发出这些命令(也尝试以 root 身份但也没有运气)。为什么会失败?
config.log 的输出在这里 http://pastebin.com/QUqHW6zQ
谢谢
答案1
错误在这一行:
ac_cv_env_CFLAGS_value='*-march-native*'
无论出于何种原因,其中包含通配符。该日志不会显示比在 gcc 中尝试使用它更早的使用情况,因此:
- 您下载的内容存在脚本错误,或者
- 您的环境变量设置使脚本感到困惑。
要查看脚本错误,您必须打开 shell 跟踪(set -x
在第一行后添加 )并(它会转到标准错误)捕获输出并读取很多更长的日志...