以用户身份安装Clang(无Root特权)? [英] Install Clang as User (no Root Privileges)?

查看:111
本文介绍了以用户身份安装Clang(无Root特权)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以以用户身份访问University的Shell帐户,但没有root特权.服务器正在运行Ubuntu 8.04-Hardy.我希望在下学期的Unix编程课程中使用Clang作为我的C编译器.已安装GCC,但未安装Clang,并且大学的IT部门已按预期拒绝在系统上安装Clang.

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 semester's Unix programming course. GCC is installed but not Clang, and the University's IT dept has, as expected, declined to install Clang on the system.

是否可以以用户身份从我的主目录运行Clang?大概我需要从源代码编译.我只需要它来编译C.本课程不需要C ++或Obj C.

Is it possible to run Clang from my home directory as user? Presumably I would need to compile from source. I need it to compile only C. I don't need C++ or Obj C for this course.

推荐答案

您可以通过运行./configure --prefix=$HOME(或者您愿意的话,可以使用主目录的某个子目录)或通过使用CMake构建和安装来使用自动工具安装方法. CMAKE_INSTALL_PREFIX设置为您家下面的某个目录.前者记录在此处,只需在配置步骤中添加--prefix标志,然后运行进行安装".

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.

安装完成后,将您使用的任何前缀的bin子目录放入PATH环境变量中,您应该会做得很好.实际上,这就是我经常使用Clang作为Clang和LLVM的开发人员的方式.

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.

作为参考,这绝对是我们(Clang开发人员)想要支持的安装和使用方式.如果您遇到问题,请随时文件错误或寻求我们的电子邮件列表

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

这篇关于以用户身份安装Clang(无Root特权)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