Le 10/12/2021 à 17:51, Stefan Ring via Gcc-help a écrit :
On Fri, Dec 10, 2021 at 4:43 PM Patrick Begou via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
But I need a recent Nvidia environment to support my A100 GPU. So I'm
unable to compile GCC 10.3 for offloading too.
Try if patching along the lines of
https://github.com/apavenis/djgpp-gcc/pull/2 works. In my case it did.
Hi Stefan
I've spent a couple of days trying your suggestion but it did not works
for me...
- first, using releases/gcc-11 branch I hit the new bug on "undefined
directly_supported_"
(https://www.mail-archive.com/gcc-patches@xxxxxxxxxxx/msg276579.html)
- I try the patch with the master branch, but the "fatal error:
sys/mman.h: No such file or directory" still occurs.
- I've then tried to specify the compiler where to look for the include
files using:
CFLAGS="-I/usr/include" ../gcc/configure \
--target=nvptx-none
--with-build-time-tools=$install_dir/nvptx-none/bin \
--enable-as-accelerator-for=$target \
--disable-sjlj-exceptions \
--enable-newlib-io-long-long \
--enable-languages="c,c++,fortran,lto" \
--prefix=$install_dir
but it has no effect as it is not the installed gcc which fails to
compile but the just created xgcc:
*/robin/data/begou/GCC11/GCC11.2-offload/build-nvptx-gcc/./gcc/**xgcc*
-B/robin/data/begou/GCC11/GCC11.2-offload/build-nvptx-gcc/./gcc/
-nostdinc
-B/robin/data/begou/GCC11/GCC11.2-offload/build-nvptx-gcc/nvptx-none/newlib/
-isystem
/robin/data/begou/GCC11/GCC11.2-offload/build-nvptx-gcc/nvptx-none/newlib/targ-include
-isystem /robin/data/begou/GCC11/GCC11.2-offload/gcc/newlib/libc/include
-B/opt/GCC11.2/nvptx-none/bin/ -B/opt/GCC11.2/nvptx-none/lib/ -isystem
/opt/GCC11.2/nvptx-none/include -isystem
/opt/GCC11.2/nvptx-none/sys-include -g -O2 -mgomp -O2 -g -O2
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wstrict-prototypes
-Wmissing-prototypes -Wno-error=format-diag -Wold-style-definition
-isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc -I. -I. -I../../.././gcc
-I../../../../gcc/libgcc -I../../../../gcc/libgcc/.
-I../../../../gcc/libgcc/../gcc -I../../../../gcc/libgcc/../include
-DHAVE_CC_TLS -DUSE_EMUTLS -o _gcov_merge_add.o -MT _gcov_merge_add.o
-MD -MP -MF _gcov_merge_add.dep -DL_gcov_merge_add -c
../../../../gcc/libgcc/libgcov-merge.c
/In file included from ../../../../gcc/libgcc/libgcov-merge.c:26://
//../../../../gcc/libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No
such file or directory//
// 49 | #include <sys/mman.h>/
Moreover I'm not sureif I need to include this file...
My goal is really to use Gnu compilers for offloading on nvidia GPU and
also AMD GPU. We have a large fortran CFD code and llvm compilers
(provided by Nvidia or AMD) needs a lot of time to compile fortran files
with a lot of "use" statements. Typically more than 20mn per file when
gfortran is ten time faster. And these files with many dependences are
compiled at each modification of the code. :-(
Patrick