Do not include -isystem /usr/include in compile parameters
See: https://groups.google.com/forum/#!topic/bob-devel/vDCKfTWEh-s
Environment: archlinux with gcc 7.2.1 Have installed bob.extension successfully by
pip install --user bob.extension
. Then, when Ipip install --user bob.blitz
, got the following error:
running install
running bdist_egg
running egg_info
creating bob.blitz.egg-info
writing bob.blitz.egg-info/PKG-INFO
writing dependency_links to bob.blitz.egg-info/dependency_links.txt
writing requirements to bob.blitz.egg-info/requires.txt
writing top-level names to bob.blitz.egg-info/top_level.txt
writing manifest file 'bob.blitz.egg-info/SOURCES.txt'
reading manifest file 'bob.blitz.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'bob.blitz.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/bob
copying bob/__init__.py -> build/lib.linux-x86_64-3.6/bob
creating build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/__init__.py -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/extension.py -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/test.py -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/api.cpp -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/array.cpp -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/main.cpp -> build/lib.linux-x86_64-3.6/bob/blitz
copying bob/blitz/version.cpp -> build/lib.linux-x86_64-3.6/bob/blitz
creating build/lib.linux-x86_64-3.6/bob/blitz/include
creating build/lib.linux-x86_64-3.6/bob/blitz/include/bob.blitz
copying bob/blitz/include/bob.blitz/capi.h -> build/lib.linux-x86_64-3.6/bob/blitz/include/bob.blitz
copying bob/blitz/include/bob.blitz/cleanup.h -> build/lib.linux-x86_64-3.6/bob/blitz/include/bob.blitz
copying bob/blitz/include/bob.blitz/config.h -> build/lib.linux-x86_64-3.6/bob/blitz/include/bob.blitz
copying bob/blitz/include/bob.blitz/cppapi.h -> build/lib.linux-x86_64-3.6/bob/blitz/include/bob.blitz
running build_ext
building 'bob.blitz.version' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/bob
creating build/temp.linux-x86_64-3.6/bob/blitz
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstac$
-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -Wno-strict-aliasing -DBOB_EXT_MODULE_PREFIX="bob.blitz" -DBOB_EXT_MODULE_NAME="version" $
DBOB_EXT_ENTRY_NAME=PyInit_version -DBOB_EXT_MODULE_VERSION="2.0.15b0" -DHAVE_BOOST=1 -DBOOST_VERSION="1.66.0" -DHAVE_BLITZ=1 -DBLITZ_VERSION="0.10" -DPY_ARRAY_UNIQUE_SYMBOL=BOB_BLITZ_NUMPY_C_API
-DNO_IMPORT_ARRAY=1 -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/home/yuxinwu/install/bob.blitz/bob/blitz/include -I/home/yuxinwu/.local/lib/python3.6/site-packages/bob/extension/include -I/usr$
include/python3.6m -c bob/blitz/version.cpp -o build/temp.linux-x86_64-3.6/bob/blitz/version.o -std=c++0x -isystem /home/yuxinwu/.local/lib/python3.6/site-packages/numpy/core/include -isystem /us$
/include
In file included from /usr/include/boost/config/platform/linux.hpp:15:0,
from /usr/include/boost/config.hpp:57,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:17,
from /usr/include/boost/shared_ptr.hpp:17,
from /home/yuxinwu/install/bob.blitz/bob/blitz/include/bob.blitz/cleanup.h:13,
from /home/yuxinwu/install/bob.blitz/bob/blitz/include/bob.blitz/config.h:22,
from bob/blitz/version.cpp:10:
/usr/include/c++/7.2.1/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
The reason is because, the command line has
-isystem /usr/include
.
For new version of gcc, you should not compile with
-isystem /usr/include
. See: https://stackoverflow.com/questions/37218953/isystem-on-a-system-include-directory-causes-errors
By looking at
bob.extension
source code, I found that/usr/include
comes fromboost.include_directory
, defined inbob.extension.boost
. It is then added as a system-include directory insidebob.extension.__init__
.
I think this is an abuse of
-isystem
. Please fix. Thanks.