aMSN Forums
August 21, 2018, 04:30:26 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [BUG] AMSN SVN fails to compile when using -march=native  (Read 4185 times)
Rainmaker
Newbie

Offline Offline

Posts: 5


View Profile
« on: May 12, 2009, 08:53:36 pm »

I'm not entirely sure if this is the right place to report bugs. Forgive me if it's not.

This issue has been going on for a while, and it's just been annoying me, so I wanted to finnaly mention it to people who can actually fix it Smiley

Since some recent version of GCC, users can use the option -march=native to get the code compiled for the specific CPU type GCC is running on. On my Gentoo install, I let packages compile using the flags:
Code:
"-march=native -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer"


however, the MakeFile of AMSN does not seem to like the -march=native flag.

When I change my GCC options to
Code:
"-march=nocona -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer"


AMSN compiles fine.

As said, this has been going on for a while, but this specific buildlog was of SVN revision 11179:
Code:
checking for pkg-config... yes
checking for x86_64-pc-linux-gnu-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for GST... yes
checking for GST_INTERFACES... yes
checking for FARSIGHT2... no
checking for LIBV4L... no
checking for GUPNP... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating utils/linux/capture/config.h

compile time options summary
============================

    X11          : yes
    Tcl : 8.5
    TK : 8.5
    DEBUG        : no
    STATIC       : no
    FARSIGHT     : no
    LIBV4L       : no
    GUPNP-IGD    : no

