Skip to content
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

7.28.7 - Compilation problem on CentOS 5 #20

Closed
stanislaw opened this issue Jun 20, 2012 · 10 comments
Closed

7.28.7 - Compilation problem on CentOS 5 #20

stanislaw opened this issue Jun 20, 2012 · 10 comments

Comments

@stanislaw
Copy link

I used the latest tarball http://www.vips.ecs.soton.ac.uk/supported/7.28/vips-7.28.7.tar.gz

I am on CentOS 5, so I am not sure what is problem here -

@jakecobb says it is CentOS 5 issue having old version of glib:

"I'm sure this is related to CentOS having an older version of glib, but it probably deserves it's own issue report since it's a different libvips version and file than mentioned in the title of this issue." (https://github.com/jcupitt/libvips/issues/16)

Could you please explain what can I do in this case?

./configure works

make stage gives following:

...
mv -f .deps/mapfile.Tpo .deps/mapfile.Plo
/bin/sh ../../libtool --tag=CC   --mode=compile gcc -std=gnu99 
-DHAVE_CONFIG_H -I. -I../.. -I../../libvips/include -DG_DISABLE_ASSERT 
-DG_DISABLE_CHECKS -pthread -fopenmp -I/usr/lib/glib-2.0/include 
-I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/include/ImageMagick           
-g -O2 -MT cache.lo -MD -MP -MF .deps/cache.Tpo -c -o cache.lo cache.c
libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. 
-I../../libvips/include -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -pthread 
-fopenmp -I/usr/lib/glib-2.0/include -I/usr/include/libxml2 
-I/usr/include/glib-2.0 -I/usr/include/ImageMagick -g -O2 -MT cache.lo -MD 
-MP -MF .deps/cache.Tpo -c cache.c  -fPIC -DPIC -o .libs/cache.o
cache.c: In function 'vips_value_hash':
cache.c:137: warning: implicit declaration of function 'g_int64_hash'
cache.c:152: warning: implicit declaration of function 'g_double_hash'
cache.c: In function 'vips_cache_dump':
cache.c:423: error: 'GHashTableIter' undeclared (first use in this function)
cache.c:423: error: (Each undeclared identifier is reported only once
cache.c:423: error: for each function it appears in.)
cache.c:423: error: expected ';' before 'iter'
cache.c:427: warning: implicit declaration of function 
'g_hash_table_iter_init'
cache.c:427: error: 'iter' undeclared (first use in this function)
cache.c:428: warning: implicit declaration of function 
'g_hash_table_iter_next'
cache.c: In function 'vips_cache_drop_all':
cache.c:505: error: 'GHashTableIter' undeclared (first use in this function)
cache.c:505: error: expected ';' before 'iter'
cache.c:508: error: 'iter' undeclared (first use in this function)
make[3]: *** [cache.lo] Error 1
make[3]: Leaving directory 
`/home/stanislaw/etc/vips/vips-7.28.7/libvips/iofuncs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/stanislaw/etc/vips/vips-7.28.7/libvips'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/stanislaw/etc/vips/vips-7.28.7'
make: *** [all] Error 2
@jcupitt
Copy link
Member

jcupitt commented Jun 20, 2012

Oh dear, yes, g_int64_hash() was introduced in glib-2.22. GHashTableIter was introduced in 2.16.

What's the glib version on centos 5?

@jcupitt
Copy link
Member

jcupitt commented Jun 20, 2012

OK, I see it's 2.12 :-( I'll try installing that glib here and see what breaks.

@stanislaw
Copy link
Author

Thanks for this attempt of supporting older CentOS 5. My server with several projects is running on it. Would be great to have libvips working there.

@stanislaw
Copy link
Author

I have managed to install latest vips after doing risky (I hope not ;)) upgrade of glib to the version 2.21.6.

All procedure: ./configure && make && make install worked fine without any errors.

Versions 2.16, 2.17, 2.32 didn't work, but 2.21.6 did. Oh, this strange Unix/C stuff ;)

But now when building a gem, I have the following output:

[stanislaw@onapp ruby-vips]$ gem install ruby-vips-0.1.0.gem 
Installing gem ruby-vips-0.1.0
Using local gem ruby-vips-0.1.0.gem
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips/reader.rb
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips/version.rb
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips/writer.rb
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips.rb
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/LICENSE
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/README.md
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/writer.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_mosaicing.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_colour.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/reader.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/ruby_vips.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/header.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_morphology.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_histograms_lut.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_freq_filt.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_morphology.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_convolution.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_resample.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/interpolator.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_boolean.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_freq_filt.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_arithmetic.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/ruby_vips.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/mask.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_boolean.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_conversion.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_relational.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/interpolator.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/header.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_histograms_lut.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_relational.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_colour.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/mask.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_resample.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_conversion.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_mosaicing.h
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_convolution.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/image_arithmetic.c
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/ext/extconf.rb
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-vips-0.1.0.gem:
    ERROR: Failed to build gem native extension.

        /home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vips/vips.h... no
creating Makefile

make
compiling writer.c
In file included from ruby_vips.h:5,
                 from writer.c:1:
/usr/local/include/vips/vips.h:84:18: error: glib.h: No such file or 
directory
/usr/local/include/vips/vips.h:85:25: error: glib/gstdio.h: No such file or 
directory
/usr/local/include/vips/vips.h:86:21: error: gmodule.h: No such file or 
directory
/usr/local/include/vips/vips.h:87:25: error: glib-object.h: No such file or 
directory
In file included from /usr/local/include/vips/vips.h:99,
                 from ruby_vips.h:5,
                 from writer.c:1:
/usr/local/include/vips/buf.h:51: error: expected specifier-qualifier-list 
before ‘gboolean’

I think it could be somehow solved by including the following into maybe ./configure options:

[root@onapp vips-7.28.7]# pkg-config --cflags glib-2.0
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include

Any hints?

@jcupitt
Copy link
Member

jcupitt commented Jun 20, 2012

Here's a patch to remove the glib-2.16+ stuff in cache.c

jcupitt@9bb9f59

I made a test tarball for you:

http://www.vips.ecs.soton.ac.uk/development/vips-7.28.8.tar.gz

Could you try it?

@jcupitt
Copy link
Member

jcupitt commented Jun 20, 2012

Argh! I hope your glib upgrade doesn't cause you too much trouble.

On your gem build: you need to get the gem builder to see the vips install area. You need to check the values of PKG_CONFIG_PATH, PATH, LD_CONFIG_PATH.

@stanislaw
Copy link
Author

John, your test tarball worked fine! I removed 2.21.6 and tried it on 2.12.3. It works!

About gem build and PKG_CONFIG_PATH & friends - I don't know how to do it yet, but I will learn it ASAP.

@jcupitt
Copy link
Member

jcupitt commented Jun 20, 2012

It's very easy: ruby-vips is using pkg-config to find vips. It's
running this command:

pkg-config vips-7.28 --cflags

to find where the vips headers are.

pkg-config in turn is searching for a file called vips-7.28.pc which
holds all of the vips config stuff. It searches along the directories
listed in PKG_CONFIG_PATH.

When you "make install" in vips, it puts vips-7.28.pc into
$prefix/lib/pkgconfig ... so all you need to do is work out where you
installed vips to, and make sure /home/me/vips/lib/pkgconfig (or
wherever) is early on in your PKG_CONFIG_PATH.

On 20 June 2012 22:47, Stanislaw Pankevich
reply@reply.github.com
wrote:

John, your test tarball worked fine! I removed 2.21.6 and tried it on 2.12.3. It works!

About gem build and PKG_CONFIG_PATH & friends - I don't know how to do it yet, but I will learn it ASAP.


Reply to this email directly or view it on GitHub:
https://github.com/jcupitt/libvips/issues/20#issuecomment-6468298

@stanislaw
Copy link
Author

Ok, I got it. I had set

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

and it worked.

The only question left about pkg_config: how to persist PKG_CONFIG_PATH variable - I'll find it somehow.

Gem builds and installs. But...

[stanislaw@onapp jcupitt-ruby-vips-26f360c]$ irb
1.9.3-p194 :001 > require 'vips'
LoadError: libvips.so.32: cannot open shared object file: No such file or 
directory - 
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips_ext.so
    from 
/home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
    from 
/home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 
`require'
    from 
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips.rb:4:in 
`<top (required)>'
    from 
/home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 
`require'
    from 
/home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in 
`rescue in require'
    from 
/home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in 
`require'
    from (irb):1
    from /home/stanislaw/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in 
`<main>'

This is strange because file exists:

[stanislaw@onapp jcupitt-ruby-vips-26f360c]$ ls -l 
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips_ext.so
-rwxr-xr-x 1 stanislaw users 401905 Jun 21 01:49 
/home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0/lib/vips_ext.so

Do you have any ideas?

@jcupitt
Copy link
Member

jcupitt commented Jun 21, 2012

I guess it's a gem install thing. Your GEM_HOME seems to be /home/stanislaw/.rvm/gems/ruby-1.9.3-p194/gems/ruby-vips-0.1.0, have you added GEM_HOME/lib and GEM_HOME/bin to your path and library path?

I've made that 7.28.8 tarball official, so I'll close this issue.

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

No branches or pull requests

2 participants