Skip to content

trying to install pyvips with binary libvips #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ccellado opened this issue May 1, 2020 · 16 comments
Closed

trying to install pyvips with binary libvips #180

ccellado opened this issue May 1, 2020 · 16 comments
Labels

Comments

@ccellado
Copy link

ccellado commented May 1, 2020

System - NixOS

Hello, i've trying to pyvips to work in a python venv.

Installation skips to cffi ABI mode, fails there too. But i want to get the API mode.

What does it exactly mean to have libvips with dev headers installed?
From the trace i can see that "import _libvips" couldn't any. Where does it look?

Nix have vips package, but no -dev version. I could make my own -dev version of it, but how does it differ.

Thanks!

@jcupitt
Copy link
Member

jcupitt commented May 2, 2020

Hello @ccellado

During install in API mode, setuptools will generate some C source code for the low-level parts of the binding, then build them against the libvips headers and make a python module called _libvips.so.

To do this, it needs a C compiler, the libvips shared library (libvips.so.42.0, probably), the libvips headers (usually in /usr/include/vips), and vips.pc, the package config file (usually in /usr/lib/pkgconfig).

To test your libvips install, try:

pkg-config vips --cflags

And see if you get a set of compiler flags.

@ccellado
Copy link
Author

ccellado commented May 2, 2020

Thanks , @jcupitt!

Through some tough luck and drag'n'drop sorcery i was able to setup pyvips in a python venv, but i've got a different problem. When i run testing scripts (wobble,py from your reps) i've got :

terminated by signal SIGSEGV (Address boundary error)

I've had the same error when tried conda install, but did not bother to look at it closer.

What could it be?

@jcupitt
Copy link
Member

jcupitt commented May 3, 2020

Sorry, I don't know. You can run python in a debugger and see if you can get a stacktrace, that might help. If you can build with debugging on, even better.

@jcupitt
Copy link
Member

jcupitt commented May 3, 2020

I had a quick look, and nix seems to include vips-8.9.1. I would just do:

nix-env --install vips gcc python3 libffi
python -m ensurepip --default-pip
python -m pip install pyvips 

And it should work. I'd ask a nixos expert for help, I don't really know anything about it.

@ccellado
Copy link
Author

ccellado commented May 3, 2020

I've made 8.9.2 version of vips, should building it debug version help?
pip doesnt work as is in Nix, so i used venv.

Could it be that i've created corrupted API module, well, my pointing installer to the things it wanted?
I've sent all libvips headers in a usr/include, symlink to glib, gobject, libffi, vips respective *.pc files in usr/pkgconfig, and added dir with libgio, libgobject and libvips to LD_LIBRARY_PATH.

I've missed something or symlinks blew it?

@jcupitt
Copy link
Member

jcupitt commented May 3, 2020

A debug version would make a backtrace from the crash easier to understand.

You can use pip in nixos, eg.:

python -m ensurepip --default-pip
python -m pip install pyvips 

I wouldn't make symlinks, it's pretty dangerous. I would just install the nixos vips and use PKG_CONFIG_PATH to point to their vips.pc. But you should ask a nixos expert!

@ccellado
Copy link
Author

I've made a lot of progress, trying to add pyvips to nix repository.
It's building and working, but i don't know for sure which version it is ( API or ABI )

How can I find out for sure?

Installing logs ( nix building of package ) did not tell me enough.

In my mockup env I have to export LD_LIBRARY_PATH, and when it's missing the traceback shows ***/cffi/api.py files trying to access lib.

Is that and asnwer?

Thank you.

@jcupitt
Copy link
Member

jcupitt commented Jun 30, 2020

Hello @ccellado,

You can get the library version like this:

$ python3
>>> import pyvips
>>> pyvips.version(0)
8
>>> pyvips.version(1)
10
>>> pyvips.version(0)
8

pyvips checks that the API and ABI match during startup, so the headers will always be the same.

You can test the wrapper mode like this:

>>> pyvips.API_mode
True

And get the pyvips version in the obvious way:

>>> pyvips.__version__
'2.1.12'

@kleisauke
Copy link
Member

pip show pyvips should also print whether the API or ABI mode is used.

$ pip show pyvips
Name: pyvips
Version: 2.1.12
Summary: binding for the libvips image processing library, API mode
Home-page: https://github.com/libvips/pyvips
Author: John Cupitt
Author-email: jcupitt@gmail.com
License: MIT
Location: /usr/local/lib64/python3.8/site-packages
Requires: cffi, pkgconfig
Required-by: 

@ccellado
Copy link
Author

ccellado commented Jul 1, 2020

I checked and it is in ABI mode.
The problem is that in NIxOS i is two different envs for building and running the module.

  1. Assuming the module was built with API mode, does it have some special runtime dependencies that wont allow it to run in API mode?

  2. What flags are needed to pass to "pip install" or "setuptools.py" for a verbose enough output to see what's missing in building env to create API module?

Thanks

@jcupitt
Copy link
Member

jcupitt commented Jul 1, 2020

The ABI/API mode detect happens during pip install. It tries to compile the binding for API mode and falls back to ABI mode if the compile fails.

The compile can fail for many reasons, eg. missing libvips headers, pkg-config not configured correctly, no C compiler, no Python headers, no headers for an indirect dependency, etc.

You can use the --verbose flag to watch install:

pip3 install pyvips --verbose

It produces a /lot/ of output, unfortunately.

@jcupitt
Copy link
Member

jcupitt commented Jul 1, 2020

Here's what I see for a successful API mode install:

Sample `pip install pyvips --verbose` output
$ pip3 install pyvips --verbose
User install by explicit request
Created temporary directory: /tmp/pip-ephem-wheel-cache-sdfr518i
Created temporary directory: /tmp/pip-req-tracker-go5rd_9n
Initialized build tracking at /tmp/pip-req-tracker-go5rd_9n
Created build tracker: /tmp/pip-req-tracker-go5rd_9n
Entered build tracker: /tmp/pip-req-tracker-go5rd_9n
Created temporary directory: /tmp/pip-install-v44emkwn
1 location(s) to search for versions of pyvips:
* https://pypi.org/simple/pyvips/
Fetching project page and analyzing links: https://pypi.org/simple/pyvips/
Getting page https://pypi.org/simple/pyvips/
Found index url https://pypi.org/simple
Getting credentials from keyring for https://pypi.org/simple
Getting credentials from keyring for pypi.org
Looking up "https://pypi.org/simple/pyvips/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/pyvips/ HTTP/1.1" 200 1928
Updating cache with response from "https://pypi.org/simple/pyvips/"
Caching due to etag
  Found link https://files.pythonhosted.org/packages/6a/2d/5ca1ee5077f733335c208b7a3f3d62f964aaab87731ab3e2850e404df7f1/pyvips-2.0.0-py2.py3-none-any.whl#sha256=c99590364cfc620af0db004aa9c6e6830a3c337d0db074d0a61da74dd4b91071 (from https://pypi.org/simple/pyvips/), version: 2.0.0
  Found link https://files.pythonhosted.org/packages/40/99/2d9991eff005de6674f155808423e8aac934ba50b5c8858abef5e148c51f/pyvips-2.0.1-py2.py3-none-any.whl#sha256=bf74b25a91bed8d9a96be8d457ce26ee487bf8b72c48f2c56aa643e233e341b2 (from https://pypi.org/simple/pyvips/), version: 2.0.1
  Found link https://files.pythonhosted.org/packages/b6/3a/261808544f6832f6e00b6ee26435210d6293cc022b9c51e2b48543575dc5/pyvips-2.0.2-py2.py3-none-any.whl#sha256=e6a6541672c6eab62ab8442738742b021c624a7b51b49c1ba9ab9aa99935692f (from https://pypi.org/simple/pyvips/), version: 2.0.2
  Found link https://files.pythonhosted.org/packages/62/32/bd01d86b81fdd84c0699cda1c40b0334f63e4deb981d22f468b3ef681513/pyvips-2.0.3-py2.py3-none-any.whl#sha256=0939c390af4584d2a48d488630f0f249d234e6087b188f7e8a70418479b66488 (from https://pypi.org/simple/pyvips/), version: 2.0.3
  Found link https://files.pythonhosted.org/packages/47/1f/a646ed24baab8404d7ce485e088bd58ec2ec4e9108089dffa6acf42b6347/pyvips-2.0.4-py2.py3-none-any.whl#sha256=f1b502e20d3b12abf295a2eb57387061b3285b6f93a228a1c0beada01a2e435d (from https://pypi.org/simple/pyvips/), version: 2.0.4
  Found link https://files.pythonhosted.org/packages/17/08/9314ee0082c56aeac9dbbc23f5948e1e884ac9679cf6032197d5be34fa56/pyvips-2.0.5-py2.py3-none-any.whl#sha256=684a459452b1b1968c7c8dbd636cdb669f780e9927291dc469a25c751e9337be (from https://pypi.org/simple/pyvips/), version: 2.0.5
  Found link https://files.pythonhosted.org/packages/b5/74/5c963d0dcc76fb467902e18aab55500158f5c9acdc86235061a878c16376/pyvips-2.1.0-py2.py3-none-any.whl#sha256=eec805bba1de3bcaedf855a5696c85ca550896785e1fdf96ef7021248850b618 (from https://pypi.org/simple/pyvips/), version: 2.1.0
  Found link https://files.pythonhosted.org/packages/a0/32/f819aa0de7394b4d714fece744bde53ee82df5e545e4c5affb17563bdfcd/pyvips-2.1.0.tar.gz#sha256=4196e80ef03ca7efff21f00866e1302c5e90d45a8d9d87f3e5b122a1ba04ced2 (from https://pypi.org/simple/pyvips/), version: 2.1.0
  Found link https://files.pythonhosted.org/packages/c2/42/dbb88d6049ec0cdd5aa62070019d50a9381cb390dd5e68ab3c062b0a5260/pyvips-2.1.1.tar.gz#sha256=034210a7bfdbe574e07f71c96ca8cca3cc6072a5460032dad2794d8e75bd43dc (from https://pypi.org/simple/pyvips/), version: 2.1.1
  Found link https://files.pythonhosted.org/packages/5c/6e/df4a34a9c8b349e40d6400bd4ac40558b3497732795fa0399596155b18b1/pyvips-2.1.2.tar.gz#sha256=c9de58aa073194e85ea0b8e90cb6b6a22905293c5c53d030424bec40dbe281ad (from https://pypi.org/simple/pyvips/), version: 2.1.2
  Found link https://files.pythonhosted.org/packages/60/fb/820d471aa27cea5c11e752579cf11308adcfbd18558f509e7a7a5d7f229b/pyvips-2.1.3.tar.gz#sha256=223bb78753866c604a9918d89b53b5dd7b6102c5302c6672f0c4cb047c4c15f2 (from https://pypi.org/simple/pyvips/), version: 2.1.3
  Found link https://files.pythonhosted.org/packages/b3/55/abb37dfddb4907b00b0e55b85cda090aa0704f9a587d62b925b0238e898c/pyvips-2.1.4.tar.gz#sha256=4fb56ab9f30baa1d1103e488e368e60387a936dc9682b2456327bbfa2dc00a55 (from https://pypi.org/simple/pyvips/), version: 2.1.4
  Found link https://files.pythonhosted.org/packages/39/1e/b1df477d78bba37d3b9f83258e9a44bb505355e2e56a82e8398bfe699096/pyvips-2.1.5.tar.gz#sha256=42dfbf14f19374bef7db89f3943758deec3dc055c026ff9ae5fbd09a7cb1c0e3 (from https://pypi.org/simple/pyvips/), version: 2.1.5
  Found link https://files.pythonhosted.org/packages/ae/dd/8a223ac12ed4cc5bfe85b81503683bcf4c49804f176cebe13ff28ee88ce3/pyvips-2.1.6.tar.gz#sha256=36d41051da83a87ff0becf98c34f6e72921f64f0c3a6e0f180bae267e4d87a73 (from https://pypi.org/simple/pyvips/), version: 2.1.6
  Found link https://files.pythonhosted.org/packages/fe/dd/49b514c7a05343677946999b7ab1c63947b68546a12ca62d0d15d1473945/pyvips-2.1.7.tar.gz#sha256=41e7c514ab4458b385ff5d4e15b5954ea260d58b6e5773e639ed7187d5a15f58 (from https://pypi.org/simple/pyvips/), version: 2.1.7
  Found link https://files.pythonhosted.org/packages/07/b1/16e181d3c2d5fa0d009fb73e332a5c5ed2340d48af3ef060edcbd2992f46/pyvips-2.1.8.tar.gz#sha256=8992acde85331c08bf4cd0b8213d99bc65c523fc67eade93820d600de138ad04 (from https://pypi.org/simple/pyvips/), version: 2.1.8
  Found link https://files.pythonhosted.org/packages/a5/ad/3e467b2f81dfc84887922f50f104a4bb4a730b3643f4cda159af43c5bb06/pyvips-2.1.10.tar.gz#sha256=66268514e0361227471274610f09e02ce458df9c9b68114f59bd1e4d3fe0f76f (from https://pypi.org/simple/pyvips/), version: 2.1.10
  Found link https://files.pythonhosted.org/packages/f2/1d/69450110de9295f6fb4a9cb03602d954c05ca55618d9c88e6dc88d333050/pyvips-2.1.11.tar.gz#sha256=5e90526d177c7373d64d050bc9e5864a8d764ec83d83bb855c496ed06dba76ce (from https://pypi.org/simple/pyvips/), version: 2.1.11
  Found link https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz#sha256=84c2f7e31525c2d56813dcfc15344771d90753bfbcc455d63a55c4d7616fe05d (from https://pypi.org/simple/pyvips/), version: 2.1.12
