7

apt-get install build-essential:i386 doesn't work at all:

The following packages have unmet dependencies:
 build-essential:i386 : Depends: gcc:i386 (>= 4:4.4.3) but it is not going to be installed
                        Depends: g++:i386 (>= 4:4.4.3) but it is not going to be installed

Note the tag. Answers on Trouble compiling a 32 bit binary on a 64 bit machine are outdated. Also, there are no ./configure script to use the Compile 32 bit on 64 bitsystem answer.

More details

I'm trying to complite DFHack from quietust branch: https://github.com/quietust/dfhack/

apt-get install gcc-multilib g++-multilib removed the

CMake Error at depends/protobuf/CMakeLists.txt:60 (MESSAGE):
  Could not find a working hash map implementation.  Please install GCC >=
  4.4, and all necessary 32-bit C++ development libraries.

message, but

-- Could NOT find Threads (missing:  Threads_FOUND) 
Can't locate XML/LibXML.pm in @INC (you may need to install the XML::LibXML module) (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at xml/list.pl line 6.
BEGIN failed--compilation aborted at xml/list.pl line 6.

is still there. Do I have to manually seek all i386 build-essential the dependencies?

3
  • AFAIK you can't have 32 and 64bit build-essential at the same time..
    – AlexGreg
    Aug 12, 2014 at 13:00
  • Well, that's sad and uncomfortable.
    – int_ua
    Aug 12, 2014 at 13:01
  • i dont have the answer for you , but once i made a cross-compiling from an 32bit to arm architecture, and it worked fine , it was openCV , just shared this here to give you any help or clue. Sep 22, 2016 at 23:35

2 Answers 2

5

Yes, for anything that is not already packaged in Ubuntu, or in a PPA that you've added, you will have to manually install all the dependencies needed to compile it. For anything already packaged in Ubuntu, you can run apt-get build-dep $package and it will install the build dependencies for that package, however, if there are any additional or changed dependencies from what was used in the version built in Ubuntu, you will still need to manually install those additional or changed dependencies.

3
  • Thanks, but I meant build-essential dependencies. Added it to the question. But still looks like I'll have to manually install them. In the absence of a better answer I'll accept yours in several days.
    – int_ua
    Aug 12, 2014 at 13:34
  • 10
    Ok, installing gcc-multilib g++-multilib and build-deps was enough.
    – int_ua
    Aug 12, 2014 at 14:25
  • 1
    Yes, and you asked about perl modules too, which is why my answer is more generic.
    – dobey
    Aug 12, 2014 at 15:20
1

AFAIU, an optimal way to compile 32-bit executable on a 64-bit system would be creating a chroot in the following way (you may want to replace xenial with a needed codename):

mk-sbuild --arch=i386 xenial # Currently, first time it needs to be executed twice, unfortunately, please comment if you know how to omit this.
mk-sbuild --arch=i386 xenial

# Allowing the same home folder to be used
echo "$HOME                 /home/$USER  none  rw,bind  0  0" | sudo tee -a /etc/schroot/sbuild/fstab

Then you can use the chroot with just

schroot -c xenial-i386

Notice that it won't have sudo by default, you'll have to manage it with

sudo schroot -c source:xenial-i386 -u root

Idea found in this answer https://askubuntu.com/a/216670/20275

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .