harvard-lts / kakadu-vips

Kakadu JP2 reader and writer for libvips
Apache License 2.0
3 stars 0 forks source link

make failure on Ubuntu 20.04.4 LTS #19

Closed justinlittman closed 2 months ago

justinlittman commented 2 months ago
# make
g++  -shared -fPIC  `pkg-config vips --cflags` -I/home/jlittman/kakadu-vips/kakadu/v8_3-02138L/managed/all_includes  -c -o kakaduload.o kakaduload.cpp
kakaduload.cpp: In function ‘void vips_foreign_load_kakadu_set_error_behaviour(VipsForeignLoadKakadu*)’:
kakaduload.cpp:442:12: error: ‘VipsForeignLoad’ {aka ‘struct _VipsForeignLoad’} has no member named ‘fail_on’; did you mean ‘fail’?
  442 |  if (load->fail_on <= VIPS_FAIL_ON_NONE)
      |            ^~~~~~~
      |            fail
kakaduload.cpp:442:23: error: ‘VIPS_FAIL_ON_NONE’ was not declared in this scope; did you mean ‘VIPS_FOREIGN_NONE’?
  442 |  if (load->fail_on <= VIPS_FAIL_ON_NONE)
      |                       ^~~~~~~~~~~~~~~~~
      |                       VIPS_FOREIGN_NONE
kakaduload.cpp:444:17: error: ‘VipsForeignLoad’ {aka ‘struct _VipsForeignLoad’} has no member named ‘fail_on’; did you mean ‘fail’?
  444 |  else if (load->fail_on >= VIPS_FAIL_ON_WARNING)
      |                 ^~~~~~~
      |                 fail
kakaduload.cpp:444:28: error: ‘VIPS_FAIL_ON_WARNING’ was not declared in this scope
  444 |  else if (load->fail_on >= VIPS_FAIL_ON_WARNING)
      |                            ^~~~~~~~~~~~~~~~~~~~
kakaduload.cpp: In function ‘void vips_foreign_load_kakadu_class_init(VipsForeignLoadKakaduClass*)’:
kakaduload.cpp:932:28: error: ‘VIPS_OPERATION_UNTRUSTED’ was not declared in this scope; did you mean ‘VIPS_OPERATION_DEPRECATED’?
  932 |  operation_class->flags |= VIPS_OPERATION_UNTRUSTED;
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
      |                            VIPS_OPERATION_DEPRECATED
make: *** [<builtin>: kakaduload.o] Error 1

build-essential, libvips, libvips-tools, libvips-dev, and libnuma-dev are all installed.

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:    20.04
Codename:   focal
# uname -p
x86_64

(Side note: I have the build working correctly in a docker image on an M1 mac using the Linux-arm-64-gcc architecture.)

jcupitt commented 2 months ago

Hi @justinlittman,

kakadu-vips needs livips 8.12 or later for fail_on. Perhaps this should be in the readme, thanks for pointing this out.

justinlittman commented 2 months ago

Thanks for the speedy response.

justinlittman commented 2 months ago

Also, looks like you need at least libvips 8.13 for VIPS_OPERATION_UNTRUSTED:

kakaduload.cpp:932:35: error: ‘VIPS_OPERATION_UNTRUSTED’ was not declared in this scope; did you mean ‘VIPS_OPERATION_DEPRECATED’?
  932 |         operation_class->flags |= VIPS_OPERATION_UNTRUSTED;
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                   VIPS_OPERATION_DEPRECATED
make: *** [<builtin>: kakaduload.o] Error 1

Unfortunately, 8.12.1 is the default for Ubuntu 22.04.4 LTS (Jammy).

jcupitt commented 2 months ago

Ah, true. Do you think we should ifdef around this, or can you use a more recent libvips?

justinlittman commented 2 months ago

I'm working on trying to build it on Jammy, but I suspect that will be a significant technical barrier.

On Wed, Jun 12, 2024 at 7:56 AM John Cupitt @.***> wrote:

Ah, true. Do you think we should ifdef around this, or can you use a more recent libvips?

— Reply to this email directly, view it on GitHub https://github.com/harvard-lts/kakadu-vips/issues/19#issuecomment-2162821719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPUL5RJBTZTQV5HFTHBM3ZHAZQBAVCNFSM6AAAAABI7D7DUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRSHAZDCNZRHE . You are receiving this because you modified the open/close state.Message ID: @.***>

jcupitt commented 2 months ago

I'll make a PR, it should be a simple thing to ifdef over.

jcupitt commented 2 months ago

Ah sorry, there are a range of problems with these older libvips versions.

The biggest one for 8.12 is seeking of output objects --- kakadu needs to be able to seek as it writes (it has to be able to go back and adjust some values), and libvips only added seekable generic outputs in 8.13.

Even 8.13 has some issues. It's missing improvements to colour profile handling, for example.

It shouldn't be too hard to build a more recent libvips, eg. I used:

https://github.com/jcupitt/docker-builds/blob/master/libvips-ubuntu20.04/Dockerfile

jcupitt commented 2 months ago

I made a quick dockerfile to build libvips 8.15 on jammy:

https://github.com/jcupitt/docker-builds/blob/master/libvips-ubuntu22.04/Dockerfile