2

I have some embedded servers running RHEL with limited amount of memory. Because of this I do not want to install gcc because it is so large.

Is there a way to remote compile with gcc?

The only way I can think of doing this is through NFS or SSHFS and sharing directories, but I feel there has to be an easier way. I have used remote system explorer via eclipse, but I do not always want to create an eclipse project.

I have little knowledge of cross-compiling, but I don't think I need that because all systems are x86_64. Does "cross-compiling" allow remote compiling with the same native architectures?

2
  • cross-compiling has nothing to do with remote vs. local code; a compiler that is capable of cross-compilation is able to build an executable file that is capable of running on something other than the native architecture. In other words, I can write code on my Windows/Linux machine that has a 64-bit Intel Xeon IA64 based CPU and compile said code for my Android Tablet which has a 32-bit ARM based CPU.
    – txtechhelp
    Mar 20, 2016 at 21:47
  • Thanks for confirming, that is how I understood it myself.
    – user_ABCD
    Mar 20, 2016 at 21:57

2 Answers 2

2

Distributed compiling can be done with distcc.

You can even try crosscompiling with different architectures.

Users of gentoo linux compile their whole system from source and you can find lots of hints about crosscompiling, cflags and distcc in the gentoo wiki, but you can adopt this knowledge to any other distribution of course.

It may help you to reduce the number of threads for some source packages, if you run out of RAM. This will

0

If you want to compile, you will need one RHEL server for development. You can copy the compiled programs and run those on servers with the same RHEL version (and libraries).

File-sharing using NFS or SSHFS will not help with reducing memory, though it would help if disk space were the limiting factor. However, compiling with gcc on a shared disk would not perform well.

4
  • I am running different RHEL, 6.7 on some, 6.6 on others, and 6.4 on others. Also they have different micro-architectures, they are all x86_64, but different intel chips. So I really wanna compile on each.
    – user_ABCD
    Mar 20, 2016 at 21:33
  • @user_ABCD, do you use any asm directives in your source that is specific to the actual instruction sets used in the different Intel CPU's you're wanting to compile for? If not, why are you that concerned if they are all x86_64 compatible?
    – txtechhelp
    Mar 20, 2016 at 21:43
  • @txtechhelp, I am not concerned. More of naive and only assumed it mattered.
    – user_ABCD
    Mar 20, 2016 at 21:50
  • compiling on 6.4, you're unlikely to run into problems by copying executables to 6.7 Mar 20, 2016 at 22:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .