[csw-users] fortran broken in gcc4?

James Lee james at opencsw.org
Tue Aug 11 18:31:32 CEST 2009


On 28/07/09, 13:56:50, gerard <ghenry at cmi.univ-mrs.fr> wrote regarding
[csw-users] fortran broken in gcc4?:

> hello all,

Hello to the very few people that use FORTRAN.


> i'm unable to compile a fortran program with gcc4:
> % gcc couleur_mod.f95
> gcc: error trying to exec 'f951': execvp: No such file or directory


> Here the packages installed:
> % pkginfo | grep CSWgcc4
> application CSWgcc4core gcc4core - GNU C Compiler
> application CSWgcc4corert gcc4corert - GNU C Compiler
> Run Time
> application CSWgcc4g++rt gcc4g++rt - GNU C++
> Compiler Run Time
> application CSWgcc4g95 gcc4g95 - GNU FORTRAN Compiler
> application CSWgcc4g95rt gcc4g95rt - GNU FORTRAN 95
> Compiler Run Time

Assuming you have gcc4 v4.3.3, remove CSWgcc4g95 and CSWgcc4g95rt and
install CSWgcc4gfortran and CSWgcc4gfortranrt.

gcc4g95 are from the previous gcc4 collection, either the name
shouldn't have changed or there should be some empty replacement
packages to remove the old files with special depends to install
the new packages are transparently.


$ pkginfo | grep CSWgcc4
application CSWgcc4core          gcc4core - GNU C Compiler
application CSWgcc4corert        gcc4corert - GNU C Compiler Run Time
application CSWgcc4g++           gcc4g++ - GNU C++ Compiler
application CSWgcc4g++rt         gcc4g++rt - GNU C++ Compiler Run Time
application CSWgcc4gfortran      gcc4gfortran - GNU Fortran Compiler
application CSWgcc4gfortranrt    gcc4gfortranrt - GNU Fortran Compiler
Run Time




Using the new packages I've just compiled a antique piece of code
- which has sections for Univacs and PDP-10s and used punch tapes
for "mass" storage - and I had I did have some other problems.

gcc3 and SunPRO both compiled fine.

Using /opt/csw/gcc4/bin/gcc as the compiler fails to link, trivial
example:

$ gcc main.f
Undefined                       first referenced
 symbol                             in file
main
/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/crt1.o
_gfortran_transfer_character        /tmp/ccUr3kjw.o
_gfortran_st_write                  /tmp/ccUr3kjw.o
_gfortran_set_options               /tmp/ccUr3kjw.o
_gfortran_st_write_done             /tmp/ccUr3kjw.o
ld: fatal: Symbol referencing errors. No output written to a.out


Use gfortran as the compiler.
export FC=/opt/csw/gcc4/bin/gfortran

$ gfortran main.f

but there is no RPATH to the FORTRAN lib:


$ ./a.out
ld.so.1: a.out: fatal: libgfortran.so.3: open failed: No such file or
directory
zsh: killed     ./a.out


$ LD_LIBRARY_PATH=/opt/csw/gcc4/lib ./a.out
 hello from the past

better workaround is to set -R/opt/csw/gcc4/lib on link but obviously
the package needs fixing properly.





James.



More information about the users mailing list