CASA Adoption of C++11 as Compiler Standard

Introduction

The CASA project dates from the early days of C++. When development started, C++ had no exceptions, it had no runtime type information, and it had no templates. As a result, the CASA code is a mixture of coding styles and coding standards. The first step on the road to standardization is to adopt C++11 as the language standard for CASA because it is the primary standard now supported by modern compilers available on all platforms.

Getting Started

CASA's adoption of C++11 has been severely delayed by the absence of modern, vendor supplied C++ compilers for architecture we are required to support. The arrival of RedHat's Developer Toolset has remedied this situation. Versions of the Developer Toolset is available for both RedHat Enterprise Linux 5 (RHEL5) and RedHat Enterprise Linux 6. These are available for installation from the CASA yum repository:

  • RHEL5: yum install devtoolset-2-toolchain
  • RHEL6: yum install devtoolset-3-toolchain
  • OSX: Apple's Xcode has supported the C++11 standard for some time

CASA's C++11 conversion is currently a work in progress. A version of the trunk (which may lack recent changes) is available at:

  • https://svn.cv.nrao.edu/svn/casa/trunk-cpp-11/

The build configuration I use is:

  • RHEL5
    • casacore
      • cmake '-DCXX11=1' '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gfortran' '-DCMAKE_BUILD_TYPE=Debug' -DBUILD_TESTING=OFF '-DCMAKE_INSTALL_PREFIX=../../linux' ..
    • code
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DINTERACTIVE_ITERATION=1 '-DCMAKE_INSTALL_PREFIX=../../linux' '-DUSE_ALMAWVR=1' ..
    • gcwrap
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DCFITSIO_INCLUDE_DIR=/usr/include/cfitsio ..
    • asap
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-2/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DCFITSIO_INCLUDE_DIR=/usr/include/cfitsio ..

  • RHEL6
    • casacore
      • cmake '-DCXX11=1' '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran' '-DCMAKE_BUILD_TYPE=Debug' -DBUILD_TESTING=OFF '-DCMAKE_INSTALL_PREFIX=../../linux' ..
    • code
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DINTERACTIVE_ITERATION=1 '-DCMAKE_INSTALL_PREFIX=../../linux' '-DUSE_ALMAWVR=1' ..
    • gcwrap
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DCFITSIO_INCLUDE_DIR=/usr/include/cfitsio ..
    • asap
      • cmake '-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/g++' '-DCMAKE_C_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gcc' '-DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-3/root/usr/bin/gfortran' '-DLLVMCOMPILER=1' '-Darch=linux' '-DCMAKE_BUILD_TYPE=Debug' -DCFITSIO_INCLUDE_DIR=/usr/include/cfitsio ..

  • OSX
    • casacore
      • cmake '-DCXX11=1' '-DCMAKE_CXX_COMPILER=/usr/bin/clang++' '-DCMAKE_C_COMPILER=/usr/bin/clang' '-DCMAKE_Fortran_COMPILER=/opt/casa/01/bin/gfortran-mp-4.9' '-DCMAKE_BUILD_TYPE=Debug' -DBUILD_TESTING=OFF '-DCMAKE_INSTALL_PREFIX=../../darwin' ..
    • code
      • cmake '-DCMAKE_CXX_COMPILER=/usr/bin/clang++' '-DCMAKE_C_COMPILER=/usr/bin/clang' '-DCMAKE_Fortran_COMPILER=/opt/casa/01/bin/gfortran-mp-4.9' '-DLLVMCOMPILER=1' '-DREADLINE_ROOT_DIR=/opt/casa/01' '-Darch=darwin' '-DCMAKE_BUILD_TYPE=Debug' -DINTERACTIVE_ITERATION=1 '-Dpgplot_ext=_nox' '-DCMAKE_INSTALL_PREFIX=../../darwin' '-DUSE_ALMAWVR=1' ..
    • gcwrap
      • cmake '-DCMAKE_CXX_COMPILER=/usr/bin/clang++' '-DCMAKE_C_COMPILER=/usr/bin/clang' '-DCMAKE_Fortran_COMPILER=/opt/casa/01/bin/gfortran-mp-4.9' '-DLLVMCOMPILER=1' '-DREADLINE_ROOT_DIR=/opt/casa/01' '-Darch=darwin' '-DCMAKE_BUILD_TYPE=Debug' -DINTERACTIVE_ITERATION=1 '-Dpgplot_ext=_nox' '-DCMAKE_INSTALL_PREFIX=../../darwin' ..
    • asap
      • cmake '-DCMAKE_CXX_COMPILER=/usr/bin/clang++' '-DCMAKE_C_COMPILER=/usr/bin/clang' '-DCMAKE_Fortran_COMPILER=/opt/casa/01/bin/gfortran-mp-4.9' '-DLLVMCOMPILER=1' '-Dcasa_packages=/opt/casa/01' '-DPYTHON_LIBNAME=2.7' '-Darch=darwin' '-DCMAKE_BUILD_TYPE=Debug' ..

-- DarrellSchiebel - 2015-02-19

This topic: Software > WebHome > LegacyCASA > ObtainingCASA > CasaIndex > CasaC++11
Topic revision: 2015-02-19, DarrellSchiebel
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback