Thursday, 2 February 2012

32bit VMC++ on 64bit Architecture

In trying to migrate to a 64-bit architecture, I found that the 64-bit version of my (closed source) executable was corrupt.  But, since I still had a 32-bit version, it was no problem to setup the necessary 32-bit libraries and use the 32-bit version of my executable.  I am using Ubuntu 10.04 to illustrate this procedure.

First we must install the libraries needed by our executable.  If you run this on the command line:
ldd executable_filename
linux-gate.so.1 => not found
libvmcpp.so (0xf7677000)
libm.so.6 => not found
libgcc_s.so.1 =>not found
libc.so.6 => not found
libdl.so.2 => not found
libpthread.so.0 => not found
/lib/ld-linux.so.2 (0xf7712000)
libstdc++.so.5 => not found
you see all of the dynamic libraries on which this binary depends.  In my example, most of the needed libraries can't be found.  Install the ia32-libs package:
sudo apt-get install ia32-libs
This will satisfy most dependencies, but there is just one left for vmc++: libstdc++.so.5.  In previous Ubuntu versions, this library was packaged with ia32-libs package.  This problem already has an associated bug, but it sounds like we won't see a fix.  So, here is the way to get the 32-bit version of that last package (derived from this thread):
  1. Go to the Ubuntu package database
  2. Download the i386 version of the .deb (which is an archive containing the library we need)
  3. Extract the contents of the .deb file with this command:
    ar vx libstdc++5_3.3.6-15ubuntu4_i386.deb
  4. Copy the libstdc++.so.5.0.7 file to /usr/lib32/
    sudo cp libstdc++.so.5.0.7 /usr/lib32/.
  5. Create a symbolic link with the standard name
    sudo ln -s /usr/lib32/libstdc++.so.5.0.7 /usr/lib32/libstdc++.so.5
Try to run your executable again: it should automatically detect the presence of the new libraries.  Yay!

2 comments:

  1. Can you share 32bit VMC++ executable file with me? I emailed Dr. Kawrakow and no reply.

    ReplyDelete
    Replies
    1. Sorry for the long reply delay! I wish I could provide the executable, but the software is closed source :( I know that this is a terrible practice for research, I urge you to choose other monte carlo engines that are open sources, such as DOSXYZ_NRC or gDPM

      Delete