Build fails on Debian 9 with GCC 6.3
shakthimaan opened this issue · 2 comments
I am trying to build axiom on Debian 9. I have used the following steps:
$ sudo apt-get update
$ sudo apt-get install sudo git make build-essential libx11-dev m4 gawk gcl
$ cd /home/debian/axiom
$ export AXIOM=/home/debian/axiom/mnt/debian
$ export PATH=$AXIOM/bin:$PATH
$ make
The build fails with the following error messages:
./libgclp.a(user_match.o): In function `fixnum_dpf':
user_match.c:(.text+0x3100): multiple definition of `fixnum_dpf'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4260): first defined here
./libgclp.a(user_match.o): In function `immnum_dpf':
user_match.c:(.text+0x3130): multiple definition of `immnum_dpf'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4290): first defined here
./libgclp.a(user_match.o): In function `immnum_max':
user_match.c:(.text+0x31e0): multiple definition of `immnum_max'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4340): first defined here
./libgclp.a(user_match.o): In function `immnum_min':
user_match.c:(.text+0x3220): multiple definition of `immnum_min'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4380): first defined here
./libgclp.a(user_match.o): In function `immnum_logt':
user_match.c:(.text+0x3260): multiple definition of `immnum_logt'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x43c0): first defined here
./libgclp.a(user_match.o): In function `fixnum_gcd':
user_match.c:(.text+0x32b0): multiple definition of `fixnum_gcd'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4410): first defined here
./libgclp.a(user_match.o): In function `immnum_gcd':
user_match.c:(.text+0x3330): multiple definition of `immnum_gcd'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4490): first defined here
./libgclp.a(user_match.o): In function `fixnum_lcm':
user_match.c:(.text+0x3400): multiple definition of `fixnum_lcm'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x4560): first defined here
./libgclp.a(user_match.o): In function `immnum_lcm':
user_match.c:(.text+0x3540): multiple definition of `immnum_lcm'
./libpre_gcl.a(alloc.o):alloc.c:(.text+0x46a0): first defined here
./libpre_gcl.a(alloc.o): In function `alloc_object':
alloc.c:(.text+0x74c3): undefined reference to `alloc_after_turning_off_sgc'
alloc.c:(.text+0x8341): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0x8fc5): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0x96bb): undefined reference to `maybe_reallocate_page'
./libpre_gcl.a(alloc.o): In function `alloc_contblock':
alloc.c:(.text+0xa871): undefined reference to `alloc_after_turning_off_sgc'
alloc.c:(.text+0xb05e): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0xbb31): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0xc086): undefined reference to `maybe_reallocate_page'
./libpre_gcl.a(alloc.o): In function `alloc_relblock':
alloc.c:(.text+0xdd33): undefined reference to `alloc_after_turning_off_sgc'
alloc.c:(.text+0xe4c0): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0xf072): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0xfb5e): undefined reference to `maybe_reallocate_page'
./libpre_gcl.a(alloc.o): In function `make_cons':
alloc.c:(.text+0x10a73): undefined reference to `alloc_after_turning_off_sgc'
alloc.c:(.text+0x11793): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0x127db): undefined reference to `maybe_reallocate_page'
alloc.c:(.text+0x12ed3): undefined reference to `maybe_reallocate_page'
./libpre_gcl.a(gbc.o): In function `sgc_start':
gbc.c:(.text+0x740b): undefined reference to `add_page_to_freelist'
gbc.c:(.text+0x74d9): undefined reference to `set_tm_maxpage'
gbc.c:(.text+0x768d): undefined reference to `add_pages'
gbc.c:(.text+0x81a0): undefined reference to `set_tm_maxpage'
./libpre_gcl.a(gbc.o): In function `GBC':
gbc.c:(.text+0x94c9): undefined reference to `opt_maxpage'
./libpre_gcl.a(main.o): In function `minimize_image':
main.c:(.text+0xa26): undefined reference to `set_tm_maxpage'
main.c:(.text+0xdc6): undefined reference to `mbrk'
main.c:(.text+0xdd6): undefined reference to `mbrk'
main.c:(.text+0x11e4): undefined reference to `mbrk'
main.c:(.text+0x11f4): undefined reference to `mbrk'
main.c:(.text+0x1512): undefined reference to `mbrk'
./libpre_gcl.a(main.o):main.c:(.text+0x15fd): more undefined references to `mbrk' follow
./libpre_gcl.a(main.o): In function `update_real_maxpage':
main.c:(.text+0x47cf): undefined reference to `set_tm_maxpage'
main.c:(.text+0x53a2): undefined reference to `mbrk'
main.c:(.text+0x53b2): undefined reference to `mbrk'
main.c:(.text+0x53c2): undefined reference to `mbrk'
main.c:(.text+0x6724): undefined reference to `mbrk'
main.c:(.text+0x6739): undefined reference to `mbrk'
./libpre_gcl.a(main.o):main.c:(.text+0x67fe): more undefined references to `mbrk' follow
./libpre_gcl.a(num_sfun.o): In function `number_expt':
num_sfun.c:(.text+0x5536): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x5b33): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x5ea7): undefined reference to `number_big_iexpt'
num_sfun.c:(.text+0x6149): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x633e): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x6820): undefined reference to `number_big_iexpt'
num_sfun.c:(.text+0x759c): undefined reference to `number_big_iexpt'
num_sfun.c:(.text+0x785e): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x79f3): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x7d1f): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x7e7c): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8002): undefined reference to `number_fix_iexpt'
./libpre_gcl.a(num_sfun.o):num_sfun.c:(.text+0x8171): more undefined references to `number_fix_iexpt' follow
./libpre_gcl.a(num_sfun.o): In function `number_expt':
num_sfun.c:(.text+0x84d5): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x84e5): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x85a5): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8625): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8635): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x86f5): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8789): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8799): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8859): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x88d9): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x88e9): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x89a9): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8a28): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8a38): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8af8): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8b77): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8b87): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8c47): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8cc6): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8cd6): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8d96): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x8e15): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8e25): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x8ee5): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x936a): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x937b): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x9486): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x94ce): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x94df): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x95b2): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x99e3): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x99f8): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x9aa0): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x9ab5): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0x9ba6): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0x9cc5): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0xa264): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa275): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa31b): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa32c): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa418): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0xa51f): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0xa811): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa826): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa8d4): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa8e9): undefined reference to `number_ui_expt'
num_sfun.c:(.text+0xa9f0): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0xab7a): undefined reference to `number_fix_iexpt'
num_sfun.c:(.text+0xb5fa): undefined reference to `number_zero_expt'
num_sfun.c:(.text+0xb678): undefined reference to `number_zero_expt'
num_sfun.c:(.text+0xba3a): undefined reference to `number_zero_expt'
num_sfun.c:(.text+0xbb06): undefined reference to `number_zero_expt'
num_sfun.c:(.text+0xbc24): undefined reference to `number_zero_expt'
./libpre_gcl.a(num_sfun.o):num_sfun.c:(.text+0xbca9): more undefined references to `number_zero_expt' follow
collect2: error: ld returned 1 exit status
makefile:171: recipe for target 'raw_pre_gcl_map' failed
make[3]: *** [raw_pre_gcl_map] Error 1
make[3]: Leaving directory '/home/debian/axiom/lsp/gcl-2.6.12/unixport'
makefile:71: recipe for target 'unixport/saved_pre_gcl' failed
make[2]: *** [unixport/saved_pre_gcl] Error 2
make[2]: Leaving directory '/home/debian/axiom/lsp/gcl-2.6.12'
/bin/sh: 6: unixport/saved_gcl: not found
Makefile:8: recipe for target 'gcldir' failed
make[1]: *** [gcldir] Error 127
make[1]: Leaving directory '/home/debian/axiom/lsp'
Makefile:195: recipe for target 'lspdir' failed
make: *** [lspdir] Error 2
The GCC version used is:
$ gcc --version
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
I think #6 is related. Any idea on how to proceed?
@shakthimaan I received similar errors to the ones you've posted.
I've had a look at #6 and @daly says he's using gcc version 4.8.2 .
I'm using Debian buster which has gcc 8 in the repository.
So I had a look to see which Debian has a version closer to @daly 's version and it turns
out that jessie has version 4.9.2
I then used debootstrap to create an environment with jessie (in a similar way to how it's described in this post )
debootstrap --foreign --arch=amd64 jessie jessie-chroot http://ftp.de.debian.org/debian/
Then, copy the axiom repository into the chroot and enter the chroot:
cp -r axiom/ jessie-chroot/
sudo chroot jessie-chroot
Then ran the 2nd stage inside the chroot to install the rest of the base system
/debootstrap/debootstrap --second-stage
If you have an unclean local axiom git clone, you can reset and remove any files that are not part of the git repo.
cd /axiom/
git reset --hard dbef4a575d95bc2b6726d4ed67a4c46e39e5590d
git clean -dfx .
From here on, I've installed the packages mentioned in the download page under the debian section, and then ran make
:
apt-get install gcc build-essential debhelper gettext gs-gpl html2text
apt-get install intltool-debian libgmp3-dev libice-dev libxau-dev libxaw7-dev
apt-get install po-debconf x-dev x11proto-input-dev x11proto-kb-dev
apt-get install libreadline5-dev gawk
apt-get install texlive-pstricks git-core texlive
git clone git://github.com/daly/axiom.git
cd axiom
export AXIOM=`pwd`/mnt/debian
export PATH=$AXIOM/bin:$PATH
make
It took some hours, but eventually the build succesfully finished.
I believe this can be a solution to @shakthimaan 's reported issue.
@daly can we close this?
Thanks
Thanks for the detailed steps. I was able to follow the above instructions and compile axiom. The gs-gpl and x-dev packages were not found though. Also, I installed libreadline-gplv2-dev instead of libreadline5-dev (not available). Note: In order to copy the built artefacts to the host system, I had to copy them to /tmp inside the chroot environment, and then access them on the host system.