Installation script for Z800

From www.coria-cfd.fr
Revision as of 13:27, 22 February 2012 by Lartigue (Talk | contribs)

Jump to: navigation, search

Copy and paste the following lines in .bash_profile:

alias l='ls -l'
export PATH=$PATH:/home/admin/local/openmpi-1.4.4/bin
export LD_LIBRARY_PATH="/home/admin/local/openmpi-1.4.4/lib:$LD_LIBRARY_PATH"

Copy and paste this in a file called Install.make:

INSTALL_DIR = /home/admin

F77   = /usr/bin/gfortran
FC    = /usr/bin/gfortran
CC    = /usr/bin/gcc
CXX   = /usr/bin/g++
CPP   = /usr/bin/cpp
CXXCPP = /usr/bin/cpp

all: structure sed fftw3 openmpi hdf5 lapack ParMetis scotch petsc

freenx-ocelot:
	sudo add-apt-repository ppa:freenx-team
	sudo sed -i 's/oneiric/lucid/g' /etc/apt/sources.list.d/freenx-team-ppa-oneiric.list
	sudo apt-get update && sudo apt-get upgrade
	wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/esound-common_0.2.41-8_all.deb
	wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/libesd0_0.2.41-8_amd64.deb
	wget http://de.archive.ubuntu.com/ubuntu/pool/main/e/esound/esound-clients_0.2.41-8_amd64.deb
	-sudo dpkg -i esound-common_0.2.41-8_all.deb
	-sudo dpkg -i libesd0_0.2.41-8_amd64.deb
	-sudo dpkg -i esound-clients_0.2.41-8_amd64.deb
	sudo apt-get -f -y install
	sudo dpkg -i esound-common_0.2.41-8_all.deb
	sudo dpkg -i libesd0_0.2.41-8_amd64.deb
	sudo dpkg -i esound-clients_0.2.41-8_amd64.deb
	rm -f esound-common_0.2.41-8_all.deb libesd0_0.2.41-8_amd64.deb esound-lients_0.2.41-8_amd64.deb
	sudo apt-get install -y freenx

packages:
	sudo apt-get install -y tcsh
	sudo apt-get install -y ssh
	sudo apt-get install -y g++
	sudo apt-get install -y gdb
	sudo apt-get install -y gfortran
	sudo apt-get install -y cmake
	sudo apt-get install -y flex
	sudo apt-get install -y bison
	sudo apt-get install -y git
	sudo apt-get install -y gitk
	sudo apt-get install -y subversion
	sudo apt-get install -y rapidsvn
	sudo apt-get install -y vim-gnome
	sudo apt-get install -y lib32z1-dev
	sudo apt-get install -y zlib1g-dev
	sudo apt-get install -y tkdiff
	sudo apt-get install -y default-jre
	sudo apt-get install -y gparted
	sudo apt-get install -y synaptic
	sudo apt-get install -y eclipse
	sudo apt-get install -y paraview
	sudo apt-get install -y gnash

structure:
	mkdir -p $(INSTALL_DIR)/Downloads
	mkdir -p $(INSTALL_DIR)/Builds
	mkdir -p $(INSTALL_DIR)/local

