You are not logged in.

#1 2015-01-11 15:19:12

tomzooi
Member
Registered: 2010-05-01
Posts: 24

[SOLVED] cross compiling libopenfst makepkg error

Hello there,

I am trying to cross compile openfst on my 64 bit arch setup since it is taking too long on my raspberry pi (which also happily runs arch). I thought I would be ok with the following makepkg to get me a binary package which I could transfer to my pi and then install with pacman-U:

# Maintainer: Christoph Drexler <chrdr at gmx dot at>

pkgname=openfst
pkgver=1.4.1
pkgrel=1
pkgdesc="Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs)"
arch=('i686' 'x86_64' 'armv6h')
url="http://www.openfst.org/"
license=('APACHE')
depends=('gcc-libs' 'glibc')
options=(!libtool)
source=("http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/${pkgname}-${pkgver}.tar.gz")
md5sums=('ca8f1730b9b9b281e515611fa9ae23c0')

build() {
	cd ${srcdir}/${pkgname}-${pkgver}
	#export CXX=arm-linux-gnueabi-g++
	#export CC=arm-linux-gnueabi-gcc
	# Options according to http://openfst.cs.nyu.edu/twiki/bin/view/FST/ReadMe
	OPTIONS="--prefix=/usr --disable-dependency-tracking"
	OPTIONS+=" --enable-bin"            # Enable fst::script and command-line binaries;   Default: yes
	OPTIONS+=" --enable-compact-fsts"   # Enable all CompactFst classes;                  Default: no
	OPTIONS+=" --enable-const-fsts"     # Enable all ConstFst classes;                    Default: no
	OPTIONS+=" --enable-far"            # Enable FAR (FST Archive) extension;             Default: no
	OPTIONS+=" --enable-linear-fsts"    # Enable Linear{Tagger,Classifier}Fst extensions; Default: no
	OPTIONS+=" --enable-lookahead-fsts" # Enable LookAheadFst classes;                    Default: no
	OPTIONS+=" --enable-pdt"            # Experimental push-down transducer extensions;   Default: no
	OPTIONS+=" --host=arm-linux-gnueabi"            # Experimental push-down transducer extensions;   Default: no
	OPTIONS+=" --build=x86_64"            # Experimental push-down transducer extensions;   Default: no
	LIBS="-ldl" ./configure $OPTIONS
	make
}

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

(basically adding the host and build option)

However, I get an error in the output:

