東京工業大学大学院理工学研究科基礎物理学専攻中村研究室メンバーTakayuki Sako

Ubuntu9.10にanapawをインストールする方法のメモ(bash版)

概略

基本はUbuntu9.04/9.10にanapawをインストールする方法のメモと変わらない。 今回はHIMAC実験後にbash版でインストールした時のメモを残しておく。
個人的にはtcshよりbashの方が使いやすい。ANAPAWが、ではなく、shellが。

~/usr/local/anapaw/Setup/setupanapaw

setupanapaw.bash
#! /bin/bash -f

# Environments for ANAPAW

# modify these parts
export ANAPAW_WORK=$HOME/exp/himac
export CERNLIB=/opt/cern/pro/lib
export ANAPAW_HOME=$HOME/usr/local/anapaw

#
export ANAPAW_SOURCE=$ANAPAW_HOME/src
export ANAPAW_LIB=$ANAPAW_HOME/lib
export ANAPAW_MACROS=$ANAPAW_HOME/Macros
export ANAPAW_DOCS=$ANAPAW_HOME/Documents
export ANAPAW_SETUP=$ANAPAW_HOME/Setup
export VIEWANA_SOURCE=$ANAPAW_SOURCE/vana
export VIEWANA_PARAM=./viewana.prm
export VIEWANA_PID=./viewana.pid
export NTUPLE_DIR=./ntpl
export USER_LASTKUMAC=./anapaw_last.kumac
export USER_LASTKUMAC_OLD=./anapaw_last.kumacold

export ANALOGON=$ANAPAW_SETUP/analogon.kumac

# For using on local.
#source $ANAPAW_SETUP/setup.local

# For using on experiment.
#export EXP_DIR=$HOME/exp/anapawtest
export EXP_DIR=$ANAPAW_WORK
source $ANAPAW_SETUP/setup.exp.bash

echo $ANAPAW_WORK
source $ANAPAW_WORK/setlocal.bash

alias anapaw='cd $ANAPAW_WORK;$USER_SOURCE/anapaw'
# for multi PC
#export ANAPAW_BIN=$HOME/exp/bin
#alias anapaw='cd $ANAPAW_WORK;$ANAPAW_BIN/anapaw'

alias setana='source $USER_SOURCE/setana.bash'
alias acd='cd $ANAPAW_WORK'

#
# Define ENVIRONMENTS for user source.
#  ex.) FERA_MAP,FERA_PRM
# If you want to add ENVs, edit $USER_SOURCE/setana.
#
setana anapaw
#
# Print ENVs
#
setana chkenv
#
echo ' =========================== NOTICE ! ============================= '
echo ' '
echo '   If you change ihit_min0 in enc_fera, use setana.'
echo ' '
echo '      ex) > setana ihitmin 4'
echo ' '
echo '   To execute ANAPAW, type anapaw .'
echo ' '
echo '   If you change Local Environments, edit setlocal.'
echo ' '

cd $ANAPAW_WORK

~/usr/local/anapaw/src/vana/Makefile

Makefile
CFRAGS=-I/usr/X11R6/include 
LFRAGS=-L/usr/X11R6/lib
LIBS=-lX11 -lXt -lXaw

viewana : viewana.c
	gcc viewana.c $(CFRAGS) $(LFRAGS) $(LIBS) -o viewana

#
#--- make clean 
#
clean:
	rm -f viewana *.o *.c~

~/usr/local/anapaw/src/Makefile

Makefile
# Makefile for analib.a anapaw.o
#
# user defined variables
#
FC = g77
FFLAGS = -O2 -funroll-loops -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
CFLAGS = -O2 -funroll-loops -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LINKER = g77
CC = gcc
#
# common variables (Do not change !) 
#
OBJ = anamnu.o ainit.o anaread.o astart.o astop.o anaact.o \
	anainit.o anafill.o anasub.o anasub2.o anaevent.o anabatch.o \
	ntuple_io.o anasubc.o getevt.o getblock.o dumpdata.o \
	anasubplot.o anasubutil.o anaeff.o bbcpri.o
MAINOBJ = anapaw.o
LIB = libanalib.a
#
# Make all
#
all: $(LIB) $(MAINOBJ)
#
#
$(LIB): $(OBJ)
	ar r $@ $(OBJ)
	ranlib $@
anamnu.o: anamnu.f
	$(FC) $(FFLAGS) -c anamnu.f
ainit.o: ainit.f
	$(FC) $(FFLAGS) -c ainit.f
anaread.o: anaread.f
	$(FC) $(FFLAGS) -c anaread.f
astart.o: astart.f
	$(FC) $(FFLAGS) -c astart.f
astop.o: astop.f
	$(FC) $(FFLAGS) -c astop.f
anaact.o: anaact.f
	$(FC) $(FFLAGS) -c anaact.f
anainit.o: anainit.f
	$(FC) $(FFLAGS) -c anainit.f
anafill.o: anafill.f
	$(FC) $(FFLAGS) -c anafill.f
anasub.o: anasub.f
	$(FC) $(FFLAGS) -c anasub.f
anasub2.o: anasub2.f
	$(FC) $(FFLAGS) -c anasub2.f
anasubplot.o: anasubplot.f
	$(FC) $(FFLAGS) -c anasubplot.f
anasubutil.o: anasubutil.f
	$(FC) $(FFLAGS) -c anasubutil.f
anaevent.o: anaevent.f
	$(FC) $(FFLAGS) -c anaevent.f
anabatch.o: anabatch.f
	$(FC) $(FFLAGS) -c anabatch.f
ntuple_io.o: ntuple_io.f
	$(FC) $(FFLAGS) -c ntuple_io.f
anaeff.o: anaeff.f
	$(FC) $(FFLAGS) -c anaeff.f
anasubc.o: anasubc.c
	$(CC) $(CFLAGS) -c anasubc.c
getevt.o: getevt.c
	$(CC) $(CFLAGS) -c getevt.c
getblock.o: getblock.c
	$(CC) $(CFLAGS) -c getblock.c
dumpdata.o: dumpdata.c
	$(CC) $(CFLAGS) -c dumpdata.c
bbcpri.o: bbcpri.c
	$(CC) $(CFLAGS) -c bbcpri.c
#
anapaw.o: anapaw.f
	$(FC) $(FFLAGS) -c anapaw.f

#
#--- make viewana
#
viewana:
	make -C $(VIEWANA_SOURCE)
#
#--- make viewanaclean
#
viewanaclean:
	make -C $(VIEWANA_SOURCE) clean
#
#--- make install
#
install:
	make viewana
	mv $(MAINOBJ) $(ANAPAW_LIB)/$(MAINOBJ)
	mv $(LIB) $(ANAPAW_LIB)/$(LIB)
#
#--- make anaclean
# 
anaclean:
	rm -f *~ *.o *.f~ *.c~ *.a $(ANAPAW_LIB)/$(MAINOBJ) \
	      $(ANAPAW_LIB)/$(LIB)
#
#--- make clean 
#
clean:
	make anaclean
	make -C $(VIEWANA_SOURCE) clean