Given no hashes to check 19 links for project 'pyvips': discarding no candidates
Using version 2.1.12 (newest of versions: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.1.8, 2.1.10, 2.1.11, 2.1.12)
Collecting pyvips
  Created temporary directory: /tmp/pip-unpack-j7qjlrnt
  Getting credentials from keyring for files.pythonhosted.org
  Looking up "https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz" in the cache
  No cache entry available
  Starting new HTTPS connection (1): files.pythonhosted.org:443
  https://files.pythonhosted.org:443 "GET /packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz HTTP/1.1" 200 43722
  Downloading pyvips-2.1.12.tar.gz (43 kB)
     |██████████████████████████████  | 40 kB 2.1 MB/s eta 0:00:01  Ignoring unknown cache-control directive: immutable
  Updating cache with response from "https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz"
  Caching due to etag
     |████████████████████████████████| 43 kB 908 kB/s 
  Added pyvips from https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz#sha256=84c2f7e31525c2d56813dcfc15344771d90753bfbcc455d63a55c4d7616fe05d to build tracker '/tmp/pip-req-tracker-go5rd_9n'
    Running setup.py (path:/tmp/pip-install-v44emkwn/pyvips/setup.py) egg_info for package pyvips
    Running command python setup.py egg_info
    running egg_info
    creating /tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info
    writing /tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/requires.txt
    writing top-level names to /tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/top_level.txt
    writing manifest file '/tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file '/tmp/pip-install-v44emkwn/pyvips/pip-egg-info/pyvips.egg-info/SOURCES.txt'
  Source in /tmp/pip-install-v44emkwn/pyvips has version 2.1.12, which satisfies requirement pyvips from https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz#sha256=84c2f7e31525c2d56813dcfc15344771d90753bfbcc455d63a55c4d7616fe05d
  Removed pyvips from https://files.pythonhosted.org/packages/b2/72/7aae89781d37f3c20bc9d54bc8154bad700d18760768b2d40b7ff30cc887/pyvips-2.1.12.tar.gz#sha256=84c2f7e31525c2d56813dcfc15344771d90753bfbcc455d63a55c4d7616fe05d from build tracker '/tmp/pip-req-tracker-go5rd_9n'
Requirement already satisfied: cffi>=1.0.0 in /usr/lib/python3/dist-packages (from pyvips) (1.14.0)
Requirement already satisfied: pkgconfig in /home/john/.local/lib/python3.8/site-packages (from pyvips) (1.5.1)
Building wheels for collected packages: pyvips
  Created temporary directory: /tmp/pip-wheel-o28dunkt
  Building wheel for pyvips (setup.py) ...   Destination directory: /tmp/pip-wheel-o28dunkt
  Running command /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v44emkwn/pyvips/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v44emkwn/pyvips/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-o28dunkt
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/gvalue.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vsourcecustom.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vsource.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/base.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/pyvips_build.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/enums.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/error.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/voperation.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/__init__.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vregion.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/gobject.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vdecls.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vimage.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vinterpolate.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vconnection.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vtargetcustom.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/version.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vobject.py -> build/lib.linux-x86_64-3.8/pyvips
  copying pyvips/vtarget.py -> build/lib.linux-x86_64-3.8/pyvips
  running build_ext
  generating cffi module 'build/temp.linux-x86_64-3.8/_libvips.c'
  creating build/temp.linux-x86_64-3.8
  building '_libvips' extension
  creating build/temp.linux-x86_64-3.8/build
  creating build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/home/john/vips/include -I/usr/include/libgsf-1 -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu//ImageMagick-6 -I/usr/include/ImageMagick-6 -I/usr/include/orc-0.4 -I/usr/include/OpenEXR -I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/openslide -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu -I/usr/include/libpng16 -I/usr/include/libexif -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/python3.8 -c build/temp.linux-x86_64-3.8/_libvips.c -o build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8/_libvips.o
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_d_vips_value_set_blob’:
  build/temp.linux-x86_64-3.8/_libvips.c:5875:27: warning: passing argument 2 of ‘vips_value_set_blob’ from incompatible pointer type [-Wincompatible-pointer-types]
   5875 |   vips_value_set_blob(x0, x1, x2, x3);
        |                           ^~
        |                           |
        |                           void (*)(void *)
  In file included from /home/john/vips/include/vips/vips.h:118,
                   from build/temp.linux-x86_64-3.8/_libvips.c:541:
  /home/john/vips/include/vips/type.h:232:17: note: expected ‘VipsCallbackFn’ {aka ‘int (*)(void *, void *)’} but argument is of type ‘void (*)(void *)’
    232 |  VipsCallbackFn free_fn, const void *data, size_t length );
        |  ~~~~~~~~~~~~~~~^~~~~~~
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_f_vips_value_set_blob’:
  build/temp.linux-x86_64-3.8/_libvips.c:5923:29: warning: passing argument 2 of ‘vips_value_set_blob’ from incompatible pointer type [-Wincompatible-pointer-types]
   5923 |   { vips_value_set_blob(x0, x1, x2, x3); }
        |                             ^~
        |                             |
        |                             void (*)(void *)
  In file included from /home/john/vips/include/vips/vips.h:118,
                   from build/temp.linux-x86_64-3.8/_libvips.c:541:
  /home/john/vips/include/vips/type.h:232:17: note: expected ‘VipsCallbackFn’ {aka ‘int (*)(void *, void *)’} but argument is of type ‘void (*)(void *)’
    232 |  VipsCallbackFn free_fn, const void *data, size_t length );
        |  ~~~~~~~~~~~~~~~^~~~~~~
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_checkfld__GEnumClass’:
  build/temp.linux-x86_64-3.8/_libvips.c:6100:25: warning: initialization of ‘GTypeClass **’ {aka ‘struct _GTypeClass **’} from incompatible pointer type ‘GTypeClass *’ {aka ‘struct _GTypeClass *’} [-Wincompatible-pointer-types]
   6100 |   { GTypeClass * *tmp = &p->g_type_class; (void)tmp; }
        |                         ^
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_checkfld__GValue’:
  build/temp.linux-x86_64-3.8/_libvips.c:6163:25: warning: initialization of ‘uint64_t (*)[2]’ {aka ‘long unsigned int (*)[2]’} from incompatible pointer type ‘union <anonymous> (*)[2]’ [-Wincompatible-pointer-types]
   6163 |   { uint64_t(*tmp)[2] = &p->data; (void)tmp; }
        |                         ^
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_checkfld__VipsObject’:
  build/temp.linux-x86_64-3.8/_libvips.c:6233:19: warning: initialization of ‘void **’ from incompatible pointer type ‘VipsArgumentTable **’ {aka ‘struct _GHashTable **’} [-Wincompatible-pointer-types]
   6233 |   { void * *tmp = &p->argument_table; (void)tmp; }
        |                   ^
  build/temp.linux-x86_64-3.8/_libvips.c: In function ‘_cffi_checkfld__VipsProgress’:
  build/temp.linux-x86_64-3.8/_libvips.c:6263:19: warning: initialization of ‘void **’ from incompatible pointer type ‘GTimer **’ {aka ‘struct _GTimer **’} [-Wincompatible-pointer-types]
   6263 |   { void * *tmp = &p->start; (void)tmp; }
        |                   ^
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/build/temp.linux-x86_64-3.8/_libvips.o -L/home/john/vips/lib -lvips -lgobject-2.0 -lglib-2.0 -o build/lib.linux-x86_64-3.8/_libvips.abi3.so
  installing to build/bdist.linux-x86_64/wheel
  running install
  running install_lib
  creating build/bdist.linux-x86_64
  creating build/bdist.linux-x86_64/wheel
  creating build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/gvalue.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vsourcecustom.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vsource.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/base.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/pyvips_build.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/enums.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/error.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/voperation.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/__init__.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vregion.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/gobject.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vdecls.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vimage.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vinterpolate.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vconnection.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vtargetcustom.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/version.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vobject.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/pyvips/vtarget.py -> build/bdist.linux-x86_64/wheel/pyvips
  copying build/lib.linux-x86_64-3.8/_libvips.abi3.so -> build/bdist.linux-x86_64/wheel
  running install_egg_info
  running egg_info
  writing pyvips.egg-info/PKG-INFO
  writing dependency_links to pyvips.egg-info/dependency_links.txt
  writing requirements to pyvips.egg-info/requires.txt
  writing top-level names to pyvips.egg-info/top_level.txt
  reading manifest file 'pyvips.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'pyvips.egg-info/SOURCES.txt'
  Copying pyvips.egg-info to build/bdist.linux-x86_64/wheel/pyvips-2.1.12.egg-info
  running install_scripts
  adding license file "LICENSE.txt" (matched pattern "LICEN[CS]E*")
  creating build/bdist.linux-x86_64/wheel/pyvips-2.1.12.dist-info/WHEEL
  creating '/tmp/pip-wheel-o28dunkt/pyvips-2.1.12-cp38-cp38-linux_x86_64.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
  adding '_libvips.abi3.so'
  adding 'pyvips/__init__.py'
  adding 'pyvips/base.py'
  adding 'pyvips/enums.py'
  adding 'pyvips/error.py'
  adding 'pyvips/gobject.py'
  adding 'pyvips/gvalue.py'
  adding 'pyvips/pyvips_build.py'
  adding 'pyvips/vconnection.py'
  adding 'pyvips/vdecls.py'
  adding 'pyvips/version.py'
  adding 'pyvips/vimage.py'
  adding 'pyvips/vinterpolate.py'
  adding 'pyvips/vobject.py'
  adding 'pyvips/voperation.py'
  adding 'pyvips/vregion.py'
  adding 'pyvips/vsource.py'
  adding 'pyvips/vsourcecustom.py'
  adding 'pyvips/vtarget.py'
  adding 'pyvips/vtargetcustom.py'
  adding 'pyvips-2.1.12.dist-info/LICENSE.txt'
  adding 'pyvips-2.1.12.dist-info/METADATA'
  adding 'pyvips-2.1.12.dist-info/WHEEL'
  adding 'pyvips-2.1.12.dist-info/top_level.txt'
  adding 'pyvips-2.1.12.dist-info/RECORD'
  removing build/bdist.linux-x86_64/wheel
