Bug 55919

Summary: fatal error: nouveau/nouveau_device.h: No such file or directory
Product: Mesa Reporter: Roland Egger <spark74>
Component: Drivers/Gallium/r300Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: medium    
Version: 7.11   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Roland Egger 2012-10-12 13:35:34 UTC
After 
make linux-x86-64
I got
make[4]: Entering directory `/remote/lithop4-3/egger/mesa/Mesa-7.11.2/src/gallium/drivers/nvfx'
gcc -c -I. -I../../../../src/gallium/include -I../../../../src/gallium/auxiliary -I../../../../src/gallium/drivers  -I../../../../src/gallium/drivers/nouveau/include -Wall -Wmissing-prototypes -Wdeclaration-after-statement -Wpointer-arith -O3 -g -fPIC -m64 -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN -DUSE_X86_64_ASM -I/usr/X11R6/include -std=c99 -ffast-math -fno-strict-aliasing  nv04_2d.c -o nv04_2d.o
nv04_2d.c:36:36: fatal error: nouveau/nouveau_device.h: No such file or directory
compilation terminated.
make[4]: *** [nv04_2d.o] Error 1
make[4]: Leaving directory `/remote/lithop4-3/egger/mesa/Mesa-7.11.2/src/gallium/drivers/nvfx'
make[3]: *** [default] Error 1
make[3]: Leaving directory `/remote/lithop4-3/egger/mesa/Mesa-7.11.2/src/gallium/drivers'
make[2]: *** [default] Error 1
make[2]: Leaving directory `/remote/lithop4-3/egger/mesa/Mesa-7.11.2/src/gallium'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/remote/lithop4-3/egger/mesa/Mesa-7.11.2/src'

What is wrong and is it needed to build this gallium drivers if I just want to have libGL.so and libOSMesa.so?

My linux is Red Hat Enterprise Linux WS release 4 (Nahant Update 8)
and gcc version 4.5.2 (GCC).

I even tried to build libdrm-2.4.39 but there is no nouveau_device.h, too.
I tried to copy a nouveau_device.h from somewhere else but then the next nouveau-header is missing.

It would be great if you give me an advice.


Kind regards,
  Roland
Comment 1 Roland Egger 2012-10-12 14:15:19 UTC
The next error is:
../../../../src/gallium/drivers/nouveau/nouveau_winsys.h:7:32: fatal error: nouveau/nouveau_bo.h: No such file or directory
Comment 2 Roland Egger 2012-10-12 14:19:56 UTC
I found out that although I have problems with the drivers I could build
./lib/libOpenVG.so.1.0.0
./lib/libOpenVG.so.1
./lib/libOpenVG.so
./lib/libGL.so.1.5.071100
./lib/libGL.so.1
./lib/libGL.so
./lib/libOSMesa.so.7.11.0
./lib/libOSMesa.so.7
./lib/libOSMesa.so

with make linux -k
Comment 3 Roland Egger 2012-10-12 14:26:31 UTC
And 
make linux-osmesa
build
/lib/libOSMesa.so.7.11.0
./lib/libOSMesa.so.7
./lib/libOSMesa.so
./lib/libGLU.so.1.3.071100
./lib/libGLU.so.1
./lib/libGLU.so

So libGLU is only compiled if I use make linux-osmesa. Is that correct?
I had to remove the -ansi compiler flag because otherwise it has problems 
with c++ comments //
Comment 4 Tomasz P. 2012-10-13 17:00:19 UTC
Do you have only problems with version 7.11 ? Have you tried 9.0 ?
Comment 5 Christoph Bumiller 2012-10-14 11:19:25 UTC
It's an old version of mesa so you need an old version of libdrm if you want to build nouveau, 2.4.33 or earlier in this case. You can also keep the headers and libdrm_nouveau.so of both old and new versions installed if you want.

But if you don't want to build nouveau anyway, disable/don't enable it with the configure script (--with-gallium-drivers=...). It shouldn't even be selected by default.
Comment 6 Roland Egger 2012-10-15 07:35:48 UTC
Hi,
thank you. Running configure fails, so I just ran 
make linux
after little manually configurating the file in the configs directory.
I'll try to find the old libdrm and will try to use it.
Comment 7 Roland Egger 2012-10-15 08:20:11 UTC
I fetched libdrm-2.4.24

