Re: Getting g77 running on my Macintosh MacBook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would suggest that if you are going to be doing much of this, go out and buy a book on working in a command line environment, or google, or whatever your pref is.  The reason you must specify the full path is because the executables you are trying to run are not in your path environmental variable.

that said...

> 
> I downloaded g77 into a MacBook I purchased in December because I have some old FORTRAN programs (f77) that want to compile and run.  The tar file was downloaded to my Desktop, where I decompressed it.  When I tried to run it in my terminal window, I discovered that I can only get it to execute if I specify the full path /Users/ebel/Desktop/usr/local/bin/g77.  Using that command, I was able to compile one of my Fortran programs.  However, when I tried to execute the program I created, I could not do so.  I found I could start the execution by specifying the full path name (i.e., /Users/ebel/Documents/HAZARD/eqriskCampbl1.exe), but the code did not run.  I got the error message
I would guess that you need to do some installation of the items you downloaded.  I know nothing about g77 so I don't know what exactly you have, but clearly the package was meant to be installed in /usr/local/bin (for executables) and /usr/local/lib for the lib's.  Look around the package for some kind of install tool.  Barring that, copy everything from /Users/ebel/Desktop/usr/local/bin/ into /usr/local/bin and the same for the lib's, etc.  That will put both the g77 executable and the dylib in a place where the system looks for such things.

To run your own executables you will need to specify the full path, or be in the same directory and prepend the executable name with '.' (a period), or move it to a known path location.  Type "echo $PATH " in terminal to get a list of known path locations.

> 
> dyld: Library not loaded: /usr/local/lib/libg2c.0.dylib
>  Referenced from: /Users/ebel/Documents/HAZARD/eqriskCampbl1.exe
>  Reason: image not found
> Trace/BPT trap
If you don't want to install things properly (or can't) you can set the environmental variable DYLD_LIBRARY_PATH to the location of the dylib before you execute your code and the loader will look there first.  So if you are using bash (stock terminal shell):
DYLD_LIBRARY_PATH=/Users/ebel/Desktop/usr/local/lib (or where ever libg2c.0.dylib is located)

good luck

alan


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux