Compiling SQLite 3.8.1 on CentOS 5

Taken from Beyond Linux® From Scratch – Version 2013-11-30

SQLite 3.8.1

  1. Download (HTTP): http://sqlite.org/2013/sqlite-autoconf-3080100.tar.gz
  2. Download size: 1.9 MB

SQLite 3.8.1 Documents

  1. Download (HTTP): http://sqlite.org/2013/sqlite-doc-3080100.zip
  2. Download size: 4.1 MB

Compiling SQLite 3.8.1

# ./configure --prefix=/usr/local/sqlite-3.8.1 --disable-static        \
CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 \
-DSQLITE_ENABLE_COLUMN_METADATA=1     \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1       \
-DSQLITE_SECURE_DELETE=1" &&
# make
# make install

Compiling SQLite Documents

# install -v -m755 -d /usr/local/sqlite-3.8.1/share/doc/sqlite-3.8.1 &&
# cp -v -R sqlite-doc-3080100/* /usr/local/sqlite-3.8.1/share/doc/sqlite-3.8.1

For more information,

Command Explanations (taken from Beyond Linux® From Scratch – Version 2013-11-30)

–disable-static: This switch prevents installation of static versions of the libraries.

CFLAGS=”-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY=1“: Applications such as Firefox require secure delete and enable unlock notify to be turned on. The only way to do this is to include them in the CFLAGS. By default, these are set to “-g -O2” so we specify that to preserve those settings. You may, of course, wish to omit the ‘-g’ if you do not wish to create debugging information. For further information on what can be specified see http://www.sqlite.org/compile.html.

Installing HTseq for python 26 for CentOS 6

Installing HTseq is very straightforward for CentOS 6. You will need to do just follow the installation manual

# yum install python-devel numpy python-matplotlib

Download and untar the HTSeq source files.

# tar -zxvf HTSeq-0.5.4p5.tar.gz
# cd HTSeq-0.5.4p5

Inside the expanded HTSeq home directories, to make HTSeq available for all users

# python setup.py build
# python setup.py install

For more information, do look at

  1. HTSeq Prerequisites and Installation

Using Eclipse IDE with Intel C++ Compilers on CentOS

This article is taken from Intel C++ Compiler with the Eclipse IDE on Linux

Introduction
Intel C++ Compilers for Linux can be used together with the Eclipse IDE to create C/C++ applications. Via an Intel C++ Eclipse extension the compiler is integrated using the well-known Eclipse C/C++ Development Tooling (CDT) plug-in. Hence all existing features of CDT, like different views, wizards, a powerful editor, and debugging, can be easily used with the Intel compiler as well. In the following a “How-to” guide is provided which explains configuration and usage.


