Skip to content
Advertisement

Run an executable from Ubuntu to Debian

I have a project in C++, but my data is just too big for my computer. So, I tried to build my project in a desktop in our lab, but the compiler is too old (4.3.5 and I had 4.8.1 when I developed my code).

I do not have the rights to upgrade and the people that do have the rights are just too busy for me this period. Moreover, they said to me that the Debian version the lab desktop runs on is too old, thus it won’t allow a significant upgrade for the compiler.

So I was hoping that somehow I could manage to copy the executable that I created in my Ubuntu to the desktop with Debian and run it. But I am afraid I am asking too much so a negative answer is also acceptable.

My computer (in which the executable is created):

samaras@samaras-A15:~$ uname -a
Linux samaras-A15 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux
samaras@samaras-A15:~$ lsb_release -d
Description:    Ubuntu 12.04.3 LTS

The lab computer and what happens when I run the executable:

gsamaras@geomcomp:~/Desktop/code$ uname -a
Linux geomcomp 3.2.0-1-amd64 #1 SMP Fri Feb 17 05:17:36 UTC 2012 x86_64 GNU/Linux
gsamaras@geomcomp:~/Desktop/code$ lsb_release -d
Description:    Debian GNU/Linux 6.0.10 (squeeze)
gsamaras@geomcomp:~/Desktop/code$ ./rkd_sam
./rkd_sam: /usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by ./rkd_sam)
./rkd_sam: /usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.17' not found (required by ./rkd_sam)
./rkd_sam: /usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./rkd_sam)

I have hope because they are both Linux systems, but the 32 bit and 64 bit might be an issue… :/


With the -static flag, I got an error less, but still..

gsamaras@geomcomp:~/Desktop/code$ ./rkd_sam
./rkd_sam: /usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by ./rkd_sam)
./rkd_sam: /usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./rkd_sam)

The dependencies are (this on my PC):

samaras@samaras-A15:~/parallel/rkd_forest/code$ ldd rkd_sam
    linux-gate.so.1 =>  (0xb76f8000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb75e9000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb75bd000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb759e000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb73f4000)
    /lib/ld-linux.so.2 (0xb76f9000)

and I am getting

which libstdc++

prints nothing in the lab computer, so that means game over?

Advertisement

Answer

We don’t know what kind of program you are coding, so this is just a wild guess.

Your machine is a 32 bits Intel, so your binary on it is a ia32 (ie x86 32 bits) binary. So you will always be limited by the address space (practically at most 2.5 to 3Gbytes of data).

Yoru lab’s machine is a 64 bits intel running an old version of Linux

You might try to compile on your machine by linking statically (so g++ -static both at compile and at link time, i.e. make -f Makefile_sam_par clean then make -f Makefile_sam_par CXX='g++ -static')

BTW, your Makefile_sam_par is wrong, you should use CXX not CC inside it (since conventionally CXX and CXXFLAGS are for C++, run make -p to get the builtin rules inside make to understand the details, and read documentation of GNU make), . So correct that first. See this example.

If you are ready to spend several days of work, and if you have a lot of disk space (e.g. 15 Gbytes) available on the lab’s desktop you might try to compile a recent binutils and a recent GCC 4.9 compiler (be sure to ….../configure --prefix=$HOME/soft --program-suffix=-my-4.9); it is probably not worth the effort.

Perhaps try to ask some friend (having a bigger laptop than yours, with a Linux 64 bits and more than 4Gb RAM) to run your program.

BTW, if your laptop has more than 4Gbytes RAM and some x86-64 processor (which is very common these days, except on netbooks), it is definitely worthwhile to install a 64 bits variant of Linux.

Advertisement