1

I'm compiling LLVM/Clang but want to give a different name to the executable. Is there a special option I need to be using, like --binary-name? The trick is that I want to rename every tool that comes with LLVM/Clang.

For example:

clang -> my-clang 
llvm-conig -> my-llvm-config
etc.

Is it even possible in Unix/Linux?

  • 1
    How many binaries are you talking about? If there are only a handful, I do not see why you could not use mv to rename them. You could also make a symbolic link the the binary with the name you prefer. – Peschke Sep 22 '15 at 19:49
  • @ElixirofLove The idea is to have multiple versions of the tool installed. I need to compile different versions of clang/llvm and it would be nice if I could run clang-3.5, llvm-config-3.4 etc. – flashburn Sep 22 '15 at 20:55
  • Clang doesn't support this while building: clang-developers.42468.n3.nabble.com/…, so I suppose you'll have to do this manually. – muru Sep 22 '15 at 22:42
  • Let me generalize the question. Is it possible to install multiple versions of the same tool on a *nix system? And if not then what are the best practices to do that? In addition should a *nix developers implement some sort of a management system in the future to solve this type of problem? If this comment is off topic, I'd appreciate if some moderator could create a separate discussion thread for it. – flashburn Sep 22 '15 at 22:46
  • @flashburn it is possible. They do, they're called packages (with package managers). We don't have discussion threads on Stack Exchange, you can use chatrooms instead. – muru Sep 22 '15 at 22:54
0

I am unsure if you can change the name of all binary files during compilation... but my suggestion would be to compile the program in the directory it came in, move than entire directory to /usr/src, then create a symbolic link to the main binary in /usr/bin.

ln -s /usr/src/clang-3.5/bin/clang /usr/bin/clang-3.5

This way you can have multiple versions of different programs and not worry about the older libraries, and other files, being overwritten when installing them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.