Code Comments
Programming Forum and web based access to our favorite programming groups.Hi, I'm attempting to install g95 on OS X (Jaguar), but being a complete Darwin newbie, I really don't understand the instructions that go with it. What does it mean by saying "G95 and friends expect to live under /tmp/g95"? Does that mean I have to move files around into some new directory that I've created? Can I do this in the GUI? I'm actually quite scared of poking around in Darwin because I was once told that I could completely wreck it if I didn't know what I was doing... I'd be really grateful if anyone can help me out here. Thanks! Nat
Post Follow-up to this messagesebire@hotmail.com (Nat) writes: I don't know anything about the particular g95-related question you asked, but... > I'm actually quite scared of poking around in Darwin because I was > once told that I could completely wreck it if I didn't know what I was > doing... Somebody appears to have oversensitized you to this. While it is true, the same thing is true of pretty much every operating system out there. Proofs by demonstration exist. I have first-hand evidence of this on both Windows-based and Unix systems. :-( It happens that I haven't completely trashed any of my Macs, but I certainly know ways that it could happen. Probably the only thing that has "saved" me is that I've only been using them for about a year and a half I think it has been. I have trashed some apps, but not the whole system...yet. I've trashed my Windows boxes several times. Heck, it has been argued (with some merit) that one should rebuild a Windows box from scratch about every other year anyway in order to remove "cruft" that will have accumulated. Unix boxes tend to be harder in that it tends to take symin permission for most ways of trashing them. But I sy
min several. :-( The usual (and very good) advice is to keep separate accounts for daily use and for sy
min stuff. OS X is a Unix box, well at least for current purposes, and the same caveat applies. The only way in which I might say it was particularly easy to wreck it is that most people will set themselves up so that the account they use for daily use has sy
min privileges. Doesn't have to be that way, but that's how most systems are (because it's what happens by default if you don't set it up otherwise). But your typical Windows box has the same kind of setup. Most other Unix boxes aren't set up like this... but the added danger is when you *AREN'T* intentionally using the system privileges. As soon as you are intentionally doing sy
min work, you have the same kinds of potential problems. If you are really worried, it would be a lot more constructive to make 2 accounts - one for daily use and one for sy
min - than to be afraid of ever touching the machine. I did that for a while... but got lazy. In any case, have backups. No matter what. No matter what OS or how you use it. I've sympathized with no end of people who lost huge amounts of work because they thought they didn't need backups (or most often, just didn't think about it at all). Usually sympathy is about all I can offer. Yep, some of them were on Macs. It is probably a corollary of Murphy's law that the only people who don't need backups are the people who do them... but it is worth doing the backups just to make sure that you won't need them. :-) If you are going to be quite a scared of touching the system as you describe, then I shouldn't tell you that I've trashed a Windows/Linux (dual-boot) system by just touching the keyboard without even depressing a key. :-( Darned static electricity. Fried the keyboard controller, which meant a new motherboard. -- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
Post Follow-up to this messageOn 18 Oct 2004 15:05:34 -0700, Nat wrote: > Hi, I'm attempting to install g95 on OS X (Jaguar), but being a > complete Darwin newbie, I really don't understand the instructions > that go with it. What does it mean by saying "G95 and friends expect > to live under /tmp/g95"? Does that mean I have to move files around > into some new directory that I've created? Can I do this in the GUI? > I'm actually quite scared of poking around in Darwin because I was > once told that I could completely wreck it if I didn't know what I was > doing... > I'd be really grateful if anyone can help me out here. Thanks! Do you really need g95 rather than gfortran? Both are f95 compilers, but gfortran is easier to install on the Mac. If you have fink installed, all y ou need to do is type sudo fink install gfortran and let it build. See <http://fink.sourceforge.net> if you need to install fink. This assumes that you have Apple's Developer Tools (known as Xcode in Panther) already installed. You may be able to install a prebuilt binary us ing the apt-get command (that's not necessarily available for all fink products, and I haven't tried it). If you really need g95, then you need to know that there are some standard locations that are recognized by all versions of Unix and Linux (including Darwin): /tmp Temporaries. It's ok to place files here, but you should understand that they may be deleted the next time you reboot. Why they would insist on having a symbolic link in /tmp is beyond me. /usr/local Traditionally a place to install things that are not provided as part of the operating system. For example, you could create a directory /usr/local/g95-install by untaring the distribution file. To install in /usr/local you will need to use the 'sudo' command, which give s you root access for a single command. You will probably also want to create a /usr/local/bin directory if you don't have one yet, and place a symbolic lin k g95 in that directory as described in the INSTALL file. You also need to ma ke sure /usr/local/bin is in your PATH, where PATH is a shell variable that controls where the shell looks for executable programs that you call from th e command line. If the preceding paragraph looks like gibberish to you, you may want to consider installing fink and using gfortran instead, since more of the proce ss is automated when you go that route. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/i...book&bookid=228>
Post Follow-up to this message> > > On 18 Oct 2004 15:05:34 -0700, Nat wrote: > To get the g95 binary working do the following: 1) Download g95-powerpc-osx.tgz and put it in /tmp 2) type: su in a shell, it will ask you for the admin password.. type it in. 3) type: cd /tmp 4) type: tar -zxf g95-powerpc-osx.tgz 5) type: ln -s /tmp/g95-install/bin/powerpc-apple-darwin6.8-g95 /usr/local/bin/g95 all this in one line. It makes a link from /usr/local/bin/g95 to the compiler binary in /tmp/ so you can just type g95 to compile something. 5) type: exit 6) type: g95 -c myprog.f90 where myprog.f90 is some simple program (make sure you are in the directory where the program lives). If it produces an a.out file you are golden. If it doesn't let me know and it means that /usr/local/bin isn't in your path... if that is the case which I doubt e-mail again and I'll give you directions (/usr/local/bin is a pretty standard dir for a user account on *NIX machines and should be in your path by default). The reason why you should untar the file in /tmp is that the compiler thinks all its important libraries are there so it can link them at compile time. If you don't put it in /tmp you will have to tell the compiler where they are using environmental variables.. so my suggestion is to simply use /tmp... when the compiler is complete I'm sure a better directory will be chosen. Cheers, Jason
Post Follow-up to this messageOn Tue, 19 Oct 2004 00:10:25 GMT, Jason Nielsen wrote: > To get the g95 binary working do the following: > 1) Download g95-powerpc-osx.tgz and put it in /tmp > 2) type: su > in a shell, it will ask you for the admin password.. type it in. That won't work unless you have gone to the trouble of enabling root logins, a procedure that is definitely not recommended on the Mac. For one thing, it's rather difficult to undo, once done. Instead of 'su' you should use a command like sudo bash where you may substitute your favorite shell for 'bash', if desired. You will be asked for your account password. You must be running under an account that has admin privileges for this to work. From here on until you type 'exit' you will see '#' as your prompt, which is a reminder that you are running with root privileges and therefore you should carefully verify each command you type before you press <return>. > 3) type: cd /tmp > 4) type: tar -zxf g95-powerpc-osx.tgz This is not quite what the INSTALL file recommends. I suggest using the following instead: 3) cd /usr/local 4) tar -zxf /tmp/g95-powerpc-osx.tgz and then type the following (this is between steps 4 and 5): ln -s /usr/local/g95-install /tmp/g95 > 5) type: ln -s /tmp/g95-install/bin/powerpc-apple-darwin6.8-g95 /usr/local/bin/g95 > all this in one line. It makes a link from /usr/local/bin/g95 to the > compiler binary in /tmp/ so you can just type g95 to compile something. First you should make sure the directory /usr/local/bin exists. It doesn't on a stock Macintosh: mkdir -p /usr/local/bin Next, you should modify the command 5) to specify a path beginning with /usr/local in place of /tmp: 5) ln -s /usr/local/g95-install/bin/powerpc-apple-darwin6.8-g95 /usr/local/b in/g95 That's supposed to be all on one line. > 5) type: exit After this you are no longer running with root privileges. > 6) type: g95 -c myprog.f90 Assuming you have a fortran program in the file myprog.f90 in your current directory. If you see a response like "g95: command not found" at this point, it means you need to add /usr/local/bin to your PATH. The exact method for doing that depends on your shell. If you are using bash, you can add the line export PATH=/usr/local/bin:$PATH to the file .bash_profile in your home directory (or create a new file by that name if it doesn't exist). From that point on, each new Terminal window that you open will have your PATH initialized so that g95 can be found. > where myprog.f90 is some simple program (make sure you are in the > directory where the program lives). If it produces an a.out file you are > golden. If it doesn't let me know and it means that /usr/local/bin isn't > in your path... if that is the case which I doubt e-mail again and I'll > give you directions (/usr/local/bin is a pretty standard dir for a user > account on *NIX machines and should be in your path by default). > The reason why you should untar the file in /tmp is that the compiler > thinks all its important libraries are there so it can link them at > compile time. If you don't put it in /tmp you will have to tell the > compiler where they are using environmental variables.. so my suggestion > is to simply use /tmp... when the compiler is complete I'm sure a better > directory will be chosen. I don't see how you can count on /tmp/g95-install staying put after the next reboot. I installed in /usr/local/g95-install and then placed a symbolic link in /tmp, as described in the INSTALL file. It works fine. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/i...book&bookid=228>
Post Follow-up to this messageDave Seaman wrote: > On 18 Oct 2004 15:05:34 -0700, Nat wrote: > > > Do you really need g95 rather than gfortran? Both are f95 compilers, but > gfortran is easier to install on the Mac. If you have fink installed, all > you need to do is type g95 is far more complete than gfortran.
Post Follow-up to this messagesebire@hotmail.com (Nat) writes: | Hi, I'm attempting to install g95 on OS X (Jaguar), but being a | complete Darwin newbie, I really don't understand the instructions | that go with it. What does it mean by saying "G95 and friends expect | to live under /tmp/g95"? Does that mean I have to move files around | into some new directory that I've created? Can I do this in the GUI? | I'm actually quite scared of poking around in Darwin because I was | once told that I could completely wreck it if I didn't know what I was | doing... no it means you can have the actual g95 files anywhere, but that you need to make a symbolic link from /tmp/g95 to that directory. since everyone are allowed to write to /tmp, you can install g95 without needing to be the system administrator, root or whatever it is called in the OS X world. so the quickest way to install g95 are 1) open the terminal application 2) download g95 and install in current directory with this command line: wget -O - http://www.g95.org/g95-powerpc-osx.tgz | tar xvfz - 3) ln -s $PWD/g95-install /tmp/g95 finally to make an alias for the compiler in the current directory 4) ln -s /tmp/g95/bin/i686-pc-linux-gnu-g95 ./g95 you may now invoke g95 with ./g95 Helge
Post Follow-up to this messageDave Seaman <dseaman@no.such.host> writes: | Files in /tmp are automatically cleaned out at boot time, as is standard | practice on Unix boxes. The reason it's called "tmp" is to serve as | a so what. most programs need some initialization of the environment, in g95's case the only thing you need to make it work all the time is to set a symlink to the install directory. this can trivially be done in .bashrc or similar init script. the point is that you can install g95 without having to fiddle around as the sym... Helge
Post Follow-up to this message> Files in /tmp are automatically cleaned out at boot time, as is standard > practice on Unix boxes. The reason it's called "tmp" is to serve as a > warning that everything you put there is temporary. The code for the > cleanup on the Mac is in the file /etc/rc.cleanup. Keep in mind that > /tmp on a Macintosh is a symbolic link to /private/tmp: > This certainly isn't true at least not on my FreeBSD box (adding clear_tmp_enable="YES" to rc.conf will do the trick) or my Linux boxes. I use /tmp all the time to dump cruft that I'm not sure I want to delete. That Mac uses /etc/rc.cleanup to remove stuff in /tmp does not make deleting the contents of /tmp standard. Granted if you are using a long running server it might be good practice to run a cron job once a month to clean out /tmp but that is a different matter! So the instructions I gave in fact work just fine on the *NIX boxes I have... none of which is a Mac.. and for that I agree my instructions were a bit off ... just trying to help. Cheers, Jason
Post Follow-up to this messageOn Tue, 19 Oct 2004 06:40:50 GMT, Jason Nielsen wrote: > This certainly isn't true at least not on my FreeBSD box (adding > clear_tmp_enable="YES" to rc.conf will do the trick) or my Linux boxes. I > use /tmp all the time to dump cruft that I'm not sure I want to delete. > That Mac uses /etc/rc.cleanup to remove stuff in /tmp does not make > deleting the contents of /tmp standard. Granted if you are using a long > running server it might be good practice to run a cron job once a month to > clean out /tmp but that is a different matter! So the instructions I gave > in fact work just fine on the *NIX boxes I have... none of which is a > Mac.. and for that I agree my instructions were a bit off ... just trying > to help. Most of the Unix/Linux boxes that I deal with are running the Portable Batch Server (PBS) for scheduling long jobs, and on those machines it is standard practice to clean out /tmp each time a job finishes -- not just at boot time. Regardless of the exact policy in effect, it is sheer madness to consider the contents of /tmp to be anything other than temporary. If you want to keep it, put it in /usr/local, unless your local policy designates a different directory for that purpose. A permanent directory, that is. -- Dave Seaman Judge Yohn's mistakes revealed in Mumia Abu-Jamal ruling. <http://www.commoncouragepress.com/i...book&bookid=228>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.