You are not logged in.

#1 2009-08-03 16:11:56

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

compile flags disturbe building of package [solved]

Hi.

I have my compile flags set in makepkg.conf, and every package was building ok till now. Yesterday I tryed to build Sphinx with yaourt, but the build stoped when building libsphinxclient. I think it has something to do with the compiler flags set in makepkg.conf. When it builds with yaourt:

/bin/sh ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c -o sphinxclient.lo sphinxclient.c

and the build stops after that (this does not give the error, but it doesn't build some libraries needed afterwards).
When I build it manually, the command differs:

/bin/sh ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c -o sphinxclient.lo sphinxclient.c

The ./configure for the manuall build is the same as from the PKGBUILD

This is the whole build process for libsphinxclient from yaourt:

make[1]: Entering directory `/tmp/yaourt-tmp-krt/aur-sphinx/sphinx/src/sphinx-0.9.8.1/api/libsphinxclient'
/bin/sh ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c -o sphinxclient.lo sphinxclient.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c test.c
make[1]: *** No rule to make target `.libs/libsphinxclient.a', needed by `test'. Stop.
make[1]: *** Waiting for unfinished jobs....
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c sphinxclient.c -fPIC -DPIC -o .libs/sphinxclient.o
gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c sphinxclient.c -o sphinxclient.o >/dev/null 2>&1
make[1]: Leaving directory `/tmp/yaourt-tmp-krt/aur-sphinx/sphinx/src/sphinx-0.9.8.1/api/libsphinxclient'
make: *** [all] Error 2

The build of libsphinxclient manually:

make  all-am
make[1]: Entering directory `/home/krt/Desktop/sphinx-0.9.8.1/api/libsphinxclient'
/bin/sh ./libtool --mode=compile --tag=CC gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c -o sphinxclient.lo sphinxclient.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c sphinxclient.c  -fPIC -DPIC -o .libs/sphinxclient.o
 gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c sphinxclient.c -o sphinxclient.o >/dev/null 2>&1
/bin/sh ./libtool --mode=link --tag=CC gcc  -g -O2   -o libsphinxclient.la -rpath /usr/lib -release 0.0.1 sphinxclient.lo  
gcc -shared  .libs/sphinxclient.o   -Wl,-soname -Wl,libsphinxclient-0.0.1.so -o .libs/libsphinxclient-0.0.1.so
(cd .libs && rm -f libsphinxclient.so && ln -s libsphinxclient-0.0.1.so libsphinxclient.so)
ar cru .libs/libsphinxclient.a  sphinxclient.o
ranlib .libs/libsphinxclient.a
creating libsphinxclient.la
(cd .libs && rm -f libsphinxclient.la && ln -s ../libsphinxclient.la libsphinxclient.la)
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c test.c
/bin/sh ./libtool --mode=link --tag=CC gcc  -g -O2   -o test  test.o .libs/libsphinxclient.a 
gcc -g -O2 -o test test.o  .libs/libsphinxclient.a
make[1]: Leaving directory `/home/krt/Desktop/sphinx-0.9.8.1/api/libsphinxclient'

In yaourt a whole block of output is skipped after the second line, and it continues with the compiling of test.c:

gcc -DHAVE_CONFIG_H -I. -I. -I. -march=athlon64 -O2 -pipe -c test.c

Since test.c need's libsphinxclient.a and it doesn't exist (it would have been compiled in the skiped part (like in the manually compiled section)), the build isn't successful.
NOTE: I don't know much about compiling, it's just my observation.

Why doesn't it work with the compile flags set?

Last edited by KRTac (2009-08-03 19:39:00)

Offline

#2 2009-08-03 18:23:05

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: compile flags disturbe building of package [solved]

Looks like something is off with the build system. By any chance, do you have MAKEFLAGS="-j2" uncommented in your /etc/makepkg.conf? smile

Offline

#3 2009-08-03 19:03:55

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

Re: compile flags disturbe building of package [solved]

jeah...the proc is a dual core, so it's -j3. Why?

Offline

#4 2009-08-03 19:15:36

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: compile flags disturbe building of package [solved]

Well, it appears that the package doesn't build with multiple concurrent build jobs.

Try adding the following above the line beginning with "./configure" and see if it then builds correctly:

export MAKEFLAGS="-j1"

On a side note, I've found -j2 to work perfectly for dual core systems. I've definitely seen -j(number of cores)+1 being suggested elsewhere, but I can't see why -j(number of cores) isn't equally suitable or even more correct. smile

Offline

#5 2009-08-03 19:21:10

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

Re: compile flags disturbe building of package [solved]

ok....will try that now. I'll update the results in this post.

Update:
Yeah, the MAKEFLAGS set to -j1 did the trick. I don't know if the issue exists on all architectures, but the maintainer should look into that. I'll comment on the aur package page about that. Thanks for the help foutrelis.

And, thank's for the advice on MAKEFLAGS....will try that.

Last edited by KRTac (2009-08-03 19:38:40)

Offline

#6 2009-08-03 22:25:32

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: compile flags disturbe building of package [solved]

KRTac wrote:

ok....will try that now. I'll update the results in this post.

Update:
Yeah, the MAKEFLAGS set to -j1 did the trick. I don't know if the issue exists on all architectures, but the maintainer should look into that. I'll comment on the aur package page about that. Thanks for the help foutrelis.

And, thank's for the advice on MAKEFLAGS....will try that.

BTW, the correect way to do this is to add:
options=('!makeflags')
to the PKGBUILD.

Offline

#7 2009-08-03 22:31:28

KRTac
Member
From: Croatia
Registered: 2008-07-01
Posts: 99

Re: compile flags disturbe building of package [solved]

ok. this is way more elegant. thanks :-)

Offline

Board footer

Powered by FluxBB