Error Running jextract on d3d12.h

Michael Ennen mike.ennen at gmail.com
Tue Sep 8 20:12:03 UTC 2020


Fantastic. I will give building it a try and see what happens. Thanks for
fixing the issue already!

On Tue, Sep 8, 2020 at 3:41 AM Jorn Vernee <jorn.vernee at oracle.com> wrote:

> Hi Michael,
>
> Thanks for trying out jextract!
>
>  > Sorry if it is too early to post feedback like this.
>
> Not at all :)
>
> It looks like you are using the pre-built binary from jdk.java.net? Note
> that that one is pretty old. We are planning to update it in the near
> future, but if you don't want to wait, you can also try building the
> panama JDK yourself. The repo is found at:
> https://github.com/openjdk/panama-foreign See doc/building.md [1] for
> instructions (though you'll have to substitute mercurial for git, as the
> doc has not yet been updated after the recent mainline transition [2])
>
> In the time between that binary coming out and now, there has been a
> complete re-write of jextract. With the current version I gave
> extracting d3d12.h a try, using the following commands (powershell):
>
>      $jdk = <path to built jdk>
>      nal -Name jextract -Value "$jdk\bin\jextract.exe"
>      $I = "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0"
>      jextract -d out -t org.jextract -I "$I\um" --filter "d3d12.h" --
> "$I\um\d3d12.h"
>
> But I ran into a problem for which I've filed:
> https://bugs.openjdk.java.net/browse/JDK-8252899
>
> I'll try and see if I can get the extraction of d3d12.h working.
>
> Thanks,
> Jorn
>
> [1] :
>
> https://github.com/openjdk/panama-foreign/blob/foreign-jextract/doc/building.md
> [2] : https://github.com/openjdk/jdk/pull/21
>
> On 08/09/2020 08:27, Michael Ennen wrote:
> > Sorry for the consecutive replies to my own message. I read some more
> docs
> > and believe the following should work in theory:
> >
> > $inc ="C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0"
> > $lib = "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0"
> > $panamaHome = "C:\Program Files\Java\jdk-14-panama"
> > & $panamaHome\bin\jextract -J-Xmx8G --log FINEST -L "C:\Windows\System32"
> > -L "$lib\um\x64" -I "$inc\um" -l d3d12 -o d3d12.jar --record-library-path
> > $inc\um\d3d12.h
> >
> > The same error occurs.
> >
> > Log:
> >
> > Package clang_support is selected for C:\Program
> > Files\Java\jdk-14-panama\conf\jextract
> >
> > Package  is selected for C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um
> >
> > Parsing header file C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um\d3d12.h with following args:
> >
> > arg[0] = -IC:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um
> >
> >
> > arg[1] = -IC:\Program Files\Java\jdk-14-panama\conf\jextract
> >
> >
> >
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12.h:33:10: warning: non-portable path
> > to file '"Windows.h"'; specified path differs in case from f
> > ile name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12.h:34:10: warning: non-portable path
> > to file '"Ole2.h"'; specified path differs in case from file
> >   name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12.h:334:10: warning: non-portable
> path
> > to file '"OAIdl.h"'; specified path differs in case from fi
> > le name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12.h:335:10: warning: non-portable
> path
> > to file '"OCIdl.h"'; specified path differs in case from fi
> > le name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/ocidl.h:29:10: warning: non-portable path
> > to file '"Windows.h"'; specified path differs in case from f
> > ile name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/ocidl.h:30:10: warning: non-portable path
> > to file '"Ole2.h"'; specified path differs in case from file
> >   name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/ocidl.h:324:10: warning: non-portable
> path
> > to file '"OAIdl.h"'; specified path differs in case from fi
> > le name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3dcommon.h:29:10: warning: non-portable
> > path to file '"Windows.h"'; specified path differs in case fr
> > om file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3dcommon.h:30:10: warning: non-portable
> > path to file '"Ole2.h"'; specified path differs in case from
> > file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3dcommon.h:57:10: warning: non-portable
> > path to file '"OAIdl.h"'; specified path differs in case from
> >   file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3dcommon.h:58:10: warning: non-portable
> > path to file '"OCIdl.h"'; specified path differs in case from
> >   file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:33:10: warning:
> > non-portable path to file '"Windows.h"'; specified path differs in ca
> > se from file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:34:10: warning:
> > non-portable path to file '"Ole2.h"'; specified path differs in case
> > from file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:138:10: warning:
> > non-portable path to file '"OAIdl.h"'; specified path differs in cas
> > e from file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:139:10: warning:
> > non-portable path to file '"OCIdl.h"'; specified path differs in cas
> > e from file name on disk [-Wnonportable-include-path]
> >
> >
> > Clang diagnostic: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:2730:15: error: unknown
> > type name 'D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED'
> >
> >
> >
> > java.lang.RuntimeException: C:\Program Files (x86)\Windows
> > Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:2730:15: error: unknown
> > type name 'D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UN
> > SUPPORTED'
> >
> >
> >
> > Thanks.
> >
> > On Mon, Sep 7, 2020 at 11:05 PM Michael Ennen <mike.ennen at gmail.com>
> wrote:
> >
> >> I should note that I also tried adding the DirectX 12 libraries like so:
> >>
> >> & $panamaHome\bin\jextract -J-Xmx8G -L $inc\um\x64 -L
> C:\Windows\System32\
> >> -I $inc\um -l d3d12 -o d3d12.jar --record-library-path $inc\um\d3d12.h
> >>
> >> (first -L argument)
> >>
> >> On Mon, Sep 7, 2020 at 4:29 PM Michael Ennen <mike.ennen at gmail.com>
> wrote:
> >>
> >>> Hi Panama Devs,
> >>>
> >>> Sorry if it is too early to post feedback like this.
> >>>
> >>> I am attempting to run `jextract` on the d3d12.h DirectX 12 header file
> >>> so that I can use panama to interact with native DirectX 12 from Java.
> >>>
> >>> I am attempting to run jextract as follows:
> >>>
> >>> $inc ="C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0"
> >>> $panamaHome = "C:\Program Files\Java\jdk-14-panama"
> >>> & $panamaHome\bin\jextract -J-Xmx8G -L C:\Windows\System32\ -I $inc\um
> -l
> >>> d3d12 -o d3d12.jar --record-library-path $inc\um\d3d12.h
> >>>
> >>> When I do I get the following error:
> >>>
> >>> java.lang.RuntimeException: C:\Program Files (x86)\Windows
> >>> Kits\10\Include\10.0.17763.0\um/d3d12sdklayers.h:2730:15: error:
> unknown
> >>> type name 'D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED'
> >>>
> >>> It is quite probable I have the command line arguments wrong. I read
> the
> >>> jextract --help arguments list and the examples document (for the 2
> Windows
> >>> examples) and this is what I came up with.
> >>>
> >>> Thanks for your work.
> >>> --
> >>> Michael Ennen
> >>>
> >>
> >> --
> >> Michael Ennen
> >>
> >
>


-- 
Michael Ennen


More information about the panama-dev mailing list