Skip to content
Chris Choy edited this page Apr 18, 2020 · 30 revisions

Installing the Minkowski Engine

System Python

sudo apt install libopenblas-dev
pip install MinkowskiEngine

From the Source

sudo apt install libopenblas-dev
git clone https://github.com/StanfordVL/MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install

If you have multiple python versions and want to specify the version, define an environment variable to install the Minkowski Engine on the specified version.

export PYTHON=python3.7
$PYTHON setup.py install

With Anaconda

conda install mkl mkl-include -c intel
conda install pytorch -c pytorch
git clone https://github.com/StanfordVL/MinkowskiEngine.git
cd MinkowskiEngine
python setup.py install --blas=mkl

Specifying BLAS directory

export BLAS_INCLUDE_DIRS=$OPENBLAS_ROOT/include/
export BLAS_LIBRARY_DIRS=$OPENBLAS_ROOT/lib/
python setup.py install --blas=openblas

Specifying CXX

/usr/local/cuda/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported!

sudo apt install g++-8
export CXX=gcc-8; python setup.py install

Possible compilation error with torch 1.4

In a very rare case, you might get compilation errors

error: cannot call member function `void std::basic_string<_CharT, _Traints, _Alloc>::_Rep::_M_set_sharable() ....` without object

[2020-04-15] Got a report that using torch 1.3.1 solved the issue, but it is unclear what exactly caused the problem.

Compilation error with GCC < 7

error: invalid static_cast from type ‘const torch::OrderedDict<std::basic_string<char>, at::Tensor>’ to type ‘torch::OrderedDict<std::basic_string<char>, at::Tensor>&

To install g++ > 6

sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7

A related issue can be found at #124

With Docker

https://github.com/StanfordVL/MinkowskiEngine/issues/88