Cross-compiling boost 1.7 for ARM Raspberry pi 3 - c++11

I'm trying to get my boost cross-compilation ready for my raspberry project. I have the cross-compilation of my project up until now running but now I need to start using some boost features.
In order to do that, I'm trying to compile it and I'm following many guides (The main one is this one) but I'm getting some errors while executing the bjam:
./bjam install toolset=gcc-arm --prefix=~/libs/ --disable-long-double --sNO_ZLIB=1 --sNO_BZIP2=1
I have the toolchain recognized with the modification of the project-config.jam file to using gcc : arm : arm-linux-gnueabi-g++ ;
I'm using the WSL debian on my windows 10 for all this. You will see that on the paths.
This the error that I'm getting:
*** argument error
* rule numbers.less ( n1 n2 )
* called with: ( 4 )
* missing argument n2
/mnt/d/Downloads/boost_1_70_0/tools/build/src/util/numbers.jam:66:see definition of rule 'numbers.less' being called
/mnt/d/Downloads/boost_1_70_0/tools/build/src/tools/common.jam:854: in common.format-name
/mnt/d/Downloads/boost_1_70_0/tools/boost_install/boost-install.jam:87: in boost-install.generate-cmake-variant-
/mnt/d/Downloads/boost_1_70_0/tools/build/src/kernel/modules.jam:107: in modules.call-in
/mnt/d/Downloads/boost_1_70_0/tools/build/src/util/indirect.jam:105: in indirect.call
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build/virtual-target.jam:902: in execute
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build/virtual-target.jam:821: in class#action.actualize
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build/virtual-target.jam:332: in actualize-action
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build/virtual-target.jam:518: in actualize-no-scanner
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build/virtual-target.jam:142: in class#virtual-target.actualize
/mnt/d/Downloads/boost_1_70_0/tools/build/src/build-system.jam:810: in load
/mnt/d/Downloads/boost_1_70_0/tools/build/src/kernel/modules.jam:295: in import
/mnt/d/Downloads/boost_1_70_0/tools/build/src/kernel/bootstrap.jam:139: in boost-build
/mnt/d/Downloads/boost_1_70_0/boost-build.jam:17: in module scope
I'm quite lost regarding this. I've been searching for a solution for the last week and I'm giving up now. Does anybody knows what's going on?
I have this compiler and cross-compiler installed:
g++/stable,now 4:6.3.0-4 amd64 [installed,automatic]
g++-6/stable,stable,now 6.3.0-18+deb9u1 amd64 [installed,automatic]
g++-6-arm-linux-gnueabi/stable,now 6.3.0-18cross1 amd64 [installed,automatic]
g++-arm-linux-gnueabi/stable,now 4:6.3.0-4 amd64 [installed]
gcc/stable,now 4:6.3.0-4 amd64 [installed,automatic]
gcc-6/stable,stable,now 6.3.0-18+deb9u1 amd64 [installed,automatic]
gcc-6-arm-linux-gnueabi/stable,now 6.3.0-18cross1 amd64 [installed,automatic]
gcc-6-arm-linux-gnueabi-base/stable,now 6.3.0-18cross1 amd64 [installed,automatic]
gcc-6-base/stable,stable,now 6.3.0-18+deb9u1 amd64 [installed]
gcc-6-cross-base/stable,now 6.3.0-18cross1 all [installed,automatic]
gcc-arm-linux-gnueabi/stable,now 4:6.3.0-4 amd64 [installed]

This can be ignored. It's a bug in the one of the bjam files. You can follow this link for more information

Related

Undefined reference to Magick when trying to build Octave with GCC

