Compile for a linux platform that does not have gcc available

0

I'm used to compiling programs with custom feature sets on my own linux laptop. I want to do the same for a remote linux platform that I work on, but unfortunately that platform does not have gcc available. I also do not have root privileges, so I can't use rpm or install gcc myself.

Is it possible to compile a program on my laptop that targets a custom linux platform? Both my laptop and the target are x86_64 architecture. How do I set up gcc on my laptop to use the same libraries as the target?

topcat

Posted 2014-09-11T16:19:46.353

Reputation: 205

Sure. I can compile a Linux application on Windows, provided I used gcc, and used the proper linked files. Without more information I am not sure if we can help you. – Ramhound – 2014-09-11T16:48:24.083

There are many options that allow you to use even specific optimization for the remote machine. You need to know the class of the cpu... man gcc. Give it a look to --static too. ;) – Hastur – 2014-09-12T21:28:31.137

Answers

0

You could install gcc in your $HOME on the server, setup your $PATH to include the place where you installed it ($HOME/.local for example) and just have it work on the remote machine. This does require that you can compile binaries for the target machine.

Clearer

Posted 2014-09-11T16:19:46.353

Reputation: 185