qd-cae/qd-cae-python

installation failed with message: can't find python.h error

linlut opened this issue · 3 comments

hi,

when i am trying to compile the code, the follow error was found:

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from qd/cae/dyna_cpp/python_api/pybind_wrapper.cpp:20:0:
qd/cae/dyna_cpp/utility/PythonUtility.hpp:9:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

if i install the package with: pip install qd the following error was found:
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
qd/cae/dyna_cpp/python_api/pybind_wrapper.cpp:2:39: fatal error: dyna_cpp/db/DB_Elements.hpp: No such file or directory
#include <dyna_cpp/db/DB_Elements.hpp>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Hmm that is weird, though no big issue. Have you cloned the master repo or downloaded the source code from pipy?

yes, i have cloned the master repo, but it can't be compiled also.
but i can install it by using Anaconda Python.

Hmm I maybe need to test it these days. I usually also use Anaconda Python on Linux to test all versions, so that is a safe haven.

The include errors are very weird though, and I honestly can't explain why it suddenly works with Anaconda Python. In the end it is always gcc which compiles the code ...

Little recommendation:
I btw recommend in case of any compilation or runtime trouble to create a new environment (even if it is the same version) and install qd in there. This has prevented many runtime issues, where a wrong *.so was used on the system.