and after configure I got:
libdrm 2.4.24 will be compiled with:

  libkms         yes
  Intel API      yes
  vmwgfx API     no
  Radeon API     yes
  Nouveau API    no

Therefor I tried configure with --enable-nouveau-experimental-api

The goog thing is that the important libraries are build before it tries to build these strange driver that needs nouveau. There should be a possibility to disable nouveau in the config files, too. That would be very nice especially after the nouveau thing is experimental.

After building and installing the lib I added the LD_LIBRARY_PATH to the install directory for libdrm and added the include path to the configs/linux file.
Let's see if that helps ;)

Now the build succeeds and I got libEGL.so and libGLw.so as additional libraries. Which one contains the nouveau driver and what are the advantages of having libEGL.so and libGLw.so?
Comment 8 Roland Egger 2012-10-15 08:42:46 UTC
I tested configure and had to install
glproto-1.4.16, dri2proto-2.8 and libdrm-2.4.24 and set the PKG_CONFIG_PATH

Afterwards configure fails with
checking for llvm-config... no
configure: error: LLVM is required to build Gallium R300 on x86 and x86_64

There is a nice configure option
  --enable-gallium-llvm   build gallium LLVM support [default=enabled on
                          x86/x86_64]
Is it possible to disable that option? Trying 
--disable-gallium-llvm does not help

I succeeded with the configure optio
--with-gallium-drivers=""
and recieved
        prefix:          /tmp/Mesa
        exec_prefix:     ${prefix}
        libdir:          ${exec_prefix}/lib
        includedir:      ${prefix}/include

        OpenGL:          yes (ES1: no ES2: no)
        OpenVG:          no

        Driver:          dri
        OSMesa:          no
        DRI drivers:     i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon savage tdfx unichrome swrast
        DRI driver dir:  ${libdir}/dri
        Use XCB:         no
        Shared dricore:  no

        GLU:             yes
        GLw:             yes (Motif: no)
        glut:            no

        EGL:             yes
        EGL platforms:   x11
        EGL drivers:     builtin:egl_glx

        llvm:            no

        Gallium:         no

        Shared libs:     yes
        Static libs:     no

        CFLAGS:          -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fPIC
        CXXFLAGS:        -g -O2 -Wall -fno-strict-aliasing -fPIC
        Macros:          -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DUSE_X86_64_ASM

        PYTHON2:         python2

        Run 'gmake' to build Mesa
Comment 9 Roland Egger 2012-10-15 08:52:36 UTC
After successful configure I got:
glxconfig.c:52:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
glxconfig.c:223:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
glxconfig.c:266:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
glxconfig.c:287:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
glxconfig.c:299:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
gmake[2]: *** [glxconfig.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
glxext.c:65:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
glxext.c:351:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
glxext.c:709:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
glxext.c:725:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
...
At this point the following shared libs are build:
./src/mesa/drivers/dri/i915/i915_dri.so
./src/mesa/drivers/dri/i965/i965_dri.so
./src/mesa/drivers/dri/mach64/mach64_dri.so
./src/mesa/drivers/dri/mga/mga_dri.so
./src/mesa/drivers/dri/nouveau/nouveau_vieux_dri.so
./src/mesa/drivers/dri/r128/r128_dri.so
./src/mesa/drivers/dri/r200/r200_dri.so
./src/mesa/drivers/dri/r300/r300_dri.so
./src/mesa/drivers/dri/r600/r600_dri.so
./src/mesa/drivers/dri/radeon/radeon_dri.so
./src/mesa/drivers/dri/savage/savage_dri.so
./src/mesa/drivers/dri/swrast/swrast_dri.so
./src/mesa/drivers/dri/tdfx/tdfx_dri.so
./src/mesa/drivers/dri/unichrome/unichrome_dri.so
./lib/i915_dri.so
./lib/i965_dri.so
./lib/mach64_dri.so
./lib/mga_dri.so
./lib/nouveau_vieux_dri.so
./lib/r128_dri.so
./lib/r200_dri.so
./lib/r300_dri.so
./lib/r600_dri.so
./lib/radeon_dri.so
./lib/savage_dri.so
./lib/tdfx_dri.so
./lib/unichrome_dri.so
./lib/swrast_dri.so

That's bad because all GL libs are not build so far. Thank god the build/compile process works with the old config and without the configure.
Comment 10 Roland Egger 2012-12-08 22:43:54 UTC
Why is it marked as resolved invalid?
Regards,
  Roland

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.