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):

JavaScript

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

JavaScript

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..

JavaScript

The dependencies are (this on my PC):

JavaScript

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