Skip to content
Nichols A. Romero edited this page Apr 3, 2015 · 1 revision
  1. summary Instructions for building MADNESS on the "MCS Green build" Ubuntu Linux at Argonne National Laboratory

Table of Contents

Environment

Add the Intel compiler to your $USER/.soft environment

+intel
+gcc-4.7.3
+cmake-2.8.12
+totalview-8.10.0-1
@default

Additionally, add the Intel XE Composer 2013 to your environment. $USER/.cshrc

if ( $?prompt ) then
  1. intel inspector
source /soft/com/packages/intel/13/146/inspector_xe_2013/inspxe-vars.csh

MPICH

The version of MPI that is default on the Ubuntu Linux distribution appears to work with MADNESS. The instructions below are for those who wish to compile a newer version of MPICH2 with debugging flags.

Download MPICH2 1.5, and compile with Intel or GNU compiler

#./configure CC=icc CXX=icpc F77=ifort FC=ifort \
./configure CC=gcc CXX=g++ F77=gfortran FC=gfortran \
    --prefix=/homes/naromero/mpich2-1.5-GCC4.7.3 \
    --with-thread-package=posix \
    --enable-g=all \
    --enable-cxx \
    --enable-f77 \
    --enable-fc \
    --enable-romio \
    --with-device=ch3:nemesis \
    --with-pm=hydra \
    --enable-smpcoll 
make -j 6

MADNESS source

You will need to download the source from the Github.

Generate Configure Scripts

$ cd madness
$ autogen.sh

MADNESS with GCC 4.7.3

Here is an example build script that works:

#!/bin/bash -x
export LANG=C

export INTELROOT=/soft/com/packages/intel/13/146
export MKLROOT=${INTELROOT}/mkl
export LIBS="-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group ${INTELROOT}/lib/intel64/libifcore.a"
export LIBS="${LIBS} -lpthread -lm -ldl"
export CPPFLAGS="-I." 
export CXXFLAGS="${CPPFLAGS} -O2"

export MPICC=mpicc
export MPICXX=mpicxx
export CC=mpicc
export CXX=mpicxx
export F77=mpif77

./configure \
   --enable-debugging=yes \
   --enable-optimal=no  \
   --enable-optimization=no \
   --with-fortran-int32 \

All regression tests are currently passing.

MADNESS with Intel 13.0.1

Here is an example build script that works:

#!/bin/bash -x

export LANG=C

export MKLROOT=/soft/com/packages/intel/13/146/mkl
export LIBS="-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLR
OOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--
end-group"
export LIBS="${LIBS} -lpthread -lm"
  1. export LIBS="${LIBS} -L/home/naromero/madness-icc-trunk/src/lib/tensor/new_mtx
mq/bests -lMADMTXM" export CPPFLAGS="-I." export CXXFLAGS="${CPPFLAGS} -O2 -g" export MPICC=mpicc export MPICXX=mpicxx export CC=mpicc export CXX=mpicxx export F77=mpif77 ./configure \ --enable-debugging=no \ --enable-optimal=no \ --enable-optimization=no \ --enable-warning=Intel \ --with-fortran-int32 \ --with-google-test=/homes/naromero/gtest-1.6.0-ICC13.0.1

All tests are passing, but you need the latest version of the compiler.

naromero-desktop:~> icc -V
Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.1.163 Build 20130313
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

Elemental Toolchain with MKL support

Tested with Intel 13 compiler, will probably work with GCC as well.

set(CMAKE_SYSTEM_NAME MCSGreenBuildLinux-static)

set(MKLROOT "/soft/com/packages/intel/13/146/mkl")

# The serial compilers                                                                              
set(CMAKE_C_COMPILER        mpicc)
set(CMAKE_CXX_COMPILER      mpicxx)
# set(CMAKE_Fortran_COMPILER  mpif77)                                                               

# The MPI wrappers for the C and C++ compilers                                                      
set(MPI_C_COMPILER   mpicc)
set(MPI_CXX_COMPILER mpicxx)

set(CXX_FLAGS_PUREDEBUG "-g")
set(CXX_FLAGS_PURERELEASE "-g -O2")
set(CXX_FLAGS_HYBRIDDEBUG "-g")
set(CXX_FLAGS_HYBRIDRELEASE "-g -O2")

# set(CMAKE_THREAD_LIBS_INIT "-fopenmp")                                                            
# set(OpenMP_CXX_FLAGS "-fopenmp")                                                                  

##############################################################                                      
# adjust the default behaviour of the FIND_XXX() commands:                                          
# search headers and libraries in the target environment, search                                    
# programs in the host environment                                                                  
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

##############################################################                                      

set(MATH_LIBS "-Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/\
libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lm")
set(IFCORE_LIB "/soft/com/packages/intel/13/146/lib/intel64/libifcore.a")