has anyone ported g77?


As the subject says - has anyone ported g77 (part of the gcc) compiler package. I downloaded gcc from http://www.gnu.org as well as the new config files for darwin and discovered that gcc is not supported in the 2.95 release (meaning more work than just compiling I guess). I have ported f2c, but it really isn't a substitute as I have code that specifically warns not to use f2c as it will not work. If anyone has gotten gcc to compile that alone will help - the I suppose I can hack out how to compile g77.
I have already downloaded the developer tools. The cc is "based" upon gcc (an old version). They did not port g77, although g++, objective c, and c are there. Unfortunately, I have a large fortran program to compile...
There is a FORTRAN to C converter which tons of FORTRAN programmers use every day. In fact there is even a mac version somewhere.

People have found it works better than g77.
I assume you are referring to f2c from bell laboratories (available from netlib). I have already ported that. You are correct in stating that many people use it, but it is somewhat more fragile than a true fortran compiler (not sure how good g77 is) and in particular in this case as the application is for X11 drivers in a graphics package and f2c is specifically sited as being inadequate, I am looking for something better.
yes, the page http://www-jlc.kek.jp/~fujiik/macosx/memo/index.html is an excellent resource... but
these pages describe how to get g77 etc going
on the macosx Public Beta, not the actual release...

i spent a weekend trying to follow those instructions
anyway and could compile many of the packages, but
i was unable in the end to get gcc w/ g77 to compile
all the way. i got very close, as far as the ld step
near the end, but not all the way... and then i
had to move onto other things...

i'm keeping an ear to the ground though so to speak,
as actual g77 on macosx would also help me... take care....


Sorry to hear that g77 did not work --at this time at least! I do not have a mac and thus I cannot attempt to do anything on it, but since te problem is with ld it could be that either libraries are missing or libraries have been relocated in OSX Final. I am pretty sure that K Fujii will tackle that before Apple release an (official) g77 port...


I think I was having the same problem you are. Try copying the libg2c.a file from /usr/local/lib to /usr/lib. My guess is that somehow ld couldn't find it. Now, problem, I can compile a simple program but it chokes on one using the sqrt function?? Missing math library?


If compilation (linking to be precise) fails when using a function from the math library, it is because you did not use 'g77 -lm' to force linking with the math library libm (math library is not linked by default).

If "it chokes" means a runtime error there is something seriously wrong with compilation of g77...

Great! I hope that Apple follow this thread. I find it a bit unacceptable that basic tools such as FORTRAN compilers are ported to OSX faster by individuals who all they want is to do their job -- which was not to port the compiler in the first place...
I just did that and when I try to compile it tells me:

f77: installation problem, cannot exec `f771': No such file or directory

Anybody got any clue?
Originally posted by monty
nope wasn't the -lm.

I emailed the guy who ported it and he said the binary I downloaded was the public beta version. The one that works with the final is the one that says cvs..... anyway here's the link http://www-jlc.kek.jp/~fujiik/macosx/tgz/gcc-cvs20010413-with-g77-bin.tar.gz

Just su to root and untar it at / and presto full gcc. It works well.


I tried this, and everything worked beautifully--that is, until I tried to use some of the Fortran functions that would be found in the math library. For example, when I tried to use the function "sin" I got the following error message:


/usr/bin/ld: /var/tmp/ccAHaaaa.o has external relocation entries in non-writable section (__TEXT,__text) for symbols:


A colleague who has tried the same thing has received similar messages.

Does anyone have any idea what to do about this? It looks as though the math library is in a read-only folder. I've e-mailed the person in Japan who posted the link for the gcc-with-g77 download, but I haven't yet received a response, since my e-mail was sent when it is the middle of the night over there.