[Mesa-dev] [PATCH] meson, anv: Add inc_vulkan to include directories

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Sat Dec 29 16:50:15 UTC 2018


On Sat, Dec 29, 2018 at 5:23 PM Jan Vesely <jan.vesely at rutgers.edu> wrote:
>
> On Wed, 2018-12-26 at 15:26 +0000, Eric Engestrom wrote:
> > On Tuesday, 2018-12-25 23:09:53 +0100, Jan Vesely wrote:
> > > Guess my meson-fu is still pretty weak.
> > > Now I see the build failure again:
> > > In file included from ../mesa/src/intel/vulkan/anv_private.h:77:0,
> > >                  from ../mesa/src/intel/vulkan/genX_pipeline.c:24:
> > > src/../include/vulkan/vulkan_intel.h:27:10: fatal error: vulkan.h: No such
> > > file or directory
> > >  #include "vulkan.h"
> > >           ^~~~~~~~~~
> > > compilation terminated.
> > > [189/1491] Compiling C++ object 'src/c...49@@glsl at sta
> > > /builtin_functions.cpp.o'.
> > > ninja: build stopped: subcommand failed.
> > >
> > > Honestly, I've no idea how '#include "vulkan.h"' should work
> >
> > It's documented here:
> > http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
> >
> > The bit we care about in this instance is the first paragraph:
> >
> >   > By default, the preprocessor looks for header files included by the
> >   > quote form of the directive `#include "file"` first relative to the
> >   > directory of the current file, and then in a preconfigured list of
> >   > standard system directories. For example, if /usr/include/sys/stat.h
> >   > contains `#include "types.h"`, GCC looks for types.h first in
> >   > /usr/include/sys, then in its usual search path.
> >
> > Which means that include/vulkan/vulkan_intel.h having `#include "vulkan.h"`
> > will first match include/vulkan/vulkan.h, which is exactly the correct
> > path.
> >
> > I'm really confused as to how you can see this failure.
>
> OK, the problem was that I used install prefix identical with the
> builddir so the files would not be in the same location:
>
> $ ls mesa-meson-64/include/vulkan/
> vulkan_intel.h
>
> $ ls mesa/include/vulkan/
> vk_android_native_buffer.h  vulkan.h          vulkan_win32.h
> vk_icd.h                    vulkan_intel.h    vulkan_xcb.h
> vk_platform.h               vulkan_ios.h      vulkan_xlib.h
> vulkan_android.h            vulkan_macos.h    vulkan_xlib_randr.h
> vulkan_core.h               vulkan_vi.h       vulkan_xlib_xrandr.h
> vulkan_fuchsia.h            vulkan_wayland.h
>
> although, it's a bit weird that only vulkan_intel.h got installed.

Only vulkan_intel.h getting installed is because the other headers are
supposed to be provided by the vulkan-headers repo, while
vulkan_intel.h is something completely non-standard.

>
> sorry for the noise,
> Jan
>
> >
> >
> >
> > >
> > >
> > > Jan
> > >
> > > On Mon, Dec 24, 2018 at 10:51 AM Jan Vesely <jan.vesely at rutgers.edu> wrote:
> > >
> > > > On Sun, 2018-12-23 at 15:35 +0000, Eric Engestrom wrote:
> > > > > On Sunday, 2018-12-23 12:31:20 +0100, Jan Vesely wrote:
> > > > > > From: Jan Vesely <jano.vesely at gmail.com>
> > > > > >
> > > > > > intel_vulkan.h uses '#include "vulkan.h"' so the file needs to be in
> > > > > > include path.
> > > > > > Fixes meson build of anv
> > > > >
> > > > > Hmm, that doesn't look?
> > > > >
> > > > > include/vulkan/vulkan_intel.h has `#include "vulkan.h"`, which lives at
> > > > > include/vulkan/vulkan.h, ie. in the same directory, so the current code
> > > > > should work?
> > > > >
> > > > > What failure do you see, and in what circumstance?
> > > > >
> > > > > Could it be related to left over autotools files in your source dir?
> > > > > Try again in a fresh clone?
> > > >
> > > > hm, I can't reproduce it again after the latest pull and git clean. I
> > > > guess it was an artifact of switching to meson.
> > > >
> > > > sorry for the noise.
> > > > thanks,
> > > > Jan
> > > >
> > > > >
> > > > > >
> > > > > > Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
> > > > > > ---
> > > > > >  src/intel/vulkan/meson.build | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/src/intel/vulkan/meson.build
> > > >
> > > > b/src/intel/vulkan/meson.build
> > > > > > index e30e922528..d1c89be0f8 100644
> > > > > > --- a/src/intel/vulkan/meson.build
> > > > > > +++ b/src/intel/vulkan/meson.build
> > > > > > @@ -181,7 +181,7 @@ libanv_common = static_library(
> > > > > >    [libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h,
> > > >
> > > > sha1_h],
> > > > > >    include_directories : [
> > > > > >      inc_common, inc_intel, inc_compiler, inc_drm_uapi,
> > > >
> > > > inc_vulkan_util,
> > > > > > -    inc_vulkan_wsi,
> > > > > > +    inc_vulkan_wsi, inc_vulkan
> > > > > >    ],
> > > > > >    c_args : anv_flags,
> > > > > >    dependencies : anv_deps,
> > > > > > --
> > > > > > 2.19.2
> > > > > >
> > > > > > _______________________________________________
> > > > > > mesa-dev mailing list
> > > > > > mesa-dev at lists.freedesktop.org
> > > > > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > > > >
> > > > > _______________________________________________
> > > > > mesa-dev mailing list
> > > > > mesa-dev at lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
> > > >
> > > > --
> > > > Jan Vesely <jan.vesely at rutgers.edu>
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
> --
> Jan Vesely <jan.vesely at rutgers.edu>_______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list