davidmalcolm / gcc-python-plugin

GCC plugin that embeds CPython inside the compiler
GNU General Public License v3.0
197 stars 58 forks source link

auto-host.h not found #113

Open thealberto opened 6 years ago

thealberto commented 6 years ago

Hi, I'm trying to compile the project on my Linux machine running gcc 6.3.0 and with python and six installed but I had the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-linux-gnu/6/plugin/include/auto-host.h'

Any idea on how to fix it please?

Thanks

davidmalcolm commented 6 years ago

Looks like output from generate-config-h.py

Is there more output than that? Can you post the full log please?

thealberto commented 6 years ago

Hi @davidmalcolm , sure that's the full output:

➜  gcc-python-plugin git:(master) make
Makefile:193: warning: overriding recipe for target 'autogenerated-casts.c'
Makefile:190: warning: ignoring old recipe for target 'autogenerated-casts.c'
python generate-config-h.py -o autogenerated-config.h --gcc="cc" --plugindir="/usr/lib/gcc/x86_64-linux-gnu/6/plugin"
Checking whether cc was built with C or C++... Traceback (most recent call last):
  File "generate-config-h.py", line 125, in <module>
    ch.main()
  File "generate-config-h.py", line 44, in main
    self.test_whether_built_with_cplusplus()
  File "generate-config-h.py", line 93, in test_whether_built_with_cplusplus
    with open(auto_host_h, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/gcc/x86_64-linux-gnu/6/plugin/include/auto-host.h'
Makefile:177: recipe for target 'autogenerated-config.h' failed
make: *** [autogenerated-config.h] Error 1

So the plugin dir exist but the include dir does not so obviously also the .h does not.

Any idea?

Thanks

davidmalcolm commented 6 years ago

Aha: looks like the plugin includes are missing.

Thanks.

Is the gcc 6 installed via a package manager (e.g. apt/.deb or rpm/yum/dnf)? If so, maybe there's another package you need to install. On Fedora/RHEL I believe it's "gcc-plugin-devel".

We should probably provide a better error message for this.

thealberto commented 6 years ago

@davidmalcolm , how did I miss that? :)

I had to install gcc-6-plugin-dev, my suggestion is to update the README file on github.

Update: Installing it I have now this error:

gcc-location.c: In function ‘gcc_location gcc_location_get_caret(gcc_location)’:
gcc-location.c:68:65: error: ‘get_pure_location’ was not declared in this scope
   return gcc_private_make_location (get_pure_location (loc.inner));

I'll try to find the solution...

Thanks

davidmalcolm commented 6 years ago

That one looks like a dup of issue #112.

dvarrazzo commented 5 years ago

FYI, on Ubuntu "auto-host.h not found" is solved by installing the gcc-X-plugin-dev package for the right gcc version.