Example of installation jana2000

Showing also troubles that usually do not occur

Conventions:

this is a comment
this is a command
this is a console output
[localhost:~] admin% is the prompt of the user "admin"
[localhost:~] root# is the prompt of the user "root"
Instead of "~" we can see the current directory if it is different of the user's root directory.

Logging as the root

[localhost:~] admin% sudo su
Password: (type the password of admin)
[localhost:/Users/admin] root# (now we are logged as the root, i.e. with the write permission to any file or directory)

Is g77 available?

The following commands show the situation when g77 is not available or it is not included in the path to executables
[localhost:~] root# g77
tcsh: g77: Command not found.(The reply "No input files" would mean that g77 is available)
[localhost:~] root# whereis g77
[localhost:~] root# which g77

In the next attempt we search the whole file system for g77
[localhost:~] root# find / -name g77
/sw/bin/g77
/sw/share/doc/g77

G77 was found in /sw/bin/g77. The reason why it cannot be started is that /sw/bin it is not in the path:
[localhost:/Users/admin] root# echo $path
/bin /sbin /usr/bin /usr/sbin

We can make g77 accessible by adding a symbolic link to /usr/bin (this is in the path) that points to /sw/bin/g77.
[localhost:/Users/admin] root# cd /usr/bin
[localhost:/usr/bin] root# ln -s /sw/bin/g77 g77
The ls command shows the new symbolic link in /usr/bin:
[localhost:/usr/bin] root# ls -l g77
lrwxr-xr-x 1 root wheel 11 12 May 14:42 g77 -> /sw/bin/g77
localhost:/] root# rehash
(this command recomputes the internal hash table of the contents of directories listed in the path environmental variable to account for new commands added)

Now g77 can be started from any directory. To test it we shall move out of /usr/bin.
[localhost:/Users/admin] root# cd /
[localhost:/] root# g77
g77: no input files
[localhost:/] root#

Is gcc available?

Use the same way to localize gcc compiler. This is usually available and in the path.

Are X11 development libraries and header files available?

X11 graphics library consists of two parts. The runtime part is used for displaying X11 graphics while the development part is used for compilation of programs that use X11 graphics. To make sure that the development part of X11 is installed we can look for the file Xlib.h.
[localhost:~] root# cd /usr/X11R6/include/X11/
[localhost:X11R6/include/X11] root# ls
Composite.h     PM              XKBlib.h        Xlib.h          Xutil.h
CompositeP.h    RectObj.h       XWDFile.h       Xlibint.h       ap_keysym.h
ConstrainP.h    RectObjP.h      Xalloca.h       Xlocale.h       bitmaps
Constraint.h    SM              Xarch.h         Xmd.h           cursorfont.h
Core.h          Shell.h         Xatom.h         Xmu             extensions
CoreP.h         ShellP.h        Xauth.h         Xos.h           fonts
DECkeysym.h     StringDefs.h    Xaw             Xos_r.h         keysym.h
HPkeysym.h      Sunkeysym.h     Xcms.h          Xosdefs.h       keysymdef.h
ICE             Vendor.h        Xdefs.h         Xpoll.h         xpm.h
Intrinsic.h     VendorP.h       Xdmcp.h         Xproto.h
IntrinsicP.h    X.h             Xft             Xprotostr.h
Object.h        X10.h           Xfuncproto.h    Xresource.h
ObjectP.h       XF86keysym.h    Xfuncs.h        Xthreads.h
[localhost:X11R6/include/X11] root#
If Xlib.h is not present in /usr/X11R6/include/X11/ we can test for instance /usr/include/X11 and similar directories. We can also use the find command:
[localhost:/] root# find / -name Xlib.h
/usr/X11R6/include/X11/Xlib.h
[localhost:/] root#

(find command is very slow. However, File -> Find started from the graphical interface cannot be used as some system files are hidden for graphical interface)

Downoading installation of jana2000 by program ftp

The installation file jana2000Pack.exe can be downloaded from the jana2000 Web page using http protocol or from ftp.fzu.cz using program Fetch. However, it is useful to know that we can do the same from the command line. In this step a decision should be done about the directory where we want to install jana2000. In our example we shall install to Applications/jana2000 directory.
[localhost:/Applications] root# cd /Applications
(To install jana2000 into directory /Applications/jana2000 we have to download the installation file to /Applications)
[localhost:/Applications] root# ftp ftp.fzu.cz
Connected to dell006e.fzu.cz.
220-======================================================================= 
.... The welcome dialogue of the ftp server has been truncated ....
220-
220 
Name (ftp.fzu.cz:admin): anonymous
331 Please specify the password.	
Password: (press enter or your e-mail for the password)
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /pub/cryst/beta2000	
250 Directory successfully changed.
ftp> get jana2000Pack.exe
local: jana2000Pack.exe remote: jana2000Pack.exe
229 Entering Extended Passive Mode (|||17268|)
150 Opening BINARY mode data connection for jana2000Pack.exe (3160014 bytes).
100% |*******************************************|  3085 KB    1.56 MB/s    00:00 ETA
226 File send OK.
3160014 bytes received in 00:01 (1.54 MB/s)
ftp> quit
221 Goodbye.
[localhost:/Applications] root#

Compilation of jana2000

The compilation procedure creates directory jana2000 as a subdirectory of the current directory. In our case this will be /Applications/jana2000. After successful compilation this directory should contain the executable jana2000.

The compilation procedure is started by the command "source" under the UNIX shell (i.e. the command interpretor) called csh ot tcsh. For other shells "source" is not available. Therefore we have to determine if our current shell is csh or tcsh:
[localhost:/Applications] root# echo $SHELL
/bin/tcsh
Yes, it is tcsh. In case of other shells (sh, bash, ksh etc.) the shell csh or tcsh must be started prior to the next command. It can be done by typing command "csh" or "tcsh". If we start the new shell "csh" or "tcsh" it may happen that the current directory will change to the users'r root directory. In that case it shoud be changed back to /Applications.

Now we shall start the installation of jana2000.

[localhost:/Applications] root# source jana2000Pack.exe
>
           Jana2000
Crystallographic Computing System
              by
 Vaclav Petricek & Michal Dusek
 
****************************
* Installation of jana2000 *
****************************
Archive name: jana2000Pack.exe
 
This procedure will run the following steps:
1. Unpacking of Jana2000 
2. Detection of workstation type
3. Creation of the Makefile
4. Compilation of Jana2000
 
Do you want to continue? [y]	(enter or y means "yes")
Typing "quiet" assumes "yes" on all queries during the points 1-4
Enter
 
******   Directory jana2000 already exists *****
The installation procedure overwrites only JANA files.
The rest of the directory will not be changed.
Important: you will lose any special setting you might
 have set in your Makefile. This is standard installation. 
Do you want to continue installation? [y]
Enter
jana2000.tar.gz:         79.0% -- replaced with jana2000.tar
jana2000/source/contour.f
jana2000/source/datred.f
jana2000/source/dist.f
.... truncated ....
jana2000/source/fg/r2.fnt
jana2000/source/fg/sc1.fnt
jana2000/source/fg/sc2.fnt
jana2000/tmp/00readme.txt
jana2000/Makefile
jana2000/README.TXT
 
**** jana2000.tar.gz has been succesfully unpacked ***
 
**** The type of your workstation has been recognized as Darwin ***
Do you want to continue? [y]
Enter
 
**** The Makefile has been succesfully created ***
 
Do you want to start the compilation? [y]
Enter
Running testing compilation ... 
testing compilation passed		
 
***********
* prepare *
***********
Darwin - g77 compiler
32 bits compilation
testing dependencies on include files ....
testing dependencies on include files ....
testing dependencies on include files ....
 
***********
* contour *
***********	
 
**********
* datred *
**********
 
********
* dist *
********
 
***********
* editm40 *
***********
 
***********
* editm50 *
***********
 
**********
* editm9 *
**********
 
***********
* fourier *
***********
 
**********
* grapht *
**********
 
************
* jana2000 *
************
 
**********
* refine *
**********
 
**********
* pictur *
**********
Updating jlibrary.a .... 
ar: creating archive ../jlibrary.a
 
***********
* janalib *
***********
Updating jlibrary.a .... 
 
************
* crystlib *
************
Updating jlibrary.a .... 
 
**********
* pwdlib *
**********
Updating jlibrary.a .... 
 
********
* glib *
********
Updating jlibrary.a .... 
 
******
* fg *
******
ar: creating archive ../fg.a
 
Building jana2000 ... 
 
 
**** Jana has been succesfully compiled ***
 
The compilation can be repeated by command:
make   
executed in directory jana2000.
 
The executable jana2000 can be moved elsewhere if the directory 
jana2000 has not been moved. The compiled JANA remembers the path 
to jana2000. If the directory jana2000 has been moved, too, its new pathname
has to be defined in the environmental variable JANADIR.
 
Four testing examples are available in directory jana2000/test
 
 
 
Do you want to delete jana2000Pack.exe? [y]
Enter
exit
[localhost:/Applications] root#

Ownership and permissions

After the successful compilation it is good practice to change the ownership of all created files to be owned by some ordinary user, not root. Moreover, some files will need the write permission for all possible users of jana2000.

The permissions and ownership would not need to be changed if jana2000 would be installed by "admin" in the user space of "admin" and used afterwords only by "admin".

In the following command we display to which group belongs the user admin:
[localhost:/Applications] root# id -p admin
uid admin
groups staff admin

Now we change ownership of all files in the directory jana2000 and in all its subdirectories to "admin from the group staff"

[localhost:/Applications] root# chown -R admin:staff jana2000
[localhost:/Applications] root# ls -l jana2000	
total 152920
-rw-r--r--   1 admin  staff     44975 13 May 11:03 Makefile
-rw-r-----   1 admin  staff     45005 13 May 11:03 Makefile_sample
-rw-r-----   1 admin  staff      8111 12 Mar 18:39 README.TXT
-rw-r--r--   1 admin  staff       303 13 May 11:03 Xtest.log
-rw-r--r--   1 admin  staff    458168 13 May 11:06 contour.o
-rw-r--r--   1 admin  staff         0 13 May 11:34 crystlib.a
drwxr-xr-x  33 admin  staff      1122 13 May 11:04 d
-rw-r--r--   1 admin  staff    633520 13 May 11:10 datred.o
-rw-r--r--   1 admin  staff    236676 13 May 11:11 dist.o
-rw-r--r--   1 admin  staff    589956 13 May 11:14 editm40.o
-rw-r--r--   1 admin  staff    210672 13 May 11:15 editm50.o
-rw-r--r--   1 admin  staff    216380 13 May 11:16 editm9.o
-rw-r--r--   1 admin  staff   2290764 13 May 11:56 fg.a
-rw-r--r--   1 admin  staff    154732 13 May 11:17 fourier.o
-rw-r--r--   1 admin  staff         0 13 May 11:48 glib.a
-rw-r--r--   1 admin  staff    135628 13 May 11:18 grapht.o
-rwxr-xr-x   1 admin  staff  36003528 13 May 11:56 jana2000
-rw-r--r--   1 admin  staff  31752444 13 May 11:18 jana2000.o
-rw-r--r--   1 admin  staff         0 13 May 11:28 janalib.a
-rw-r--r--   1 admin  staff   4495612 13 May 11:48 jlibrary.a
-rw-r--r--   1 admin  staff       950 13 May 11:56 logfile
-rw-r--r--   1 admin  staff         0 13 May 11:25 pictur.a
-rw-r--r--   1 admin  staff         0 13 May 11:36 pwdlib.a
-rw-r--r--   1 admin  staff    984772 13 May 11:25 refine.o
drwxr-xr-x  43 admin  staff      1462 13 May 11:03 source
drwxr-xr-x  14 admin  staff       476 13 May 11:56 specific
drwxr-xr-x  18 admin  staff       612 13 May 11:03 test
drwxr-xr-x   3 admin  staff       102 13 May 11:03 tmp
[localhost:/Applications] root#

We want the read access to all users of the computer for all files in jana2000. This can
be done by command "chmod".
The command "chmod" is demonstrated in the form accepted by shells csh or tcsh. For instance, 
"chmod ugo+r" means "add the read permission (r) for the current user (u), members of the group 
the current user belongs to (g) and for all other users (o)".
[localhost:/Applications] root# chmod -R ugo+r jana2000
[localhost:/Applications] root# ls -l jana2000 
total 152920
-rw-r--r--   1 admin  staff     44975 13 May 11:03 Makefile
-rw-r--r--   1 admin  staff     45005 13 May 11:03 Makefile_sample
-rw-r--r--   1 admin  staff      8111 12 Mar 18:39 README.TXT
-rw-r--r--   1 admin  staff       303 13 May 11:03 Xtest.log
-rw-r--r--   1 admin  staff    458168 13 May 11:06 contour.o
-rw-r--r--   1 admin  staff         0 13 May 11:34 crystlib.a
drwxr-xr-x  33 admin  staff      1122 13 May 11:04 d
-rw-r--r--   1 admin  staff    633520 13 May 11:10 datred.o
-rw-r--r--   1 admin  staff    236676 13 May 11:11 dist.o
-rw-r--r--   1 admin  staff    589956 13 May 11:14 editm40.o
-rw-r--r--   1 admin  staff    210672 13 May 11:15 editm50.o
-rw-r--r--   1 admin  staff    216380 13 May 11:16 editm9.o
-rw-r--r--   1 admin  staff   2290764 13 May 11:56 fg.a
-rw-r--r--   1 admin  staff    154732 13 May 11:17 fourier.o
-rw-r--r--   1 admin  staff         0 13 May 11:48 glib.a
-rw-r--r--   1 admin  staff    135628 13 May 11:18 grapht.o
-rwxr-xr-x   1 admin  staff  36003528 13 May 11:56 jana2000
-rw-r--r--   1 admin  staff  31752444 13 May 11:18 jana2000.o
-rw-r--r--   1 admin  staff         0 13 May 11:28 janalib.a
-rw-r--r--   1 admin  staff   4495612 13 May 11:48 jlibrary.a
-rw-r--r--   1 admin  staff       950 13 May 11:56 logfile
-rw-r--r--   1 admin  staff         0 13 May 11:25 pictur.a
-rw-r--r--   1 admin  staff         0 13 May 11:36 pwdlib.a
-rw-r--r--   1 admin  staff    984772 13 May 11:25 refine.o
drwxr-xr-x  43 admin  staff      1462 13 May 11:03 source
drwxr-xr-x  14 admin  staff       476 13 May 11:56 specific
drwxr-xr-x  18 admin  staff       612 13 May 11:03 test
drwxr-xr-x   3 admin  staff       102 13 May 11:03 tmp
[localhost:/Applications] root#

