CoSci-LLC / PRIMULA

A C++ version of PRobabilistic MUltidimensional shallow Landslide Analysis
GNU General Public License v3.0
0 stars 2 forks source link

Check Compilation of Stats Lib with MSVC #43

Open oparkins opened 3 years ago

oparkins commented 3 years ago

We get a compiler error when compiling our code with OpenMP on Windows with MSVC:

C:\Users\Owen Parkins\Development\KiLib-OSS\lib\stats\include\stats_incl\dens\dbern.ipp(94,5): fatal error C1001: Int
ernal compiler error. [C:\Users\Owen Parkins\Development\KiLib-OSS\build\KiLib.vcxproj]
  (compiler file 'msc1.cpp', line 1584)
   To work around this problem, try simplifying or changing the program near the locations listed above.
  If possible please provide a repro here: https://developercommunity.visualstudio.com
  Please choose the Technical Support command on the Visual C++
   Help menu, or open the Technical Support help file for more information
  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333 
  \bin\HostX64\x64\CL.exe'
      Please choose the Technical Support command on the Visual C++
      Help menu, or open the Technical Support help file for more information

This has been reported to M$ by someone else. Supposedly there is an internal fix and now we need to wait for the next release. I've followed the issue and will receive emails when it gets fixed.

This means that the stats lib can't have any OpenMP at the moment :frowning_face:

I'm going to work on getting OpenMP working for PRIMULA code at least.

oparkins commented 3 years ago

What I have tried so far:

Next steps:

oparkins commented 3 years ago

I tried compiling with clang. I had to install clang (llvm.org) and a VS LLVM extension for Visual Studio. Then I ran cmake as:

cmake ../ -T"LLVM" -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=Release

This allowed me to build PRIMULA and it seems to run properly. I need a test case to make sure it works all properly.


Messing with the refactor of KiLib didn't get what I wanted. It is actually all PRIMULA's fault for the lack of OpenMP support though. I thought it was because of KiLib, but it was through KiLib, an import and usage from primula++.cpp. We could butcher that stats lib to get it to compile, but since Clang compiled I'm not too upset about waiting for a patch from Microsoft.

deniscohen commented 3 years ago

@oparkins There are 3 examples to test in https://github.com/CoSci-LLC/PRIMULATests under Data