wiki:InstallFromSource/cmake

Compiling rasdaman using CMake (v3.0+)

  1. Clone rasdaman source code:
    git clone git://rasdaman.org/rasdaman.git rasdaman
    
  2. Create a build directory:
    mkdir build
    
  3. Configure rasdaman to be build in the build directory (see the section below for the list of available configurations):
    cd build
    cmake <path to rasdaman source directory> 
    
  4. Compile and install:
    make (or make -j)
    make install
    

Available configurations

1. Command line configuration:

CMake accepts command line parameters using -D specifier. The list of available configurations in rasdaman are listed below:

// Installation directory.
CMAKE_INSTALL_PREFIX

// Enable  this if you need detailed output from the make process. (default: OFF)
CMAKE_VERBOSE_OUTPUT

// Change the default Base DBMS (sqlite, postgresql) (default: sqlite)
DEFAULT_BASEDB

// This feature enables generation of binaries that contain extra code for benchmark output. (default: OFF)
ENABLE_BENCHMARK

// Enable debug symbols and define RMANDEBUG and DEBUG. If you do not need RMANDEBUG, only create a Debug build using CMake.(default: OFF)
ENABLE_DEBUG

// Enable or disable compilation and installation of Java-based components, including rasj and petascope.(default: ON)
ENABLE_JAVA

// Compile and install R package. (default: OFF)
ENABLE_R

// Enable compiling in strict mode: warnings terminate compilation. (default: OFF)
ENABLE_STRICT

// The path where the server stores blobs as files. (default: <rasdaman_install_dir>/data)
FILE_DATA_DIR

// Generate doxygen documentation during build.(default: OFF)
GENERATE_DOCS

// Generate position independent code (PIC) (default: ON)
GENERATE_PIC

// Set the Java application deployment mode (external or embedded) (default: external)
JAVA_SERVER

// The path where the servers will store their logs. (default: <rasdaman_install_dir>/log)
LOG_DIR

// Set the network protocol used in rasdaman (rasnet or rnp). (default: rasnet)
NETWORK_PROTOCOL

// Change the default DBMS used by petascope (postgresql, hsqldb, sqlite) (default: postgresql)
PETASCOPEDB

// This feature enables the inclusion of GDAL library during installation. (default: ON)
USE_GDAL

// This feature enables the inclusion of GRIB library during installation. (default: OFF)
USE_GRIB

// This feature enables the inclusion of HDF4 library during installation. (default: OFF)
USE_HDF4

// This feature enables the inclusion of netCDF library during installation. (default: OFF)
USE_NETCDF

// The path where the war files should be installed. (default: <rasdaman_install_dir>/share/rasdaman/war
WAR_DIR

// You can add the flags for g++ by adding these values in DCMAKE_CXX_FLAGS (e.g: -DCMAKE_CXX_FLAGS=" -O1" it will append the optimization flag " -01" in g++).

Example: Configure rasdaman to be installed in /home/rasdaman/install, with WAR directory in /var/lib/tomcat/webapps, using NETCDF

cmake ../rasdaman -DCMAKE_INSTALL_PREFIX=/home/rasdaman/install -DWAR_DIR=/var/lib/tomcat/webapps -DUSE_NETCDF=ON

2. Using cmake-gui

  • install cmake-gui or cmake-qt-gui
  • specify the source and build directories
  • click on generate "Configure"
  • select the desired configuration from GUI
  • click on "Generate" to generate the configuration
  • go to the build directory and run make

Getting better build times

The cmake build of rasdaman supports parallel builds. The below command can be used to build rasdaman on <no of cores> - 1 cores (if the machine where rasdaman is built has multiple cores):

make -j $(($(nproc) - 1))

The build time can be further improved by installing ccache.

Last modified 6 months ago Last modified on Jan 3, 2017 11:21:51 AM