-
Notifications
You must be signed in to change notification settings - Fork 1
Compiling MUMPS with GFortran on Windows? #7
Comments
I now see that your team has discussed this in various places, including here: microsoft/vcpkg#233 |
Hi @chrisdembia , thanks for getting in contact! As you may have found out in microsoft/vcpkg#233 (comment) the IPOPT binaries that you find in http://www.icub.org/download/3rd-party/ are actually compiled with the Intel Fortran compiler, that has native compatibility with MSVC. They are relatively self-contained, so if it is feasible for you to just include them in your installer I think you can just do that. We have script used to build it on a local machine, as soon as I am back in IIT I can send it to you. I briefly tried to compile fortran libraries with GFortran for adding support for them in vcpkg but I abandoned that attempt because gfortran does not support linking against the latest MSVC CRT library, something that vcpkg enforces. However, for a library linking a different CRT library from the rest of the linked libraries and binaries is ok as long as no file handles (or similar objects managed by the CRT) are passed along the library interface, and I hope this is the case with MUMPS. You can find a report of my attempt in microsoft/vcpkg#23 (comment) , and actually I think that with this commit microsoft/vcpkg@e604d4e the vcpkg fork with fortran support proposed in microsoft/vcpkg#1098 is able to compile MUMPS with gfortran. |
@traversaro First of all thank's for trying the fortran support and I am glad that it works for you! About the gfortran support. Theoretically microsoft/vcpkg@e604d4e enables MinGW support for vcpkg, but building MUMPS with it is blocked by multiple issues. First of all CMake does not yet support GNUtoMS for the Ninja generator. I've submitted a merge request for that at https://gitlab.kitware.com/cmake/cmake/merge_requests/1165. But this would not be a blocker since one could switch to MinGW Makefiles if GNU is selected. |
Thanks for the relevant comment @albertziegenhagel and also for your precious work on Fortan support in vcpkg. |
I would appreciate if you could send that to me; thank you (my email address is on my GitHub profile page). I look forward to being able to get IPOPT via vcpkg. |
Thank you both for the quick responses and the awesome contributions to the larger community. |
Some status update: The required changes to CMake have been merged to the latest master and I have pushed a few changes to my branch that made me successfully build MUMPS with gfortran on windows. I have not yet tested whether this version works correctly. |
@albertziegenhagel thanks for the update. I do not need MSMPI. Does that mean that once there is a MUMPS port for vcpkg, I'll be able to install MUMPS via vcpkg so long as I am using the latest master of CMake? |
@chrisdembia Yes, that is true, even with MSMPI. The MUMPS port I wrote is not capable of being build without MPI support yet, though this shouldn't be very difficult to add. But please note that I don't know when/if the fortran support will be merged into vcpkg and that using gfortran may come with a few issues due to the CRT mismatch. I would still suggest to use Intel Fortran if available or PGI Fortran if a free alternative is required. |
@albertziegenhagel do you have any scripts or instructions to build MUMPS with PGI Fortran? |
@chrisdembia If you want to use vcpkg you can use my branch at https://github.com/albertziegenhagel/vcpkg/tree/fortran-ports to build MUMPS. The instructions should be as simple the follwing:
NOTE 1: This is all experimental, so you will might encounter some issues. If there a problems, let me know and I will try to help. NOTE 2: vcpkg will try to find the PGI Fortran compiler automatically, and I am not sure whether this will work under all circumstances. PGI in general is not my main compiler, so I do not test this often. If you just do need MUMPS and do not care about the Fortran compiler used to compile it, I would suggest to set NOTE 3 I update my fork with changes from upstream vcpkg only very occasionally, so you may not get all the newest versions of the other ports. NOTE 4 To build MUMPS on windows, I am using a very simple, handwritten CMake build system. The CMakeLists file can be found here: https://github.com/albertziegenhagel/vcpkg/blob/fortran-ports/ports/mumps/CMakeLists.txt |
Thanks @albertziegenhagel . I will try these instructions. However, I'd like to build MUMPS without vcpkg, so I may try to go straight from your MUMPS CMake build system, but in this case I do not know how to tell CMake to use PGI. Any suggestions? |
If the compiler is in your PATH (which should be the case if you are within the PGI command prompt, or have loaded the environment via the |
@albertziegenhagel your branch worked! I was able to build MUMPS very easily. I will now try integrating these MUMPS binaries with Ipopt. Please let me know if you have suggestions for this process. cc @traversaro |
Great @chrisdembia, and thanks a lot @albertziegenhagel for his hard work ! Depending on the version of MUMPS and/or IPOPT (in particular with IPOPT < 3.12.11 with MUMPS >= 5.1.0), you may be affected by this: robotology/idyntree#456 . |
Thanks @traversaro |
@traversaro you mentioned you had build scripts for Ipopt on Windows. Do you still have those and if so would you be willing to share them? Thank you. |
Sorry @chrisdembia, I probably missed your reply, I need to ask to the person that is handling this. |
Thanks. I now have the ability to build IPOPT using clang-cl with a toolchain from conda. https://github.com/chrisdembia/coin/tree/ipopt_external_mumps |
Given that @chrisdembia solved his original problem, I think we can close this issue. Thanks for the useful inputs @chrisdembia @albertziegenhagel ! |
I apologize for creating an issue on GitHub for this, but I simply have a question. I see that you have done a very nice job with a build script for Ipopt on WIndows that builds MUMPS as well using Intel's Fortran compiler.
I was wondering if you had tried compiling MUMPS with GFortran and Ipopt with MSVC? I would like to do this so that I can compile and use Ipopt with free compilers. This would be nice so that I could use AppVeyor to build Ipopt and MUMPS in an automated way. Would this be possible?
I appreciate that your project makes Ipopt binaries for Windows available (here). I would like to do the same for my project.
Thank you.
The text was updated successfully, but these errors were encountered: