Install Clang as User (no Root Privileges)?

后端 未结 3 2038
野性不改
野性不改 2021-02-20 06:43

I have access to a shell account at University as a user but with no root privileges. The server is running Ubuntu 8.04 - Hardy. I wish to use Clang as my C compiler for next se

相关标签:
3条回答
  • 2021-02-20 06:51

    You can use the autotools installation method by running ./configure --prefix=$HOME (or some subdirectory of your home directory if you prefer) or by using the CMake build and installation with the CMAKE_INSTALL_PREFIX set to some directory under your home. The former is documented here, merely add the --prefix flag to the configure step, and run 'make install' at the end.

    Once installed, put the bin subdirectory of whatever prefix you used into your PATH environment variable, and you should be good-to-go. This is actually the way I use Clang regularly as a developer of Clang and LLVM.

    For reference, this is definitely a mode of installation and use that we (Clang developers) want to support. If you run into issues, don't hesitate to file bugs or reach out for support on our email lists or IRC channel (#llvm on irc.oftc.net).

    0 讨论(0)
  • 2021-02-20 06:52

    With free software, you can always configure it and (if needed) patch and improve it to suit your needs. However, building a compiler (be it GCC or Clang) requires a lot of resources (disk space, several gigabytes, and also RAM & CPU time), and some of your time and efforts.

    Clang building and installation is documented here. I guess that its configure script -assuming it is similar to GCC's one- accepts arguments like --prefix (which you could e.g. set to $HOME/pub). You might need to build also the required dependencies.

    0 讨论(0)
  • 2021-02-20 06:53

    As the project appears to use autotools you can alter the installation destination with command line parameters to the configure program (e.g. --prefix=$HOME/clang). Running ./configure --help and reading the INSTALL text file will give you more details.

    If not already installed, you also need to build LLVM, which is the parent project (Low Level Virtual Machine) as well. Installation instructions for both are available at the clang website.

    0 讨论(0)
提交回复
热议问题