Closed scossu closed 7 months ago
Hi @scossu,
git main is working for me with libvips 8.14 on ubuntu 23.10:
$ vips --version
vips-8.14.5
$ vips kakaduload world.jp2 x.jpg
vips_foreign_save_kakadu_class_init:
$
OK, I will review my compile options and recompile if needed.
Is there a way to list all the loaded modules and other module information in the Vips CLI?
It'll print some startup debug info with VIPS_INFO
:
$ VIPS_INFO=1 vips kakadusave k2.jpg x.jp2
VIPS-INFO: 17:23:02.114: VIPSHOME = /home/john/vips
VIPS-INFO: 17:23:02.114: VIPS_PREFIX = /home/john/vips
VIPS-INFO: 17:23:02.114: VIPS_LIBDIR = /home/john/vips/lib
VIPS-INFO: 17:23:02.114: prefix = /home/john/vips
VIPS-INFO: 17:23:02.114: libdir = /home/john/vips/lib
VIPS-INFO: 17:23:02.115: searching "/home/john/vips/lib/vips-modules-8.14"
VIPS-INFO: 17:23:02.115: loading "/home/john/vips/lib/vips-modules-8.14/vips-openslide.so"
VIPS-INFO: 17:23:02.116: loading "/home/john/vips/lib/vips-modules-8.14/vips-heif.so"
VIPS-INFO: 17:23:02.116: loading "/home/john/vips/lib/vips-modules-8.14/vips-jxl.so"
VIPS-INFO: 17:23:02.120: loading "/home/john/vips/lib/vips-modules-8.14/vips-kakadu.so"
VIPS-INFO: 17:23:02.122: loading "/home/john/vips/lib/vips-modules-8.14/vips-poppler.so"
VIPS-INFO: 17:23:02.125: loading "/home/john/vips/lib/vips-modules-8.14/vips-magick.so"
VIPS-INFO: 17:23:02.126: searching "/home/john/vips/lib/vips-plugins-8.14"
vips_foreign_save_kakadu_class_init:
new VipsKakaduTarget:
VipsKakaduTarget::open()
VipsKakaduTarget: close()
VipsKakaduTarget: write 4 bytes ...
VipsKakaduTarget: write 4 bytes ...
VipsKakaduTarget: write 4 bytes ...
VipsKakaduTarget: write 4 bytes ...
VipsKakaduTarget: write 4 bytes ...
... etc.
This should be working now, I'll close.
There seems to be a path discrepancy:
# VIPS_INFO=1 vips kakaduload /data/sample1.ppm sample1-2.jp2
VIPS-INFO: 10:46:06.367: found /usr/lib/x86_64-linux-gnu/vips-modules-8.14
VIPS-INFO: 10:46:06.372: using configure-time prefix
VIPS-INFO: 10:46:06.372: VIPS_PREFIX = /usr
VIPS-INFO: 10:46:06.372: VIPS_LIBDIR = /usr/lib/x86_64-linux-gnu
VIPS-INFO: 10:46:06.372: prefix = /usr
VIPS-INFO: 10:46:06.372: libdir = /usr/lib/x86_64-linux-gnu
VIPS-INFO: 10:46:06.372: searching "/usr/lib/x86_64-linux-gnu/vips-modules-8.14"
VIPS-INFO: 10:46:06.372: loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-jxl.so"
VIPS-INFO: 10:46:06.376: loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-poppler.so"
VIPS-INFO: 10:46:06.381: loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-magick.so"
VIPS-INFO: 10:46:06.382: loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-heif.so"
VIPS-INFO: 10:46:06.383: loading "/usr/lib/x86_64-linux-gnu/vips-modules-8.14/vips-openslide.so"
VIPS-INFO: 10:46:06.384: searching "/usr/lib/x86_64-linux-gnu/vips-plugins-8.14"
vips: unknown action "kakaduload"
make install
in my Docker container does:
# make install
mkdir -p /lib/vips-modules-8.14
cp vips-kakadu.so /lib/vips-modules-8.14
In https://github.com/harvard-lts/kakadu-vips/blob/main/src/Makefile#L53-L57:
PLUGIN_DIR = $(VIPSHOME)/lib/vips-modules-$(VIPS_VERSION)
install: $(OUT)
-mkdir -p $(PLUGIN_DIR)
-cp $(OUT) $(PLUGIN_DIR)
For now I resolved this by setting PLUGIN_DIR
in the make install
command using the output above from VIPS_INFO=1 vips --version
but it's kind of brittle because it's using grep and awk. I haven't found a better way to do this because I'm compiling for multiple arch/OS combinations.
Is there a more deterministic way to get the current libvips library install path?
FYI in my Docker file:
RUN \
export VIPS_LIBDIR=$(VIPS_INFO=1 vips --version \
| grep -m1 'VIPS_LIBDIR' | awk '{print $NF}') && \
KAKADU_HOME=${KDU_SRC} \
KAKADU_ARCH=$(cat /etc/kakadu_makefile) \
make PLUGIN_DIR=${VIPS_LIBDIR}/vips-modules-${VIPS_VERSION} install
You can get the libvips libdir with:
$ pkg-config vips --variable libdir
/home/john/vips/lib
Your libvips has been built with a debian-style arch component in libdir. I added the above ^^ to the makefile:
https://github.com/harvard-lts/kakadu-vips/commit/900d3748f2533cdf78064bde0090d980248ed020
That should fix it, I hope!
You beat me to it! I think that's the best option (as I am removing pkgconfig from the Docker image after build).
I wish Debian didn't add arch to libdir :( It causes a lot of bugs and confusion, and it's hard to believe many people use this feature.
The module compiles both on my workstation (Archlinux, libvips 8.15) and in an Ubuntu container (mantic, libvips 8.14). While I can run
vips kakaduload
in 8.15 and get a converted image, 8.14 gives me an error:vips: unknown action "kakaduload"
I verified that
/lib/vips-modules-8.14/vips-kakadu.so
exists. Is 8.14 compatible with this plugin architecture? Or shall I run any setup prior to running kakaduload?