HINTS ON USING THE LINUX SYSTEM IN ITS (Information Technology Services) Last revised 25 August 2015 by J F Harper, SMS, VUW. ITS has a Linux x86_64 machine with various compilers and other useful software on it, called miro = vuwunicosas0002.ods.vuw.ac.nz = 10.40.0.14 (which changed on 9 July 2015). Warning 1: Only the software I use myself appears in the notes below. (But I do use emacs, which is not described here because it is used the same way as usual. There are a lot of LaTeX files on miro in directory /opt/matlab/sys/tex/latex but can one use LaTeX outside Matlab on miro?) Warning 2: I access ITS machines only from ECS/SMS machines, and the only operating system I use is Linux. I have tested nothing I say below in any other environment, but I have tested it all on ECS/SMS/ITS machines. If anything below needs changing for you, let me know, preferably by email to john.harper@vuw.ac.nz please. LOGGING ON TO MIRO Before you can log on to a machine in ITS you must get a userid from them. If ITSuser means your userid on miro and you want to log on from a non-ITS Linux system, use ssh -l ITSuser -p 10 miro.vuw.ac.nz PASSWORD REQUIREMENTS When you need a new ITS password you'll have to invent one with at least 8 characters, some lower case, some upper, and at least one number. TRANSFERRING FILES TO/FROM ITS The scp command transfers files either way between miro and a machine in ECS/SMS. Whenever I want to download to miro from further afield I download to an ECS/SMS machine first and from there to miro. If your ITS userid is ITSuser and the file is called ITSfile on miro but is nonITSfile on the other machine called nonITSmachine (e.g. circa.ecs.vuw.ac.nz), on which your userid is nonITSuser, then for nonITSmachine -> miro use this on nonITSmachine: scp -P 10 nonITSfile ITSuser@miro.vuw.ac.nz:ITSfile or this on miro: scp -P 22 nonITSuser@nonITSmachine:nonITSfile ITSfile for miro -> nonITSmachine use this on nonITSmachine: scp -P 10 ITSuser@miro.vuw.ac.nz:ITSfile nonITSfile or this on miro : scp -P 22 ITSfile nonITSuser@nonITSmachine:nonITSfile In all four cases you may be asked for your password on the machine you're not logged on at. I prefer to transfer files TO the machine I'm logged on at rather than FROM it because it's then easier to check if an existing file might be overwritten. (That's not defeated by set -o noclobber, and it's a pity that scp seems to have no noclobber option. Or am I showing my Linux-ignorance?) Those scp commands include -P followed by a port number. You need that if the machines you are sending files between have different port numbers. To check that, enter printenv SSH_CLIENT or printenv SSH_CONNECTION from each machine. The output should consist of several numbers, the last of which is the port number to use when logged on to the other machine. Example: if I log on to circa, the output of printenv SSH_CLIENT ends with 22 but if I log on to miro, it ends with 10. The workstation on my desk is cayley.msor.vuw.ac.nz but neither SSH_CLIENT nor SSH_CONNECTION is defined there. However both are defined on circa, and all the files I have on cayley are automatically accessible from circa (without needing to use scp). To transfer files to or from a device e.g. USB "stick" or CD plugged into cayley while you're logged on to miro, you must find what directory it uses. The nonITSfile will be in that directory, which may be /media or /run/media or something else. It's a good idea to backup your more useful ITS files to somewhere else yourself. More than once I have inadvertently deleted some files from an ITS machine and found out the hard way that ITS's own backup system was either slow (once it took 2 weeks to get files back) or not working properly. FORTRAN COMPILERS ON MIRO For Fortran 77, 90, 95, with some of the 2003 and 2008 extensions, listing the latest versions of gfortran and g95 first: gfortran 6.0.0 Aug 2015 invoked by the command /opt/gcc-6.0/bin/gfortran -fno-use-linker-plugin but your LD_LIBRARY_PATH must also include /opt/gcc-6.0/lib64:/usr/local/lib For a simple way to get it automatically when needed, see ALIASES below. gfortran 5.1.0 Apr 2015 invoked by the command /opt/gf5/bin/gfortran but your LD_LIBRARY_PATH must also include /opt/gf5/lib64 or you will get error messages about missing libraries when you try to run programs. For a simple way to get it automatically when needed, see ALIASES below. gfortran 4.4.7 Mar 2012 invoked by the command gfortran or f95 g95 0.94 Jan 2013 invoked by the command /opt/g95-0.94/bin/g95 g95 0.92 Jun 2009 invoked by the command /opt/g95/g95-install/bin/x86_64-unknown-linux-gnu-g95 Oracle (Sun) f95 12.3 Nov 2011 invoked by the command /opt/oracle/solarisstudio12.3/bin/f95 Intel Fortran 15.0.0 dated 2015 is invoked by the command ifort. It takes a couple of minutes to compile even a short program. For Fortran 77 with a few later enhancements: g77 3.4.6 Apr 2006 invoked by the command g77 Watcom f77 1.9 Jun 2010 is said to be invoked by the command /opt/watcom/f77/binl/wfc386 but I haven't managed to make it work. (It will produce from a Fortran program ending with .f a file ending with .o but that won't run. It seems not to be for Linux systems.) ALIASES to simplify using those compilers To avoid typing very long commands I set up and use aliases. For example, on miro I copied /etc/skel/.bashrc to my own .bashrc file whose last line was then # User specific aliases and functions After that line I inserted the following lines in my own .bashrc file. Each alias line is one line in that file even if some of them look like more in this copy of it. alias gf6=' LD_LIBRARY_PATH=/opt/gcc-6.0/lib64:/usr/local/lib ; /opt/gcc-6.0/bin/gfortran -fno-use-linker-plugin ' alias gf5=' export LD_LIBRARY_PATH=/opt/gf5/lib64 ; /opt/gf5/bin/gfortran ' alias gf4='gfortran ' alias g95='/home/harperj1/G9586/g95-install/bin/x86_64-unknown-linux-gnu-g95' alias sun='/opt/oracle/solarisstudio12.3/bin/f95' alias watcom='/opt/watcom/f77/binl/wfc386' Note: you may not now have to do that because some of the aliases are already in /etc/profile and you may not need any that aren't. However, if you don't, you may get old versions of some of them. I download new versions of g95 and gfortran every now and then, especially when told that bugs I reported myself have been fixed. Unfortunately, g95 has had no work done on it since 2013. Warning: downloading and installing your own g95 is fairly straightforward but gfortran is another matter: it is complicated, and it uses lots of disk space (about 4 Gb) and time (over 2 hours) while you're installing it from source. When you have finished, you will find that a lot of those 4 Gb of files are no longer needed. I test that by renaming their directories and seeing if programs will still compile and run. If they do then I remove them. If you install gfortran from a binary version, you may need extra options you didn't previously know about when using it. See the details on gf6 above for an example. With the aliases above in force, I need only type, for example, sun programname.f90 instead of /opt/oracle/solarisstudio12.3/bin/f95 programname.f90 (The alias sun is there simply because various computers get you various different compilers if you just ask for f95.) PGPLOT ON MIRO You have to use a gfortran compiler. It copes happily with programs written in Fortran 77 (but if they disobey anything in the f77 standard, expect error or warning messages), or in Fortran 90 or f5, and with some of the extra features introduced in 2003 and 2008. Being more recent, gf5 has implemented more of those extra features than gf4, and gf6 has implemented even more. However, many f77 programs use "vendor extensions" to Fortran that are not mentioned in the f77 standard, and those programs won't compile with gfortran unless they happen to be OK by the f95 standard. I am willing to try and help f77 users whose programs used to compile but now won't. But I am not privy to every version of Fortran implemented by every compiler-writer ever since 1957 when the first Fortran compiler appeared... If the aliases mentioned above are in force, and your program is called pgtest.f, you can compile it with either gf4 pgtest.f -L/usr/local/pgplot -lpgplot -lX11 or gf5 pgtest.f -L/usr/local/pgplot -lpgplot -lX11 or gf6 pgtest.f -L/usr/local/pgplot -lpgplot -lX11 and if that worked OK, run it with the command ./a.out If it made a Postscript picture called pgtest.ps you can view that with gs pgtest.ps or evince pgtest.ps Both gave me strange error messages but showed the right picture. Note: the documentation suggests you may have to give the variable PGPLOT_DIR the value /usr/local/pgplot but I didn't need to. -- John Harper, School of Mathematics Statistics and Operations Research Victoria University, PO Box 600, Wellington 6140, New Zealand e-mail john.harper@vuw.ac.nz phone (+64)(4)463 5276 fax (+64)(4)463 5045