跳转到内容

ROSE 编译器框架/获取 ROSE

来自维基教科书,开放的世界,开放的书籍


Git 仓库

[编辑 | 编辑源代码]

ROSE 的源文件由 git 管理,git 是一个分布式版本控制和源代码管理系统。

rose 的最新开发版本。它可能无法通过所有回归测试。(建议使用)

通过所有回归测试的 ROSE 的发布版本。

以下是一些粗略的说明,可帮助您开始在 Linux 机器上构建和安装 ROSE

1. 安装 Boost C++ 库。您可以使用我的快速且脏的脚本:install-boost.sh.

2. 配置您的环境

3. 运行 $ROSE/build 脚本以执行 Autotools 引导

4. 运行 $ROSE/configure 脚本,使用 "--with-boost=/path/to/boost"、"--prefix=/path/for/installation"。可选地,如果您想使用 ROSE 的 OpenMP 支持并与 GCC 4.4 的 OpenMP 运行时库链接,则应配置 --with-gomp_omp_runtime_library=/usr/apps/gcc/4.4.1/lib64/。

5. 运行 "make –j24 install-core" 以构建和安装 ROSE

请注意,我们目前仅支持 ROSE-EDG4 存储库中的 GCC 4.2.4 和 GCC 4.4.5。完整文档可在我们的网站上找到,http://rosecompiler.org,尽管特定于 ROSE-EDG4 的说明通常缺乏。

自动配置配置

[编辑 | 编辑源代码]

EDG4.7 前端默认启用,您可以使用以下选项配置 ROSE

   $ $ROSE/configure --with-boost=/path/to/boost/installation --prefix=/path/for/rose/installation

示例环境

[编辑 | 编辑源代码]
   # Example setup.sh file to source relevant environment settings for building ROSE
   #
   # Update the paths to fit your environment…
   export BOOST_ROOT=/home/too1/local/opt/boost/1_45_0
   export BOOST_HOME="${BOOST_ROOT}"
   export JAVA_HOME=/home/too1/local/workspace/rose/edg3/keep_going/opt/java/jdk/1.7.0_15
   export LIBTOOL_HOME=/usr/apps/libtool/2.2.4
   export AUTOMAKE_HOME=/usr/apps/automake/1.9.6
   export LD_LIBRARY_PATH=":${JAVA_HOME}/lib:${JAVA_HOME}/jre/lib/amd64/server:${BOOST_ROOT}/lib:"
   export PATH="${JAVA_HOME}/bin:${AUTOMAKE_HOME}/bin:${LIBTOOL_HOME}/bin:$PATH"
   export PATH="/usr/apps/git/latest/bin:$PATH"
   # GCC 4.4.1
   source /nfs/apps/mpfr/2.4.1/setup.sh
   source /nfs/apps/gmp/4.3.1/setup.sh
   source /nfs/apps/gcc/4.2.4/setup.sh

虚拟机映像

[编辑 | 编辑源代码]

首次安装 ROSE 可能需要相当长的时间。提供了一个虚拟机映像,其中包含已安装 ROSE 的 Ubuntu 10.04 操作系统。

您可以使用 VMware Player 下载并播放它

更多信息请访问 ROSE 虚拟机映像

适用于 github.com 的 git 1.7.10 或更高版本

[编辑 | 编辑源代码]

https://help.github.com/articles/https-cloning-errors 中所述,github 需要 git 1.7.10 或更高版本才能避免 https 克隆错误。

Ubuntu 10.04 的软件包存储库包含 git 1.7.0.4。因此,需要构建更高版本的 git。但您仍然需要旧版本的 git 来获取最新版本的 git。

 apt-get install git-core

现在您可以克隆最新的 git

 git clone https://github.com/git/git.git

安装从源文件构建 git 所需的所有先决条件软件包(假设您已经安装了带有 GCC 编译器的 GNU 工具链、make 等)

 sudo apt-get install gettext zlib1g-dev asciidoc libcurl4-openssl-dev
 $ cd git  # enter the cloned git directory
 $ make configure ;# as yourself
 $ ./configure --prefix=/usr ;# as yourself
 $ make all doc ;# as yourself
 # make install install-doc install-html;# as root

EDG 源代码

[编辑 | 编辑源代码]

如果您有 EDG 许可证,我们可以为您提供 ROSE 的 EDG 源代码。原始的官方 EDG 源代码不适用于 ROSE,因为我们已经修改了 EDG 以更好地满足我们的目的。

