Installation report and instructions: Ubuntu 8.10 64 bit

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

Viewing 2 reply threads
  • Author
    Posts
    • #310
      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

      • #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

        • #9259
          Anonymous

            Hi,

            I followed what was suggested by Tamir above, but my problem is gcc-4.1 is no longer available. I noticed that the post was in 2009.
            Sorry, but anyone please help me?

            I tried both make and scons, but none worked.

            For MAKE, i got the error:
            /usr/bin/ld: cannot find -lstdc++
            collect2: ld returned 1 exit status
            make: ***[rosetta.gcc] Error 1

            And for SCONS, i got:
            KeyError: “Unknown version number 4.4 for compiler gcc”

            Thanks, and please help.

            chinhsutran

          • #9264
            Anonymous

              Assuming you’re trying to install 2.3.1, edit the rosetta++/tools/build/basic.settings file. At line 179 or so, where it has the “gcc, 4.1” block, copy those 9 lines into a new block, and then change the ‘4.1’ into 4.4 and ‘[ “4”, “1” ]’ into ‘[ “4”, “4” ]’. Then try re-running scons. If you run into problems, try deleting the two lines which say ‘”compile” : [ “-param inline-unit-growth=1000″,”-param large-function-growth=50000″ ],’ and try it again.

            • #9296
              Anonymous

                Thank you very much.
                As I couldn’t wait for the solution, so I tried the install on another machine which runs Linux RedHat 64bit and gcc 4.1.2.

                I did as instructed by TamirEr (above) again, but also ran into some issues. However, I got help from another colleague, and it was successfully installed. Hence, just wanna share the small changes here in case someone ran into the same error as I did.

                Note: my gcc version is 4.1.2 while the gcc version Rosetta++ needs is 4.1.1.

                We followed exactly what Tamir suggested, but we deleted the “-static” in line52 of the makefile. My line 52 becomes:

                LDFLAGS = -32 -Llib -L”/usr/lib” -L”/usr/lib64″ -lstdc++

                And it worked.

                Hope it help. And thanks to all of your help, esp. to TamirEr and rmoretti.

            Viewing 2 reply threads
            • You must be logged in to reply to this topic.