==> Making package: openfst 1.4.1-1 (Sun Jan 11 16:13:22 CET 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found openfst-1.4.1.tar.gz
==> Validating source files with md5sums...
    openfst-1.4.1.tar.gz ... Passed
==> Extracting sources...
  -> Extracting openfst-1.4.1.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabi-strip... arm-linux-gnueabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-gnueabi-g++... arm-linux-gnueabi-g++
checking whether the C++ compiler works... no
configure: error: in `/home/tom/openfst-1.4.1/src/openfst-1.4.1':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
==> ERROR: A failure occurred in build().
    Aborting...

the error being that the C++ compiler cannot create excecutables makes sense since they are not meant to be excecuted on x86_64 but for armv6h (cross compilation). I have checked with arm-linux-gnueabi-g++ and its excecutables I can run on my pi so this should be ok. I am guessing that I am either missing an option to disable the compiler check, or I should change the configure script and remove this check, but I cannot figure out how to do either...

//edit: I'm not sure this topic is in the right place btw, maybe it should be in scripting...

Last edited by tomzooi (2015-01-11 18:23:35)

Offline

#2 2015-01-11 17:12:00

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] cross compiling libopenfst makepkg error

Try to add '!buildflags' to options - it will prevent adding x86 specific flags to CFLAGS/LDFLAGS.

Also check config.log file - it contains more information about failed step.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#3 2015-01-11 18:23:24

tomzooi
Member
Registered: 2010-05-01
Posts: 24

Re: [SOLVED] cross compiling libopenfst makepkg error

that seems to do the trick, I'm not gonna test it since my pi just finished compiling it locally (which took 12+hours or so), but the compile seems to work since they are not excecutable on 64 bit, so pkgbuild for raspi cross compilation using makepkg -s:

# Maintainer: Christoph Drexler <chrdr at gmx dot at>

pkgname=openfst
pkgver=1.4.1
pkgrel=1
pkgdesc="Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs)"
arch=('i686' 'x86_64' 'armv6h')
url="http://www.openfst.org/"
license=('APACHE')
depends=('gcc-libs' 'glibc')
options=(!libtool !buildflags)
source=("http://openfst.cs.nyu.edu/twiki/pub/FST/FstDownload/${pkgname}-${pkgver}.tar.gz")
md5sums=('ca8f1730b9b9b281e515611fa9ae23c0')

build() {
	cd ${srcdir}/${pkgname}-${pkgver}
	# Options according to http://openfst.cs.nyu.edu/twiki/bin/view/FST/ReadMe
	OPTIONS="--prefix=/usr --disable-dependency-tracking"
	OPTIONS+=" --enable-bin"            # Enable fst::script and command-line binaries;   Default: yes
	OPTIONS+=" --enable-compact-fsts"   # Enable all CompactFst classes;                  Default: no
	OPTIONS+=" --enable-const-fsts"     # Enable all ConstFst classes;                    Default: no
	OPTIONS+=" --enable-far"            # Enable FAR (FST Archive) extension;             Default: no
	OPTIONS+=" --enable-linear-fsts"    # Enable Linear{Tagger,Classifier}Fst extensions; Default: no
	OPTIONS+=" --enable-lookahead-fsts" # Enable LookAheadFst classes;                    Default: no
	OPTIONS+=" --enable-pdt"            # Experimental push-down transducer extensions;   Default: no
	OPTIONS+=" --host=arm-linux-gnueabi"            # Experimental push-down transducer extensions;   Default: no
	OPTIONS+=" --build=x86_64"            # Experimental push-down transducer extensions;   Default: no
	LIBS="-ldl" ./configure $OPTIONS
	make
}

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

to get some stuff which I think I can ignore:

strip: Unable to recognise the format of the input file `./usr/bin/fstprint'
strip: Unable to recognise the format of the input file `./usr/bin/farprintstrings'
strip: Unable to recognise the format of the input file `./usr/bin/fstmap'
strip: Unable to recognise the format of the input file `./usr/bin/fstsynchronize'
strip: Unable to recognise the format of the input file `./usr/bin/fstdraw'
strip: Unable to recognise the format of the input file `./usr/bin/fstepsnormalize'
strip: Unable to recognise the format of the input file `./usr/bin/fstdisambiguate'
strip: Unable to recognise the format of the input file `./usr/bin/fstunion'
strip: Unable to recognise the format of the input file `./usr/bin/pdtexpand'
strip: Unable to recognise the format of the input file `./usr/bin/fstminimize'
strip: Unable to recognise the format of the input file `./usr/bin/fsttopsort'
strip: Unable to recognise the format of the input file `./usr/bin/pdtreplace'
strip: Unable to recognise the format of the input file `./usr/bin/fstreverse'
strip: Unable to recognise the format of the input file `./usr/bin/fstsymbols'
strip: Unable to recognise the format of the input file `./usr/bin/farequal'
strip: Unable to recognise the format of the input file `./usr/bin/fstequal'
strip: Unable to recognise the format of the input file `./usr/bin/fstcompile'
strip: Unable to recognise the format of the input file `./usr/bin/fstshortestpath'
strip: Unable to recognise the format of the input file `./usr/bin/farinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstrandgen'
strip: Unable to recognise the format of the input file `./usr/bin/fstshortestdistance'
strip: Unable to recognise the format of the input file `./usr/bin/fstarcsort'
strip: Unable to recognise the format of the input file `./usr/bin/fstrmepsilon'
strip: Unable to recognise the format of the input file `./usr/bin/fstconvert'
strip: Unable to recognise the format of the input file `./usr/bin/fstreplace'
strip: Unable to recognise the format of the input file `./usr/bin/farcompilestrings'
strip: Unable to recognise the format of the input file `./usr/bin/fstencode'
strip: Unable to recognise the format of the input file `./usr/bin/fstpush'
strip: Unable to recognise the format of the input file `./usr/bin/pdtshortestpath'
strip: Unable to recognise the format of the input file `./usr/bin/fstinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstrelabel'
strip: Unable to recognise the format of the input file `./usr/bin/fstinvert'
strip: Unable to recognise the format of the input file `./usr/bin/fstconcat'
strip: Unable to recognise the format of the input file `./usr/bin/fstintersect'
strip: Unable to recognise the format of the input file `./usr/bin/pdtreverse'
strip: Unable to recognise the format of the input file `./usr/bin/fstclosure'
strip: Unable to recognise the format of the input file `./usr/bin/fstdeterminize'
strip: Unable to recognise the format of the input file `./usr/bin/fstcompose'
strip: Unable to recognise the format of the input file `./usr/bin/fstlinear'
strip: Unable to recognise the format of the input file `./usr/bin/pdtcompose'
strip: Unable to recognise the format of the input file `./usr/bin/farcreate'
strip: Unable to recognise the format of the input file `./usr/bin/fstdifference'
strip: Unable to recognise the format of the input file `./usr/bin/fstloglinearapply'
strip: Unable to recognise the format of the input file `./usr/bin/fstprune'
strip: Unable to recognise the format of the input file `./usr/bin/pdtinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstproject'
strip: Unable to recognise the format of the input file `./usr/bin/farextract'
strip: Unable to recognise the format of the input file `./usr/bin/fstequivalent'
strip: Unable to recognise the format of the input file `./usr/bin/fstconnect'
strip: Unable to recognise the format of the input file `./usr/bin/fstreweight'
strip: Unable to recognise the format of the input file `./usr/lib/libfst.so.3.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstfar.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const16-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/arc_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const64-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstlinearscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstlookahead.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/linear_classifier-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/linear_tagger-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstcompact.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/olabel_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const8-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstconst.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/ilabel_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstfarscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstpdtscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/libfstscript.so.1.0.0'

I will check soon I hope wink, for now will mark it as solved.

Offline

#4 2015-01-12 03:36:49

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] cross compiling libopenfst makepkg error

tomzooi wrote:

to get some stuff which I think I can ignore:

strip: Unable to recognise the format of the input file `./usr/bin/fstprint'
strip: Unable to recognise the format of the input file `./usr/bin/farprintstrings'
strip: Unable to recognise the format of the input file `./usr/bin/fstmap'
strip: Unable to recognise the format of the input file `./usr/bin/fstsynchronize'
strip: Unable to recognise the format of the input file `./usr/bin/fstdraw'
strip: Unable to recognise the format of the input file `./usr/bin/fstepsnormalize'
strip: Unable to recognise the format of the input file `./usr/bin/fstdisambiguate'
strip: Unable to recognise the format of the input file `./usr/bin/fstunion'
strip: Unable to recognise the format of the input file `./usr/bin/pdtexpand'
strip: Unable to recognise the format of the input file `./usr/bin/fstminimize'
strip: Unable to recognise the format of the input file `./usr/bin/fsttopsort'
strip: Unable to recognise the format of the input file `./usr/bin/pdtreplace'
strip: Unable to recognise the format of the input file `./usr/bin/fstreverse'
strip: Unable to recognise the format of the input file `./usr/bin/fstsymbols'
strip: Unable to recognise the format of the input file `./usr/bin/farequal'
strip: Unable to recognise the format of the input file `./usr/bin/fstequal'
strip: Unable to recognise the format of the input file `./usr/bin/fstcompile'
strip: Unable to recognise the format of the input file `./usr/bin/fstshortestpath'
strip: Unable to recognise the format of the input file `./usr/bin/farinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstrandgen'
strip: Unable to recognise the format of the input file `./usr/bin/fstshortestdistance'
strip: Unable to recognise the format of the input file `./usr/bin/fstarcsort'
strip: Unable to recognise the format of the input file `./usr/bin/fstrmepsilon'
strip: Unable to recognise the format of the input file `./usr/bin/fstconvert'
strip: Unable to recognise the format of the input file `./usr/bin/fstreplace'
strip: Unable to recognise the format of the input file `./usr/bin/farcompilestrings'
strip: Unable to recognise the format of the input file `./usr/bin/fstencode'
strip: Unable to recognise the format of the input file `./usr/bin/fstpush'
strip: Unable to recognise the format of the input file `./usr/bin/pdtshortestpath'
strip: Unable to recognise the format of the input file `./usr/bin/fstinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstrelabel'
strip: Unable to recognise the format of the input file `./usr/bin/fstinvert'
strip: Unable to recognise the format of the input file `./usr/bin/fstconcat'
strip: Unable to recognise the format of the input file `./usr/bin/fstintersect'
strip: Unable to recognise the format of the input file `./usr/bin/pdtreverse'
strip: Unable to recognise the format of the input file `./usr/bin/fstclosure'
strip: Unable to recognise the format of the input file `./usr/bin/fstdeterminize'
strip: Unable to recognise the format of the input file `./usr/bin/fstcompose'
strip: Unable to recognise the format of the input file `./usr/bin/fstlinear'
strip: Unable to recognise the format of the input file `./usr/bin/pdtcompose'
strip: Unable to recognise the format of the input file `./usr/bin/farcreate'
strip: Unable to recognise the format of the input file `./usr/bin/fstdifference'
strip: Unable to recognise the format of the input file `./usr/bin/fstloglinearapply'
strip: Unable to recognise the format of the input file `./usr/bin/fstprune'
strip: Unable to recognise the format of the input file `./usr/bin/pdtinfo'
strip: Unable to recognise the format of the input file `./usr/bin/fstproject'
strip: Unable to recognise the format of the input file `./usr/bin/farextract'
strip: Unable to recognise the format of the input file `./usr/bin/fstequivalent'
strip: Unable to recognise the format of the input file `./usr/bin/fstconnect'
strip: Unable to recognise the format of the input file `./usr/bin/fstreweight'
strip: Unable to recognise the format of the input file `./usr/lib/libfst.so.3.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstfar.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const16-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/arc_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const64-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstlinearscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstlookahead.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/linear_classifier-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/linear_tagger-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstcompact.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/olabel_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/const8-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact16_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstconst.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/ilabel_lookahead-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_weighted_string-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstfarscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/libfstpdtscript.so.1.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact8_unweighted-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_unweighted_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/fst/compact64_acceptor-fst.so.0.0.0'
strip: Unable to recognise the format of the input file `./usr/lib/libfstscript.so.1.0.0'

Add !strip to options=()


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

Board footer

Powered by FluxBB