How to build SUNDIALS 2.6.2 with Intel compilers and CMake

The removal of the old configure build system for SUNDIALS means that CMake must be used. This requires a few different settings than my previous posts. The commands below worked for me on Ubuntu 14.04.1 with the Intel version 15 compilers.

First, download SUNDIALS from and untar the tarball. Then, ensure that your version of CMake is new enough by downloading and installing a recent version of CMake from

Then, build and install SUNDIALS

cd sundials-2.6.2 && mkdir build && cd build
-DCMAKE_C_FLAGS="-xhost -O3 -m64 -I${MKLROOT}/include/intel64/lp64 -I${MKLROOT}/include -fPIC -fp-model precise" \
-DCMAKE_Fortran_FLAGS="-xhost -O3 -m64 -I${MKLROOT}/include/intel64/lp64 -I${MKLROOT}/include -fPIC -fp-model precise" \
make -j12
sudo -s
. /opt/intel/bin/ intel64
make install

Rather than using the variables in the configure script, this sets all the same variables in CMake. Happy solving!