facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.89k stars 2.01k forks source link

Error when running infer on ML DL libraries #1649

Open dmc1778 opened 2 years ago

dmc1778 commented 2 years ago

I want to run Infer on numpy library to detect its weaknesses. When I run the following command:

infer run -- gcc -c /numpy/numpy/numpy/core/src/multiarrayabstractdtypes.c

It throws the following error:

Capturing in make/cc mode... abstractdtypes.c:5:10: fatal error: 'Python.h' file not found

include

     ^~~~~~~~~~

1 error generated. Error: the following clang command did not run successfully: /opt/infer-linux64-v1.0.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-9 @/media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/numpy/numpy/numpy/core/src/multiarray/infer-out/tmp/clangcommand.tmp.a9d22f.txt ++Contents of '/media/nimashiri/DATA/vsprojects/ICSE23/ml_repos_cloned/numpy/numpy/numpy/core/src/multiarray/infer-out/tmp/clangcommand.tmp.a9d22f.txt': "-cc1" "-load"...

How can I run infer against individual source files in project having special compilers, e.g. numpy or tensorflow. These compilers do not use make or cmake explicitly.

Thanks.