Member Site Forums Rosetta++ Rosetta++ – General Installation report and instructions: Ubuntu 8.10 64 bit Reply To: Installation report and instructions: Ubuntu 8.10 64 bit

#4037
Anonymous

    > Hi Everyone,
    >
    > I was able to install rosetta 32 bit (2.3.0) on a 64 bit Ubuntu machine.
    > I wrote an install log/doc to describe the process in case anyone else would like to do the same in the future.
    >
    > I realized that gcc 4.1 could work according to this forum post regarding 32 bit install on a 32 bit machine:
    > [http://www.rosettacommons.org/node/1584
    >
    > I also googled for solutions and gcc information when I encountered extra problems.
    >
    > I think that this could be helpful when trying to install on other 64 bit machines in general, not just Ubuntu.
    >
    > If you have any feedback regarding this installation log/doc/method I’d be happy to know about it.
    >
    > These are the extra steps I used:
    > 1. In the makefile, add -m32 to LDFLAGS, line 52 should now be “LDFLAGS = -m32 -static -Llib”. This is because we link 32 bit objects. If it’s not there, compilation would work but linking (ld) would fail.
    > 2. Since there was no gcc64 target in the makefile I changed the gcc target, (I could have also defined a new target instead):
    > 2a) Added line 82 as “LIB32 := 1”
    > 2b)Changed line 92 to “OPTFLAGS += -DNDEBUG -O1 -s -m32” (lowered optimization level from -O3 according to wiki, added -m32 to build 32 bit file)
    > 3. Copied the 32bit libz.a supplied by Ubuntu (in /usr/lib32/libz.a from the package lib32z1-dev, “sudo aptitude install lib32z1-dev” if it’s not there) to lib/i686-pc-linux-gnu/libz.a inside the rosetta++ directory.
    >
    > Now for extra ubuntu-specific steps based on the forum post mentioned above:
    > 1. Ubuntu 8.10 installs gcc-4.3 and g++-4.3 by default. These do not compile Rosetta++ well (too strict?). However, versions 4.1 do (according to forum post in rosetta’s page).
    > 1a) sudo aptitude install gcc-4.1 g++-4.1
    > 1b) cd /usr/bin
    > 1c) ls -l gcc*
    > 1d) if the symlink from gcc is to gcc-4.3 as it should be, “sudo rm gcc” and “sudo ln -s gcc-4.1 gcc”.
    > 1e) ls -l g++*
    > 1f) if the symlink from g++ is to g++-4.3 as it should be, “sudo rm g++” and “sudo ln -s g++-4.1 g++”.
    > 2. Make sure you have the needed lib32 files. “sudo aptitude install lib32gcc1 lib32stc++6 lib32z1 lib32z1-dev ia32-libs libc6-i386 libc6-dev-i386”.
    > *note: ia32-libs probably provides more than what’s basically needed, you can try without it first…
    >
    > ==Extra debugging step:
    > Make sure you can compile “hello world” as 32bit and 64 bit programs and execute them.
    > “gcc -Wall hello.c -o hello.bin.64”
    > “file hello.bin.64” should show “hello.bin.64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped”.
    > “./hello.bin.64” should give “hello, world” output.
    > “gcc -Wall -m32 hello.c -o hello.bin.32”
    > “file hello.bin.32” should show “hello.bin.32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped”.
    > “./hello.bin.32” should give “hello, world” output.
    >
    > == and now we can make Rosetta++ using
    > “make -j2 LIB32:=1 gcc”
    >
    > (I used -j2 because It’s a dual core machine)
    > (if you defined a new target instead of the “gcc” one, change accordingly)
    >
    > while compiling, you can check an object file to see if it is a 32bit object…
    > “ls .*o” and do “file [filename]” on one of the filenames you found. sometimes you may encounter an empty file which hasn’t been written to yet.
    >
    > ==cleanup
    > 1b) cd /usr/bin
    > 1c) ls -l gcc*
    > 1d) if the symlink from gcc is to gcc-4.1, “sudo rm gcc” and “sudo ln -s gcc-4.3 gcc”.
    > 1e) ls -l g++*
    > 1f) if the symlink from g++ is to g++-4.1, “sudo rm g++” and “sudo ln -s g++-4.3 g++”.
    >
    > NOTE: of course, extra build tools necessary for every other software are not mentioned in this doc (e.g. the build-essential package, which should already be installed if anything else was previously compiled similarly on the machine ).
    >
    > Good luck,
    > Tamir

    Hi,

    I found these instructions to be very helpful. I’ll add that I found it necessary to install g++-4.1-multilib and lib32stdc++-4.1-dbg in order to get it to compile. Thank you for the writeup.

    ~jws