For directory jana2000/test we need also the write access as it contains testing examples
[localhost:/Applications] root# chmod -R ugo+w jana2000/test
[localhost:/Applications] root# ls -l jana2000/test
total 1160
-rw-rw-rw-  1 admin  staff    5522 12 Mar 19:26 testa.m40
-rw-rw-rw-  1 admin  staff    3559 12 Mar 19:26 testa.m50
-rw-rw-rw-  1 admin  staff  178396 12 Mar 19:26 testa.m91
-rw-rw-rw-  1 admin  staff   60272 12 Mar 19:26 testa.res
-rw-rw-rw-  1 admin  staff    8152 12 Mar 19:26 testb.m40
-rw-rw-rw-  1 admin  staff    3670 12 Mar 19:26 testb.m50
-rw-rw-rw-  1 admin  staff   61136 12 Mar 19:26 testb.m91
-rw-rw-rw-  1 admin  staff   56511 12 Mar 19:26 testb.res
-rw-rw-rw-  1 admin  staff    3564 12 Mar 19:26 testc.m40
-rw-rw-rw-  1 admin  staff    2763 12 Mar 19:26 testc.m50
-rw-rw-rw-  1 admin  staff   17025 12 Mar 19:26 testc.m91
-rw-rw-rw-  1 admin  staff   30131 12 Mar 19:26 testc.res
-rw-rw-rw-  1 admin  staff    8334 12 Mar 19:26 testm.m40
-rw-rw-rw-  1 admin  staff    3670 12 Mar 19:26 testm.m50
-rw-rw-rw-  1 admin  staff   61136 12 Mar 19:26 testm.m91
-rw-rw-rw-  1 admin  staff   66692 12 Mar 19:26 testm.res
[localhost:/Applications] root#

Temporary directory

Jana2000 creates temporary files in the directory /tmp, /var/tmp or /scratch. If none of them exists or they don't have the write permission the temporary files are created in the user's root directory. In MacOSX /tmp and /var/tmp are symbolic links to the directory /private without the write access. Directory /scratch doesn't exist. A simple solution is to create /scratch with read and write permission for all users.
[localhost:/scratch] root# cd /
[localhost:/] root# ls -l 
(this shows that /scratch does not exist and /tmp, /var/tmp are mapped to 
/private without write access for all users)
total 428817
drwxr-xr-x   2 root      unknown         68  1 Apr  2002 ???Move&Rename
-rw-rw-rw-   1 root      admin        15364 12 May 15:49 .DS_Store
d-wx-wx-wt   2 root      admin           68  4 Dec  2001 .Trashes
. . . truncated . . .
lrwxr-xr-x   1 root      admin           11 10 May 19:33 tmp -> private/tmp
drwxr-xr-x  11 root      wheel          374 11 May 09:17 usr
lrwxr-xr-x   1 root      admin           11 10 May 19:33 var -> private/var
[localhost:/] root# mkdir scratch
[localhost:/] root# chmod ugo+w scratch
[localhost:/] root# ls -l  
(we should see /scratch with write permissions)
total 428817
drwxr-xr-x   2 root      unknown         68  1 Apr  2002 ???Move&Rename
-rw-rw-rw-   1 root      admin        15364 12 May 15:49 .DS_Store
d-wx-wx-wt   2 root      admin           68  4 Dec  2001 .Trashes
... truncated ...
drwxrwxrwx   2 root      admin           68 13 May 15:06 scratch
drwxr-xr-x  13 root      admin          442 25 Sep  2003 sw
lrwxr-xr-x   1 root      admin           11 10 May 19:33 tmp -> private/tmp
drwxr-xr-x  11 root      wheel          374 11 May 09:17 usr
lrwxr-xr-x   1 root      admin           11 10 May 19:33 var -> private/var
This logs out the root
[localhost:/Applications] root# exit
[localhost:~]