You are not logged in.

#1 2009-11-11 00:15:42

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

I've got a strange linking error when trying to create a PKGBUILD for g'mic that I have no idea how to search for:

http://gmic.sourceforge.net/

To make a long story short, this is what happens when I manually enter the src directory of the package and run './configure --prefix=/usr':

... snip ...
checking for main in -lMagick++... yes
checking for main in -lXext... yes
checking for main in -lXrandr... yes
checking for main in -ljpeg... yes
checking for main in -lm... yes
checking for main in -lnsl... yes
checking for main in -lpng... yes
checking for main in -lpthread... yes
checking for main in -lrt... yes
checking for main in -ltiff... yes
checking for main in -lz... yes
checking for main in -lfftw3... yes
checking for InitializeMagick in -lGraphicsMagick++... yes
... snip ...

This is what happens from within a PKGBUILD:

... snip ...
checking for main in -lMagick++... yes
checking for main in -lXext... yes
checking for main in -lXrandr... yes
checking for main in -ljpeg... yes
checking for main in -lm... yes
checking for main in -lnsl... yes
checking for main in -lpng... yes
checking for main in -lpthread... yes
checking for main in -lrt... yes
checking for main in -ltiff... yes
checking for main in -lz... yes
checking for main in -lfftw3... yes
checking for InitializeMagick in -lGraphicsMagick++... no
***
** Fatal Error : Header or library files for 'GraphicsMagick++' are missing but are mandatory to compile G'MIC. **
***
... snip ...

I'm already passing !makeflags because it (cimg I'm sure) doesn't like multi-core builds, but it doesn't change this situation either way. I'll gladly accept any ideas.

Offline

#2 2009-11-11 01:30:07

tdy
Member
From: Sacremende
Registered: 2008-12-14
Posts: 440

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

I can't reproduce this on any of my boxes.  If you haven't already, maybe you could split out the package() function in case it's a fakeroot building issue (although it doesn't make a difference either way for me).

This is the incomplete PKGBUILD I used.  FYI even though I didn't have your linker issue, it still didn't actually compile for me.. it just stalled a little bit into the make process.

pkgname=gmic
pkgver=1.3.2.9
pkgrel=1
pkgdesc="GREYC's Magic Image Converter"
arch=('i686' 'x86_64')
url="http://gmic.sourceforge.net/"
license=('custom:CeCILL')
depends=('fftw' 'graphicsmagick' 'imagemagick' 'libxrandr')
makedepends=('pkgconfig>=0.9')
source=(http://downloads.sourceforge.net/$pkgname/${pkgname}_$pkgver.tar.gz)
md5sums=('a3c5650dbef69efc09430e71dc42a5ef')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  ./configure --prefix=/usr
  make || return 1
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}

Last edited by tdy (2009-11-11 01:57:20)

Offline

#3 2009-11-11 02:41:37

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

The stalling is from the version of GCC that we're using. It will compile... after it sits there for a while. I discovered this with greycstoration.

Your build fails exactly the same way mine does on my 64 bit box. I haven't tried the 32 bit one yet. The fact that it works outside of a PKGBUILD is a major mystery to me, and maybe fakeroot has something to do with it?

Offline

#4 2009-11-11 10:15:17

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

I can confirm on x86_64 .

Last edited by Nezmer (2009-11-11 10:27:15)


English is not my native language .

Offline

#5 2009-11-11 10:45:25

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

Alright .
I know what's the problem but I don't know how to fix it . the configure script is simply not compatible with bash . I bet you run "./configure" from zsh or some shell other than bash .


English is not my native language .

Offline

#6 2009-11-12 02:11:02

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

Nezmer wrote:

Alright .
I know what's the problem but I don't know how to fix it . the configure script is simply not compatible with bash . I bet you run "./configure" from zsh or some shell other than bash .

Actually, I use bash. And, I discovered the problem. I had some LDFLAGS in makepkg.conf that I saw in the forums that I was tying out. I forgot about them because everything kept working... I thought anyway. These are the flags and removing them solved the problem:

LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"

By the way tdy, your PKGBUILD works. It cleanly created the package including the GIMP plug-in and documentation.

Offline

#7 2010-03-30 13:31:06

traaf
Member
Registered: 2009-08-06
Posts: 10

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

i had the same error
i commented the LDFLAGS line in makepkg.conf
the configure runs fine but compilation fails anyway with another error

Configuration for gmic 1.3 :
-----------------------------------

  Compiler ........................ : g++
  Linker LDFLAGS .................. : g++  -lIlmImf -lGraphicsMagick++ -lfftw3 -lz -ltiff -lrt -lpthread -lpng -lnsl -lm -ljpeg -lXrandr -lXext -lMagick++
  CXXFLAGS ........................ : -march=x86-64 -mtune=generic -O2 -pipe
  INSTALL gmic .................... : /usr/bin/gmic

  Now type 'make' to build the full version of gmic 1.3,
  or go to the 'src/' directory and type 'make gimp' to compile
  the Gimp plug-in only, and then type (under root) 'make install' for installation.

make "CFLAGS+=-Dcimg_display=0 -Dgmic_build -Wall -W -Dcimg_use_fftw3 -Dcimg_use_png -O3 -fno-tree-pre" "LDFLAGS+=-lpthread -lfftw3 -lpng -lz" "STRIP_EXE=1" gmic_gimp
make[1]: entrant dans le répertoire « /tmp/yaourt-tmp-traaf/aur-gimp-plugin-gmic4gimp/gimp-plugin-gmic4gimp/src/gmic-1.3.3.3/src »
g++ -o gmic_gimp.o -c gmic.cpp -Dgmic_gimp -Dgmic_minimal -march=x86-64 -mtune=generic -O2 -pipe -Dcimg_display=0 -Dgmic_build -Wall -W -Dcimg_use_fftw3 -Dcimg_use_png -O3 -fno-tree-pre
In file included from gmic.h:63,
                 from gmic.cpp:423:
./CImg.h: In member function 'cimg_library::CImg<T>& cimg_library::CImg<T>::_load_png(FILE*, const char*)':
./CImg.h:30254: erreur: 'int_p_NULL' was not declared in this scope
./CImg.h:30265: erreur: there are no arguments to 'png_set_gray_1_2_4_to_8' that depend on a template parameter, so a declaration of 'png_set_gray_1_2_4_to_8' must be available
./CImg.h:30265: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
./CImg.h: In member function 'cimg_library::CImg<T>& cimg_library::CImg<T>::_load_png(FILE*, const char*) [with T = float]':
./CImg.h:30177:   instantiated from 'cimg_library::CImg<T>& cimg_library::CImg<T>::load_png(const char*) [with T = float]'
./CImg.h:29693:   instantiated from 'cimg_library::CImg<T>& cimg_library::CImg<T>::load(const char*) [with T = float]'
./CImg.h:13278:   instantiated from 'cimg_library::CImg<T>& cimg_library::CImg<T>::pow(const char*) [with T = float]'
gmic.cpp:1578:   instantiated from 'gmic& gmic::parse(const cimg_library::CImgList<char>&, unsigned int&, cimg_library::CImgList<T>&, cimg_library::CImgList<char>&, cimg_library::CImgList<unsigned int>&, cimg_library::CImgList<unsigned int>&, cimg_library::CImgList<unsigned int>&, bool) [with T = float]'
gmic.cpp:5491:   instantiated from here
./CImg.h:30265: erreur: 'png_set_gray_1_2_4_to_8' was not declared in this scope
make[1]: *** [gmic_gimp.o] Erreur 1
make[1]: quittant le répertoire « /tmp/yaourt-tmp-traaf/aur-gimp-plugin-gmic4gimp/gimp-plugin-gmic4gimp/src/gmic-1.3.3.3/src »
make: *** [gimp] Erreur 2

Offline

#8 2010-05-04 13:48:20

braza
Member
Registered: 2010-02-21
Posts: 3

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

I have the same error even if i commented LDFLAGS in makepg.conf.


** Fatal Error : Header or library files for 'Openexr' are missing but are necessary to compile G'MIC. **
***
make "CFLAGS+=-Dgmic_build -Dcimg_display=0 -Dcimg_use_fftw3 -Dcimg_use_png -Dcimg_use_zlib -O3 -fno-tree-pre" "LDFLAGS+=-lpthread -lfftw3 -lpng -lz -lz" "STRIP_EXE=1" gmic_gimp
make[1]: Entering directory `/home/braza/src/gmic-1.3.4.1/src'
g++ -o gmic_gimp.o -c gmic.cpp -Dgmic_gimp -Dgmic_minimal -Dgmic_float -march=i686 -mtune=generic -O2 -pipe -Dgmic_build -Dcimg_display=0 -Dcimg_use_fftw3 -Dcimg_use_png -Dcimg_use_zlib -O3 -fno-tree-pre


It looks like this problem isnt solved !!!

Offline

#9 2010-05-04 14:44:27

braza
Member
Registered: 2010-02-21
Posts: 3

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

braza wrote:

I have the same error even if i commented LDFLAGS in makepg.conf.


** Fatal Error : Header or library files for 'Openexr' are missing but are necessary to compile G'MIC. **
***
make "CFLAGS+=-Dgmic_build -Dcimg_display=0 -Dcimg_use_fftw3 -Dcimg_use_png -Dcimg_use_zlib -O3 -fno-tree-pre" "LDFLAGS+=-lpthread -lfftw3 -lpng -lz -lz" "STRIP_EXE=1" gmic_gimp
make[1]: Entering directory `/home/braza/src/gmic-1.3.4.1/src'
g++ -o gmic_gimp.o -c gmic.cpp -Dgmic_gimp -Dgmic_minimal -Dgmic_float -march=i686 -mtune=generic -O2 -pipe -Dgmic_build -Dcimg_display=0 -Dcimg_use_fftw3 -Dcimg_use_png -Dcimg_use_zlib -O3 -fno-tree-pre


It looks like this problem isnt solved !!!

Sorry, my bad. After commenting LDFLAGS and installing openexr, it works.

Offline

#10 2010-05-19 22:42:38

foxbunny
Member
From: Serbia
Registered: 2006-10-31
Posts: 759
Website

Re: Weird linking error from within a PKGBUILD (g'mic) [SOLVED]

I get on 32-bit an error message different than on 64-bit:

** Fatal Error : Header or library files for 'libavcodec' are missing but are necessary to compile G'MIC. **
***

On 64-bit I get the same error message as the OP.

This is on the same box, but 32-bit is a bundled system in a chroot, whereas the host is 64-bit.

Last edited by foxbunny (2010-05-19 22:43:19)

Offline

Board footer

Powered by FluxBB