Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-07-2010, 02:18 PM   #1
LQ Newbie
Registered: Dec 2009
Posts: 5

Rep: Reputation: 0
fortran compiler that can compile progs on a linux machine, but execute on windows XP

hi, i'm currently using the gnu compiler "gfortran" , but i don't think the executable files it creates are compatible with windows XP (though i may be mistaken). my boss needs a few simple programs that i have written, but i will not be able to compile the code on his pc. are there any compilers out there that i can use to create such executables?
Old 01-07-2010, 02:21 PM   #2
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 553

Rep: Reputation: 116Reputation: 116
I don't believe you can use a compiler on one os to compile files for another unless you are using a language which runs in a virtual machine such as java.
Old 01-07-2010, 02:59 PM   #3
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
I'm not sure what exactly is available in the MINGW project. If they don't have what you are asking for, I doubt it is elsewhere.

MINGW is a port of the GNU compiler (but I'm not sure whether includes fortran or whether it is just C and C++) both to produce native Windows executables and to be run on Windows.

Some people have built compilers from the MINGW sources that produce the same Windows output as MINGW but run on Linux. That would be what you want. I don't know whether there is any released copy of that, or whether it is something only a MINGW expert can do with the MINGW source code.

Alternately, why can't you compile on a Windows machine? No access to a Windows machine? Or just no compatible compiler?

I think either Cygwin or MINGW or both includes a gfortran compiler. Both Cygwin and Mingw are designed to compile on Windows. IIUC, Mingw produces true native Windows executables, while Cywin produces semi-native executables than run on Windows with support from a Cygwin .DLL (internally use Unix semantics for various OS requests that get translated to Windows calls by that DLL).

Another alternate (if you don't have access to a Windows system, nor a license to run Windows in a VM in Linux): You can run Mingw or Cygwin or other Windows fortran compiler in wine on Linux to produce a Windows executable (may require installing a significant number of include files and lib files from a Windows development environment into your wine environment).

Last edited by johnsfine; 01-07-2010 at 03:06 PM.
Old 01-07-2010, 03:04 PM   #4
LQ 5k Club
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
MinGW is available as a cross-compiler on Debian, but I don't know about other distros.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
error Linux Fortran compiler: terrence Programming 6 06-15-2012 03:51 PM
g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. TheBrick Linux - Software 3 07-04-2007 06:39 AM
Fortran 90/95 compiler for linux, to output .exe? Lordandmaker General 4 10-04-2006 06:12 AM
any recommendations for a fortran compiler for linux? buddy_epson Programming 3 08-18-2006 02:00 AM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 08:59 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration