The code compiles just fine under 32bit (debug and release) and 64bit(debug) but chokes up when i try 64bit release (with any optimization). The culprit, as far as i can tell, is a combination of openmp and the boost/random library.Here is the error message:1>Link:1> Generating code1>c:\users\jose-luis.guerrero\documents\visual studio 2010\projects\testopenmp\testopenmp\main.cpp(40): fatal error C1001: An internal error has occurred in the compiler.1> (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c[0x615BAC56:0x342279FC]', line 183)1> To work around this problem, try simplifying or changing the program near the locations listed above.1> Please choose the Technical Support command on the Visual C++ 1> Help menu, or open the Technical Support help file for more information1> 1>LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage1> 1> Version 10.00.30319.011> 1> ExceptionCode = C00000051> ExceptionFlags = 000000001> ExceptionAddress = 615BAC56 (61500000) "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\c2.dll"1> NumberParameters = 000000021> ExceptionInformation[ 0] = 000000001> ExceptionInformation[ 1] = 342279FC1> 1> CONTEXT:1> Eax = 040718BC Esp = 004AEAE01> Ebx = 0000001E Ebp = 004AEB301> Ecx = 0C0710F4 Esi = 04063EC81> Edx = 04063628 Edi = 04025AFC1> Eip = 615BAC56 EFlags = 000102871> SegCs = 00000023 SegDs = 0000002B1> SegSs = 0000002B SegEs = 0000002B1> SegFs = 00000053 SegGs = 0000002B1> Dr0 = 00000000 Dr3 = 000000001> Dr1 = 00000000 Dr6 = 000000001> Dr2 = 00000000 Dr7 = 000000001>1>Build FAILED.1>1>Time Elapsed 00:00:08.91========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========And here is the offending piece of code:#include<iostream>#include<boost/timer.hpp>#include <boost/random/linear_congruential.hpp>#include <boost/random/uniform_int.hpp>#include <boost/random/uniform_real.hpp>#include <boost/random/variate_generator.hpp>#include <boost/generator_iterator.hpp>#include <boost/random/mersenne_twister.hpp>#include<omp.h>#define NUM_THREADS 8using namespace std;typedef boost::mt19937 base_generator_type; //Defining the pseudo-random number generatorint main(void){ omp_set_num_threads(NUM_THREADS); base_generator_type generator(42u); boost::uniform_real<double> distA4(0.7,0.9); int tid; #pragma omp parallel private(tid) { tid = omp_get_thread_num(); cout << "Hello from thread: " << tid << endl; } boost::variate_generator<base_generator_type&, boost::uniform_real<> > uniA4(generator, distA4); #pragma omp parallel private(tid) { tid = omp_get_thread_num(); cout << "Hello from thread: " << tid << endl; } return 0;}The second #pragma omp parallel for is the culprit. The first one works just fine.
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results