sed:
	(cd $(INSTALL_DIR)/Downloads && wget http://ftp.gnu.org/gnu/sed/sed-4.2.tar.bz2)
	(cd $(INSTALL_DIR)/Builds && tar -jxvf $(INSTALL_DIR)/Downloads/sed-4.2.tar.bz2)
	(cd $(INSTALL_DIR)/Builds/sed-4.2 && ./configure --prefix=$(INSTALL_DIR)/local/sed-4.2 && make && make install)

fftw3:
	(cd $(INSTALL_DIR)/Downloads && wget http://www.fftw.org/fftw-3.3.tar.gz)
	(cd $(INSTALL_DIR)/Builds && tar -zxvf $(INSTALL_DIR)/Downloads/fftw-3.3.tar.gz)
	(cd $(INSTALL_DIR)/Builds/fftw-3.3 && ./configure --prefix=$(INSTALL_DIR)/local/fftw-3.3 && make && make install)

openmpi:
	(cd $(INSTALL_DIR)/Downloads && wget http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.4.tar.bz2)
	(cd $(INSTALL_DIR)/Builds && tar -jxvf $(INSTALL_DIR)/Downloads/openmpi-1.4.4.tar.bz2)
	(cd $(INSTALL_DIR)/Builds/openmpi-1.4.4 && ./configure --prefix=$(INSTALL_DIR)/local/openmpi-1.4.4 --enable-mpi-f90 && make && make install)

hdf5:
	(cd $(INSTALL_DIR)/Downloads && wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.8.tar.bz2)
	(cd $(INSTALL_DIR)/Builds && tar -jxvf $(INSTALL_DIR)/Downloads/hdf5-1.8.8.tar.bz2)
	(cd $(INSTALL_DIR)/Builds/hdf5-1.8.8 && ./configure --prefix=$(INSTALL_DIR)/local/hdf5-1.8.8 --enable-fortran --enable-cxx && make && make install)

lapack:
	(cd $(INSTALL_DIR)/Downloads && wget http://www.netlib.org/lapack/lapack-3.4.0.tgz)
	(cd $(INSTALL_DIR)/Builds && tar -zxvf $(INSTALL_DIR)/Downloads/lapack-3.4.0.tgz)
	(cd $(INSTALL_DIR)/Builds/lapack-3.4.0 && cp make.inc.example make.inc && make blaslib && make lapacklib)
	mkdir -p $(INSTALL_DIR)/local/blas/lib
	mkdir -p $(INSTALL_DIR)/local/lapack/lib
	ln -s $(INSTALL_DIR)/Builds/lapack-3.4.0/liblapack.a $(INSTALL_DIR)/local/lapack/lib/liblapack.a
	ln -s $(INSTALL_DIR)/Builds/lapack-3.4.0/librefblas.a $(INSTALL_DIR)/local/blas/lib/libblas.a

ParMetis:
	(cd $(INSTALL_DIR)/Downloads && wget http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/OLD/ParMetis-3.2.0.tar.gz)
	(cd $(INSTALL_DIR)/Builds && tar -zxvf $(INSTALL_DIR)/Downloads/ParMetis-3.2.0.tar.gz)
	echo "CC = $(INSTALL_DIR)/local/openmpi-1.4.4/bin/mpicc" > $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "OPTFLAGS = -O3" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "INCDIR =" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "COPTIONS = -DNDEBUG" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "LD = $(INSTALL_DIR)/local/openmpi-1.4.4/bin/mpicc" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "LIBDIR =" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "AR = ar rv" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "RANLIB = ar -ts" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	echo "VERNUM = 3.2.0" >> $(INSTALL_DIR)/Builds/ParMetis-3.2.0/Makefile.in
	(cd $(INSTALL_DIR)/Builds/ParMetis-3.2.0 && make)
	mkdir -p $(INSTALL_DIR)/local/ParMetis-3.2.0/lib
	mkdir -p $(INSTALL_DIR)/local/ParMetis-3.2.0/include
	ln -s $(INSTALL_DIR)/Builds/ParMetis-3.2.0/*.a $(INSTALL_DIR)/local/ParMetis-3.2.0/lib/
	ln -s $(INSTALL_DIR)/Builds/ParMetis-3.2.0/*.h $(INSTALL_DIR)/local/ParMetis-3.2.0/include/

scotch:
	(cd $(INSTALL_DIR)/Downloads && wget https://gforge.inria.fr/frs/download.php/28977/scotch_5.1.12b.tar.gz)
	(cd $(INSTALL_DIR)/Builds && tar -zxvf $(INSTALL_DIR)/Downloads/scotch_5.1.12b.tar.gz)
	echo "EXE             =" > $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "LIB             = .a" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "OBJ             = .o" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "MAKE            = make" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "AR              = ar" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "ARFLAGS         = -ruv" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CAT             = cat" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CCS             = $(CC)" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CCP             = $(INSTALL_DIR)/local/openmpi-1.4.4/bin/mpicc" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CCD             = $(CC)" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CFLAGS          = -O3 -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_RENAME_PARSER -DSCOTCH_PTHREAD -Drestrict=__restrict -DIDXSIZE64 -I$(INSTALL_DIR)/local/openmpi-1.4.4/include" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CLIBFLAGS       =" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "LDFLAGS         = -lz -lm -lrt" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "CP              = cp" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "LEX             = flex -Pscotchyy -olex.yy.c" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "LN              = ln" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "MKDIR           = mkdir -p" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "MV              = mv" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "RANLIB          = ranlib" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "YACC            = bison -pscotchyy -y -b y" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	echo "prefix          = $(INSTALL_DIR)/local/scotch_5.1.12" >> $(INSTALL_DIR)/Builds/scotch_5.1.12/src/Makefile.inc
	(cd $(INSTALL_DIR)/Builds/scotch_5.1.12/src && make scotch && make ptscotch && make install)

petsc:
	(cd $(INSTALL_DIR)/Downloads && wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.2-p6.tar.gz)
	(cd $(INSTALL_DIR)/Builds && tar -zxvf $(INSTALL_DIR)/Downloads/petsc-lite-3.2-p6.tar.gz)
	(cd $(INSTALL_DIR)/Builds/petsc-3.2-p6 && ./configure --prefix=$(INSTALL_DIR)/local/petsc-3.2-p6 --download-hypre=yes --with-mpi-dir=$(INSTALL_DIR)/local/openmpi-1.4.4 --with-blas-lib=$(INSTALL_DIR)/local/blas/lib/libblas.a --with-lapack-lib=$(INSTALL_DIR)/local/lapack/lib/liblapack.a && make PETSC_DIR=$(INSTALL_DIR)/Builds/petsc-3.2-p6 PETSC_ARCH=arch-linux2-c-debug all && make PETSC_DIR=$(INSTALL_DIR)/Builds/petsc-3.2-p6 PETSC_ARCH=arch-linux2-c-debug install)

clean:
	echo


WARNING: If you encounter any problem for installing freeNX, you should consider visiting this website...

GAMBIT Installation: You must type the following lines to install some additional packages that are recquired by gambit:

cd /tmp && wget http://ubuntu.mirror.cambrium.nl/ubuntu//pool/multiverse/o/openmotif/libmotif3_2.2.3-4_amd64.deb && dpkg -i /tmp/libmotif3_2.2.3-4_amd64.deb
sudo apt-get install libstdc++5 xfs xfstt xfonts-75dpi xfonts-100dpi