You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building CODA with CMake fails on Centos 7 due to an include order issue with Python.h.
The error I received is as follow:
...
[ 39%] Built target math.poly_test_llsq
[ 40%] Built target math.poly_test_OneD_templates
[ 40%] Built target math.poly_test_fixed
[ 40%] Built target math.poly_test_poly
[ 40%] Built target math.poly_test_inner_poly
[ 40%] Built target math.poly_test_1d_poly
[ 40%] Built target math.poly_test_2d_poly
[ 40%] Built target math.poly_test_fixed_1d_poly
[ 40%] Built target math.poly_test_fixed_2d_poly
[ 40%] Built target numpyutils-c++
[ 40%] Building CXX object externals/coda-oss/modules/c++/numpyutils/CMakeFiles/numpyutils_test_num_elements.dir/unittests/test_num_elements.cpp.o
In file included from /usr/include/python2.7/pyconfig.h:6:0,
from /usr/include/python2.7/Python.h:8,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/include/numpyutils/numpyutils.h:27,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/unittests/test_num_elements.cpp:24:
/usr/include/python2.7/pyconfig-64.h:1191:0: error: "_POSIX_C_SOURCE" redefined [-Werror]
#define _POSIX_C_SOURCE 200112L
^
In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0,
from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097,
from /usr/include/c++/4.8.2/cmath:41,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/include/TestCase.h:29,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/unittests/test_num_elements.cpp:23:
/usr/include/features.h:168:0: note: this is the location of the previous definition
# define _POSIX_C_SOURCE 200809L
^
In file included from /usr/include/python2.7/pyconfig.h:6:0,
from /usr/include/python2.7/Python.h:8,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/include/numpyutils/numpyutils.h:27,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/unittests/test_num_elements.cpp:24:
/usr/include/python2.7/pyconfig-64.h:1213:0: error: "_XOPEN_SOURCE" redefined [-Werror]
#define _XOPEN_SOURCE 600
^
In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/os_defines.h:39:0,
from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++config.h:2097,
from /usr/include/c++/4.8.2/cmath:41,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/include/TestCase.h:29,
from /home/admin/CodeProjects/six-library-SIX-3.1.3/externals/coda-oss/modules/c++/numpyutils/unittests/test_num_elements.cpp:23:
/usr/include/features.h:170:0: note: this is the location of the previous definition
# define _XOPEN_SOURCE 700
^
cc1plus: all warnings being treated as errors
make[2]: *** [externals/coda-oss/modules/c++/numpyutils/CMakeFiles/numpyutils_test_num_elements.dir/unittests/test_num_elements.cpp.o] Error 1
make[1]: *** [externals/coda-oss/modules/c++/numpyutils/CMakeFiles/numpyutils_test_num_elements.dir/all] Error 2
make: *** [all] Error 2
Building CODA with CMake fails on Centos 7 due to an include order issue with Python.h.
The error I received is as follow:
The issue can be found in
coda-oss/modules/c++/numpyutils/unittests/test_num_elements.cpp
Lines 23 to 24 in e5f3d77
This issue can be fixed by either changing the include order to:
or by adding Python.h before the other includes:
This Jira post for Mongo Python Driver pointed me to the solution:
https://jira.mongodb.org/browse/PYTHON-2260
The text was updated successfully, but these errors were encountered: