Re: Installing g95 on OS X

From: Dave Seaman (dseaman_at_no.such.host)
Date: 10/19/04


Date: Tue, 19 Oct 2004 21:59:40 +0000 (UTC)

On Tue, 19 Oct 2004 20:52:29 GMT, Gordon Sande wrote:

> Dave Seaman wrote:
>>>>Maybe I just need another cup of coffee, but after 20+
>>>>years of unix development(?), why is it so hard to
>>>>install a $%^&ing compiler?

>>>Good question!

>> Agreed. But not all compilers require such fiddling. Commercial-quality
>> compilers tend to come with fancy installers that make the process
>> painless.

> Painless is exactly what I have observed for several things that
> I have installed on Mac Os X that are clearly Unix (as well as Mac).
> fink/gfortran did not make it into that company.

Agreed. I was thinking more of CodeWarrior. Compilers tend to be more
complicated to install than most other products.

>>>I followed the recipe given for gfortran and found

>>>0. I can only sudo fink ... from my admin account and not my
>>> user account. Probably a good thing in the large except
>>> I though the sudo/password fuss was intended to avoid
>>> the the extra fuss.

>> Using the 'sudo' command gives you root privileges. Do you want everyone
>> on your machine to have root privileges? Maybe you have no other users
>> to worry about, but the whole idea is that user accounts are for those
>> who have only user privileges and no admin or root privileges.

> SUDO requires that the sysadmin set up files so that the user gives his
> account/password and proceeds. Mac Os X authentication asks for an
> admin account/password and then proceeds. Much slicker. SUDO wants
> someone to vouch for the user in advance and then for the user to
> give a good account of himself. I have the impression that the usual
> hack is to preapprove everyone for everything. Mac Os X authenticate
> wants to hear about an admin account/password on the spot. Less
> intrusive and less prone to the global bypass. SUDO makes sense
> for admin of 100 user machines as in time shared Unices of yore.
> Makes much less sense for a single user desktop microcomputer
> where admin/user is more to prevent accidents.

You have a point, but perhaps that's part of what Apple had in mind when
they implemented fast user switching in Panther. I just run everything
on an admin account, since that is what I am used to in the Unix
environment, and therefore it is not a problem.

>>>1. I needed to fiddle a low level file because FINK was
>>> not set to use UNSTABLE packages "out of the box".
>>> The fix was in the FAQ under "Why doesn't it work"!
>>> And there was some sort of problem with the path
>>> settings for fink so it was /sw/bin/fink instead of
>>> just fink.

By that last statement I take it you mean that /sw/bin was not in your
PATH. But it should be, starting the first time you open a new Terminal
window after installing fink. Either that, or something went wrong with
the fink installation. The stable/unstable business has nothing to do
with that at all.

>> If fink fixed up your shell initialization to add /sw/bin to your PATH,
>> which it should do by default, then all you need to do is open a new
>> Terminal window and then use the fink command. It will work from that
>> point on. The fink installer should have checked for that and printed a
>> message about your shell initialization.

> fink "out of the box" uses STABLE. One has to fiddle some file to get
> it to look at UNSTABLE. Since gfortran is UNSTABLE one seems to be
> told that it is not ready for prime time. The fink recipe as given
> was for use with UNSTABLE and not as it arrives.

That has nothing to do with what I was talking about. I also use
UNSTABLE, but my paths are fine. I use "fink", not "/sw/bin/fink".
Is that the path problem you mean, or is there something else?

> The fink installation
> reports that it is having trouble with paths which seems a bit curious
> as it only has to deal with the Apple supplied Unix. Apple changed its
> mind about the default shell so other aspects of account configuration
> have undoubedly changed and the path problem goes with the territory.

When did you see this message about a "path problem"? Was it during the
fink installation, or was it later on when you tried to use a fink
command?

Fink looks at your shell startup file and attempts to patch it during the
installation in order set up your environment appropriately. Mine has
the statement

        if [ -f /sw/bin/init.sh ]
        then
                . /sw/bin/init.sh
        fi
        
which works in any of the Bourne-style shells (basically, anything other
than csh or tcsh). If fink successfully patched your startup file like
this, then you only need to open a new Terminal window in order to have
/sw/bin and /sw/sbin in your PATH. If you don't see a statement like
that, you will need to add it manually. See the fink documentation for
instructions.

>>>2. The results have some sort of conflict between the Apple's
>>> supplied X11 and the older do-it-yourself X11. The fixes
>>> suggested in the diagnostics appear to do nothing. Why
>>> does a compiler require X11?

>> The compiler doesn't require X11, but some fink packages depend on X11.
>> You can't get fink to build those packages unless you have X11 installed
>> and configured as fink expects. Other fink packages are not affected.

>>> Why does having the Apple
>>> supplied Aqua compatible X11 grind things to a halt?

>> It's been a while since I looked at this, but I think you just need to
>> install the X11 SDK from the system install disks (it's an optional
>> install) and fink should be happy.

> Open Office plays nicely with Apple's X11. Why do the other
> folks get upset with it? You are right that one has to install
> it separately and that is exactly what fink/gfortran was so unhappy
> to find. Installing the Aqua X11 is a double click and authenticate
> painless exercise. Likewise Xcode. etc

Install what separately? Do you mean the optional X11 SDK from the Apple
installation disks? If you installed that, then I don't know what the
problem is, since I installed using "sudo fink install gfortran" and it
installed successfully. There were no complaints about Apple's X11. Try
the following command:

[gemini:dseaman] $ fink list system-xfree86
Information about 3921 packages read in 1 seconds.
 i system-xfree86 2:4.3-2 [placeholder for user installed x11]
 i system-xfree... 2:4.3-2 [placeholder for user installed x11 devel...
 i system-xfree... 2:4.3-2 [placeholder for user installed x11 share...

If you don't see the three letter "i"'s in column 2, indicating that
those three packages are installed, then perhaps your Apple packages are
not properly installed.

[gemini:dseaman] $ fink describe system-xfree86
Information about 3921 packages read in 1 seconds.

system-xfree86-4.3-2: [placeholder for user installed x11]
 This package represents a pre-existing installation
 of X11 on your system that is not installed through
 Fink.
 .
 If it shows as not installed, you likely need to
 install the X11User and/or X11SDK packages from
 Apple, or a similarly-compatible version. For more
 information, please see the FAQ entry on X11
 installation at:
 .
   http://fink.sourceforge.net/faq/usage-packages.php#apple-x11-wants-xfree86

 .
 Web site: http://fink.sourceforge.net/faq/usage-general.php#virtpackage

>>> (I am sure that if I wanted to be a full time sysadmin
>>> the answer would be interesting but ...). Apple's slick
>>> X11 arrived circa Os X.3 and the fink scripts are probably
>>> older so I will have to wait for the fixes to work their way
>>> through the system.

>>>So now I do not have gfortran and I am reinforced in the notion
>>>that if and only if I fiddled full with Unix/Open Software/etc
>>>would I be able to get it to work. I will leave the explanation
>>>of why a compiler needs X11 as one of the great mysteries of the
>>>universe. It is clear that fink has a lot of ingenuity behind it
>>>as does gfortran, but at the end of the session all I have is a
>>>lot of wasted disk space that I may get around to clearing out.

>> Some fink packages require X11 and some do not. That's a feature of the
>> individual packages, not of fink or of the compiler. If a program
>> expects to display things in X windows when you run it, then it's going
>> to need access to X11 headers and libraries when you build it.

> The fink installation scripts for gfortran are the things that want
> an X11 and object to the existing one supplied by Apple. Net result
> is that after
> "sudo fink install gfortran"
> there is no gfortran after the reams and reams of compilations of
> various X11 pieces. The only reason that makes sense to me fo the X11
> stuff is that someone is trying to be helpful and it has backfired
> badly. Perhaps gfortran only works for versions of Mac Os X that are
> earlier than the version that came preinstalled. Not a helpful
> situation.

Fink gets finicky sometimes. I had a package that repeatedly failed to
update on one Mac, although it was fine on another. I finally deleted
that package and rebuilt from scratch, and it succeeded.

All I can say is that "sudo fink install gfortran" worked without a hitch
for me, and I use Apple's X11. Look at your fink output from the
commands I listed above and see what looks different.

You might also try the following:

        sudo fink selfupdate
        sudo fink update-all

-- 
Dave Seaman
Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling.
<http://www.commoncouragepress.com/index.cfm?action=book&bookid=228>


Relevant Pages

  • Re: Installing g95 on OS X
    ... If fink fixed up your shell initialization to add /sw/bin to your PATH, ... The compiler doesn't require X11, but some fink packages depend on X11. ... install the X11 SDK from the system install disks (it's an optional ...
    (comp.lang.fortran)
  • Re: Is Maxima available for OS X?
    ... If you installed maxima via fink, you surely must have configured X11 ... One thing to watch for is that you may need to install the X11.sdk from your system install disks in order to provide all the pieces that fink may require. ... - launch xmaxima ...
    (sci.math.symbolic)
  • [Fink] Problem installing gcc 4 for Fink 0.8.1
    ... The Fink installer barfed at first, ... After you do this you can install other packages. ... Under Mac OS X 10.4.7, Fink must be bootstrapped or updated with gcc ...
    (comp.sys.mac.apps)
  • Re: Fink Vs Darwinports
    ... a loss I wended my way over to the Darwinports web site instead. ... I now have a basic install, and I have a couple of packages in there. ... Not as neat as Fink for sure, ...
    (uk.comp.sys.mac)
  • Re: gfortran: OK, I quit, you win
    ... >> TEX is available under a different set of packaging. ... I quickly found TeX ... > fink and so just installed the fink copy, ... > install, I'll do differently. ...
    (comp.lang.fortran)