f2c

Chris Jones jonesc at hep.phy.cam.ac.uk
Sun Apr 22 05:01:07 PDT 2012


Hi,

Also, you could run

 > sudo port select gcc mp-gcc46

That will make MacPorts gcc 4.6 compiler your default compiler suite. This will make 'gcc' point to the same consistent version as the fortran compiler. Having done this, you could also use just 'export F77=gfortran'

Finally, if you don't want gcc 4.6, you can pick any of the other compiler versions and do the same sort of thing.

cheers Chris

On 22 Apr 2012, at 12:55pm, Chris Jones wrote:

> Hi,
> 
> I think you might be going about trying to install this the wrong way. ratfor appears to only need f2c, if it cannot find a working fortran compiler, so you just need to give it one. By default it searches for 'f77', but you can change this by setting the environment variable F77. S0..
> 
> 1. Install a MacPorts fortran compiler. For instance 'gcc46'. 
> 
>> sudo port install gcc46
> 
> This provides the compiler 'gfortran-mp-4.6', so then all you need is
> 
> Chris-Jones-Macbook-Pro ~/Downloads/ratfor-1.01 > export F77=gfortran-mp-4.6 
> Chris-Jones-Macbook-Pro ~/Downloads/ratfor-1.01 > ./configure 
> loading cache ./config.cache
> checking for a BSD compatible install... /opt/local/bin/ginstall -c
> checking whether build environment is sane... yes
> checking whether make sets ${MAKE}... yes
> checking for working aclocal... found
> checking for working autoconf... found
> checking for working automake... found
> checking for working autoheader... found
> checking for working makeinfo... found
> checking for gawk... gawk
> checking for gcc... gcc
> checking whether the C compiler (gcc  ) works... yes
> checking whether the C compiler (gcc  ) is a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether gcc accepts -g... yes
> checking whether the Fortran 77 compiler (gfortran-mp-4.6  ) works... yes
> checking whether the Fortran 77 compiler (gfortran-mp-4.6  ) is a cross-compiler... no
> checking whether we are using GNU Fortran 77... yes
> checking whether gfortran-mp-4.6 accepts -g... yes
> checking for a BSD compatible install... /opt/local/bin/ginstall -c
> checking whether ln -s works... yes
> checking whether make sets ${MAKE}... (cached) yes
> checking how to run the C preprocessor... gcc -E
> checking for ANSI C header files... yes
> updating cache ./config.cache
> creating ./config.status
> creating Makefile
> creating config.h
> Chris-Jones-Macbook-Pro ~/Downloads/ratfor-1.01 > 
> 
> Chris
> 
> On 22 Apr 2012, at 5:56am, Phil Dobbin wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> On 22/04/2012 01:12, Ryan Schmidt wrote:
>> 
>>> On Apr 21, 2012, at 15:30, Phil Dobbin wrote:
>>> 
>>>> On 21/04/2012 19:49, Ryan Schmidt wrote:
>>>> 
>>>>> On Apr 21, 2012, at 08:14, Phil Dobbin wrote:
>>>>> 
>>>>>> I'm trying to use f2c to compile ratfor but there's no fort77
>>>>>> script so I'm getting:
>>>>>> 
>>>>>> `checking for f2c... f2c checking whether the Fortran 77 compiler
>>>>>> (f2c  ) works... no configure: error: installation or
>>>>>> configuration problem: Fortran 77 compiler cannot create
>>>>>> executables.`
>>>>>> 
>>>>>> Any workarounds to this or shall I just go grab a tarball?
>>>>> 
>>>>> 
>>>>> Can you give a reproduction recipe? What files did you download and
>>>>> what commands did you run to try to compile ratfor with f2c?
>>>> 
>>>> As I understand it, f2c is a fortran77-to-c source code translator
>>>> which obviates the need for a Fortran compiler but should contain a
>>>> fort77 script in order to function correctly.
>>>> 
>>>> I installed ratfor on Debian using apt-get & so I checked the package
>>>> list & then went here:
>>>> 
>>>> <http://www.webmo.net/support/fortran_osx.html>
>>>> 
>>>> & grabbed a copy of g77 & then it installed fine. There was no ratfor
>>>> port but I thought I'd grab f2c for which there was a port as my build
>>>> set-up is based almost wholly on the ports in /opt/local minus Apple's
>>>> dev tools of course.
>>>> 
>>>> I'm guessing the problem was the fort77 script but of course may be
>>>> completely wrong...
>>> 
>>> I'm still unsure how to reproduce the problem on my system. Can you provide a list of steps I should follow so that I would see the same error you saw?
>> 
>> $ cd src
>> $ src tar -zxvf ratfor.xxx.tar.gz
>> $ cd ratfor.xxx
>> $ ratfor.xxx ./configure
>> $ creating cache ./config.cache
>> checking for a BSD compatible install... /opt/local/bin/ginstall -c
>> checking whether build environment is sane... yes
>> checking whether make sets ${MAKE}... yes
>> checking for working aclocal... found
>> checking for working autoconf... found
>> checking for working automake... found
>> checking for working autoheader... found
>> checking for working makeinfo... found
>> checking for gawk... gawk
>> checking for gcc... gcc
>> checking whether the C compiler (gcc  ) works... yes
>> checking whether the C compiler (gcc  ) is a cross-compiler... no
>> checking whether we are using GNU C... yes
>> checking whether gcc accepts -g... yes
>> checking for g77... no
>> checking for f77... no
>> checking for f2c... f2c
>> checking whether the Fortran 77 compiler (f2c  ) works... no
>> configure: error: installation or configuration problem: Fortran 77
>> compiler cannot create executables.
>> 
>> Cheers,
>> 
>> Phil...
>> 
>> - -- 
>> But masters, remember that I am an ass.
>> Though it be not written down,
>> yet forget not that I am an ass.
>> 
>> 	Wm. Shakespeare - Much Ado About Nothing
>> 
>> 
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
>> Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>> 
>> iQEcBAEBAgAGBQJPk49pAAoJEKpMeDHWT5ADfu4H/1n0Y1KJ7sj/7ccfI+4Cuycm
>> 8eFYOYwkLBunTToXERy9wiIsWhBMZoPtoJJqeEEZll77eHD1bzMgjAZE+qU8Upvp
>> cI+Dmjey5BfPGXkY5UVtYGALoYUfikyBZ+xUn8mdRiKXzNPv6BZ7rFOsHWCYgJyJ
>> q1K9KDM/BJ2Y/7+MkZPVavonRFALTTsfJ6DT+fY49T4+qEZgvlNwpynEvmN6lPsi
>> h9/fBte/YZorXUqEmuV3AgAbDcWojggMoBCTVnfnIvhzNX4jjn/AenOPHewtsJv3
>> F7OSLPZlhsnaPjy2GY0RZF70PPi8bNVOp3anJAr25JAoPuPfrQSUPeWGYds6sDs=
>> =rEpn
>> -----END PGP SIGNATURE-----
>> 
>> _______________________________________________
>> macports-users mailing list
>> macports-users at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
> 
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2966 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120422/564e6885/attachment.bin>


More information about the macports-users mailing list