ddemidov / vexcl

VexCL is a C++ vector expression template library for OpenCL/CUDA/OpenMP
http://vexcl.readthedocs.org
MIT License
700 stars 81 forks source link

FFT test causes internal compiler error in Visual Studio Express 2013. #100

Open sebsjoberg opened 10 years ago

sebsjoberg commented 10 years ago

When trying to find a compiler error occuring in Windows for my own project I tested compiling the tests for vexcl and they are getting a compiler error as well when using the fft code. Does this happen for anyone else?

[ 12%] Building CXX object tests/CMakeFiles/fft.dir/fft.cpp.obj
        cd C:\Users\sesg\Src\cleanSlate\vexcl-build\tests
        C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe  @C:\Users\sesg\AppData\Local\Temp\
nm20F4.tmp
fft.cpp
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xstring(2305) : f
atal error C1001: An internal error has occurred in the compiler.
(compiler file 'msc1.cpp', line 1325)
 To work around this problem, try simplifying or changing the program near the l
ocations listed above.
Please choose the Technical Support command on the Visual C++
 Help menu, or open the Technical Support help file for more information
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xstring(2
305) : while compiling class template static data member 'const unsigned int std
::basic_string<char,std::char_traits<char>,std::allocator<char>>::npos'
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdexcept
(31) : see reference to class template instantiation 'std::basic_string<char,std
::char_traits<char>,std::allocator<char>>' being compiled
Internal Compiler Error in C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe.  You will be pr
ompted to send an error report to Microsoft later.
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe' : return code
'0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
ddemidov commented 10 years ago

I think I have VS 2013 installed on my Windows test machine. Will look into this tomorrow.

ddemidov commented 10 years ago

I can confirm this. fft, fft_benchmark, fft_profile all lead to the internal compiler error when compiled with MS Visual C++ 2013. MSVC 2010 (and I think 2012) manages to compile the tests.

@sebsjoberg has already opened a ticket at microsoft connect.

ddemidov commented 10 years ago

I think I remember one of either g++ or clang++ compiler versions reported a warning about vexcl/backend/opencl/fft/unrolled_dft.hpp. Something to the effect that string literals used there are too long according to standard and a compiler is not required to work with those correctly.

This could be the reason behind MSVC2013 crash. Next time I'll be around Windows computer I'll try to test this.

@sebsjoberg, if the issue is critical for you, you could also test this by replacing all string literals there (like this one) with empty strings (""). This should fail at runtime, but what is important is if this would allow fft.cpp to compile. If this is the case, I could split the strings into smaller chunks.

sebsjoberg commented 10 years ago

@ddemidov That might be the reason I couldn't reproduce it when I tried to create a minimal testcase as I made it with empty strings.

ddemidov commented 10 years ago

The PR #101 did not work for me. VC2013 still crashes on fft.cpp.

sebsjoberg commented 10 years ago

@ddemidov I have ported my project to work with VS2012 so it's not that critical anymore.

ddemidov commented 10 years ago

Ok, lets say its a Microsoft problem (they should not crash in any case). I would keep it open though to be visible for others.

ddemidov commented 10 years ago

Visual Studio 2013 still crashes with #114 applied.