done
  Created wheel for pyvips: filename=pyvips-2.1.12-cp38-cp38-linux_x86_64.whl size=142342 sha256=4a411484c9381ed120d4c4b35ee7b8c0c0a5e00912ecb5ae16be4a25eb22a3d3
  Stored in directory: /home/john/.cache/pip/wheels/1c/d2/69/3dd4be20f51592f87b9183aa58a8f3af53e583028712ecc6a9
Successfully built pyvips
Installing collected packages: pyvips
  Created temporary directory: /tmp/pip-unpacked-wheel-9pdroh9u

Successfully installed pyvips-2.1.12
Cleaning up...
  Removing source in /tmp/pip-install-v44emkwn/pyvips
Removed build tracker: '/tmp/pip-req-tracker-go5rd_9n'

@kleisauke
Copy link
Member

You could also try the patch from here: #84 (comment). This patch ensures that it will print details if pkg-config or libvips is missing.

@jcupitt That patch fell of my radar. Should I make a PR? It also ensures that these messages are printed during installation with --verbose:

# we must have the vips package to be able to do anything
if not pkgconfig.exists('vips'):
raise Exception('unable to find pkg-config package "vips"')
if pkgconfig.installed('vips', '< 8.2'):
raise Exception('pkg-config "vips" is too old -- need libvips 8.2 or later')

jcupitt added a commit that referenced this issue Jul 4, 2020
log the exception on API install fail

see #180
@jcupitt
Copy link
Member

jcupitt commented Jul 4, 2020

Oh, I forgot about that too.

It's only a few lines of code -- I pasted your patch in.

@ccellado
Copy link
Author

Ok, I've done it - pyvips now in nixpkgs ( git latest rep ) in API mode.

Thanks to all!

@ccellado
Copy link
Author

@jcupitt And now ofc you can mention that the package available via nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants