jextract woes
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Mon Jan 27 00:13:47 UTC 2020
I noticed that problem too - I was trying to use jextract on opencl
headers too to take a look at what came out and found that issue.
This is something we fixed in the old jextract by having it include some
clang headers by default - Sundar, I think this change is missing from
current foreign-jextract?
For now you can workaround like this (at least, this is what I used):
jextract --filter cl.h -I
/opt/clang/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04/lib/clang/9.0.0/include/
/usr/include/CL/cl.h
This gave me something that was enough to Panama-ize some basic OpenCL
examples I found on the web.
(The clang path you see is the one you use to build the Panama JDK)
Maurizio
On 26/01/2020 23:39, Michael Zucchi wrote:
>
> I'm using the github repoistory, foreign-jextract branch if that
> matters. While tracking that gnu make problem I ended up checking
> that out because I didn't want to wait for mercurial again and I
> wasn't sure if something was broken locally.
>
> By default it can't find system includes:
>
> notzed at shitzone:~$ /opt/panama-jextract/bin/jextract /usr/include/CL/cl.h
> WARNING: Using incubator modules: jdk.incubator.foreign,
> jdk.incubator.jextract
> Exception in thread "main" java.lang.RuntimeException:
> /usr/include/CL/cl_platform.h:378:10: fatal error: 'stddef.h' file not
> found
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.lambda$parse$0(Parser.java:61)
> at
> jdk.incubator.jextract/jdk.internal.clang.TranslationUnit.processDiagnostics(TranslationUnit.java:76)
> at
> jdk.incubator.jextract/jdk.internal.clang.Index.parse(Index.java:102)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.parse(Parser.java:58)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.JextractTaskImpl.parse(JextractTaskImpl.java:59)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.JextractTaskImpl.parse(JextractTaskImpl.java:53)
> at
> jdk.incubator.jextract/jdk.incubator.jextract.tool.Main.run(Main.java:184)
> at
> jdk.incubator.jextract/jdk.incubator.jextract.tool.Main.main(Main.java:97)
>
> If I use gcc to pre-process it first:
>
> notzed at shitzone:~$ gcc -E /usr/include/CL/cl.h > cl.h
> notzed at shitzone:~$ /opt/panama-jextract/bin/jextract cl.h
> WARNING: Using incubator modules: jdk.incubator.jextract,
> jdk.incubator.foreign
> Exception in thread "main" java.lang.RuntimeException: cl.h:2989:1:
> error: definition of builtin function '_mm_getcsr'
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.lambda$parse$0(Parser.java:61)
> at
> jdk.incubator.jextract/jdk.internal.clang.TranslationUnit.processDiagnostics(TranslationUnit.java:76)
> at
> jdk.incubator.jextract/jdk.internal.clang.Index.parse(Index.java:102)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.Parser.parse(Parser.java:58)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.JextractTaskImpl.parse(JextractTaskImpl.java:59)
> at
> jdk.incubator.jextract/jdk.internal.jextract.impl.JextractTaskImpl.parse(JextractTaskImpl.java:53)
> at
> jdk.incubator.jextract/jdk.incubator.jextract.tool.Main.run(Main.java:184)
> at
> jdk.incubator.jextract/jdk.incubator.jextract.tool.Main.main(Main.java:97)
>
> Regards,
> Michael
>
More information about the panama-dev
mailing list