Requirements

  1. Eclipse 3.7, 3.8 or 4.2 ans above
    [http://www.eclipse.org/downloads/]
  2. CDT 8.0 or later
    [http://www.eclipse.org/cdt/]
  3. Java Runtime Environment (JRE) version 6.0 (also called 1.6) update 11 or later
    [http://www.oracle.com/technetwork/java/javase/downloads/index.html]
  4. Intel® Composer XE 2013 and above (separate or any suite that provides it, like Intel® Parallel Studio XE 2013)
    [http://software.intel.com/en-us/intel-composer-xe]

Note:
In case Eclipse has to be installed first, use the package Eclipse IDE for C/C++ Developers. It already comes with everything needed for C/C++ development. We will use it as reference in the following.

Installing the Integration
The following is a brief overview about how to install the Intel C++ Eclipse extension. More information see Learn More below.

  1. Open the Install dialog for plug-ins via menu Help->Install New Software…:
  2. Click on the Add… button and the Add Repository dialog opens:
  3. Click on the Local… button, specify the directory containing the Intel C++ Eclipse extension and confirm. The Intel C++ Eclipse extension can be found in the installation directory of Intel Composer XE, subdirectory eclipse_support/cdt8.0/eclipse.
  4. Back in the Install dialog select the item Intel(R) C++ Compiler XE 13.0 for Linux* OS and continue by pressing the button Next >.
    Optionally you can also install compiler documentation (recommended) and Intel® Debugger support for native & Intel® MIC architecture (provided they are already installed with Intel Composer XE).
  5. In case there are no items listed, ensure that Group items by category is not selected.
  6. The next dialog summarizes all plug-ins to install. Continue via button Next >:
  7. Finally, the license files are displayed. Make sure to read them. Accept and start installation by clicking on button Finish:
  8. Eventually you will be faced with a warning about unsigned content. Confirm by clicking on button OK:
  9. After installation is complete, restart Eclipse

Using Intel C++ Eclipse Extension

  1. Once the Intel C++ Eclipse extension is installed it can be used for all C/C++ projects – new ones as well as existing ones.
  2. When using the extension, make sure to source the compiler scripts before starting Eclipse:
    $ source <composer_xe_path>/bin/compilervars.[sh|csh] [ia32|intel64]
    $ eclipse
  3. This is crucial to locate the compiler installation. See the compiler documentation for more information about the compiler scripts.
  4. If you experience issues with the integration try to set the locale to en_US when starting Eclipse, e.g.:
    $ LANG=en_US eclipse

 

Create New Project

  1. To create a new C/C++ project, use the Eclipse/CDT wizard via File->New->C Project or C++ Project;
  2. By default the flag Show project types and toolchains only if they are supported on the platform is selected. Thus, all toolchains are shown for which there is an existing compiler installation. Select the toolchains for your project – multiple can be selected at once. To use the latest compiler from Intel Composer XE 2013, select version v13.0.0. It is also possible to use older versions in addition as long as there are existing compiler installations.
    When unchecking the flag Show project types and toolchains only if they are supported on the platform, all toolchains are shown, even if no appropriate compiler is installed on the local system. This can be used for environments with distributed build systems where not all nodes have all compilers installed, but only subsets each. Those toolchains can’t be used unless the proper compiler is installed but they will be present and can be configured.

Once a new project is created like this building, linking, executing and debugging is no different than used from CDT with the default toolchain.

For more information, do see Intel C++ Compiler with the Eclipse IDE on Linux

Compiling and Installing Meep-1.2.1 on CentOS 6 and OpenMPI

Meep (or MEEP) is a free finite-difference time-domain (FDTD) simulation software package developed at MIT to model electromagnetic systems, along with our MPB eigenmode package. The latest official version is 1.2 and can be found at  Download Page for Meep

But there is a Lapack linking problem for 1.2 which is explained in Error when compiling Meep-1.2 on CentOS. It is strongly recommended to use the pre-release Meep 1.2.1 found at http://jdj.mit.edu/~stevenj/meep-1.2.1.tar.gz

Before you compile Meep 1.2.1, you need to first compile the libctl library. Compiling the libctl library is quite straightforward. After downloading,

Step 1: Compiling libctl-3.2.1

# tar -zxvf libctl-3.2.1.tar.gz
# cd libctl-3.2.1
# ./configure --prefix=/usr/local/libctl-3.2.1
# make -j8
# make install

Step 2: Other Prerequisites include guile and guile-devel. Do make sure you install these 2 packages which can be done

# yum install guile guile-devel

Step 3: Compiling OpenMPI,
Do look at Compiling OpenMPI 1.6.5 with Intel 12.1.5 on CentOS 6

Step 4: Compiling meep-1.2.1

# tar -zxvf meep-1.2.1.tar.gz
# cd meep-1.2.1
#  ./configure --prefix=/usr/local/meep-1.2.1 \
--with-libctl=/usr/local/libctl-3.2.1/share/libctl/ \
LDFLAGS=-L/usr/local/libctl-3.2.1/lib \
CPPFLAGS=-I/usr/local/libctl-3.2.1/include \
--with-mpi

References:

  1. Undefined reference to `dgetrf_’ error when compiling Meep-1.2 on CentOS
  2. crtbegin.o: No such file: No such file or directory Error when compiling Meep-1.2 on CentOS
  3. My opinion: Compiling Meep

Compiling and installing FFTW 3.3.3 with OpenMPI and OpenMP

This Blog entry is an extension of the Compiling and installing FFTW 3.3.3

To Compile FFTW 3.3.3 single precision with OpenMPI, make sure you compile and set your path for Intel and OpenMPI. You may want to get more information from Compiling OpenMPI 1.6.5 with Intel 12.1.5 on CentOS 6

Step 1: Compiling FFTW 3.3.3 (Single Precision) with OpenMPI and OpenMP

After unpacking FFTW 3.3.3, you may want to use the flags

# ./configure CC=icc 
--enable-float --enable-threads --enable-openmp \
--enable-mpi MPICC=mpicc \
LDFLAGS=-L/usr/local/openmpi/intel/lib CPPFLAGS=-I/usr/local/openmpi/intel/include \ 
--prefix=/usr/local/fftw-3.3.3-single
# make -j8
# make install

Inside /usr/local/fftw-3.3.3-single/lib, you should see at least the files below

libfftw3f.a
libfftw3f_mpi.a
libfftw3f_omp.a
libfftw3f_threads.a
....
....

Step 2: Compiling FFTW 3.3.3 (Double Precision) with OpenMPI and OpenMP

# ./configure CC=icc 
--enable-threads --enable-openmp \
--enable-mpi MPICC=mpicc \
LDFLAGS=-L/usr/local/openmpi/intel/lib CPPFLAGS=-I/usr/local/openmpi/intel/include \ 
--prefix=/usr/local/fftw-3.3.3-single
# make -j8
# make install

Inside /usr/local/fftw-3.3.3-double/lib, you should see at least the files below

libfftw3.a
libfftw3_mpi.a
libfftw3_omp.a
libfftw3_threads.a
....
....

Compiling VASP 5.3.3 with OpenMPI 1.6.5 and Intel 12.1.5

Vienna Ab initio Simulation Package (VASP) is a computer program for atomic scale materials modelling, e.g. electronic structure calculations and quantum-mechanical molecular dynamics, from first principles.

To compile VASP, I will be using the following

  1. Intel Compiler XE 12.1.5
  2. OpenMPI 1.6.5
  3. Maths Kernel Library (MKL)
  4. CentOS 6.3 / RH 6.3

A. Prerequisites

Step 1: Install and Compile Intel XE Compilers 12.1.5 and OpenMPI 1.6.5

  1. Compiling OpenMPI 1.6.5 with Intel 12.1.5 on CentO 6

Step 2: Intel MKL FFTW wrappers

  1. Compile and Build FFTW3 wrapper routines on MKL implementation of FFT

B. Compiling VASP Libraries

Assuming you have unpacked the VASP files. Here is may make file

.SUFFIXES: .inc .f .F
#-----------------------------------------------------------------------
# Makefile for LINUX NAG f90
#-----------------------------------------------------------------------
# fortran compiler
FC=ifort

# C-preprocessor
#CPP     = /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -P -C $*.F >$*.f
CPP      = gcc -E -P -C -DLONGCHAR $*.F >$*.f

CFLAGS = -O
FFLAGS = -Os -FI
FREE   = -FR

DOBJ =  preclib.o timing_.o derrf_.o dclock_.o  diolib.o dlexlib.o drdatab.o

#-----------------------------------------------------------------------
# general rules
#-----------------------------------------------------------------------

libdmy.a: $(DOBJ) linpack_double.o
-rm libdmy.a
ar vq libdmy.a $(DOBJ)

linpack_double.o: linpack_double.f
$(FC) $(FFLAGS) $(NOFREE) -c linpack_double.f

# files which do not require autodouble
lapack_double.o: lapack_double.f
$(FC) $(FFLAGS) $(NOFREE) -c lapack_double.f
lapack_single.o: lapack_single.f
$(FC) $(FFLAGS) $(NOFREE) -c lapack_single.f
#lapack_cray.o: lapack_cray.f
#       $(FC) $(FFLAGS) $(NOFREE) -c lapack_cray.f

.c.o:
$(CC) $(CFLAGS) -c $*.c
.F.o:
$(CPP)
$(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f
.F.f:
$(CPP)
.f.o:
$(FC) $(FFLAGS) $(FREE) $(INCS) -c $*.f

C. Compiling VASP

1. Copy the Makefile from makefile.linux_ifc_P4 in the vasp software.

# cp makefile.linux_ifc_P4 Makefile

2. Edit the Makefile

FC (~ line 62)

#-----------------------------------------------------------------------
# fortran compiler and linker
#-----------------------------------------------------------------------
FC=mpif90
# fortran linker
FCL=$(FC) -mkl

FFLAGS (~line 108)

#-----------------------------------------------------------------------
# general fortran flags  (there must a trailing blank on this line)
# byterecl is strictly required for ifc, since otherwise
# the WAVECAR file becomes huge
#-----------------------------------------------------------------------

FFLAGS =  -FR -names lowercase -assume byterecl

BLAS (~ line 149)

# BLAS
# setting -DRPROMU_DGEMV  -DRACCMU_DGEMV in the CPP lines usually speeds up program execution
# BLAS= -Wl,--start-group $(MKL_PATH)/libmkl_intel_lp64.a $(MKL_PATH)/libmkl_intel_thread.a $(MKL_PATH)/libmkl_core.a -Wl,--end-group -lguide
# faster linking and available from at least version 11
BLAS= -mkl=sequential

LAPACK (~ line 158)

# LAPACK from mkl, usually faster and contains scaLAPACK as well
#LAPACK= $(MKL_PATH)/libmkl_intel_lp64.a
LAPACK =

CPP ( ~ line 223)

#-----------------------------------------------------------------------
CPP = $(CPP_) -DMPI -DHOST=\"LinuxIFC\" -DIFC \
-DCACHE_SIZE=4000 -DPGF90 -Davoidalloc -DNGZhalf \
-DMPI_BLOCK=8000 -Duse_collective -DscaLAPACK \
-DRPROMU_DGEMV -DRACCMU_DGEMV

SCALAPACK (~ line 233)

#-----------------------------------------------------------------------
# location of SCALAPACK
# if you do not use SCALAPACK simply leave this section commented out
#-----------------------------------------------------------------------

# usually simplest link in mkl scaLAPACK
BLACS= -lmkl_blacs_openmpi_lp64
SCA= $(MKL_PATH)/libmkl_scalapack_lp64.a $(BLACS)

LIBRARIES (~line 238)

#-----------------------------------------------------------------------
# libraries
#-----------------------------------------------------------------------

LIB = -L../vasp.5.lib -ldmy \
../vasp.5.lib/linpack_double.o \
$(SCA) $(LAPACK) $(BLAS)

Parallel FFT (~ line 246)

#-----------------------------------------------------------------------
# parallel FFT
#-----------------------------------------------------------------------

# FFT: fftmpi.o with fft3dlib of Juergen Furthmueller
FFT3D = fftmpi.o fftmpi_map.o fft3dfurth.o fft3dlib.o

References:

  1. Building VASP* with Intel® MKL and Intel® Compilers
  2. (Intel Developer Zone)

  3. How to Compile VASP on NSC’s Triolith
  4. Installing VASP
  5. How to build VASP-4.6.36 and VASP-5.2.8 on Intel Westmere with Infiniband network

Installing cmake 2.8 on CentOS 5

If you are intending to compile and install cmake 2.8 on CentOS 5, you have to use a slightly older version of cmake 2.8.10.2 is compatible with CentOS 5. You can get it from this link

http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz

The most recent version of cmake-2.8.11 is only able to be compiled easily on CentOS 6 unless you wish to fix dependencies issues like GBLIC 2.7

Installation is quite easy to compile cmake-2.8.10.2

Step 1: You can use the bootstrap which will default the cmake to default location ie /usr/local/. If you are using bootstrap,

# tar -zxvf cmake-2.8.10.2
# cd cmake-2.8.10.2
# ./bootstrap
# make
# make install

Alternatively, I use the configure command which I’m more accustomed

# tar -zxvf cmake-2.8.10.2
# cd cmake-2.8.10.2
#./configure --prefix=/usr/local/cmake-2.8.10.2
# make
# make install

Compiling and Installing Gromacs 4.6.2 with OpenMPI and Intel on CentOS 6

Step 1: Compiling cmake
To compile Gromacs 4.6.2, first you need to compile cmake 2.8 and above. At this point in writing, the current version is cmake 2.8.11.2

# tar -zxvf cmake-2.8.11.2.tar.gz
# cd cmake-2.8.11.2
# ./configure --prefix=/usr/local/cmake-2.8.11.2
# make
# make install

Step 2: Installing OpenMPI
See Blog Entry Building OpenMPI with Intel Compilers

Step 3: Installing FFTW (Single and Double Precision)
See Blog Entry Compiling and installing FFTW 3.3.3.

Step 4: Compiling Gromacs 4.6.2 (Single-Precision with Intel and OpenMPI)

# tar -zxvf gromacs-4.6.2.tar.gz
# cd gromacs-4.6.2
# mkdir build-cmake
# cd build-cmake
# CC=icc CMAKE_PREFIX_PATH=/usr/local/fftw-3.3.3-single/ /usr/local/cmake-2.8.11.2/bin/cmake .. 
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-4.6.2-single-intel -DGMX_X11=OFF -DGMX_MPI=ON 
-DGMX_PREFER_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
# make
# make install

Step 5: Compiling Gromacs 4.6.2 (Double Precision with Intel and OpenMPI)

# tar -zxvf gromacs-4.6.2.tar.gz
# cd gromacs-4.6.2
# mkdir build-cmake
# cd build-cmake
# CC=icc CMAKE_PREFIX_PATH=/usr/local/fftw-3.3.3-single/ /usr/local/cmake-2.8.11.2/bin/cmake .. 
-DCMAKE_INSTALL_PREFIX=/usr/local/gromacs-4.6.2-single-intel -DGMX_X11=OFF -DGMX_MPI=ON 
-DGMX_PREFER_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DGMX_DOUBLE=ON
# make 
# make install

For more information,

  1. Compiling Gromacs 4.6 and PLUMED from Source
  2. Gromacs Installation instructions

Compiling and installing FFTW 3.3.3

1. FFTW 3.3.3 (Single Precision)

# ./configure --enable-float --enable-threads
# make
# make install

2. FFTW 3.3.3 (Double Precision)

# ./configure --enable threads
# make
# make install

3. Important Note.

If you using FFTW with Gromacs, you may want to compile without threading as according to the document at Gromacs Installation Instructions

…..On x86 hardware, compile only with --enable-sse2 (regardless of precision) even if your processors can take advantage of AVX extensions. Since GROMACS uses fairly short transform lengths we do not benefit from the FFTW AVX acceleration, and because of memory system performance limitations, it can even degrade GROMACS performance by around 20%……

3a. FFTW 3.3.3 (Single Precision)

# ./configure --enable-float --enable-sse2 
# make 
# make install

3b. FFTW 3.3.3 (Double Precision)

# ./configure --enable-sse2 
# make 
# make install

References:

  1. FFTW Home Page
  2. Installation of FFTW (http://www.uvm.edu/~smanchu/fftw_installation.html)

Compiling Cufflinks

Cufflinks assembles transcripts, estimates their abundances, and tests for differential expression and regulation in RNA-Seq samples. It accepts aligned RNA-Seq reads and assembles the alignments into a parsimonious set of transcripts. Cufflinks then estimates the relative abundances of these transcripts based on how many reads support each one, taking into account biases in library preparation protocols.

Preliminary Compilation

  1. Compiling and Installing Boost 1.53
  2. Compiling SamTools
  3. Compiling Eigen

Step 1: Download Cufflinks

Download Cufflinks

Step 2: Compile Cufflinks

# tar -zxvf cufflinks-2.1.1.tar.gz
# cd cufflinks-2.1.1
#  ./configure --prefix=/usr/local/cufflinks/ \
--with-boost=/usr/local/boost \ 
--with-eigen=/usr/local/include
# make
# make install

Step 3: Testing the installation

Download the test data

# /usr/local/cufflinks/bin/cufflinks ./test_data.sam

You should see the following output:

[bam_header_read] EOF marker is absent. The input is probably truncated.
[bam_header_read] invalid BAM binary header (this is not a BAM file).
File ./test_data.sam doesn't appear to be a valid BAM file, trying SAM...
[13:23:15] Inspecting reads and determining fragment length distribution.
> Processed 1 loci.                            [*************************] 100%
Warning: Using default Gaussian distribution due to insufficient paired-end reads in open ranges.  
It is recommended that correct paramaters (--frag-len-mean and --frag-len-std-dev) be provided.
> Map Properties:
>       Total Map Mass: 102.50
>       Read Type: 75bp x 75bp
>       Fragment Length Distribution: Truncated Gaussian (default)
>                     Estimated Mean: 200
>                  Estimated Std Dev: 80
[13:23:15] Assembling transcripts and estimating abundances.
> Processed 1 loci.                            [*************************] 100%

Verify that the file transcripts.gtf   is in the current directory and looks like this  (your file will have GTF attributes, omitted here for clarity)

test_chromosome Cufflinks       exon    53      250     1000    +       . 
test_chromosome Cufflinks       exon    351     400     1000    +       . 
test_chromosome Cufflinks       exon    501     550     1000    +       .