#! /bin/sh - #script to install and compile EMPIRE II package #directory in which EMPIRE is to be installed instdir=$HOME #directory with EMPIRE distribution sourcedir=`pwd` #EMPIRE version number empver=2-18 #EXFOR version number (may be different (older)) X4ver=2-17 echo ' ' echo ' ' echo 'This is the EMPIRE-II installations script. It will lead you' echo 'through the set-up procedure and eventually compile whole ' echo 'the package. Hit return to accept defaults within [].' echo ' ' echo ' ' echo 'Specify directory with EMPIRE-II distribution ['$sourcedir']:' read dir if [ ! "$dir" = "" ]; then sourcedir=$dir fi if [ -f $sourcedir/empire-$empver.tgz ]; then echo ' ' echo 'OK empire-'$empver'.tgz found' echo ' ' else echo ' ' echo 'empire-'$empver'.tgz not found in '$sourcedir', restart setup script ' echo 'and specify the correct path to the empire-'$empver'.tgz file' exit fi echo 'Specify existing directory in which EMPIRE-II should be installed.' echo 'The directory "empire" will be created inside so default should be' echo 'a good choice (hit return to accept default) ['$instdir']:' read dir if [ ! "$dir" = "" ]; then instdir=$dir fi echo 'You may choose to install EXFOR library (340 Mb) or not.' echo 'If you do not I will try to make a link to EXFOR inside ' echo 'your EMPIRE distribution directory. If this is a CD-ROM' echo 'you still will be able to use it providing that a CD-ROM' echo 'is mounted at the same mount point as it is now. Lack of EXFOR' echo 'disables comparison with experimental data but does not ' echo 'compromise EMPIRE calculations. ' echo 'Do you want to install EXFOR y/n [y]:' read yesno if [ ! "$yesno" = "" ]; then exfor=$yesno else exfor=y fi echo 'You may choose to install HF-BCS level densities (145 Mb).' echo 'If you do not I will try to make a link pointing to ' echo 'your EMPIRE distribution directory. If this is a CD-ROM' echo 'you still will be able to use them providing that the CD-ROM' echo 'is mounted at the same mount point as it is now. Lack of HF-BCS' echo 'disables HF-BCS option (LEVDEN=3) but does not affect ' echo 'calculations using other level density options. ' echo 'Do you want to install HF-BCS level densities y/n [y]:' read yesno if [ ! "$yesno" = "" ]; then hfbcs=$yesno else hfbcs=y fi cd $instdir echo 'exploding EMPIRE-II source' # gunzip $sourcedir/empire-$empver.tgz # tar xvf $sourcedir/empire-$empver.tar tar xzvf $sourcedir/empire-$empver.tgz echo 'Have decompressed EMPIRE-II in the directory '$instdir if [ "$exfor" = "y" ]; then if [ -f $sourcedir/X4-$X4ver.tgz ]; then echo 'exploding EXFOR library' # gunzip $sourcedir/X4-$X4ver.tgz # tar xzf $sourcedir/X4-$X4ver.tar tar xvzf $sourcedir/X4-$X4ver.tgz else echo 'EXFOR library installation failed, ' echo 'X4-'$X4ver'.tgz file not found' fi else if [ -f $sourcedir/EXFOR/subent/10/1000/10001001.txt ]; then ln -s $sourcedir/EXFOR/subent empire/EXFOR/subent echo ' ' echo 'Have created link to the EXFOR library on CD-ROM' echo ' ' fi fi if [ "$hfbcs" = "y" ]; then if [ -f $sourcedir/HFBCS-lev-dens.tgz ]; then echo 'exploding HF-BCS level densities' # gunzip $sourcedir/HFBCS-lev-dens.tgz # tar xzf $sourcedir/HFBCS-lev-dens.tar tar xvzf $sourcedir/HFBCS-lev-dens.tgz else echo 'Installation of HF-BCS level densities failed' echo 'HFBCS-lev-dens.tgz file not found' fi else if [ -f $sourcedir/RIPL-2/densities/total/level-densities-hfbcs/z008.dat ]; then mkdir empire/RIPL-2/densities mkdir empire/RIPL-2/densities/total ln -s $sourcedir/RIPL-2/densities/total/level-densities-hfbcs empire/RIPL-2/densities/total/level-densities-hfbcs echo ' ' echo 'Have created link to the HFBCS level densities on CD-ROM' echo ' ' fi fi echo ' ' echo 'Now I will compile the whole package.' echo 'There might be a lot of warnings during ECIS compilation.' echo 'This is fine as long as "ecis" executable is created in the' echo 'source directory.' echo 'By default g77 FORTRAN compiler will be used.' echo 'You may enter you preferred one below or hit return ' echo 'to accept default [g77]:' read ftn if [ "$ftn" = "" ]; then ftn=g77 fi #Compilation cd empire/source if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling EMPIRE ' make echo 'Compiling ECIS ' make ecis cd ../util/empend if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling EMPEND ' make cd ../x4toc4 if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling X4TOC4 ' make cd ../c4sort if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling C4SORT ' make cd ../plotc4 if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling PLOTC4 ' make cd ../fixup if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling FIXUP ' make cd ../sixtab if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling SIXTAB ' make cd ../lsttab if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling LSTTAB ' make cd ../legend if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling LEGEND ' make cd ../c4zvd echo 'Compiling ZVView ' make -f c4dat.mak make -f datzvdl.mak make -f endzvd.mak make -f curzvdl.mak make -f pntdatl.mak cd ../../EXFOR if [ ! "$ftn" = "g77" ]; then sed s/"= g77"/"= $ftn"/ Makefile >Makefile1 mv Makefile1 Makefile fi echo 'Compiling EXFOR ' make cd ../ #Checking and evantually installing Tcl/Tk packages testrpm=`which rpm` if [ ! $testrpm = "" ]; then echo ' OK your system supports rpm I will be able to try to install missing Tcl/Tk and/or Itcl packages if you choose so' echo ' ' echo 'Searching for Tcl/Tk packages' cd $sourcedir plist='itcl tcl tk tix ' for package in $plist ; do miss=n rpm -q $package || miss='y' if [ $miss = "y" ]; then echo 'I have got this package from Red Hat 7.3' echo 'and may try to install it.' echo 'Do you want me to install this package (I will need root password to do this) y/n [n]:' read yesno if [ ! $yesno = "y" ]; then yesno=n fi if [ $yesno = "y" ]; then if [ $package = "itcl" ]; then su -m -c 'rpm -U itcl-3.2-67.i386.rpm' fi if [ $package = "tk" ]; then su -m -c 'rpm -U tk-8.3.3-67.i386.rpm' fi if [ $package = "tcl" ]; then su -m -c 'rpm -U tcl-8.3.3-67.i386.rpm' fi if [ $package = "tix" ]; then su -m -c 'rpm -U tix-8.2.0b1-67.i386.rpm' fi fi fi done else echo 'SORRY no support for rpm found on your system. You will have to ensure that Tcl, Tk, Tix and Itcl packages are installed to be able to run graphic user interfaces.' fi echo ' ' echo 'If you are lucky EMPIRE-II is successfully installed! ' echo 'Lot of warnings during ECIS compilations and a few for utility codes' echo 'are normal and should not make any harm.' echo 'If there were errors during installation of the TCL/Tk packages' echo 'you will have to pick up CD-ROM(s) with your system and install' echo 'tcl, tk, itcl, and tix packages to be able to use GUIs' echo 'If all went fine you can change to the ' $instdir'/empire/work directory and type:' echo 'Xrun.tcl &' echo 'to start EMPIRE GUI.' echo 'If this does not work you may try the old interface (lrun.tcl &)' echo 'Should I do it for you y/n [y]:' yesno=y read yesno if [ "$yesno" = "y" ]; then cd $instdir/empire/work ./Xrun.tcl & exit else echo 'OK I quit' exit fi exit