Cudafe crash using cygwin or mngw gcc on windows

Hellooo !

I’m trying to compile cuda 2.0 code with nvcc using gcc (Mingw) on windows xp.

nvcc 's -foreign option (for test only as reference guide says) crash when I tried to compile with it.

As alex_dubinsky advised me here, I compiled my .cu on Linux with dryrun option which gave me the different steps of the linux compilation.
It’s a succession of gcc and cudafe calls ( + nvopencc, ptxas… calls).

First cmd is a gcc call which write a tmpxft_0000130c_00000000-4_cuda_test.cpp1.ii file. It works fine.

Second one is a cudafe call :
cudafe --m32 --diag_error=host_device_limited_call -tused “-IL:\CUDA\include” “-IL:\CUDA\include\cudart” --gen_c_file_name “tmpxft_0000130c_00000000-1_cuda_test.cudafe1.c” --stub_file_name “tmpxft_0000130c_00000000-1_cuda_test.cudafe1.stub.c” --stub_header_file_name “tmpxft_0000130c_00000000-1_cuda_test.cudafe1.stub.h” --gen_device_file_name “tmpxft_0000130c_00000000-1_cuda_test.cudafe1.gpu” --include_file_name tmpxft_0000130c_00000000-3_cuda_test.fatbin.c “tmpxft_0000130c_00000000-4_cuda_test.cpp1.ii”

This cmd crash !

The problem could be a wrong option but I didn’t find any doc about cudafe and its options (btw, “-h”, “–help” lead to a “catastrophic error” ; “?” make cudafe crash :blink: ).
I try to remove --m32, --diag_error=host_device_limited_call, -tused -> same problem.

Can anybody help me ? :rolleyes:
is there a doc swh ?

By google-izing, I find this method. I’m gonna try.

Thanks for your help !

Only Visual Studio is supported on Windows. If this crash reproduces while using Visual Studio, please provide details on how it can be reproduced, including any relevant test app(s).

Too bad because I’m using Eclipse CDT with Mingw.

But thanks for the reply ;)

That be, I find a workaround described here .

Quickly, I create a dll with nvcc using cl, then I use pexports to create a .def and at last I use Mingw’s tool, dlltool, to create .lib.

I can now link this lib in my MinGW-gcc project on Eclipse CDT and call my host function.