Topic: Using SF with an additional MinGW installed

I am trying to get SF to "play nicely" with another install of MinGW that I have at C:\MinGW. This second install of MinGW is an older version that I need to keep for compatibiity (at least for the near future).

I use the install at C:\MinGW by using Gfortran from a command window.

However, I can't get both Gfortran at the command line And SF to use the correct installs.

Currently I have this in my path.

C:\Program Files\Simply Fortran 2\mingw-w64\bin;                                           <-- first
C:\Program Files\Simply Fortran 2\mingw-w64\x86_64-w64-mingw32\lib32;
C:\Program Files\Simply Fortran 2\mingw-w64\x86_64-w64-mingw32\lib64;
C:\MinGW\bin                                                                                                       <-- last

This doesn't work as when I run gfortran from the command line, it runs the SF version.

If I move the C:\MinGW entry to the first position, I am not sure whether SF will use the PATH and therefore pick up the old files. Can you advice please.

Or could the SF Gui be made independent of the path by creating its own temporary environment when it is running (this would be the best option).

--
David

Re: Using SF with an additional MinGW installed

David,

You should generally be fine either moving C:\MinGW\bin to the front of the path or removing the Simply Fortran path elements entirely.  The only thing you'd need to keep in mind is that you should ensure anything you compile in Simply Fortran is statically linked because your programs will not be able to locate the proper DLLs (like the GNU Fortran runtime library). 

Simply Fortran itself doesn't depend on the path variable at all to operate properly.  It is there only so that GNU Fortran works from the command line (for users who need that) and dynamically linked programs work properly.

The installer should probably prompt the user as to whether the path should be set.  However, it can be a misleading question because many might not realize their subsequent Fortran programs may need it to run (if dynamically linked).

Jeff Armstrong
Approximatrix, LLC

Re: Using SF with an additional MinGW installed

Thank you for the explanation.

I have removed the Simply Fortran Entries from the PATH and created two files.

(1) Simply Fortran Command Window.cmd (which I have put in the SF fwin sub-directory) containing

: BAT file to change PATH specifically for Simply Fortran
@echo off
set "PATH=C:\Program Files (x86)\Simply Fortran 2\mingw-w64\bin;C:\Program Files (x86)\Simply Fortran 2\x86_64-mingw32\lib32;C:\Program Files (x86)\Simply Fortran 2\x86_64-mingw32\lib64"
cd %HOMEPATH%

(2) A Shortcut to cmd.exe named "Simply Fortran Command Window.exe" with

Target =%SystemRoot%\system32\cmd.exe /K "C:\Program Files (x86)\Simply Fortran 2\fwin\Simply Fortran Command Window.bat"

I have copied the shortcut to my start menu and desktop.

This gives me a special command window I can use just for compiling with Simply Fortran from a command line.

My command line work now works and I don't need static linking.

However, I still need to check if the SF GUI works with those entries deleted from the PATH. Will do this soon.

--
David