hpc_learner
hpc_learner

Reputation: 21

Error: cannot compute suffix of object files: cannot compile while building GCC 10 with offloading OpenACC Support to Nvidia GPU

I am trying to install GCC 10 for Nvidia PTX on Ubuntu 20.04 so that I can offload the openACC loads to Nvidia GPU.

I am following the steps given in this link

  1. Installing nvptx-tools
git clone https://github.com/MentorEmbedded/nvptx-tools.git
./configure
make -j  #Generates nvptx-none-as, nvptx-none-ld
make install DESTDIR=/install

Exported the PATH, export PATH=/install/usr/local/bin:$PATH

  1. Cloned newlib-cygwin, git clone git://sourceware.org/git/newlib-cygwin.git

  2. Download GCC 10 source files

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. Added Symbolic link fro newlib in gcc source folder ln -s /home/newlib-cygwin/newlib newlib

  2. Then, I have done out of source build(recommended)

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. I have also export lib runtime path for gmp,mpfr,mpc export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

I am getting the below error

Error:

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

When I check the /home/gcc-10.1.0/build/nvptx-none/libgcc/config.log file, the error is because of this

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.

Please suggest me on how to proceed.

Upvotes: 2

Views: 296

Answers (0)

Related Questions