Google Sparsehash 2.0.3

Basic information

Installation

Note

Note that the compiler used is Intel 2019 <https://software.intel.com/en-us/articles/intel-c-compiler-190-for-linux-release-notes-for-intel-parallel-studio-xe-2019>. Also, if the compiler to be used is different than this one, the compiler flag -xHost might be different.

  1. Follow these steps, run:

    $ git clone https://github.com/sparsehash/sparsehash
    $ cd sparsehash && mkdir build && cd build
    $ module load intel/19.0.4
    $ CFLAGS="-O3 -xHost" CXXFLAGS="-O3 -xHost" ../configure --prefix=/share/apps/sparsehash/2.0.3/intel/19.0.4
    $ make && make check
    $ sudo mkdir -p /share/apps/sparsehash/2.0.3/intel/19.0.4
    $ sudo make install
    
  2. Create and place the needed module file. Create a file with the following content:

    #%Module1.0####################################################################
    ##
    ## module load sparsehash/2.0.3_intel-19.0.4
    ##
    ## /share/apps/sparsehash/2.0.3/intel/19.0.4
    ## Written by Vincent A. Arcila L and Hamilton Tobon Mosquera.
    ##
    
    proc ModulesHelp {} {
         global version modroot
         puts stderr "Sets the environment for using Google's sparsehash 2.0.3\
    	 \nin the shared directory /share/apps/sparsehash/2.0.3/intel/19.0.4\
    	 \nbuilt with Intel 19.0.4."
    }
    
    module-whatis "(Name________) sparsehash"
    module-whatis "(Version_____) 2.0.3"
    module-whatis "(Compilers___) intel-19.0.4"
    module-whatis "(System______) x86_64-redhat-linux"
    module-whatis "(Libraries___) "
    
    # for Tcl script use only
    set         topdir        /share/apps/sparsehash/2.0.3/intel/19.0.4
    set         version       2.0.3
    set         sys           x86_64-redhat-linux
    
    conflict sparsehash
    
    prepend-path	LD_LIBRARY_PATH		$topdir/lib
    prepend-path	LD_RUN_PATH		$topdir/lib
    prepend-path	LIBRARY_PATH		$topdir/lib
    
    prepend-path    C_INCLUDE_PATH      	$topdir/include
    prepend-path    CXX_INCLUDE_PATH    	$topdir/include
    prepend-path    CPLUS_INCLUDE_PATH  	$topdir/include
    
    prepend-path PKG_CONFIG_PATH     	$topdir/lib/pkgconfig
    

    Create the needed folder and place it:

    $ sudo mkdir /share/apps/modules/sparsehash/
    $ sudo mv 2.0.3_intel-19.0.4 /share/apps/modules/sparsehash/
    

Usage

Load the module:

$ module load sparsehash/2.0.3_intel-19.0.4

If it’s being used to compile an application, loading the module should be enough. If it’s being used to code something, include its header files:

#include <sparsehash/sparse_hash_map> // or sparse_hash_set, dense_hash_map ...

Authors