Difference between revisions of "Installation script for Z800"

From www.coria-cfd.fr
Jump to: navigation, search
m
m
Line 61: Line 61:
 
  OPENMPI_FILE = $(OPENMPI_NAME)-$(OPENMPI_VERSION).tar.bz2
 
  OPENMPI_FILE = $(OPENMPI_NAME)-$(OPENMPI_VERSION).tar.bz2
 
  OPENMPI_CONFIGURE_OPTIONS = --enable-mpi-fortran --enable-static --enable-shared
 
  OPENMPI_CONFIGURE_OPTIONS = --enable-mpi-fortran --enable-static --enable-shared
 +
 +
ZLIB_NAME = zlib
 +
ZLIB_VERSION = 1.2.8
 +
ZLIB_LOCATION = http://zlib.net
 +
ZLIB_FILE = $(ZLIB_NAME)-$(ZLIB_VERSION).tar.gz
 +
ZLIB_CONFIGURE_OPTIONS =
 
   
 
   
 
  FFTW_NAME = fftw
 
  FFTW_NAME = fftw
Line 119: Line 125:
 
  COMPILER_VERSION  = 15.0.0
 
  COMPILER_VERSION  = 15.0.0
 
  COMPILER_PATH    = /opt/intel/composerxe/bin
 
  COMPILER_PATH    = /opt/intel/composerxe/bin
 +
COMPILER_MPI_PATH = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin
 
  COMPILER_CC      = $(COMPILER_PATH)/icc
 
  COMPILER_CC      = $(COMPILER_PATH)/icc
  COMPILER_MPICC    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpicc
+
  COMPILER_MPICC    = $(COMPILER_MPI_PATH)/mpicc
 
  COMPILER_CFLAGS  = "-O2 -g"
 
  COMPILER_CFLAGS  = "-O2 -g"
 
  COMPILER_CXX      = $(COMPILER_PATH)/icpc
 
  COMPILER_CXX      = $(COMPILER_PATH)/icpc
  COMPILER_MPICXX  = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpicxx
+
  COMPILER_MPICXX  = $(COMPILER_MPI_PATH)/mpicxx
 
  COMPILER_CXXFLAGS = "-O2 -g"
 
  COMPILER_CXXFLAGS = "-O2 -g"
 
  COMPILER_FC      = $(COMPILER_PATH)/ifort
 
  COMPILER_FC      = $(COMPILER_PATH)/ifort
  COMPILER_MPIFC    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpifort
+
  COMPILER_MPIFC    = $(COMPILER_MPI_PATH)/mpifort
 
  COMPILER_FCFLAGS  = "-O2 -g"
 
  COMPILER_FCFLAGS  = "-O2 -g"
 
  COMPILER_FF      = $(COMPILER_PATH)/ifort
 
  COMPILER_FF      = $(COMPILER_PATH)/ifort
  COMPILER_MPIFF    = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin/mpifort
+
  COMPILER_MPIFF    = $(COMPILER_MPI_PATH)/mpifort
 
  COMPILER_FFLAGS  = "-O2 -g"
 
  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)
+
  default: $(OPENMPI_NAME)-$(OPENMPI_VERSION) $(ZLIB_NAME)-$(ZLIB_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):
 
  $(OPENMPI_NAME)-$(OPENMPI_VERSION):
Line 150: Line 157:
 
  make -j $(NPROCS) &&\
 
  make -j $(NPROCS) &&\
 
  rm -rf $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION) &&\
 
  rm -rf $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION) &&\
 +
make install\
 +
)
 +
 +
$(ZLIB_NAME)-$(ZLIB_VERSION):
 +
(\
 +
mkdir -p $(INSTALL_DIR)/Downloads &&\
 +
mkdir -p $(INSTALL_DIR)/Builds &&\
 +
mkdir -p $(INSTALL_DIR)/local &&\
 +
cd $(INSTALL_DIR)/Downloads &&\
 +
if [ ! -f $(ZLIB_FILE) ]; then $(WGET) $(ZLIB_LOCATION)/$(ZLIB_FILE); fi &&\
 +
cd $(INSTALL_DIR)/Builds &&\
 +
rm -rf $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_NAME)-$(ZLIB_VERSION) &&\
 +
