Hacker News new | past | comments | ask | show | jobs | submit login

I usually avoid MinGW, because it links your binaries agains msvcrt.dll. It really shouldn't do it - https://blogs.msdn.microsoft.com/oldnewthing/20140411-00/?p=...



The mingwpy project is slowly working towards making mingw capable of linking to the new ucrt, but it isn't ready yet - http://mingwpy.github.io/issues.html#the-vs-14-2015-runtime

I'm sure they'd appreciate help.

A funny footnote to that article is now with Windows 10 and the ucrt, Windows is "a Microsoft Visual C/C++ Run-Time delivery channel" once again.


I haven't tried in awhile, but is the best option just to use VC directly at this point?


If everything is using cmake, and you don't need any inline assembly or fortran for scientific code, then maybe. But you end up in a parallel universe where everything that touches MSVC is just needlessly different than every other platform. If mingw gcc is working for you, then it's much easier for dev skills to transfer between building for Windows and building for unix. If you do need inline assembly and/or Fortran (LAPACK anyone?) then it's easiest to pretend visual studio doesn't exist.


Actually Fortran works best if you combine Visual Studio with Intel Fortran compiler. You can freely call C from Fortran and viceversa, furthermore Intel's versions of BLAS and LAPACK are seriously faster than the reference BLAS and LAPACK you will build yourself on Windows.

It is also possible to link gfortran compiled dll's with C and C++ in Visual Studio. A few years ago I even called a gfortran dll from C# using p-invoke with no particular problem.


Of course you don't build the reference BLAS if you care about performance. But OpenBLAS is quite competitive, and open source. A non-free compiler is a big impediment to build reproducibility and accessibility for new contributors for a large open source project.


> A non-free compiler is a big impediment to build reproducibility and accessibility for new contributors for a large open source project.

Agree, this is why I've mentioned that you can use Fortran code compiled as a DLL with gfortran (open source) from Visual Studio in C, C++ and C# projects.


Well, and that's the trick. Originally, I shied away from VC because I link into LAPACK. Even if I hook into a precompiled library from a manufacturer, they use the same name mangling scheme as Fortran. In order to figure that out, both autotools and CMake compile a small Fortran program and check, which means that I need a Fortran compiler. Technically, I could set a macro to the name mangling by hand since there's only four possibilities, but it's a little irritating. I suppose that I could use VC for the C++ pieces and gfortran for the Fortran pieces, but it's always been easier just to use MinGW.


Or Intel will sell you their Fortran compiler. I guess you can get academic or open source license deals too, but it ends up feeling like you need a law degree to determine whether or not you can redistribute the results.

Kind of annoying that Intel's Fortran compiler on Windows is the only commonly-used one that doesn't at least allow you to ask for gfortran-compatible mangling. Hopefully if the PGI LLVM Fortran front-end ever gets released it'll be another option (fingers crossed that it uses gfortran compatible mangling so life is simpler).


Probably yes, but on the other hand, VC is incapable of building some FOSS packages (xz comes to mind).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: