environment:
building 'apex_C' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/csrc
gcc -pthread -B /data1/hadxu/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/data1/xxx/anaconda3/lib/python3.6/site-packages/torch/include -I/data1/xxx/anaconda3/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/data1/xxx/anaconda3/lib/python3.6/site-packages/torch/include/TH -I/data1/xxx/anaconda3/lib/python3.6/site-packages/torch/include/THC -I/data1/xxx/anaconda3/include/python3.6m -c csrc/flatten_unflatten.cpp -o build/temp.linux-x86_64-3.6/csrc/flatten_unflatten.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=apex_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
gcc: error: unrecognized command line option '-std=c++14'
error: command 'gcc' failed with exit status 1
error
Cleaning up...
Removing source in /tmp/pip-r_4_lc1t-build
Command "/data1/xxx/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-r_4_lc1t-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" --cpp_ext --cuda_ext install --record /tmp/pip-_cr4dh9e-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-r_4_lc1t-build/
In my case, it was:
upgrade gcc4.8 to 7.0, done.