Skip to content
Chris Choy edited this page May 14, 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
pip install -U git+https://github.com/StanfordVL/MinkowskiEngine
# If it gives you "Unsupported GNU version!" use
# export CXX=g++-7; pip install git+https://github.com/StanfordVL/MinkowskiEngine

Specifying the compiler

Use the environment variable CXX to control the compiler.

export CXX=g++-7; pip install git+https://github.com/StanfordVL/MinkowskiEngine

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

Installation options

# export CXX=g++-7; If you have an older version of GCC.
pip install -U git+https://github.com/StanfordVL/MinkowskiEngine \
                           \ # if you want to force cuda installation
                           --install-option="--force_cuda" \
                           \ # if you want to force no cuda installation. force_cuda supercedes cpu_only
                           --install-option="--cpu_only" \
                           \ # optional when torch fails to find cuda_home.
                           --install-option="--cuda_home=<cuda_home>" \
                           \ # override to openblas, atlas, mkl, blas
                           --install-option="--blas=<blas>" \
                           \ # blas include and library path if default ones fail
                           --install-option="--blas_include_dirs=<csv>" \
                           --install-option="--blas_library_dirs=<csv>"

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 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++-7
export CXX=gcc-7; 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, https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/

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/135 https://github.com/StanfordVL/MinkowskiEngine/issues/88