Skip to content

Installation

Jon Drobny edited this page Nov 8, 2022 · 42 revisions

Without optional features, RustBCA should compile with one command using rustup/cargo on Windows, MacOS, and Linux systems. HDF5 and rcpr, the Adaptive Chebyshev Proxy Rootfinder with Automatic Subdivision and Polynomial Rootfinder package, work on Linux with some dependencies, listed below. HDF5 has been tested on Windows, but HDF5 1.10.6 must be used. rcpr has not yet been successfully compiled on Windows. However, it can be compiled on Windows Subsystem for Linux (WSL) and likely on Ubuntu for Windows or Cygwin.

Installation

Manual Dependences:

  • rustup, the Rust toolchain (includes cargo, the Rust package manager, rustc, the Rust compiler, and more).

Automatic Dependencies:

Installation instructions (on most systems) After installing rustup:

git clone https://github.com/lcpp-org/RustBCA
cd RustBCA
cargo build --release

Optional Dependencies (I recommend you start without these until you know you need them):

  • HDF5 libraries
  • rcpr: https://github.com/drobnyjt/rcpr the CPR and polynomial rootfinder, required for using attractive-repulsive interaction potentials such as Lennard-Jones or Morse, may require the following to be installed, depending on the system:
    • gcc
    • build-essential
    • cmake
    • gfortran
    • liblapack-dev
    • libblas-dev
    • liblapacke-dev
  • Python 3.6+
  • Numpy, Matplotlib, toml, Shapely, scipy

Instructions for Ubuntu 18.04 LTS:

  1. Install curl, apt-get install curl
  2. Install rustup, the Rust toolchain (includes rustc, the compiler, and cargo, the package manager) from https://rustup.rs/, by running: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh and following onscreen instructions
  3. Build RustBCA:
  • git clone https://github.com/lcpp-org/rustBCA
  • cd rustBCA
  • cargo build --release will build the code with optimizations in target/release/
  1. input.toml is the default input file -- see Usage for more information
  2. cargo test will run all required tests
  3. cargo run --release examples/layered_geometry.toml will run a basic simulation of 2 keV helium on a layered TiO2-Al-Si target.

Optional dependencies

  1. Optional: install Python 3.6+ (this comes natively in Ubuntu 18.04) for manipulating input files
  2. Optional: Install pip for Python-3, apt-get install python3-pip to install the Python package manager
  3. Optional: Install Python libraries for making/manipulating rustbca input files, python3 -m pip install numpy matplotlib shapely scipy
  4. Optional: Install Python toml library from source, because the current version on PyPi doesn't include the numpy encoder/decoder.
  • git clone https://github.com/uiri/toml.git
  • cd toml
  • python3 setup.py install
  1. Optional: Build RustBCA with optional dependencies: python bindings, hdf5, and/or rcpr (with your choice of backed: openblas, netlib, or intel-mkl):
  • cargo build --release --features cpr_rootfinder_netlib,hdf5_input
  • cargo build --release --features cpr_rootfinder_openblas,hdf5_input
  • cargo build --release --features python
  1. Optional: cargo test --features cpr_rootfinder_* will run all required and optional tests for desired backend *