Microsoft Visual Studio Fortran Compiler For Windows
There are some port requests on the tracker that require a Fortran compiler to compile the respective libraries (, ). I want to create this issue to start a discussion on how Fortran support could be brought to vcpkg.Since Visual Studio does not come with a Fortran compiler, on Windows one usually uses one of the following.
Intel Fortran (ifort). gfortran through MinGW/MSYSIntel Fortran is proprietary and thus may not be available for everyone but it has a nice Visual Studio integration which makes it pretty straight forward to consume libraries compiled with ifort from within Visual Studio.gfortran on the other hand is free but does not have an integration into Visual Studio. In general one uses MinGW/MSYS to compile fortran libraries for windows when using gfortran.
This comes with some implications:. one can not use the Visual Studio generator in CMake but instead has to use some makefile system that is supported by MSYS (GNU Makefiles in general).
As discussed in, at least initially I am for using Intel Fortran. However, I fear that requiring all the vcpkg users that want to install Fortran-dependent ports to buy the Intel Fortran compiler is a too much limiting. A possible workaround is to upload the binaries produced using Intel Fortran to a website and then let the port download them in binary form, as it is already done for ports such as tbb.Perhaps Microsoft could provide some support for hosting such binaries produced by the community? Requiring Intel Fortran for a complete out-of-the-box experience is definitely not desirable considering its licensing.
However, it does look like it's a very popular (the most popular?) solution on Windows, so we should support it. Insanity workout dvd torrent. This is exactly what triplets should do - specify the toolchain and build parameters to be used for all built libraries.We can totally handle tools that don't have VS IDE integration; we could easily download Ninja or use MSYS internally as long as we can produce crt-compatible libraries out the other side.As for hosting prebuilt binaries - assuming it is fine with the intel fortran license (I'm not too familiar on this point), we could very easily host them inside the NuGet gallery, treating the NuGet package as a simple zip archive of the prebuilt binaries. We even already have the capability to download the NuGet.exe tool (for the MSBuild per-project integration).As has been mentioned many times elsewhere, building from source would be preferable for users who can (i.e. That have intel fortran), but it's better to have binaries than nothing at all - as long as the fortran library doesn't have dependencies. We don't want the fact that library X required a binary drop to obstruct the maintainer of dependency Y from updating.Edit: flang looks really promising!
I'll look forward to whenever it gets enough fortran support to build the libraries we need:). The only thing I had to change to make it work with the Intel Compiler was to remove the extra arguments that are passed to 'cmake -build' in vcpkginstallcmake and vcpkgbuildcmake. This is because when the Visual Studio project files include Fortran code, 'cmake -build' will invoke devenv.exe instead of msbuild.exe which will not understand the extra arguments.Maybe an additional parameter that is passed to vcpkginstallcmake and vcpkgbuildcmake to disable all extra arguments can be introduced (just like the one that has recently been introduced to disable the /m switch only).The Intel compiler always got detected correctly by cmake automatically. I don't know whether this is the case under all circumstances (e.g.
If you have multiple versions installed) but one could always set 'CMAKEFortranCOMPILER' in the triplet. The problem would here would be to auto-detect and choose the correct paths to ifort.exe. Ironically, using vcpkg to build flang would be the most time-efficient method to get a fortran compiler with MSVC ABI compatibility. But, MSVC does not have OpenMP 4.0, which flang requires. So essentially, the steps would be:. Add clang support to vcpkg (clang has ABI compatibility with MSVC and supports OpenMP 4.0). Fill in the required libraries (specifically, clang-flang, which is a modified clang).
Add openmp-llvm to the ports. Use vcpkg to install the libraries and then build flang with MSVC.Now whether this will actually happen is a different story. MSFT might not want to add clang support to this project because then people may obviously not use their compiler. But based on their responses, there is little chance of MSVC adding OpenMP 4 support.In other words, this is technically solvable, but when business interests / people come into the picture it might not be (and I have nothing against MSFT; I think it's a good company and I think this is an excellent project that was long overdue). Though I'm not sure if flang is actually buildable on Windows, even with msys2 and friends.Let me be clear: flang is buildable on windows, but it has a complex dependency chain, which is the exact problem that vcpkg was designed to solve.
The only problem is that one dependency is openmp-llvm, which MSVC can't build. However, it appears that the default generator can be overridden, making it buildable with once the above libraries are ported.We could just precompile flangYes, but precompiling is the problem. The libraries aren't there yet.
But they could be with vcpkg. Actually, I have another wild idea that may be more practical than any of the current options. It is a bit complex if done manually but can be made to work seamlessly with a bit of vcpkg coordination.Windows now has the 'Windows Subsystem for Linux,' which is essentially a way to run ubuntu applications inside windows.
In addition, flang can target LLVM IR. So essentially what we need to do is install flang within the 'Subsystem for Linux' and then we can have an executable file that simply does the following:.
Takes the input file and copies it to a temporary location within the subsystem for Linux. Runs flang inside the subsystem for Linux and generates LLVM IR. Copies the LLVM IR back to the windows space and compiles it with LLVMSounds a bit tricky and somewhat complicated. But how difficult can it be to write a script that simply copies a few files and runs a few commands? And then maybe optimize that script by rewriting it in a lower-level language (like C, which I know the vcpkg folks love).What do you think of that idea? Sounds completely doable to me.
Update: we've built flang on win32. I expect there to be bugs but we need real-world testing to find them.
I'm going to look at the existing fortran PR and try to update it.Flang on win32 requires:. a development version of CMake (changes may not even be in master, but they will soon). the following cmake configuration flags:cmake -G 'NMake Makefiles' -DCMAKEFortranCOMPILER=flang -DCMAKEVERBOSEMAKEFILE=ON -DCMAKEBUILDTYPE=ReleaseFlang will be available initially using the Anaconda package management system.
MS can rebundle it with vcpkg if they don't like Anaconda. Sorry for the delay, but I've now updated the PR to download the new version from conda-forge.Btw: I could build LAPACK and ScaLAPACK with flang, but when I try to compile MUMPS it fails with a message about a missing header, although on the first look it seems that the correct include path is set.
Fortran For Visual Studio
If you want to try it yourself:. checkout the branch fortran-ports from. Add set(VCPKGFORTRANCOMPILER Flang) to the triplet file. Make sure a current CMake build is in your PATH.
Try vcpkg install mumps. I obviously cannot speak for vcpkg mantainers, but I guess one of the reasons cannot be merged is that it three out of the four supported compilers cannot be maintained in a 'clean' way (please correct me if I am getting something wrong):.
Visual Studio 2017 Fortran
Intel: It is not possible to maintain/debug problems, unless you have the (relatively expensive) license for it. Flang: The Windows version shipped through conda is a fork of upstream flang, that itself requires a fork of upstream llvm and clang. Some interesting recent discussion related to this issue:.: Recent discussion in the Python community on a Fortran UCRT-compatible, involving the same people behind the conda's Flang port (cc that may be interested in this discussion).: RFC for comment for moving the development of the new experimental Fortran LLVM front-end to LLVM upstream. The front-end is not a currently able to generate code (see for an update on a current progress) but in the long-term it could be a good solution.
In the f18 llvm-dev thread, they posted a link to, another Fortran front end for LLVM that I had never heard of.
Hi Chocobbana, Thank you for your post. Some clarification with you: Do you want to apply Intel Fortran Compiler 11 with Visual Studio 2010? Referring to your concern, for Intel Fortran Compiler 11, you can check the this helpful instruction of using Intel Visual Fortran Compiler 11, please see:.
How To Download Fortran Compiler
It seems that Intel Fortran Compiler 11 is not supported for VS2010. BTW, this forum is for the support of Visual Studio installation. For Intel Fortran Compiler, you could post your thread on forum. You will get more useful help there.
Hope this helps. If you have any concern, please feel free to let me know. Best regards, Yichun Chen (This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.)Please remember to mark the replies as answers if they help and unmark them if they provide no help.If you have any feedback, please tell us.