Reputation: 113
Currently I'm running the gfortran compiler in my computer. But I'm just wondering if I'm able to install the fortran compiler in my flash drive. That way I can run fortran anywhere else without installing the compiler into the main computer. I try to search in Google but I'm not able to find a solution to it. Does that mean that I'm not able to do it just like any other compiler??
Edited: Sorry currently I'm using Window 7 to run the Fortran Compiler. But I may run the compiler in Window Vista or XP if I'm able to install the compiler in my flash drive.
The flash drive size is 8 GB. I used about half of it already.
Thank you very much!
Upvotes: 1
Views: 1815
Reputation: 191
I don't know much about gfortran which I just use on the HPC(Linux OS) but I think u cna give g95 a try.
I simply copy the whole directory to some place and I wrote a .bat file to set the path, it works.
The only problem is , that program can not know where is the HOME dir.
my files:
D:\bin\g95>tree
卷 D: 的文件夹 PATH 列表
卷序列号为 00000200 5E6C:35EF
D:.
├─bin
├─doc
└─lib
└─gcc-lib
└─i686-pc-mingw32
└─4.1.2
D:\bin\g95>tree /f
卷 D: 的文件夹 PATH 列表
卷序列号为 00000200 5E6C:35EF
D:.
├─bin
│ a.exe
│ ar.exe
│ as.exe
│ b.f
│ b.zip
│ f.dat
│ g95.exe
│ h.ctl
│ h.grd
│ ld.exe
│ mingwm10.dll
│ ranlib.exe
│ rm.dat
│ strip.exe
│ ua.dat
│ uc.dat
│ va.dat
│ vc.dat
│ za.dat
│ zc.dat
│
├─doc
│ bg.gif
│ COPYING.txt
│ docs.html
│ g95.bmp
│ G95Manual.pdf
│ Readme.html
│ README.txt
│
└─lib
│ crt1.o
│ crt2.o
│ dllcrt2.o
│ libadvapi32.a
│ libgdi32.a
│ libkernel32.a
│ libm.a
│ libmingw32.a
│ libmingwex.a
│ libmoldname.a
│ libmsvcrt.a
│ libshell32.a
│ libuser32.a
│ libws2_32.a
│
└─gcc-lib
└─i686-pc-mingw32
└─4.1.2
cc1.lnk
f951.exe
libf95.a
libgcc.a
and my setg95.bat file:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;d:\bin\g95\bin;d:\bin\vim\vim63;d:\bin\bin;
SET LIBRARY_PATH = d:\bin\g95\lib
set G95_LIBRARY_PATH=d:\bin\g95\lib
d:
rem under win32 :
rem g95 -ffree-form -fendian=big -o readv3 readv3.f
cmd
Upvotes: 0
Reputation: 5644
A flash drive is not an operating system. A compiler is simply a computer program, which itself has been compiled for a certain operating system. So you can put the compiled binary for a given operating system on a flash drive and execute it from the flash drive, but every computer that you use it on would have to be running the same operating system. If this solution does not work for you, you could look into making a bootable flash drive (which is an entire operating system hosted on a flash drive) and installing a Fortran compiler on that.
I hope this helped.
--- EDIT ---
After seeing your edit, it is very possible that you could install a compiler on your flash drive and then use it on other Windows 7 Machines or other compatible Windows machines. It is probably as simple as setting the installation directory to the flash drive during the time of installation, as long as the compiler doesn't rely on any registry values.
Upvotes: 5