LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. (https://www.linuxquestions.org/questions/linux-software-2/g77-in-gcc-4-1-0-not-found-only-gfortran-fortran-95-compiler-i-need-fortran-77-a-423430/)

TheBrick 03-10-2006 04:21 AM

g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77.
 
Hello, time for stupid questions again. I downloaded gcc-4.1.0.tar.bz2 from the GNU project website so I could get the fortran complier which are not in the stock version of gcc with SUSE 10.0. Accourding to the doumentation
" The full distribution includes the C, C++, Objective-C, Fortran 77, Fortran (in case of GCC 4.0 and later), Java, and Ada (in case of GCC 3.1 and later) compilers".
However after I have installed gcc I only seem to have gfortran which is a fortran 95 compiler and I need fortran 77. I am guessing now that although I downloaded what I belive is the full version I will have to download an exstra bit. In older versions of gcc e.g 3.3.6 there is a gcc-g77 component to download but only a fortran component for 4.1.0. Does this mean I will have to build an old version of gcc? Ihave looked in the documentation but can't find any other refereance to fortrann 77 compilation other than g77.

The documentation also states that
"If you also intend to build binutils (either to upgrade an existing installation or for use in place of the corresponding tools of your OS), unpack the binutils distribution either in the same directory or a separate one. In the latter case, add symbolic links to any components of the binutils you intend to build alongside the compiler (bfd, binutils, gas, gprof, ld, opcodes, ...) to the directory containing the GCC sources."

Is this what I will have to do if I wich to add g77, if so could some one please explain this paragraph as I do not realy understand it and what bit I sould download. I am running SUSE 10.0 if that is important. I know this is proibibly a solution which is stairing me in the face but I don't understand why I do not seem to have the fortran 77 compiler.

Thanks for your time.

drkstr 04-02-2006 05:12 PM

gcc-g77 is separate from gcc and was probably not included with the gcc 4.* "group" because it has not been recently updated. Just get the one from the older release of gcc and it should work just fine.

regards,
...drkstr

richardash1981 08-16-2006 07:01 AM

The g77 project is dead, so there will be no more releases, only the 3.x versions already out there. Fortran 95 compilers should be capable of compiling fortran 77 code, so you should be able to use either gfortran or (I find it works better, although more work to install) g95

tethysgods 07-04-2007 06:39 AM

getting it running
 
Yes, g77 is no longer supported as of version 4.

If you want to mix C and fortran and still use g77, download
a gcc-3.4.6 tarball. If your gcc-4.something is in /usr/bin
do a configure --prefix=/usr/local so as not to overwite it.
(It is the default anyhow, but just in case...) and the usual make
and (as root) make install.

Then do

export PATH=$PATH:/usr/local/bin

ln -s /usr/local/bin/gcc gcc2

so when you do gcc2 --version you see you pick up the right one.

You also need

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

If you decide on gfortran, download a tarball. This unpacks the whole thing into a directory called irun, there is no intallation to do.
So, if you move the tarball (as root of course) to say /etc, and unpack it there you will need

export PATH=$PATH=/etc/irun/bin

and add /etc/irun/lib to the library path as above


All times are GMT -5. The time now is 02:20 PM.