New Third Party package flags:

Casacore

cmake -DCASA_BUILD=1 -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gfortran -DBoost_NO_BOOST_CMAKE=1 -DCASA_BUILD=1 -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=../../linux -DCMAKE_BUILD_TYPE=Debug ..

Code

cmake -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gfortran -DBoost_NO_BOOST_CMAKE=1 -DEXTRA_C_FLAGS=-DPG_PPU -I/opt/casa/02/include/wcslib -Darch=linux -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF ..

Gcwrap

cmake -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gfortran -DBoost_NO_BOOST_CMAKE=1 -Darch=linux -DPYTHONLIBD=/opt/casa/02/lib/python2.7 -DSWIG_EXECUTABLE=/opt/casa/02/bin/swig -DCMAKE_BUILD_TYPE=Debug ..

Asap

cmake -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-4/root/usr/bin/gfortran -DLLVMCOMPILER=1 -Darch=linux -DCMAKE_BUILD_TYPE=Debug -DCFITSIO_INCLUDE_DIR=/usr/include/cfitsio -DBoost_NO_BOOST_CMAKE=1 -DPYTHON_ROOT_DIR=/opt/casa/02 -DPGPLOT_ROOT_DIR=/opt/casa/02 -DWCSLIB_ROOT_DIR=/opt/casa/02 ..

cmake configuration for all 4 components on rpm install:

run with cmake -C file other-options path

# default casa developer settings, requires RPM dependency installations
# works on all components (casacore, code, gcwrap, asap) use via:
# cmake -C this-file -DEXTRA_OPTIONS_IF_NEEDED=ON <path-to-src>
# note extra options need to be defined after the -C flag, they can override
# the contents of this file
# does not set the compilers, this should be done via the environment e.g.:
# source /opt/rh/devtoolset-3/enable
# this way your ccache will still work out of the box

# build casacore for CASA
set(CASA_BUILD TRUEON CACHE BOOL "" FORCE)
# build casacore python bindings
set(BUILD_PYTHON ON CACHE BOOL "" FORCE)
set(PYTHON_EXECUTABLE "/usr/lib64/casa/01/bin/python" CACHE FILEPATH "" FORCE)
set(PYTHON_INCLUDE_DIR "/usr/lib64/casa/01/include/python2.7" CACHE PATH "" FORCE)
set(PYTHON_LIBRARY "/usr/lib64/casa/01/lib/libpython2.7.so" CACHE FILEPATH "" FORCE)
set(SWIG_EXECUTABLE "/usr/lib64/casa/01/bin/swig" CACHE FILEPATH "" FORCE)

# optional settings to speed up build by skipping stuff
# disable casacore unit tests build to save time
#set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
# no library versioning to avoid need to relink everything on update
#set(NO_SOVERSION TRUEON CACHE BOOL "" FORCE)

# workaround for el6 cmake bugs
set(Boost_NO_BOOST_CMAKE ON CACHE BOOL "" FORCE)

makefile to build all 4 components:

using out of source build, tab the target commands, I don't know how to do that in the wiki

update LOCAL, CMAKECACHE and the source location in the config target to your folders.

LOCAL ?= PUT YOUR CMAKE PREFIX HERE
CMAKECACHE := ../../casa.cmake.cache
BUILDOPT ?= -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g -DNDEBUG -fno-omit-frame-pointer"

all: casacore code gcwrap asap

casacore:
$(MAKE) -C $@ all install
code:
$(MAKE) -C $@ all install

#mostly java generation, limit to number of local cores instead of distcc cores
gcwrap:
make -j 16 -C $@ all install
asap:
$(MAKE) -C $@ all install

clean:
$(MAKE) -C casacore clean
$(MAKE) -C code clean
$(MAKE) -C gcwrap clean
$(MAKE) -C asap clean

distclean:
rm -rf casacore code gcwrap asap

config:
mkdir -p casacore code gcwrap asap
cd casacore && CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=$(LOCAL) -C $(CMAKECACHE) $(BUILDOPT) ../../casacore
cd code && CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=$(LOCAL) -C $(CMAKECACHE) $(BUILDOPT) ../../src.git/code
cd gcwrap && CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=$(LOCAL) -C $(CMAKECACHE) $(BUILDOPT) ../../src.git/gcwrap
cd asap && CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=$(LOCAL) -C $(CMAKECACHE) $(BUILDOPT) ../../src.git/asap

fromscratch:
$(MAKE) config || true
$(MAKE) casacore
$(MAKE) config || true
$(MAKE) code
$(MAKE) config
$(MAKE)

Under construction:

Here are Kumar's instructions to build on a RH 6 Developer Workstation:

https://safe.nrao.edu/wiki/bin/view/Software/CASAInstallFromSource

Note: -DBoost_NO_BOOST_CMAKE=1 flag is needed for cmake versions later than 2.8.5. Alternatively you can remove the later version and install 2.8.5 with "yum install cmake-2.8.5".

Extra flags for C++11

Note: These flags are required to enable C++11 support. You need to install devtoolset-3 rpms from the Casa repository before attempting the build with these

-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

Casacore

cmake  -DBoost_NO_BOOST_CMAKE=1 -DCASA_BUILD=1 -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=../../linux -DBUILD_PYTHON=1 -DPYTHON_INCLUDE_DIR=/usr/lib64/casa/01/include/python2.7 -DPYTHON_LIBRARY=/usr/lib64/casa/01/lib/libpython2.7.so -DBOOST_ROOT=/usr/lib64/casa/01 -DCMAKE_BUILD_TYPE=Release -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 ..
  • RH7: python RPMs installed in /opt/casa/01

Code

cmake  -DBoost_NO_BOOST_CMAKE=1 '-DEXTRA_C_FLAGS=-DPG_PPU -I/usr/include/wcslib' -Darch=linux -DBoost_NO_BOOST_CMAKE=1 -DCMAKE_BUILD_TYPE=Release -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 ..

Gcwrap

cmake -DBoost_NO_BOOST_CMAKE=1 -Darch=linux -DSWIG_EXECUTABLE=/usr/lib64/casa/01/bin/swig -DBoost_NO_BOOST_CMAKE=1 -DCMAKE_BUILD_TYPE=Release -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 ..

Asap

cmake -DBoost_NO_BOOST_CMAKE=1 -DEXTRA_C_FLAGS=-I/usr/include/wcslib -Darch=linux -DBoost_NO_BOOST_CMAKE=1 -DCMAKE_BUILD_TYPE=Release -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 ..

-- VilleSuoranta - 2015-04-20
Topic revision: r24 - 2017-01-12, VilleSuoranta
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