*** You do not seem to have gstreamer and farsight2 installed.
*** You will not be able to build the required component for audio conversations.
*** Read this for more information : http://amsn-project.net/wiki/Farsight
make -j3
(cd .; autoreconf -i)
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64
checking for x86_64-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc
checking for C compiler default output file name...
configure: error: in `/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** [Makefile] Fout 77


and config.log:
Code:
Medusa amsn-svn # cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.63.  Invocation command line was

  $ ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64

## --------- ##
## Platform. ##
## --------- ##

hostname = Medusa
uname -m = x86_64
uname -r = 2.6.29-zen1
uname -s = Linux
uname -v = #2 SMP Sun Apr 12 02:48:51 CEST 2009

/usr/bin/uname -p = Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/lib64/portage/bin/ebuild-helpers
PATH: /usr/local/sbin
PATH: /sbin
PATH: /usr/sbin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /opt/bin
PATH: /usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2092: checking for x86_64-pc-linux-gnu-gcc
configure:2108: found /usr/bin/x86_64-pc-linux-gnu-gcc
configure:2119: result: x86_64-pc-linux-gnu-gcc
configure:2391: checking for C compiler version
configure:2399: x86_64-pc-linux-gnu-gcc --version >&5
x86_64-pc-linux-gnu-gcc (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2403: $? = 0
configure:2410: x86_64-pc-linux-gnu-gcc -v >&5
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.3-r2/work/gcc-4.3.3/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.3/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --disable-libgcj --enable-languages=c,c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.3-r2 p1.1, pie-10.1.5'
Thread model: posix
gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.1, pie-10.1.5)
configure:2414: $? = 0
configure:2421: x86_64-pc-linux-gnu-gcc -V >&5
x86_64-pc-linux-gnu-gcc: '-V' option must have argument
configure:2425: $? = 1
configure:2448: checking for C compiler default output file name
configure:2470: x86_64-pc-linux-gnu-gcc -march=native -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include   -I. -I./utils/linux/capture -I./utils/linux/capture/libng -I./utils/linux/capture/structs -I./utils/webcamsn/src -I./utils/tcl_siren/src -I./utils/tclISF/src/libISF -DPACKAGE='"amsn"' -DVERSION='"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"' -DLIBDIR='"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"' -fPIC  -Wl,-O1 -s conftest.c  >&5
x86_64-pc-linux-gnu-gcc: svnversion: No such file or directory
x86_64-pc-linux-gnu-gcc: >: No such file or directory
x86_64-pc-linux-gnu-gcc: &&: No such file or directory
x86_64-pc-linux-gnu-gcc: svnversion: No such file or directory
x86_64-pc-linux-gnu-gcc: ||: No such file or directory
x86_64-pc-linux-gnu-gcc: true`"': No such file or directory
configure:2474: $? = 1
configure:2512: result:
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2518: error: in `/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn':
configure:2521: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-march=native -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include   -I. -I./utils/linux/capture -I./utils/linux/capture/libng -I./utils/linux/capture/structs -I./utils/webcamsn/src -I./utils/tcl_siren/src -I./utils/tclISF/src/libISF -DPACKAGE='\''"amsn"'\'' -DVERSION='\''"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"'\'' -DLIBDIR='\''"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"'\'' -fPIC'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-O2 -pipe -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include -I./utils/TkCximage/src -I./utils/TkCximage/src/CxImage -DPACKAGE='\''"amsn"'\'' -DVERSION='\''"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"'\'' -DLIBDIR='\''"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"'\'' -fPIC'
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_FARSIGHT2_CFLAGS_set=
ac_cv_env_FARSIGHT2_CFLAGS_value=
ac_cv_env_FARSIGHT2_LIBS_set=
ac_cv_env_FARSIGHT2_LIBS_value=
ac_cv_env_GLIB_CFLAGS_set=
ac_cv_env_GLIB_CFLAGS_value=
ac_cv_env_GLIB_LIBS_set=
ac_cv_env_GLIB_LIBS_value=
ac_cv_env_GST_CFLAGS_set=
ac_cv_env_GST_CFLAGS_value=
ac_cv_env_GST_INTERFACES_CFLAGS_set=
ac_cv_env_GST_INTERFACES_CFLAGS_value=
ac_cv_env_GST_INTERFACES_LIBS_set=
ac_cv_env_GST_INTERFACES_LIBS_value=
ac_cv_env_GST_LIBS_set=
ac_cv_env_GST_LIBS_value=
ac_cv_env_GUPNP_CFLAGS_set=
ac_cv_env_GUPNP_CFLAGS_value=
ac_cv_env_GUPNP_LIBS_set=
ac_cv_env_GUPNP_LIBS_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-O1 -s'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIBV4L_CFLAGS_set=
ac_cv_env_LIBV4L_CFLAGS_value=
ac_cv_env_LIBV4L_LIBS_set=
ac_cv_env_LIBV4L_LIBS_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_XMKMF_set=
ac_cv_env_XMKMF_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-pc-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-pc-linux-gnu
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_CC=x86_64-pc-linux-gnu-gcc

## ----------------- ##
## Output variables. ##
## ----------------- ##

APPNAME='amsn'
APPRELEASE='1'
APPSTABLE='no'
APPVERSION='0.98b'
BUILD_DIR=''
CC='x86_64-pc-linux-gnu-gcc'
CFLAGS='-march=native -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include   -I. -I./utils/linux/capture -I./utils/linux/capture/libng -I./utils/linux/capture/structs -I./utils/webcamsn/src -I./utils/tcl_siren/src -I./utils/tclISF/src/libISF -DPACKAGE='\''"amsn"'\'' -DVERSION='\''"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"'\'' -DLIBDIR='\''"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"'\'' -fPIC'
CONFIGURE_ARGS='--prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64'
CPP=''
CPPFLAGS=''
CXX=''
CXXFLAGS='-O2 -pipe -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include -I./utils/TkCximage/src -I./utils/TkCximage/src/CxImage -DPACKAGE='\''"amsn"'\'' -DVERSION='\''"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"'\'' -DLIBDIR='\''"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"'\'' -fPIC'
CXX_LIB=''
DEBUG='no'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FARSIGHT2_CFLAGS=''
FARSIGHT2_LIBS=''
FOUND_OS='linux'
FOUND_X11=''
GLIB_CFLAGS=''
GLIB_LIBS=''
GREP=''
GST_CFLAGS=''
GST_INTERFACES_CFLAGS=''
GST_INTERFACES_LIBS=''
GST_LIBS=''
GUPNP_CFLAGS=''
GUPNP_LIBS=''
HAVE_FARSIGHT=''
HAVE_GUPNP=''
HAVE_LIBV4L=''
HAVE_PKGCONFIG=''
LDFLAGS='-Wl,-O1 -s'
LDLIBS=''
LIBDIR=''
LIBOBJS=''
LIBPTHREAD=''
LIBS=''
LIBV4L_CFLAGS=''
LIBV4L_LIBS=''
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG=''
SHELL='/bin/sh'
STATIC='no'
TCLSH='/usr/bin/tclsh'
TCL_INC_SPEC=''
TCL_LIB_DIR=''
TCL_STUB_LIB_SPEC=''
TCL_VERSION=''
TK_INC_SPEC=''
TK_LIB=''
TK_LIBS=''
TK_LIB_DIR=''
TK_STUB_LIB_SPEC=''
TK_VERSION=''
TOP_DIR=''
USE_MMX=''
XMKMF=''
X_CFLAGS=''
X_EXTRA_LIBS=''
X_LIBS=''
X_PRE_LIBS=''
ac_ct_CC=''
ac_ct_CXX=''
ac_prefix_program=''
bindir='${exec_prefix}/bin'
build_alias='x86_64-pc-linux-gnu'
datadir='/usr/share'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias='x86_64-pc-linux-gnu'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='/usr/share/info'
libdir='/usr/lib64'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='/var/lib'
mandir='/usr/share/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""

configure: exit 77


Of course, if using SVN, the user tries to build AMSN at his own risk. But still, you might want to fix this for the people using SVN checkouts.
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #1 on: May 12, 2009, 11:45:00 pm »

Hi,

this makes no sense at all! someone reported the same issue here : http://www.amsn-project.net/forums/viewtopic.php?t=6574 it's in french, but basically it was the same problem but it had nothing to do with the -march option...  The real problem is here :
Code:

configure:2470: x86_64-pc-linux-gnu-gcc -march=native -mtune=native -msse4.1 -O2 -pipe -fomit-frame-pointer -O2 -w -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include   -I. -I./utils/linux/capture -I./utils/linux/capture/libng -I./utils/linux/capture/structs -I./utils/webcamsn/src -I./utils/tcl_siren/src -I./utils/tclISF/src/libISF -DPACKAGE='"amsn"' -DVERSION='"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"' -DLIBDIR='"/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn"' -fPIC  -Wl,-O1 -s conftest.c  >&5
x86_64-pc-linux-gnu-gcc: svnversion: No such file or directory
x86_64-pc-linux-gnu-gcc: >: No such file or directory
x86_64-pc-linux-gnu-gcc: &&: No such file or directory
x86_64-pc-linux-gnu-gcc: svnversion: No such file or directory
x86_64-pc-linux-gnu-gcc: ||: No such file or directory
x86_64-pc-linux-gnu-gcc: true`"': No such file or directory


All because of this define we put : -DVERSION='"0.98b-svn`which svnversion > /dev/null && svnversion ||  true`"'
I think the other user said he fixed it by upgrading/recompiling his subversion package... however, this seems unreal.. it looks like it's trying to execute every word of the "`which svnversion > /dev/null && svnversion ||  true`" even the redirections...
humm.. also, all those CFLAGS shouldn't be in there.. no matter how i try it, all I can get is 'gcc conftest.c' since this is the configure being run....
i'm seriously lost.. could you try to figure out why that line is executed and why the -DVERSION define fails like that ? does it really have anything to do with -march Huh
Logged

KaKaRoTo
Rainmaker
Newbie

Offline Offline

Posts: 5


View Profile
« Reply #2 on: May 13, 2009, 02:54:27 am »

You seem to be right.

As far as I can tell, portage, in the ebuild, calls an "econf" and an "emake".

Now, this is all fine. However, sometimes I get an
Code:
make -j3
(cd .; autoreconf -i)
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64

between the configure and the make statement.

It is this *second* ./configure which fails on the "cannot create executable" error.

After alter src_compile in the ebuild to:
Code:
   econf || die
    autoreconf -i
    emake || die

the ebuild consistenly failed.

The reason why econf is calling autoreconf, I do not know. The only partial explantion I got is http://www.gentoo.org/proj/en/qa/autofailure.xml, but thats more general info then anything else.

Then I did:
Code:
Medusa amsn-svn # ebuild amsn-svn-1.0-r1.ebuild clean
Medusa amsn-svn # ebuild amsn-svn-1.0-r1.ebuild unpack
 * checking ebuild checksums ;-) ...                                     [ ok ]
 * checking auxfile checksums ;-) ...                                    [ ok ]
 * checking miscfile checksums ;-) ...                                   [ ok ]
>>> Unpacking source...
 * subversion update start -->
 *      repository: https://amsn.svn.sourceforge.net/svnroot/amsn/trunk/amsn
At revision 11179.
 *    working copy: /usr/portage/distfiles/svn-src/amsn/amsn

>>> Source unpacked in /var/tmp/portage/net-im/amsn-svn-1.0-r1/work
Medusa amsn-svn # cd -
/var/tmp/portage/net-im/amsn-svn-1.0-r1/work/amsn-svn/autopackage

and removed default.apspec

After this, the ebuild compiled fine again, even with the autoreconf line in place.

The reason why it seems to be the CFLAG is pretty simple; the second time you call emerge on the same package, econf does not call autoreconf. That is why I (and the other user, I presume), thought it was a CFLAGS issue rather then this. As said, not sure why portage calls it in the first place.

Autoreconf'ing with the skeleton.1 file in the "tk" also works.

I should point out that I do not have much experience or knowledge about these auto* tools, but I hope this will be helpfull.

PS. the || true line works fine. Tested it several times, and the exit code was always 0. You might want to use paranthesis though to garantuee the presendence
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9428


View Profile WWW
« Reply #3 on: May 13, 2009, 07:11:24 am »

humm.. well.. ok.. actually, I didn't understand anything you just said! Maybe I'm just tired, i'll read it again tomorrow... in any case, I think you fixed your problem..
btw, the autoreconf is being executed by the makefile because it detects that the configure.ac file has a newer timestamp than the configure file (so it thinks configure.ac was modified and it needs to regenerate the configure file) maybe the way the ebuild does it is wrong or something.. maybe it does the configure then it applies some patch to configure.ac before doing make and that causes it to autoreconf...
anyways, I'll give the link to this thread to the gentoo maintainer of aMSN and I'm sure he'll figure it out! Smiley
Logged

KaKaRoTo
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!