Installing G95 under Windows FAQMost problems encountered by new users when installing g95 in Windows are solved by setting the
PATHand the correct environment variable for your package, either
- How do I use the Control Panel to edit PATH and add environment variables?
- Will g95 conflict with gfortran?
- unrecognized option `'--sysroot='
- cannot exec 'f951':
- cannot exec 'as':
- Is the g95 directory too deep in PATH?
- _spawnvp: Invalid argument
- ld: crt2.o: No such file:
- Why does g95 need environment variables?
- Where is g95?
- Did you run the installer?
Q. 1. How do I use the Control Panel to edit PATH and add environment variables?
A. See the discussion at: http://vlaurie.com/computers2/Articles/environment.htm
Q. 2. Will g95 conflict with gfortran?
package instead. It uses G95_LIBRARY_PATH to find its library files instead of
LIBRARY_PATH. This does not interfere with either gfortran or gcc.
Q. 3. I installed g95-MinGW-41.exe but when I compiled my code the process stopped
with the message:
ld: unrecognized option `'--sysroot='
2. Try adding the g95 directory (i.e., c:\g95\bin; c:\g95\lib\gcc-lib\i686-pc-mingw32\4.1.2;) at the beginning of your PATH environment variable. If that fails, delete g95 entirely, and reinstall. Answer "yes" to all the dialogues during the install.
Q. 4. I executed the g95 installer on my XP Home system. Everything installed fine but the compiler complained with the message:
g95: installation problem, cannot exec 'f951': Invalid argument
2. If it still fails, try copying f951.exe from its \g95\lib\gcc-lib\i686-mingw32\4.x.x\ location to \g95\bin
Q. 5. I installed g95-MinGW -41.exe on XP Pro. The environment variables are correctly set. I got the error:
g95: installation problem, cannot exec 'as': Invalid argument
Q. 6. I can't get g95 to work. My Path= ... lots of stuff and then ...;c:\g95\bin;C:\g95\lib\gcc-lib\i686-pc-mingw32\4.1.2;
2. Add G95_LIBRARY_PATH to your user set of environment variables and set it to point to \g95\lib;\g95\lib\gcc-lib\i686-mingw32\4.1.2
Q. 7. I installed g95-MinGW-41.exe and compiled "g95 test.f".
It produced the error message:
g95: _spawnvp: Invalid argument
SETX G95_LIBRARY_PATH c:\g95\lib;c:\g95\lib\gcc-lib\i686-mingw32\4.1.2 /m
The /m parameter sets these values for all users. Exit and start a new CMD window. Check whether the PATH and G95_LIBRARY_PATH environment variables are set correctly by typing:
ld: crt2.o: No such file: No such file or directory
If the problem persists, copy copy the *.o and *.a files in g95\lib\ to:
2. If you downloaded the g95-MinGW-41.exe package, add G95_LIBRARY_PATH to your user set of environment variables and set it to point to: \g95\lib;\g95\lib\gcc-lib\i686-mingw32\4.1.2\
If the problem persists, copy the *.o and *.a files in g95\lib\ to:
Q. 10. I tried installing g95, and now I can't see it. Where is it?
A. Are you sure you downloaded the correct file? Try downloading from:
You can "save" the file on your computer somewhere, then find it in Windows Explorer, click on it to run the installer. It will give you several options in pop-up windows, including one to select an install directory. Try selecting c:\g95 as the install directory. There are three directories created in c: \g95, bin, doc, and lib. You will find some additional information in the doc directory. Please consult the README.txt file.
If you are looking for an icon on your desktop, there won't be one. After running the installer, you have to open a CMD window to use g95. You can do this by clicking on Start, Run. Or, in Vista you can right-click on any folder while holding down the shift key, and select "Open Command Window Here" in the menu.
Q. 11. I clicked the link http://ftp.g95.org/g95-MinGW.exe, and I saved the program in a folder under C:/. Then I clicked "run" at the start menu. I typed "g95." Then it shows me the message:
'g95' is not recognized as an internal or external command, operable program or batch file'