I need to write a fortran program and I'd like to get a compiler on my computer so I can fiddle with it at home. It's been 4+ years since I've done any programming and I'm having some issues with getting everything runningI downloaded g95, an open source compiler. I installed it to my c:/windows/system32/ directory, the one my console opens to by default (I know how to change this, if need be). Supposedly the command-line call to compile a program for me would be
c:/windows/system32>g95 program.ext
3/31/2011 10:42:15 AM
I'd move it to a different folder then you need to add it to your path. Like Set PATH=c:/g95/;%PATH%-- or you can add to path this way. DO it once and you dont have to retype every time you restarthttp://www.computerhope.com/issues/ch000549.htmas for compiling:>g95 foobar.f90 -o foobar.execompiles and links foobar.f90 and creates the exe named foobar.exe.if you don't add the -o {filename} then it creates some default name[Edited on March 31, 2011 at 10:56 AM. Reason : .][Edited on March 31, 2011 at 10:58 AM. Reason : .]
3/31/2011 10:54:12 AM
it's called FORTRAN, not fortran.
3/31/2011 11:36:03 AM
the problem is you're using FORTRAN
3/31/2011 3:42:20 PM
actually, it's not typed in all caps anymore.
3/31/2011 6:42:44 PM
If writing it in anything except Fortran is an option, I'd go for that.
3/31/2011 6:48:08 PM
no shit. I'm sure most everyone under the age of 50 would prefer to write in something else. But there's a shit ton of legacy code + old programmers that won't accept anything but fortran modules to plug into there massively huge shit piles of common block, goto, spaghetti code. guess you can tell what i've had to do lately I've actually resorted to OO fortran 2003 to write modules, which has come a long way for fortran. I mean you can actually create classes and pointers now. Welcome to 1980.
3/31/2011 7:29:06 PM
thank you clalias...about to give it another go right nowand, for better or worse, a large portion of nuclear reactor practical coding is still done in fortran (sic)in any case, this code needs to be
3/31/2011 7:32:24 PM
damn I don't even know what changing the path does and where/why i should do itis there an idiot-proof fortran compiler out there for the clueless or at least a FORTRAN COMPILERS FOR DUMMIES guide
3/31/2011 8:14:51 PM
The PATH environment variable tells the operating system where to look for executables given by just a filename; first it looks in the current directory and then in the list of directories given in the PATH.If you install a bunch of compilers, you may run into the problem of having a PATH that is too big; for example, 32-bit Windows does not allow environment variables longer than 2KB (2048 characters).
3/31/2011 8:53:50 PM
^^ follow the link I gave at the top - just add the folder location where the compiler is installed. note this might be in a /bin sub-directory or something.If you tired that and it didn't work you may have to restart the comp for it to take effect.Unfortunately, there aren't many/any free windows fortran compilers. Linux yes, windows no.
3/31/2011 9:22:17 PM
4/1/2011 2:42:37 PM
Nuke programmers gotta start somewhere, right?
4/1/2011 3:01:01 PM
ha!To be fair, I've met some amazing fortran programmers that don't know anything about compiling or operating system environments. But they write some of the most complicated scientific code there is. go figure.
4/1/2011 5:47:32 PM
hey looki figured it out thankyouverymuchand it's not the programming i have issue with, it's the virtual semantics^yeah that, not to imply in any way that i'm an amazing programmer. i know my way around java, a bit o' c++, some pearl and i get assembly. never had to mess with fortran until i switched to NE
4/1/2011 8:40:40 PM