View previous topic :: View next topic |
Author |
Message |
John23 n00b
Joined: 15 Dec 2004 Posts: 11
|
Posted: Thu Dec 16, 2004 12:18 am Post subject: How do I get g77 (fortran) ? |
|
|
I have compiled gcc with USE=+fortran and there is no g77 executable. How do I get gentoo to install the g77/f77 compilers?
Details: I have sys-devel/gcc-3.3.4-r1 installed. The complete list of flags is " +X -bootstrap -build -debug +fortran -gcj -hardened -multilib +nls -objc -pic -static (-uclibc) "
I want g77 in order to run SciPy.
Thanks,
John |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Thu Dec 16, 2004 1:08 am Post subject: |
|
|
are you sure you don't have a g77 compiler?
after compiled it, have you done
Code: |
env-update
source /etc/profile
|
? _________________ "I'm just very selective about the reality I choose to accept." -- Calvin |
|
Back to top |
|
|
Akhouk Guru
Joined: 23 May 2003 Posts: 476 Location: The Two Niles, Africa
|
Posted: Thu Dec 16, 2004 1:10 am Post subject: |
|
|
try USE="f77" as some versions of gcc use f77 and others fortran. The one you need for your listed version is f77
Code: |
# equery uses =sys-devel/gcc-3.3.4-r1
[ Searching for packages matching =sys-devel/gcc-3.3.4-r1... ]
[ Colour Code : set unset ]
[ Legend : Left column (U) - USE flags from make.conf ]
[ : Right column (I) - USE flags packages was installed with ]
[ Found these USE variables for sys-devel/gcc-3.3.4-r1 ]
U I
- - static : !!do not set this during bootstrap!! Causes things to be statically linked instead of dynamically
+ + nls : <unknown>
- - bootstrap : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used during original system bootstrapping
- - build : !!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping.
+ - X : Adds support for X11
- - multilib : On 64bit systems, if you want to be able to compile 32bit and 64bit binaries
- - gcj : Build gcj (java compiler included with gcc package)
+ - f77 : <unknown>
- - objc : Build support for the Objective C code language
- - pic : Build Position Independent Code. Needed for prelink or the hardened toolchain
- - hardened : activate default security enhancements for toolchain (gcc, glibc, binutils)
- - uclibc : Enable uclibc specific patches and build or link uclibc
- - debug : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too
- - debug : Tells configure and the makefiles to build for debugging. Effects vary across packages, but generally it will at least add -g to CFLAGS. Remember to set FEATURES=nostrip too
|
_________________ AMD 64 3500+, 2Gb RAM DDR400, 2 x 180Gb SATA, 256Mb Nvidia |
|
Back to top |
|
|
codergeek42 Bodhisattva
Joined: 05 Apr 2004 Posts: 5142 Location: Anaheim, CA (USA)
|
Posted: Thu Dec 16, 2004 1:23 am Post subject: |
|
|
The 'fortran' USE flag only becomes useful with GCC 3.4, if I remember correctly... _________________ ~~ Peter: Programmer, Mathematician, STEM & Free Software Advocate, Enlightened Agent, Transhumanist, Fedora contributor
Who am I? :: EFF & FSF |
|
Back to top |
|
|
John23 n00b
Joined: 15 Dec 2004 Posts: 11
|
Posted: Thu Dec 16, 2004 1:54 am Post subject: No Joy |
|
|
Thanks for the suggestions.
I tried the same equery command and it reported fortran not f77 as the USE flag! I tried re-emerging anyway adding USE=f77 and still no g77/f77.
etc-update reports nothing left to do.
Any other ideas? |
|
Back to top |
|
|
rhill Retired Dev
Joined: 22 Oct 2004 Posts: 1629 Location: sk.ca
|
Posted: Thu Dec 16, 2004 4:16 am Post subject: |
|
|
gcc-config -l
? |
|
Back to top |
|
|
John23 n00b
Joined: 15 Dec 2004 Posts: 11
|
Posted: Thu Dec 16, 2004 4:26 am Post subject: |
|
|
Code: |
# gcc-config -l
[1] i686-pc-linux-gnu-3.3.4 * |
Regards,
John |
|
Back to top |
|
|
rhill Retired Dev
Joined: 22 Oct 2004 Posts: 1629 Location: sk.ca
|
Posted: Thu Dec 16, 2004 4:37 am Post subject: |
|
|
hrm, i thought we might turn up a second unused copy.
and you're right, it is USE=fortran for gcc 3.3.4-r1, at least in the current ebuild. it must have changed.
do you have slocate emerged? could you try a updatedb and then locate g77?
Code: | dirtyepic / $ locate g77
/usr/bin/g77
/usr/i686-pc-linux-gnu/gcc-bin/3.4.3/g77
/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3/man/man1/g77.1.gz
/usr/share/gcc-data/i686-pc-linux-gnu/3.4.3/info/g77.info.gz
dirtyepic / $ locate f77
/usr/libexec/gcc/i686-pc-linux-gnu/3.4.3/f771
|
|
|
Back to top |
|
|
John23 n00b
Joined: 15 Dec 2004 Posts: 11
|
Posted: Thu Dec 16, 2004 6:13 am Post subject: I have some g77 files, just not the right ones |
|
|
Code: |
# locate f77
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/f771
/usr/lib/blas/f77-ATLAS
/usr/lib/lapack/f77-ATLAS
/usr/include/octave-2.1.57/octave/f77-fcn.h
# locate g77
/usr/i686-pc-linux-gnu/gcc-bin/3.3/g77
/usr/i686-pc-linux-gnu/gcc-bin/3.3/i686-pc-linux-gnu-g77
/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man/man1/g77.1.gz
/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info/g77.info.gz
/usr/share/vim/vim63/compiler/fortran_g77.vim
|
The above made me hope that the g77 file was merely misplaced. This hope evaporated when I found that, although the .../gcc-bin/3.3/* files have the same names as the executables, they are not even the same size as the real executables. For example:
Code: |
# ls -alt /usr/bin/gcc /usr/i686-pc-linux-gnu/gcc-bin/3.3/gcc
-rwxr-xr-x 1 root root 7536 Dec 15 17:42 /usr/bin/gcc
-rwxr-xr-x 1 root root 95024 Dec 15 17:42
/usr/i686-pc-linux-gnu/gcc-bin/3.3/gcc
|
Regards,
John |
|
Back to top |
|
|
Akhouk Guru
Joined: 23 May 2003 Posts: 476 Location: The Two Niles, Africa
|
Posted: Thu Dec 16, 2004 8:34 am Post subject: |
|
|
So...it seems that g77 is on your system just that somehow the paths or environment variables are mucked up.....
What is the contents of your /etc/env.d/05gcc file?
Does ldoconfig -v give any errors? _________________ AMD 64 3500+, 2Gb RAM DDR400, 2 x 180Gb SATA, 256Mb Nvidia |
|
Back to top |
|
|
rhill Retired Dev
Joined: 22 Oct 2004 Posts: 1629 Location: sk.ca
|
Posted: Thu Dec 16, 2004 8:46 am Post subject: |
|
|
actually, i see mine is the same.
Code: | -rwxr-xr-x 1 root root 7440 Dec 9 01:21 /usr/bin/gcc
-rwxr-xr-x 1 root root 90860 Dec 7 07:25 /usr/i686-pc-linux-gnu/gcc-bin/3.4.3/gcc |
ok, here we go. i noticed that /usr/bin/gcc -v would give me 3.4.3 and i have both 3.4.3 and 3.3 installed. so on a hunch, i did a gcc-config to switch to 3.3 and now i have:
Code: | -rwxr-xr-x 1 root root 7440 Dec 16 02:17 /usr/bin/gcc
-rwxr-xr-x 1 root root 90860 Dec 7 07:25 /usr/i686-pc-linux-gnu/gcc-bin/3.4.3/gcc |
notice the timestamp. now /usr/bin/gcc -v gives me version 3.3. so in other words, it's some kind of link to whatever compiler you set with gcc-config. i bet that for some reason when you added fortran, gcc-config did not create a link for g77 in /usr/bin. in fact, i don't have a g77 in /usr/bin anymore, but it reappears when i gcc-config back to 3.4.3.
it really seems like this is a gcc-config fsckup. maybe try using the latest masked version and see if that works. that's what i'm using anyways. failing that, if /usr/i686-pc-linux-gnu/gcc-bin/3.3/g77 -v works for you, maybe adding /usr/i686-pc-linux-gnu/gcc-bin/3.3/ to your path in /etc/profile would do it.
good luck. |
|
Back to top |
|
|
John23 n00b
Joined: 15 Dec 2004 Posts: 11
|
Posted: Thu Dec 16, 2004 7:16 pm Post subject: |
|
|
Code: |
# cat /etc/env.d/05gcc
PATH="/usr/i686-pc-linux-gnu/gcc-bin/3.3"
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/3.3"
MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man"
INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info"
CC="gcc"
CXX="g++"
LDPATH="/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4"
|
ldconfig -v generated much output but no errors.
I explored the issue of the /usr/bin/ files a little more. They appear to be
duplicates:
Code: |
# cmp /usr/bin/cc /usr/bin/cpp
# cmp /usr/bin/cc /usr/bin/c++
# cmp /usr/bin/gcc /usr/bin/i686-pc-linux-gnu-gcc_
|
So, I tried:
Code: |
# cp -i /usr/bin/c++ /usr/bin/g77
# cp -i /usr/bin/c++ /usr/bin/i686-pc-linux-gnu-g77
|
Scientific Python, which had failed previously for lack of g77, now compiles.
Thanks much! |
|
Back to top |
|
|
preston n00b
Joined: 11 Jun 2005 Posts: 2
|
Posted: Sat Jun 11, 2005 2:44 pm Post subject: "slotted gcc" might explain missing g77 support |
|
|
I also tried to get g77 working, since it didn't work after emerge gcc with USE="fortran". Then I found this discussion.
Now I think I can explain why the fortran compiler may be missing by default. It is due to "slotted" gcc. My interpretation of "slotted" is that the gcc package exists in several versions in parallell. When I emerged gcc with USE="fortran ..." I got a new slotted version of gcc with g77 support, but the system was still using the old gcc version!
I discovered that the old gcc version was active by a coincedence when I gave the command:
I found the explanation why the old gcc was still in use in this forum about slotted gcc:
https://forums.gentoo.org/viewtopic-t-347608.html
You can find out which gcc version is in use, and if it is slotted by:
Code: | # gcc-config -l
[1] i686-pc-linux-gnu-3.3.6 *
[2] i686-pc-linux-gnu-3.3.6-hardened
[3] i686-pc-linux-gnu-3.3.6-hardenednopie
[4] i686-pc-linux-gnu-3.3.6-hardenednopiessp
[5] i686-pc-linux-gnu-3.3.6-hardenednossp
[6] i686-pc-linux-gnu-3.4.4
[7] i686-pc-linux-gnu-3.4.4-hardened
[8] i686-pc-linux-gnu-3.4.4-hardenednopie
[9] i686-pc-linux-gnu-3.4.4-hardenednopiessp
[10] i686-pc-linux-gnu-3.4.4-hardenednossp
|
In this case gcc is slotted (2 versions), and the "*" character tells which version is used by default, the older version without g77 support!
You can switch to the new gcc version with:
Code: | # gcc-config -f i686-pc-linux-gnu-3.4.4
* Switching to i686-pc-linux-gnu-3.4.4 compiler ... [ ok ] |
Update your environment with:
Code: | # source /etc/profile |
I am not sure if gcc is slotted if only one version is shown by "gcc-config -l". It might be a good idea to run "gcc-config -f" in any case to make sure that the newly built gcc with g77 support is in use by the system.
Hopefully you will have g77 in your PATH now, as well as manpage for g77. At least it worked for me.
By other words, no need to fiddle with new symbolic links or copy files. Most likely you need to run "gcc-config -f".
As an extra bonus you might get a newer C/C++ compiler.
Good luck with your Fortran programming!
John23 wrote: | Code: |
# cat /etc/env.d/05gcc
PATH="/usr/i686-pc-linux-gnu/gcc-bin/3.3"
ROOTPATH="/usr/i686-pc-linux-gnu/gcc-bin/3.3"
MANPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man"
INFOPATH="/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info"
CC="gcc"
CXX="g++"
LDPATH="/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4"
|
ldconfig -v generated much output but no errors.
I explored the issue of the /usr/bin/ files a little more. They appear to be
duplicates:
Code: |
# cmp /usr/bin/cc /usr/bin/cpp
# cmp /usr/bin/cc /usr/bin/c++
# cmp /usr/bin/gcc /usr/bin/i686-pc-linux-gnu-gcc_
|
So, I tried:
Code: |
# cp -i /usr/bin/c++ /usr/bin/g77
# cp -i /usr/bin/c++ /usr/bin/i686-pc-linux-gnu-g77
|
Scientific Python, which had failed previously for lack of g77, now compiles.
Thanks much! |
|
|
Back to top |
|
|
appetitus Apprentice
Joined: 28 Sep 2003 Posts: 210
|
Posted: Sat Feb 07, 2015 8:22 am Post subject: |
|
|
Currently, g77 appears to have been renamed 'gfortran' and no longer handles my fortran source.
Some youngster probably forced a change to the latest code version, but the reason for fortran being around this long is all the old code written to 'ancient' version -- in my case a simple $ALIAS no longer works. _________________ Being a Gentoo user means living in a house inhabited by a family of crazed carpenters. When you wake up, the house is different. Maybe there is a new turret, or some walls have moved, or perhaps someone has removed the floor under your bed. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Wed Apr 15, 2015 1:55 pm Post subject: |
|
|
I too desire f77, for some old games I want to play that I found. They don't work with the new gfortran, and the makefile has f77 mentioned all over the place. |
|
Back to top |
|
|
|