错误:无法计算目标文件的后缀:在将OpenACC支持卸载到Nvidia GPU的情况下构建GCC 10时无法编译

问题描述

我正在尝试在Ubuntu 20.04上为Nvidia PTX安装GCC 10,以便可以将openACC负载卸载到Nvidia GPU。

我正在按照link

中给出的步骤进行操作
  1. 安装nvptx工具
git clone https://github.com/MentorEmbedded/nvptx-tools.git
./configure
make -j  #Generates nvptx-none-as,nvptx-none-ld
make install DESTDIR=/install

导出了路径export PATH=/install/usr/local/bin:$PATH

  1. 克隆了newlib-cygwin, git clone git://sourceware.org/git/newlib-cygwin.git

  2. 下载GCC 10源文件

wget https://ftpmirror.gnu.org/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz
tar xf gcc-10.1.0.tar.xz
cd gcc-10.1.0
./contrib/download_prerequisites
  1. 在gcc源文件夹中添加了来自newlib的符号链接 ln -s /home/newlib-cygwin/newlib newlib

  2. 然后,我已经完成了源构建(推荐)

cd ..
mkdir build_gcc10 && cd build_gcc10
../gcc-10.1.0/configure --target=nvptx-none --enable-as-accelerator-for=x86_64-pc-linux-gnu --with-build-time-tools=/install/usr/local/nvptx-none/bin --disable-sjlj-exceptions --enable-newlib-io-long-long
  1. 我还导出了gmp,mpfr,mpc的lib运行时路径 export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

我遇到以下错误

错误:

checking for suffix of object files... configure: error: in `/home/gcc-10.1.0/build/nvptx-none/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details
make[1]: *** [Makefile:13187: configure-target-libgcc] Error 1
make[1]: Leaving directory '/home/gcc-10.1.0/build'
make: *** [Makefile:947: all] Error 2

当我检查/home/gcc-10.1.0/build/nvptx-none/libgcc/config.log文件时,错误是由于此原因

configure:3535: /home/build_gcc10/./gcc/xgcc -B/home/build_gcc10/./gcc/ -nostdinc -B/home/build_gcc10/nvptx-none/newlib/ -isystem /home/build_gcc10/nvptx-none/newlib/targ-include -isystem /home/gcc-10.1.0/newlib/libc/include -B/usr/local/nvptx-none/bin/ -B/usr/local/nvptx-none/lib/ -isystem /usr/local/nvptx-none/include -isystem /usr/local/nvptx-none/sys-include    -V >&5
xgcc: error: unrecognized command-line option '-V'
xgcc: fatal error: no input files
compilation terminated.
configure:3546: $? = 1
configure:3535: /home/build_gcc10/./gcc/xgcc -B/home/build_gcc10/./gcc/ -nostdinc -B/home/build_gcc10/nvptx-none/newlib/ -isystem /home/build_gcc10/nvptx-none/newlib/targ-include -isystem /home/gcc-10.1.0/newlib/libc/include -B/usr/local/nvptx-none/bin/ -B/usr/local/nvptx-none/lib/ -isystem /usr/local/nvptx-none/include -isystem /usr/local/nvptx-none/sys-include    -qversion >&5
xgcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
xgcc: fatal error: no input files
compilation terminated.

请向我建议如何进行。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...