anderslanglands / bbl-oiio

0 stars 0 forks source link

Build fails with missing types #1

Closed virtualritz closed 3 months ago

virtualritz commented 3 months ago

Maybe you know the solution OTTOYH?

I'm on Ubuntu 23.10.

clang -v
Ubuntu clang version 16.0.6 (15)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/13
Candidate multilib: .;@m64
Selected multilib: .;@m64

Running:

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release

This succeeds. Then:

cmake --build build --config Release

Gives me a bunch of those:

In file included from /home/moritz/code/crates/bbl-oiio/bind/bbl-misc.cpp:3:
In file included from /usr/include/OpenImageIO/imagebuf.h:15:
In file included from /usr/include/OpenImageIO/dassert.h:12:
In file included from /usr/include/OpenImageIO/platform.h:31:
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cstdint:56:11: error: no member named 'int_fast8_t' in the global namespace
   56 |   using ::int_fast8_t;
[severall screens of similar type errors omitted]
anderslanglands commented 3 months ago

Ah nuts yeah I think I know why this is. I assume you're using babble 0.5? I fixed this in top of tree but upgrading will also likely mean adjustments to the bind files as there've been a few changes to syntax between 0.5 and 0.7

Basically the issue is that clang bakes the system include paths from my machine into the the library, so the binaries are only good for ubuntu-22. or 20 (can't remember which version I built that on now).

Two things you could try without upgrading to 0.7: 1) Try selecting gcc-11 as your compiler. This should work as long as I didn't actually build llvm with gcc-9 2) Try copying https://github.com/anderslanglands/babble/blob/v0.7.0/bbl/cmake/babble-functions.cmake into your babble installation (this has the fix to try divining the system include paths at runtime)

virtualritz commented 3 months ago

I run a babble version I built from source. I.e. that would be past v0.7/latest main.

The bind files for OIIO have already several ctors tripping up either because of changes to OIIO or babble syntax. I just commented them out for now to see if I can get it to build at all.

Basically the issue is that clang bakes the system include paths from my machine into the the library, so the binaries are only good for ubuntu-22. or 20 (can't remember which version I built that on now).

Is this related to this PR?

virtualritz commented 3 months ago

I can confirm I'm using v0.7, from my CMakeLists.txt:

find_package(OpenImageIO 2.4 REQUIRED)
find_package(babble 0.7 CONFIG REQUIRED)
anderslanglands commented 3 months ago

Hmm actually looking at the error I'm now more confused. I'm trying on ubuntu-22 and getting a different error. Could you post the output of the /home/anders/packages/babble/0.7.0/bin/bbl-translate line with CMAKE_VERBOSE_MAKEFILE=ON please? I'm looking for the system include directories, which I think will be broken somehow

anderslanglands commented 3 months ago

In my case it was all the "-isystem" entries getting smashed together by cmake. If I manually fix those (by copy/pasting the full bbl-translate command from the makefile output, then adding spaces before each "-isystem"), then run cmake --build build again, then it builds successfully for me.

By the sounds of things it might be the actual liboiio-c.a compilation that's failing for you though?

anderslanglands commented 3 months ago

OK think I've got it fixed. Try pulling again and reinstalling babble. it's just a cmake function change so you don't need a rebuild babble, but you will need to reconfigure bbl-oiio/blow away its build directory and start over

virtualritz commented 3 months ago

Confirmed, this is fixed. Thanks heaps!