Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set PYTHON_INCLUDE_DIR with cmake. #447

Open
rheniser opened this issue Apr 11, 2020 · 2 comments
Open

Unable to set PYTHON_INCLUDE_DIR with cmake. #447

rheniser opened this issue Apr 11, 2020 · 2 comments

Comments

@rheniser
Copy link

rheniser commented Apr 11, 2020

I am unable to set PYTHON_INCLUDE_DIR. I tried setting both PYTHON_INCLUDE_PATH and
PYTHON_INCLUDE_DIRS. Neither of them worked.

When I hardcode PYTHON_INCLUDE_DIR in CMakeLists.txt or pass with CXXFLAGS it works. But, I get warnings because the python include directory needs to be first (see https://stackoverflow.com/questions/10056393/g-with-python-h-how-to-compile)

[  1%] Building CXX object CMakeFiles/nanogui-python-obj.dir/python/main.cpp.o
...
warning: "_POSIX_C_SOURCE" redefined [enabled by default]
 #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/type_traits:38,
                 from /usr/include/c++/4.8.2/ratio:38,
                 from /usr/include/c++/4.8.2/chrono:38,
                 from /usr/include/c++/4.8.2/thread:38,
                 from 
...
warning: "_XOPEN_SOURCE" redefined [enabled by default]
 #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/type_traits:38,
                 from /usr/include/c++/4.8.2/ratio:38,
                 from /usr/include/c++/4.8.2/chrono:38,
                 from /usr/include/c++/4.8.2/thread:38,
                 from /src/rheniser/git/bfd/ext/materialx/build/linux_x64_gcc48_release/nanogui/python/main.cpp:3:
/usr/include/features.h:170:0: note: this is the location of the previous definition
 # define _XOPEN_SOURCE 700
 ^

@svenevs
Copy link
Collaborator

svenevs commented Apr 11, 2020

Hmm. How peculiar! I'd like to try and reproduce this in a docker image of possible. This ultimately is coming from a relatively old glibc, yes? What distro are you using?

@rheniser
Copy link
Author

rheniser commented Apr 13, 2020

CentOS Linux release 7.4.1708 (Core)
Linux 3.10.0-957.21.2.el7.x86_64 x86_64
GNU C Library (GNU libc) stable release version 2.17, by Roland McGrath et al.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants