[SOLVED] Issue installing from source: CMake undefined references

I’ve been trying to build and install PyTorch master version from source, but at some point the installation fails with many “undefined reference” errors thrown by CMake. The first one is:

[ 97%] Linking CXX executable dlconvertor_test
CMakeFiles/broadcast_test.dir/broadcast_test.cpp.o: In function `barf(char const*, ...) [clone .constprop.40]':
broadcast_test.cpp:(.text+0xee): undefined reference to `std::runtime_error::runtime_error(char const*)'

I am following all the steps recommended in https://github.com/pytorch/pytorch, which are basically:

export CMAKE_PREFIX_PATH="~/.anaconda3/"
conda install numpy pyyaml mkl setuptools cmake cffi
conda install -c pytorch magma-cuda80
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch
python setup.py install

Thank you in advance!

Just installed conda’s gcc and the issue is solved. Maybe this should be added to the list of required packages…