注意:我们为您提供我们的 Git 版本控制 ROSE-EDG 源代码存储库的快照。这样,您可以更轻松地将您的 EDG 修改贡献回 ROSE。

1. 将您的 EDG(研究)许可证发送给两位 ROSE 工作人员,以防其中一位休假或出差。

2. 为 ROSE 工作人员提供一个 EDG 源代码的放置位置(ssh 或 ftp 服务器等)。

3. 收到 EDG 源代码后,您有两个选择

作为子模块

[编辑 | 编辑源代码]

a. 使用 ROSE-EDG 作为子模块(假设您有 ROSE 的 Git 源树)

这是使用我们提供的 EDG git 仓库的推荐方式。因此,假设您使用 ROSE 的本地 git 克隆($ROSE).

编辑子模块路径$ROSE/.gitmodules指向您的 ROSE-EDG 存储库

[submodule "src/frontend/CxxFrontend/EDG"]
       path = src/frontend/CxxFrontend/EDG
-       url = ../ROSE-EDG.git
+       url = <path/to/your/ROSE-EDG.git>
-[submodule "projects/vulnerabilitySeeding"]
-       path = projects/vulnerabilitySeeding
-       url = ../vulnerabilitySeeding.git

运行 git-submodule 命令

$ cd $ROSE
$ git submodule init
$ git submodule update

上面的命令将签出 EDG 子模块的版本并将其保存到 ROSE/src/frontend/CxxFrontend/EDG 中

作为直接插入

[编辑 | 编辑源代码]

b. 作为直接插入

将 ROSE-EDG 压缩包移动到 ROSE 源树中的正确位置$ROSE/src/frontend/EDG

  $ tar xzvf ROSE-EDG-b12158aa2.tgz
  $ ls
  EDG  ROSE-EDG-b12158aa2.tgz
  $ mv EDG $ROSE/src/frontend/EDG

警告:此方法可能无法工作,因为 EDG 是 ROSE 的子模块,因此需要这两个模块之间的版本同步。例如,最新版本的 ROSE 可能不使用最新版本的 ROSE 的 EDG。

剩余步骤

[编辑 | 编辑源代码]

4. 在 ROSE 中,运行$ROSE/buildROSE 源树顶层的脚本,即$ROSE. 此脚本引导 Autotools,包括Makefile.ams 在 EDG 源树中。

5. 配置和构建 ROSE:通常,在此过程中,ROSE 会尝试为您下载 EDG 二进制压缩包,但由于您拥有源代码,因此此步骤将被跳过。


EDG 压缩包

[编辑 | 编辑源代码]

如果您没有访问 EDG 源代码的权限,您将在 ROSE 构建过程中自动下载打包的 EDG 二进制压缩包。下载是在make$ROSE_BUILD/src/frontend/CxxFrontend.

EDG 二进制版本是相对于您的 ROSE 版本的计算的二进制兼容性签名。您可以通过运行$ROSE/scripts/bincompat-sig来检查此版本,例如

$ ./scripts/bincompat-sig 
7b1930fafc929de85182ee1a14c86758

您可能会遇到此错误

$ ./scripts/bincompat-sig 
Unable to find a remote tracking a canonical repository.  Please add a
canonical repository as a remote and ensure it is up to date.  Currently
configured remotes are:

   origin => https://github.com/rose-compiler/rose

Potential canonical repositories include:

   anything ending with "rose.git" (case insensitive)

如果是这种情况,只需在您的原点 URL 路径的末尾添加 ".git"。在我们的示例中,这将转换为

https://github.com/rose-compiler/rose.git

二进制文件列表

[编辑 | 编辑源代码]

在此处查看可用的 EDG 二进制文件列表:http://www.rosecompiler.org/edg_binaries/edg_binaries.txt.

EDG 二进制文件是为以下平台生成的(最后更新时间:2012 年 12 月 22 日)

平台 EDG 3.3 EDG 4.0
amd64-linux GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1 GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1
i686-linux GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1 GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1
32位-macos-10.5 GCC 4.0.4
64位-macos-10.6 GCC 4.2.4
64位-x86_64-macos-10.6 GCC 4.2.4
34位-debian GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1 GCC 3.4.6, 4.0.4, 4.1.2, 4.2.4, 4.3.2, 4.4.1
华夏公益教科书