Installation script for Z800

From www.coria-cfd.fr
Revision as of 23:37, 1 October 2014 by Lartigue (Talk | contribs)

Jump to: navigation, search

Install Intel Parallel Studio


Makefile_gcc:

INSTALL_DIR = /

WGET = wget

GCC_VERSION = 4.8.2

NPROCS = 8

all : structure gcc

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

gcc:
	(\
	cd $(INSTALL_DIR)/Downloads &&  \
	if [ ! -f gcc-$(GCC_VERSION).tar.bz2 ]; then $(WGET) http://gcc.cybermirror.org/releases/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.bz2; fi && \
	cd $(INSTALL_DIR)/Builds && \
	bunzip2 -c $(INSTALL_DIR)/Downloads/gcc-$(GCC_VERSION).tar.bz2 | tar xv && \
	mv gcc-$(GCC_VERSION) gcc-$(GCC_VERSION)_src&& \
	cd gcc-$(GCC_VERSION)_src && \
	./contrib/download_prerequisites && \
	cd ../ && \
	mkdir -p $(INSTALL_DIR)/Builds/gcc-$(GCC_VERSION)_build && \
	cd gcc-$(GCC_VERSION)_build && \
	../gcc-$(GCC_VERSION)_src/configure --prefix=/local/gcc-$(GCC_VERSION) && \
	make -j $(NPROCS) && \
	make check && \
	make install \
	)

Makefile_packages:

default:
	sudo add-apt-repository -y ppa:freenx-team
	sudo apt-get update
	sudo apt-get upgrade
	sudo apt-get install -y freenx  nvidia-current ubuntu-desktop gnome-session-fallback tcsh ssh g++ gdb gfortran cmake flex bison git gitk subversion rapidsvn vim-gnome lib32z1-dev zlib1g-dev tkcvs default-jre gparted synaptic eclipse paraview browser-plugin-gnash grace gnuplot filezilla dselect emacs xemacs21 meld hdfview vlc autogen autoconf automake cifs-utils valgrind kcachegrind mencoder


Makefile_extlib:

INSTALL_DIR = /
WGET = wget
NPROCS = 8
SHELL=/bin/bash

OPENMPI_NAME = openmpi
OPENMPI_VERSION = 1.8.3
OPENMPI_MAJOR_VERSION = 1.8
OPENMPI_LOCATION = http://www.open-mpi.org/software/ompi/v$(OPENMPI_MAJOR_VERSION)/downloads
OPENMPI_FILE = $(OPENMPI_NAME)-$(OPENMPI_VERSION).tar.bz2
OPENMPI_CONFIGURE_OPTIONS = --enable-mpi-fortran --enable-static --enable-shared

FFTW_NAME = fftw
FFTW_VERSION = 3.3.4
FFTW_LOCATION = http://www.fftw.org
FFTW_FILE = $(FFTW_NAME)-$(FFTW_VERSION).tar.gz
FFTW_CONFIGURE_OPTIONS =

HDF5_NAME = hdf5
HDF5_VERSION = 1.8.13
HDF5_LOCATION = http://www.hdfgroup.org/ftp/HDF5/current/src
HDF5_FILE = $(HDF5_NAME)-$(HDF5_VERSION).tar.bz2
HDF5_CONFIGURE_OPTIONS = --enable-fortran --enable-cxx

PARMETIS_NAME = parmetis
PARMETIS_VERSION = 4.0.3
PARMETIS_LOCATION = http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis
PARMETIS_FILE = $(PARMETIS_NAME)-$(PARMETIS_VERSION).tar.gz
PARMETIS_CONFIGURE_OPTIONS =

SCOTCH_NAME = scotch
SCOTCH_VERSION = 6.0.0
SCOTCH_LOCATION = https://gforge.inria.fr/frs/download.php/31831
SCOTCH_FILE = $(SCOTCH_NAME)_$(SCOTCH_VERSION).tar.gz
SCOTCH_CONFIGURE_OPTIONS =

LAPACK_NAME = lapack
LAPACK_VERSION = 3.4.2
LAPACK_LOCATION = http://www.netlib.org/lapack
LAPACK_FILE = $(LAPACK_NAME)-$(LAPACK_VERSION).tgz
LAPACK_CONFIGURE_OPTIONS =

MMG3D4_NAME = mmg3d4
MMG3D4_VERSION = 4.0.1
MMG3D4_LOCATION = https://gforge.inria.fr/frs/download.php/file/34048
MMG3D4_FILE = $(MMG3D4_NAME)-$(MMG3D4_VERSION)-Source.tar.gz
MMG3D4_CONFIGURE_OPTIONS =

PAPI_NAME = papi
PAPI_VERSION = 5.3.0
PAPI_LOCATION = http://icl.cs.utk.edu/projects/papi/downloads
PAPI_FILE = $(PAPI_NAME)-$(PAPI_VERSION).tar.gz
PAPI_CONFIGURE_OPTIONS =

PETSC_NAME = petsc
PETSC_VERSION = 3.4.4
PETSC_LOCATION = http://ftp.mcs.anl.gov/pub/petsc/release-snapshots
PETSC_FILE = $(PETSC_NAME)-$(PETSC_VERSION).tar.gz
PETSC_CONFIGURE_OPTIONS =

SLEPC_NAME = slepc
SLEPC_VERSION = 3.4.4
SLEPC_LOCATION = http://www.grycap.upv.es/slepc/download/distrib
SLEPC_FILE = $(SLEPC_NAME)-$(SLEPC_VERSION).tar.gz
SLEPC_CONFIGURE_OPTIONS =

COMPILER_FAMILY   = intel
COMPILER_VERSION  = 14.0.3
COMPILER_PATH     = /opt/intel/composerxe/bin
COMPILER_CC       = $(COMPILER_PATH)/icc
COMPILER_MPICC    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpicc
COMPILER_CFLAGS   = "-O2 -g"
COMPILER_CXX      = $(COMPILER_PATH)/icpc
COMPILER_MPICXX   = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpicxx
COMPILER_CXXFLAGS = "-O2 -g"
COMPILER_FC       = $(COMPILER_PATH)/ifort
COMPILER_MPIFC    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpifort
COMPILER_FCFLAGS  = "-O2 -g"
COMPILER_FF       = $(COMPILER_PATH)/ifort
COMPILER_MPIFF    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpifort
COMPILER_FFLAGS   = "-O2 -g"

default: $(OPENMPI_NAME)-$(OPENMPI_VERSION) $(FFTW_NAME)-$(FFTW_VERSION) $(HDF5_NAME)-$(HDF5_VERSION) $(PARMETIS_NAME)-$(PARMETIS_VERSION) $(SCOTCH_NAME)-$(SCOTCH_VERSION) $(LAPACK_NAME)-$(LAPACK_VERSION) $(MMG3D4_NAME)-$(MMG3D4_VERSION) $(PAPI_NAME)-$(PAPI_VERSION) $(PETSC_NAME)-$(PETSC_VERSION) $(SLEPC_NAME)-$(SLEPC_VERSION)

$(OPENMPI_NAME)-$(OPENMPI_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(OPENMPI_FILE) ]; then $(WGET) $(OPENMPI_LOCATION)/$(OPENMPI_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_NAME)-$(OPENMPI_VERSION) &&\
	mkdir -p $(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(OPENMPI_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_NAME)-$(OPENMPI_VERSION) &&\
	./configure --prefix=$(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION) CC=$(COMPILER_CC) CFLAGS=$(COMPILER_CFLAGS) CXX=$(COMPILER_CXX) CXXFLAGS=$(COMPILER_CXXFLAGS) FC=$(COMPILER_FC) FCLAGS=$(COMPILER_FCFLAGS) FF=$(COMPILER_FF) FFLAGS=$(COMPILER_FFLAGS) $(OPENMPI_CONFIGURE_OPTIONS)&&\
	make -j $(NPROCS) &&\
	rm -rf $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION) &&\
	make install\
	)

$(FFTW_NAME)-$(FFTW_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(FFTW_FILE) ]; then $(WGET) $(FFTW_LOCATION)/$(FFTW_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(FFTW_NAME)-$(FFTW_VERSION) &&\
	mkdir -p $(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(FFTW_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(FFTW_NAME)-$(FFTW_VERSION) &&\
	./configure --prefix=$(INSTALL_DIR)/local/$(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(FFTW_VERSION) CC=$(COMPILER_CC) CFLAGS=$(COMPILER_CFLAGS) CXX=$(COMPILER_CXX) CXXFLAGS=$(COMPILER_CXXFLAGS) FC=$(COMPILER_FC) FCLAGS=$(COMPILER_FCFLAGS) FF=$(COMPILER_FF) FFLAGS=$(COMPILER_FFLAGS) $(FFTW_CONFIGURE_OPTIONS)&&\
	make -j $(NPROCS) &&\
	rm -rf $(INSTALL_DIR)/local/$(FFTW_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(FFTW_VERSION) &&\
	make install\
	)

$(HDF5_NAME)-$(HDF5_VERSION):
	(\
	apt-get install zlib1g-dev &&\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(HDF5_FILE) ]; then $(WGET) $(HDF5_LOCATION)/$(HDF5_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(HDF5_NAME)-$(HDF5_VERSION) &&\
	mkdir -p $(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(HDF5_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(HDF5_NAME)-$(HDF5_VERSION) &&\
	./configure --prefix=$(INSTALL_DIR)/local/$(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(HDF5_VERSION) CC=$(COMPILER_CC) CFLAGS=$(COMPILER_CFLAGS) CXX=$(COMPILER_CXX) CXXFLAGS=$(COMPILER_CXXFLAGS) FC=$(COMPILER_FC) FCLAGS=$(COMPILER_FCFLAGS) FF=$(COMPILER_FF) FFLAGS=$(COMPILER_FFLAGS) $(HDF5_CONFIGURE_OPTIONS)&&\
	make -j $(NPROCS) &&\
	rm -rf $(INSTALL_DIR)/local/$(HDF5_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(HDF5_VERSION) &&\
	make install\
	)

$(PARMETIS_NAME)-$(PARMETIS_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	rm -rf   $(INSTALL_DIR)/local/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PARMETIS_VERSION) &&\
	rm -rf   $(INSTALL_DIR)/Builds/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PARMETIS_NAME)-$(PARMETIS_VERSION) &&\
	mkdir -p $(INSTALL_DIR)/Builds/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(PARMETIS_FILE) ]; then $(WGET) $(PARMETIS_LOCATION)/$(PARMETIS_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(PARMETIS_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PARMETIS_NAME)-$(PARMETIS_VERSION) &&\
	cd metis &&\
	sed -i 's/make -C $$(BUILDDIR) $$@ $$(MAKEFLAGS);/$$(MAKE) -C $$(BUILDDIR) $$@;/g' Makefile &&\
	make config prefix=$(INSTALL_DIR)/local/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PARMETIS_VERSION) CC=$(COMPILER_MPICC) CFLAGS=$(COMPILER_CFLAGS) CXX=$(COMPILER_MPICXX) CXXFLAGS=$(COMPILER_CXXFLAGS) FC=$(COMPILER_MPIFC) FCLAGS=$(COMPILER_FCFLAGS) FF=$(COMPILER_MPIFF) FFLAGS=$(COMPILER_FFLAGS) $(PARMETIS_CONFIGURE_OPTIONS) &&\
	make &&\
	make install &&\
	cd .. &&\
	sed -i 's/make -C $$(BUILDDIR) $$@ $$(MAKEFLAGS);/$$(MAKE) -C $$(BUILDDIR) $$@;/g' Makefile &&\
	sed -i 's/cc         = mpicc/cc         = not-set/g' Makefile &&\
	sed -i 's/cxx        = mpicxx/cxx        = not-set/g' Makefile &&\
	make config prefix=$(INSTALL_DIR)/local/$(PARMETIS_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PARMETIS_VERSION) CC=$(COMPILER_MPICC) CFLAGS=$(COMPILER_CFLAGS) CXX=$(COMPILER_MPICXX) CXXFLAGS=$(COMPILER_CXXFLAGS) FC=$(COMPILER_MPIFC) FCLAGS=$(COMPILER_FCFLAGS) FF=$(COMPILER_MPIFF) FFLAGS=$(COMPILER_FFLAGS) $(PARMETIS_CONFIGURE_OPTIONS) &&\
	make &&\
	make install \
	)

$(SCOTCH_NAME)-$(SCOTCH_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(SCOTCH_FILE) ]; then $(WGET) $(SCOTCH_LOCATION)/$(SCOTCH_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)-$(SCOTCH_VERSION) &&\
	mkdir -p $(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(SCOTCH_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION) &&\
	rm -rf $(INSTALL_DIR)/local/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_VERSION) &&\
	echo "EXE             =" > $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "LIB             = .a" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "OBJ             = .o" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "MAKE            = make" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "AR              = ar" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "ARFLAGS         = -ruv" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CAT             = cat" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CCS             = $(COMPILER_MPICC)" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CCP             = $(COMPILER_MPICC)" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CCD             = $(COMPILER_MPICC)" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CFLAGS          = -O3 -DCOMMON_TIMING_OLD -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_RANDOM_FIXED_SEED -DSCOTCH_RENAME -DSCOTCH_RENAME_PARSER -Drestrict=__restrict -DIDXSIZE64 -I$(COMPILER_PATH)/include" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CLIBFLAGS       =" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "LDFLAGS         = -lz -lm" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "CP              = cp" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "LEX             = flex -Pscotchyy -olex.yy.c" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "LN              = ln" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "MKDIR           = mkdir -p" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "MV              = mv" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "RANLIB          = ranlib" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "YACC            = bison -pscotchyy -y -b y" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	echo "prefix          = $(INSTALL_DIR)/local/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_VERSION)" >> $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src/Makefile.inc &&\
	cd $(INSTALL_DIR)/Builds/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_NAME)_$(SCOTCH_VERSION)/src &&\
	make -j $(NPROCS) scotch &&\
	make -j $(NPROCS) ptscotch &&\
	make install\
	)

$(LAPACK_NAME)-$(LAPACK_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(LAPACK_FILE) ]; then $(WGET) $(LAPACK_LOCATION)/$(LAPACK_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(LAPACK_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_NAME)-$(LAPACK_VERSION) &&\
	mkdir -p $(LAPACK_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(LAPACK_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(LAPACK_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(LAPACK_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_NAME)-$(LAPACK_VERSION) &&\
        rm -f make.inc &&\
        touch make.inc &&\
        echo "SHELL = /bin/sh" >> make.inc &&\
        echo "FORTRAN    = $(COMPILER_MPIFC)" >> make.inc &&\
        echo "OPTS       = $(COMPILER_FCFLAGS)" >> make.inc &&\
        echo "LOADER     = $(COMPILER_MPIFC)" >> make.inc &&\
        echo "DRVOPTS    = $(COMPILER_FCFLAGS)" >> make.inc &&\
        echo "NOOPT      = -O0" >> make.inc &&\
        echo "LOADOPTS   =" >> make.inc &&\
        echo "TIMER      = EXT_ETIME" >> make.inc &&\
        echo "CC         = $(COMPILER_MPICC)" >> make.inc &&\
        echo "CFLAGS     = $(COMPILER_CFLAGS)" >> make.inc &&\
        echo "ARCH       = ar" >> make.inc &&\
        echo "ARCHFLAGS  = cr" >> make.inc &&\
        echo "RANLIB     = ranlib" >> make.inc &&\
        echo "XBLASLIB   =" >> make.inc &&\
        echo "BLASLIB    = ../../librefblas.a" >> make.inc &&\
        echo "LAPACKLIB  = liblapack.a" >> make.inc &&\
        echo "TMGLIB     = libtmglib.a" >> make.inc &&\
        echo "LAPACKELIB = liblapacke.a" >> make.inc &&\
        make -j $(NPROCS) blaslib &&\
        make -j $(NPROCS) lapacklib &&\
        rm -rf $(INSTALL_DIR)/local/lapack/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_VERSION) &&\
        mkdir -p $(INSTALL_DIR)/local/lapack/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_VERSION)/lib &&\
        cp liblapack.a  $(INSTALL_DIR)/local/lapack/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_VERSION)/lib/liblapack.a &&\
        cp librefblas.a $(INSTALL_DIR)/local/lapack/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(LAPACK_VERSION)/lib/libblas.a\
	)


$(MMG3D4_NAME)-$(MMG3D4_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(MMG3D4_FILE) ]; then $(WGET) $(MMG3D4_LOCATION)/$(MMG3D4_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(MMG3D4_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(MMG3D4_NAME)-$(MMG3D4_VERSION)-Source &&\
	mkdir -p $(MMG3D4_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(MMG3D4_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(MMG3D4_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(MMG3D4_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(MMG3D4_NAME)-$(MMG3D4_VERSION)-Source &&\
	export SCOTCH_DIR=$(INSTALL_DIR)/local/$(SCOTCH_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SCOTCH_VERSION) &&\
	export CC=$(COMPILER_MPICC) && \
	export CXX=$(COMPILER_MPICXX) && \
	mkdir build &&\
	cd build &&\
	cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR)/local/$(MMG3D4_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(MMG3D4_VERSION) .. &&\
	make &&\
	make install \
	)

$(PAPI_NAME)-$(PAPI_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(PAPI_FILE) ]; then $(WGET) $(PAPI_LOCATION)/$(PAPI_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(PAPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PAPI_NAME)-$(PAPI_VERSION) &&\
	mkdir -p $(PAPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(PAPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(PAPI_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(PAPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PAPI_NAME)-$(PAPI_VERSION) &&\
	cd src &&\
	export F77=$(COMPILER_F77) && export CC=$(COMPILER_CC) && ./configure --prefix=$(INSTALL_DIR)/local/$(PAPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PAPI_VERSION) &&\
	make -j $(NPROCS)&&\
	make install \
	)

$(PETSC_NAME)-$(PETSC_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(PETSC_FILE) ]; then $(WGET) $(PETSC_LOCATION)/$(PETSC_FILE); fi &&\
	cd $(INSTALL_DIR)/local &&\
	rm -rf $(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PETSC_VERSION) &&\
	mkdir -p $(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(PETSC_FILE) &&\
	cd $(INSTALL_DIR)/local/$(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	mv $(PETSC_NAME)-$(PETSC_VERSION) $(PETSC_VERSION) &&\
	cd $(PETSC_VERSION) &&\
	unset PETSC_DIR && ./configure PETSC_ARCH=linux-intel64 --with-mpi-dir=$(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION) --download-hypre --with-blas-lapack-dir=/opt/intel/mkl &&\
	make PETSC_DIR=$(INSTALL_DIR)/local/$(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PETSC_VERSION) PETSC_ARCH=linux-intel64 all \
	)

$(SLEPC_NAME)-$(SLEPC_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(SLEPC_FILE) ]; then $(WGET) $(SLEPC_LOCATION)/$(SLEPC_FILE); fi &&\
	cd $(INSTALL_DIR)/local &&\
	rm -rf $(SLEPC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SLEPC_VERSION) &&\
	mkdir -p $(SLEPC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(SLEPC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(SLEPC_FILE) &&\
	cd $(INSTALL_DIR)/local/$(SLEPC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	mv $(SLEPC_NAME)-$(SLEPC_VERSION) $(SLEPC_VERSION) &&\
	cd $(SLEPC_VERSION) &&\
	export PETSC_DIR=$(INSTALL_DIR)/local/$(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PETSC_VERSION) && export PETSC_ARCH=linux-intel64 && ./configure &&\
	make SLEPC_DIR=$(INSTALL_DIR)/local/$(SLEPC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(SLEPC_VERSION) PETSC_DIR=$(INSTALL_DIR)/local/$(PETSC_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(PETSC_VERSION) PETSC_ARCH=linux-intel64 \
	)

.bash_profile / .bashrc:

#==================#
# SECTION 1: aliases

alias l='ls -l'

# end of SECTION 1
#==================#


#==================#
# SECTION 2: compilers

# crt stuff
export LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
export LIBRARY_PATH="/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"

# compiler and libraries
source ~/.bashrc_intel
source ~/.bashrc_openmpi
source ~/.bashrc_hdf5
source ~/.bashrc_papi
source ~/.bashrc_petsc
source ~/.bashrc_slepc

# end of SECTION 2
#==================#

#==================#
# SECTION 3: applications

# yales2
source ~/yales2/platforms/xxxx.bash.env

# end of SECTION 3
#==================#


.bashrc_intel:

# intel-14.0.3
source /opt/intel/composerxe/bin/compilervars.sh intel64
export INTEL_HOME="/opt/intel/composerxe"
export INTEL_INC="$INTEL_HOME/include"
export INTEL_LIB="$INTEL_HOME/lib"
export INTEL_BIN="$INTEL_HOME/bin"
export INTEL_MAN="$INTEL_HOME/man"
export PATH="$INTEL_BIN:$PATH"
export LIBRARY_PATH="$INTEL_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$INTEL_LIB:$LD_LIBRARY_PATH"
export MANPATH="$INTEL_MAN:$MANPATH"


.bashrc_openmpi:

# openmpi-1.8.1 compiled with intel-14.0.3
export MPI_HOME="/local/openmpi/intel-14.0.3/1.8.1"
export MPI_INC="$MPI_HOME/include"
export MPI_LIB="$MPI_HOME/lib"
export MPI_BIN="$MPI_HOME/bin"
export MPI_MAN="$MPI_HOME/share/man"
export PATH="$MPI_BIN:$PATH"
export LIBRARY_PATH="$MPI_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$MPI_LIB:$LD_LIBRARY_PATH"
export MANPATH="$MPI_MAN:$MANPATH"


.bahsrc_hdf5:

# hdf5 compiled with intel-14.0.3
export HDF5_HOME="/local/hdf5/intel-14.0.3/1.8.13"
export HDF5_INC="$HDF5_HOME/include"
export HDF5_BIN="$HDF5_HOME/bin"
export HDF5_LIB="$HDF5_HOME/lib"
export PATH="$HDF5_BIN:$PATH"
export LIBRARY_PATH="$HDF5_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HDF5_LIB:$LD_LIBRARY_PATH"


.bashrc_papi:

# papi compiled with intel-14.0.3
export PAPI_HOME="/local/papi/intel-14.0.3/5.3.0"
export PAPI_INC="$PAPI_HOME/include"
export PAPI_BIN="$PAPI_HOME/bin"
export PAPI_LIB="$PAPI_HOME/lib"
export PATH="$PAPI_BIN:$PATH"
export LIBRARY_PATH="$PAPI_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$PAPI_LIB:$LD_LIBRARY_PATH"


.bashrc_petsc:

# petsc compiled with intel-14.0.3
export PETSC_HOME="/local/petsc/intel-14.0.3/3.4.4/"
export PETSC_INC="$PETSC_HOME/linux-intel64/include"
export PETSC_BIN="$PETSC_HOME/linux-intel64/bin"
export PETSC_LIB="$PETSC_HOME/linux-intel64/lib"
export PATH="$PETSC_BIN:$PATH"
export LIBRARY_PATH="$PETSC_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$PETSC_LIB:$LD_LIBRARY_PATH"


.bashrc_slepc:

# slepc compiled with intel-14.0.3
export SLEPC_HOME="/local/slepc/intel-14.0.3/3.4.4/"
export SLEPC_INC="$SLEPC_HOME/linux-intel64/include"
export SLEPC_BIN="$SLEPC_HOME/linux-intel64/bin"
export SLEPC_LIB="$SLEPC_HOME/linux-intel64/lib"
export PATH="$SLEPC_BIN:$PATH"
export LIBRARY_PATH="$SLEPC_LIB:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$SLEPC_LIB:$LD_LIBRARY_PATH"


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