Skip to content

Latest commit

 

History

History
110 lines (83 loc) · 3.69 KB

GETTING_STARTED.md

File metadata and controls

110 lines (83 loc) · 3.69 KB

Getting Started with MCF

Installation

Dependencies

Mcf has been tested on Ubuntu 18.04 / 20.04 with the following package dependencies:

For building MCF with CUDA support:

Installing Dependencies

Dependencies can be installed in any of the following ways:

  • (Option 1) Install dependencies with automated install script: Run the install script to automatically install all dependencies. Dependency packages will downloaded to mcf/deps/<package_name> and installed to a user defined directory (note: install_dir must be an absolute path, for example "$HOME/flux-mcf"):

    bash install_deps.sh <install_dir> <number_of_cores>
    

    (Optional) To install dependencies required to build MCF with CUDA support:

    bash install_cuda_deps.sh <install_dir> <number_of_cores>
    
  • (Option 2) Manually install the dependencies: Ensure that the headers and libraries (where applicable) are either installed to system paths or add the paths to the cmake search path using the CMAKE_PREFIX_PATH cmake argument.

  • (Option 3) Install dependencies within Docker container: Follow the instructions in the Docker README.

Building MCF

  • The path to the installed dependencies can either be added to the MCF cmake command in -DCMAKE_INSTALL_PREFIX or can be added to $PATH:

    export PATH=$PATH:/path/to/install_dir
    
  • Install MCF:

    mkdir build
    cd build
    cmake .. \
      -DCMAKE_INSTALL_PREFIX=/path/to/install/dir \                      # Directory where mcf will be installed
      -DCMAKE_PREFIX_PATH="/path/to/deps/install;/path/to/other/dir" \    # Directories in which dependencies are installed.
      -DBUILD_CUDA=TRUE \
      -DBUILD_REMOTE=TRUE \
      -DBUILD_TESTS=TRUE
    make -j<number_of_cores>
    make install
    

    Note. If you get an error fatal error: unable to parse version script file /path/to/libexports.txt, make sure you are using the ld.bfd linker (as opposed to the gold linker for example).

  • Ensure that the install directory is on the LD_LIBRARY_PATH (to make the change persist, add the command to your .bashrc file):

    export LD_LIBRARY_PATH:$LD_LIBRARY_PATH:/path/to/install/dir
    

Installing MCF Value Type Generator

Follow instructions in the README.md

Installing MCF Python

Follow instructions in README.md

Running Tests

MCF must be compiled with `-BUILD_REMOTE=TRUE`, `-BUILD_TESTS=TRUE` to run tests.
  • To run gtests:

    cd build
    ctest
    
  • To run pytests:

    # Ensure MCF Python and MCF Value Type Generator have been installed
    pip install pytest
    PYTHONPATH=mcf_tools/types_generator:$PYTHONPATH pytest mcf_tools/types_generator/test/manual_tests mcf_remote
    
  • To run generated value type tests:

    cd mcf_tools/types_generator/test/generated_tests/example_value_types_test && bash run_test.sh
    

Cleaning

  • To clean entire cmake build:

    rm -r build
    
  • To clean data generated by MCF (e.g. generated value types):

    make McfCleaner