I'm trying to build Octave 4.2.2 on an Ubuntu 16.04 with GCC 4.9.3 but I get this error :
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::CoderInfo::CoderInfo(std::string const&)'
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::Image::comment() const'
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::CoderInfo::description() const'
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::Image::magick() const'
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::Image::attribute(std::string)'
libinterp/.libs/liboctinterp.so: undefined reference to `Magick::Image::ping(std::string const&)'
I already checked my libs and that's what I have :
graphicsmagick/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed]
graphicsmagick-libmagick-dev-compat/xenial-updates,xenial-updates,xenial-security,xenial-security,now 1.3.23-1ubuntu0.6 all [installed]
imagemagick/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed]
imagemagick-6.q16/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed]
imagemagick-common/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed]
libgraphics-magick-perl/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed,automatic]
libgraphicsmagick++-q16-12/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed]
libgraphicsmagick++1-dev/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed]
libgraphicsmagick-q16-3/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed]
libgraphicsmagick1-dev/xenial-updates,xenial-security,now 1.3.23-1ubuntu0.6 amd64 [installed]
libmagick++-6-headers/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed,auto-removable]
libmagick++-6.q16-5v5/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic]
libmagick++-6.q16-dev/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,auto-removable]
libmagickcore-6-arch-config/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic]
libmagickcore-6-headers/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed,automatic]
libmagickcore-6.q16-2/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed]
libmagickcore-6.q16-2-extra/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed]
libmagickcore-6.q16-dev/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic]
libmagickwand-6-headers/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed,automatic]
libmagickwand-6.q16-2/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed]
libmagickwand-6.q16-dev/xenial-updates,xenial-security,now 8:6.8.9.9-7ubuntu5.15 amd64 [installed,automatic]
libmagickwand-dev/xenial-updates,xenial-updates,xenial-security,xenial-security,now 8:6.8.9.9-7ubuntu5.15 all [installed]
Moreover, I have checked liboctinterp.so :
ldd libinterp/.libs/liboctinterp.so | grep -i magick++
libGraphicsMagick++-Q16.so.12 => /usr/lib/libGraphicsMagick++-Q16.so.12 (0x00007f6c7fa2b000)
nm -C /usr/lib/libGraphicsMagick++-Q16.so.12 | grep -i coderinfo
nm: /usr/lib/libGraphicsMagick++-Q16.so.12: no symbols
nm -D /usr/lib/libGraphicsMagick++-Q16.so.12 | grep -i coderinfo
000000000003e600 T _ZN6Magick9CoderInfoaSERKS0_
000000000003e650 T _ZN6Magick9CoderInfoC1EPKN9MagickLib11_MagickInfoE
000000000003e350 T _ZN6Magick9CoderInfoC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
000000000003e2c0 T _ZN6Magick9CoderInfoC1ERKS0_
000000000003e280 T _ZN6Magick9CoderInfoC1Ev
000000000003e650 T _ZN6Magick9CoderInfoC2EPKN9MagickLib11_MagickInfoE
000000000003e350 T _ZN6Magick9CoderInfoC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
000000000003e2c0 T _ZN6Magick9CoderInfoC2ERKS0_
000000000003e280 T _ZN6Magick9CoderInfoC2Ev
000000000003e530 T _ZN6Magick9CoderInfoD1Ev
000000000003e530 T _ZN6Magick9CoderInfoD2Ev
000000000003e5d0 T _ZNK6Magick9CoderInfo10isReadableEv
000000000003e5e0 T _ZNK6Magick9CoderInfo10isWritableEv
000000000003e5a0 T _ZNK6Magick9CoderInfo11descriptionB5cxx11Ev
000000000003e5f0 T _ZNK6Magick9CoderInfo12isMultiFrameEv
000000000003e570 T _ZNK6Magick9CoderInfo4nameB5cxx11Ev
I have no idea why I got this error.
Thanks for your replies :)
EDIT : I already checked thousands of posts, including this one Error while compiling Octave with GCC which is close to mine, but without any result.
EDIT2 : What I got if I check shared object dependencies with grep for Magick instead of Magick++ :
ldd libinterp/.libs/liboctinterp.so | grep -i magick
libGraphicsMagick++-Q16.so.12 => /usr/lib/libGraphicsMagick++-Q16.so.12 (0x00007f09ff71a000)
libGraphicsMagick-Q16.so.3 => /usr/lib/libGraphicsMagick-Q16.so.3 (0x00007f09ff1bf000)
And the command nm results with nm: /usr/lib/libGraphicsMagick-Q16.so.3: no symbols .
After many tries, the only solution was to rebuild GraphicsMagick.
I hope this post will help other people ! :)

GCC cross compilation tool for fedora

I need to compile a code with gcc for ARMv7-A architecture on x86 system, how can i install tools on fedora??
gcc-arm-linux-gnueabi package is not available in fedora and sudo dnf install gcc-arm-linux-gnueabi did not work.
Arm provides prebuilt GNU cross-toolchains which is available from developer.arm.com.
For A-profile cores - https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a
For R and M profile cores - https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm.
Hope that helps.

compiling gtk+3 project with msys on windows

I'm trying to compile a C project on windows that has a dependency on gtk+-3.0 (using msys to build it). Here's the list of gtk packages that I installed:
$ pacman -Ss gtk | grep installed
mingw32/mingw-w64-i686-glib2 2.52.3-1 [installed]
mingw32/mingw-w64-i686-gtk3 3.22.18-1 [installed]
mingw32/mingw-w64-i686-gtkmm3 3.22.0-1 [installed]
mingw64/mingw-w64-x86_64-glib2 2.52.3-1 [installed]
msys/glib2 2.48.2-1 [installed]
However, when I run ./configure I get the following error:
checking for GTK... no
configure: error: Package requirements (gtk+-3.0 >= gtk_required_version) were not met:
No package 'gtk+-3.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.
What did I do wrong?
The problem was due to compiling directly from bash instead of the shell environment setup for building native 32-bit apps (msys2_shell.cmd -mingw32)

All possible GOOS value?

If I get it right, GOOS is determined when compile the source code.
To better support multiple OS, I'm interested in what GOOS could be.
Of course, there might be infinite possibilities of it, since Go is opensourced. So what I really want is a "common list".
Known values are:
windows
linux
darwin or freebsd or unix? I know that at least one of them must exist.
Note that those values are defined in:
src/go/build/syslist.go, and
doc/install/source#environment.
With Go 1.5 (Q3 2015), GOARCH will become much more complete.
See commit 1eebb91 by Minux Ma (minux)
go/build: reserve GOARCH values for all common architectures
Whenever we introduce a new GOARCH, older Go releases won't recognize them and this causes trouble for both our users and us (we need to add unnecessary build tags).
Go 1.5 has introduced three new GOARCHes so far: arm64 ppc64 ppc64le, we can take the time to introduce GOARCHes for all common architectures that Go might support in the future to avoid the problem.
const goosList = "android darwin dragonfly freebsd linux nacl \
netbsd openbsd plan9 solaris windows "
const goarchList = "386 amd64 amd64p32 arm arm64 ppc64 ppc64le \
mips mipsle mips64 mips64le mips64p32 mips64p32le \ # (new)
ppc s390 s390x sparc sparc64 " # (new)
The list is still being review in Change 9644, with comments like:
I wouldn't bother with Itanium. It's basically a dead architecture.
Plus, it's so hard to write a compiler for it that I really can't see it happening except as a labor of love, and nobody loves the Itanium.
The official documentation now (GO 1.5+ Q3 2015) reflects that completed list.
Update 2018: as documented in Giorgos Oikonomou's answer, Go 1.7 (Q1 2016) has introduced the
go tool dist list command.
See commit c3ecded: it fixes issue 12270 opened in Q3 2015:
To easier write tooling for cross compiling it would be good to programmatically get the possible combinations of GOOS and GOARCH.
This was implemented in CL 19837
cmd/dist: introduce list subcommand to list all supported platforms
You can list in plain text, or in json:
> go tool dist list -json
[
{
"GOOS": "android",
"GOARCH": "386",
"CgoSupported": true
},
...
]
As Mark Bates tweeted:
Bonus: Column output properly formatted for display:
go tool dist list | column -c 75 | column -t
I think you're looking for this list of possible GOOS and GOARCH combinations, in this section:
http://golang.org/doc/install/source#environment
$GOOS and $GOARCH
The name of the target operating system and
compilation architecture. These default to the values of $GOHOSTOS and
$GOHOSTARCH respectively (described below).
Choices for $GOOS are darwin (Mac OS X 10.8 and above and iOS),
dragonfly, freebsd, linux, netbsd, openbsd, plan9, solaris and
windows. Choices for $GOARCH are amd64 (64-bit x86, the most mature
port), 386 (32-bit x86), arm (32-bit ARM), arm64 (64-bit ARM), ppc64le
(PowerPC 64-bit, little-endian), ppc64 (PowerPC 64-bit, big-endian),
mips64le (MIPS 64-bit, little-endian), and mips64 (MIPS 64-bit,
big-endian). mipsle (MIPS 32-bit, little-endian), and mips (MIPS
32-bit, big-endian).
The valid combinations of $GOOS and $GOARCH are:
$GOOS $GOARCH
android arm
darwin 386
darwin amd64
darwin arm
darwin arm64
dragonfly amd64
freebsd 386
freebsd amd64
freebsd arm
linux 386
linux amd64
linux arm
linux arm64
linux ppc64
linux ppc64le
linux mips
linux mipsle
linux mips64
linux mips64le
netbsd 386
netbsd amd64
netbsd arm
openbsd 386
openbsd amd64
openbsd arm
plan9 386
plan9 amd64
solaris amd64
windows 386
windows amd64
You can see the list of supported platform by running:
go tool dist list
and this will print(depending on the Go version):
android/386
android/amd64
android/arm
android/arm64
darwin/386
darwin/amd64
darwin/arm
darwin/arm64
dragonfly/amd64
freebsd/386
freebsd/amd64
freebsd/arm
linux/386
linux/amd64
linux/arm
linux/arm64
linux/mips
linux/mips64
linux/mips64le
linux/mipsle
linux/ppc64
linux/ppc64le
linux/s390x
nacl/386
nacl/amd64p32
nacl/arm
netbsd/386
netbsd/amd64
netbsd/arm
openbsd/386
openbsd/amd64
openbsd/arm
plan9/386
plan9/amd64
plan9/arm
solaris/amd64
windows/386
windows/amd64
And the official documentation for the tool:
https://godoc.org/github.com/golang/go/src/cmd/dist
To cross compile use:
GOOS=darwin GOARCH=386 go build main.go

Is copying lib32 necessary on FreeBSD amd64

Is it necessary to copy lib32 during a FreeBSD amd64 installation? What are they used for?
lib32 contains 32-bit libraries, which are required to run any i386-targeted binary, such as wine.

Resources