[Bug c++/100160] New: MinGW-w64 g++ with libgomp and nvptx looks for libgomp-plugin-nvptx.so.1 instead of libgomp-plugin-nvptx-1.dll
brechtsanders at users dot sourceforge.net
gcc-bugzilla@gcc.gnu.org
Tue Apr 20 18:31:30 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100160
Bug ID: 100160
Summary: MinGW-w64 g++ with libgomp and nvptx looks for
libgomp-plugin-nvptx.so.1 instead of
libgomp-plugin-nvptx-1.dll
Product: gcc
Version: 10.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: brechtsanders at users dot sourceforge.net
Target Milestone: ---
Created attachment 50640
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50640&action=edit
Test source code to reproduce issue
(see issue reported here:
https://github.com/brechtsanders/winlibs_mingw/issues/51)
Several issues when using GCC built against MinGW-w64 for Windows to compile
gomp test code (see attached minimal source code).
Code compiles fine with:
g++ -c -o test.o test.cpp -fopenmp -foffload=nvptx-none
Linking fails when done like this:
g++ -o test.exe test.o -lgomp
mkoffload: fatal error: either '-fopenacc' or '-fopenmp' must be set
compilation terminated.
lto-wrapper.exe: fatal error:
d:/prog/winlibs64-10.3.0/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/10.3.0//accel/nvptx-none/mkoffload.exe
returned 1 exit status
compilation terminated.
d:/prog/winlibs64-10.3.0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
Avoiding LTO seems to work around this and the following links fine:
g++ -o test.exe test.o -fno-lto -lgomp
When executing test.exe the output starts with:
libgomp: while loading libgomp-plugin-nvptx.so.1: "libgomp-plugin-nvptx.so.1":
The specified module could not be found.
The correct file on Windows is libgomp-plugin-nvptx-1.dll, not
libgomp-plugin-nvptx.so.1
After that the application runs, but I assume without gomp optimizations.
The g++ used in my case is the one I built myself from source, including nvptx
offload engine (can be downloaded from http://winlibs.com/):
g++ --version
g++.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
More information about the Gcc-bugs
mailing list