mkdir -p $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
 +
cd $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
 +
tar -xvf $(INSTALL_DIR)/Downloads/$(ZLIB_FILE) &&\
 +
cd $(INSTALL_DIR)/Builds/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_NAME)-$(ZLIB_VERSION) &&\
 +
./configure --prefix=$(INSTALL_DIR)/local/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_VERSION) &&\
 +
make -j $(NPROCS) &&\
 +
rm -rf $(INSTALL_DIR)/local/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_VERSION) &&\
 
  make install\
 
  make install\
 
  )
 
  )

Revision as of 15:34, 26 October 2015

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.10.0
OPENMPI_MAJOR_VERSION = 1.10
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

ZLIB_NAME = zlib
ZLIB_VERSION = 1.2.8
ZLIB_LOCATION = http://zlib.net
ZLIB_FILE = $(ZLIB_NAME)-$(ZLIB_VERSION).tar.gz
ZLIB_CONFIGURE_OPTIONS =

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.15-patch1
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.4
SCOTCH_LOCATION = https://gforge.inria.fr/frs/download.php/file/34618
SCOTCH_FILE = $(SCOTCH_NAME)_$(SCOTCH_VERSION).tar.gz
SCOTCH_CONFIGURE_OPTIONS =

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

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

PAPI_NAME = papi
PAPI_VERSION = 5.4.1
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.6.2
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.6.1
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  = 15.0.0
COMPILER_PATH     = /opt/intel/composerxe/bin
COMPILER_MPI_PATH = $(INSTALL_DIR)/local/$(OPENMPI_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(OPENMPI_VERSION)/bin
COMPILER_CC       = $(COMPILER_PATH)/icc
COMPILER_MPICC    = $(COMPILER_MPI_PATH)/mpicc
COMPILER_CFLAGS   = "-O2 -g"
COMPILER_CXX      = $(COMPILER_PATH)/icpc
COMPILER_MPICXX   = $(COMPILER_MPI_PATH)/mpicxx
COMPILER_CXXFLAGS = "-O2 -g"
COMPILER_FC       = $(COMPILER_PATH)/ifort
COMPILER_MPIFC    = $(COMPILER_MPI_PATH)/mpifort
COMPILER_FCFLAGS  = "-O2 -g"
COMPILER_FF       = $(COMPILER_PATH)/ifort
COMPILER_MPIFF    = $(COMPILER_MPI_PATH)/mpifort
COMPILER_FFLAGS   = "-O2 -g"

default: $(OPENMPI_NAME)-$(OPENMPI_VERSION) $(ZLIB_NAME)-$(ZLIB_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\
	)

$(ZLIB_NAME)-$(ZLIB_VERSION):
	(\
	mkdir -p $(INSTALL_DIR)/Downloads &&\
	mkdir -p $(INSTALL_DIR)/Builds &&\
	mkdir -p $(INSTALL_DIR)/local &&\
	cd $(INSTALL_DIR)/Downloads &&\
	if [ ! -f $(ZLIB_FILE) ]; then $(WGET) $(ZLIB_LOCATION)/$(ZLIB_FILE); fi &&\
	cd $(INSTALL_DIR)/Builds &&\
	rm -rf $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_NAME)-$(ZLIB_VERSION) &&\
	mkdir -p $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	cd $(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION) &&\
	tar -xvf $(INSTALL_DIR)/Downloads/$(ZLIB_FILE) &&\
	cd $(INSTALL_DIR)/Builds/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_NAME)-$(ZLIB_VERSION) &&\
	./configure --prefix=$(INSTALL_DIR)/local/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_VERSION) &&\
	make -j $(NPROCS) &&\
	rm -rf $(INSTALL_DIR)/local/$(ZLIB_NAME)/$(COMPILER_FAMILY)-$(COMPILER_VERSION)/$(ZLIB_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):
	(\
	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-15.0.0
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:

export MPI_HOME="/local/openmpi/intel-15.0.0/1.8.3"
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:

export HDF5_HOME="/local/hdf5/intel-15.0.0/1.8.14"
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:

export PAPI_HOME="/local/papi/intel-15.0.0/5.3.2"
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:

export PETSC_HOME="/local/petsc/intel-15.0.0/3.5.2/"
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:

export SLEPC_HOME="/local/slepc/intel-15.0.0/3.5.2/"
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"


For RHEL 7 platforms:

# Avant le premier boot
# 1/ mettre les 4 disques de 4TB dans les 4 baies du bas
# 2/ mettre le disque SSD de 256GB dans la baie du haut

# Au boot
# 1/ créer le raid matériel
# 2/ boot UEFI sur le SSD
# 3/ Désactiver HyperThreading
# 4/ Désactiver IntelBoost

# finir l’install RHEL
# créer admincoria/root avec un mdp toto (ATTENTION AU CLAVIER AMERICAIN)

# clavier francais au boot
localectl set-locale LANG=en_US.utf8
localectl set-x11-keymap fr
localectl set-keymap fr

# remettre les mdp classiques pour admincoria et root

# modifier le nom de la machine
vi /etc/hostname 

# associer un numéro RHN
subscription-manager register --username=admincoria --password=XXXXXXXX --auto-attach

# créer une table de partition gpt et une partition sur /dev/sda (RAID matériel)
parted /dev/sda
mktable gpt
mkpart primary xfs 64MB 100%

# créer un filesysteme pour /home
mkfs -t xfs /dev/sda1

# deménager l’ancien home et créer le nouveau
umount /home
mount /dev/sda1 /home
mkdir /home2
mount /dev/rhel/home /home2
mv /home2/admincoria /home/admincoria
umount /home2

# modifier /etc/fstab
/dev/sda1               /home                   xfs     defaults        1 2
#==> PENSER A ENLEVER LA LIGNE /dev/rhel/home

# commandes utils pour lvm
lvmdiskscan
vgscan
vgdisplay
lvdisplay

# enlever le volume logique de /home sur le SSD
lvremove /dev/rhel/home

# augmenter la taille de / à 100% de la place dispo
lvextend -l +100%FREE /dev/rhel/root

# augmenter la taille de / jusqu’au maxi dispo
df -k
xfs_info /
xfs_growfs /
df -k

# ajouter le EPEL 7.2
rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm

# ajouter les bons repos
subscription-manager repos --enable rhel-7-workstation-extras-rpms
subscription-manager repos --enable rhel-7-workstation-optional-rpms
subscription-manager repos --enable rhel-7-workstation-rhn-tools-rpms

# MaJ système
yum update -y

# install
yum install -y x2goserver
yum install -y gparted
yum install -y fail2ban
yum install -y zlib
yum install -y linuxdoc-tools
yum install -y gnuplot
yum install -y paraview
yum install -y lzip
yum install -y xorg-x11-fonts*
yum install -y htop emacs xemacs

# rapatrier clé ssh admincoria puis chmod 700 .ssh

# modifier la config ssh et redémarrer ssh
vi /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
#PasswordAuthentication yes
PasswordAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no

systemctl restart sshd.service

# set fail2ban
vi /etc/fail2ban/jail.conf
ignoreip = 127.0.0.1/8 194.254.16.0/24 88.184.97.196
bantime  = 86400
findtime  = 86400
[sshd]
enabled  = true
port    = ssh
logpath = %(sshd_log)s
[sshd-ddos]
enabled  = true
port    = ssh
logpath = %(sshd_log)s

fail2ban-server
fail2ban-client reload
chkconfig fail2ban on

# install intel dans /opt en tant qu'admincoria
rsync azuv amdincoria@luis:/opt/intel /tmp
mv /tmp/intel /opt
chown -R root:root /opt/intel

# créer les .bashrc_* dans /etc/skel 
source .bashrc_intel

# Install librairies (Makefile sur coria-cfd)

# installer grace
wget ftp://plasma-gate.weizmann.ac.il/pub/grace/src/stable/grace-5.1.24.tar.gz
./configure --prefix=/local
make -j 8
make install

# créer les utilisateurs

# rapatrier maqao

# VLC & mencoder & ffmpeg
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum -y update
yum install -y vlc mencoder ffmpeg


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