Pytorch Build from Source gives Error make: *** No rule to make target 'install'. Stop

Viewed 1733

I am following this guide to build Pytorch from scratch on a Raspberry Pi3B. For some reason, there is an error:

Building wheel torch-1.2.0a0+f13fadd
-- Building version 1.2.0a0+f13fadd
cmake --build . --target install --config Release -- -j 4
make: *** No rule to make target 'install'.  Stop.

when I call python3 setup.py build. I am running Python version 3.5 and I am unsure why this seems to be failing.

2 Answers

Recently I encountered this error so after some research, in https://stackoverflow.com/a/46987554/12164529 someone mentioned something about cache. Therefore I guess that's because of some CMake cache behavior, so I run this command:

sudo USE_ROCM=1 USE_LMDB=1 USE_OPENCV=1 MAX_JOBS=15 python setup.py clean

And the error went away.

ps. This is my first answer on stackoverflow, and I'm not sure if this is a good one, but I hope it helps people find here.

I solved this problem with reference to this link.

This error happened at my second installation attempt. During the first I forgot to install the c++ compiler and got CMAKE_CXX_COMPILER not found. With a proper compiler installed, the second attempt gave me the "No rule to make target 'install'" error as mentioned in the question.

The problem was solved by removing the build/ directory and re-run python setup.py install.

So it seems this is caused by the cached build information.

Related