>>Build日期:2015-2-5下午(编译失败)。

开始Linux发行版用的是CentOS 6.5,操作步骤:

1)配置git: git config --global http.sslverify false

2)签出github上的CoreCLR代码库: git clone https://github.com/dotnet/coreclr.git

3)安装cmake: yum install cmake

4)安装clang: yum install clang

5)运行build命令: sh build.sh

6)build结果——失败!错误信息如下:

Commencing CoreCLR Repo build
Checking pre-requisites...
Commencing build of native components for amd64/debug
Invoking cmake with arguments: /data/git/coreclr DEBUG
Detected Linux x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /data/git/coreclr/binaries/CMake
Executing make
[ 0%] Building CXX object src/pal/src/CMakeFiles/CoreClrPal.dir/exception/seh.cpp.o
In file included from /data/git/coreclr/src/pal/src/exception/seh.cpp:22:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/typeinfo:34:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:148:
/usr/bin/../lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception_ptr.h:143:13: error: unknown type
name 'type_info'
const type_info*
^
1 error generated.
make[2]: *** [src/pal/src/CMakeFiles/CoreClrPal.dir/exception/seh.cpp.o] Error 1
make[1]: *** [src/pal/src/CMakeFiles/CoreClrPal.dir/all] Error 2
make: *** [all] Error 2
Failed to build coreclr components.

【更新】

>>Build日期:2015-2-5晚上(编译成功)。

后来,将遇到的这个问题在github coreclr issue #77中提交了一下,很快有人回复编译器只能用clang 3.5。

看了一下CentOS安装的最新版clang是clang 3.4.2,看来是这个问题引起的。

要到LLVM官网上一看,预编译好的clang 3.5有Ubuntu的版本,但没有CentOS的。

于是,干脆将操作系统换成Ubuntu。在Ubuntu上用apt-get install clang安装,也是clang 3.4,只有手动安装clang 3.5。

手动安装参考的是园子里的这篇博文:在 Linux 下使用 clang 3.0 + llvm 3.0 + libc++

在Ubuntu中编译CoreCLR的实际操作步骤如下:

1)安装cmake: apt-get install cmake

2)下载预编译好的clang 3.5: wget http://llvm.org/releases/3.5.0/clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz

3)解压下载好的clang 3.5压缩包: tar xvf clang+llvm-3.5.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz

4)进入解压后的文件夹: cd clang+llvm-3.5.0-x86_64-linux-gnu

5)复制其中的文件至/usr: cp -R * /usr

6)编译CoreCLR: sh build.sh

7)等待编译结果:

Commencing CoreCLR Repo build
build.sh: 101: build.sh: Bad substitution
build.sh: 161: [: false: unexpected operator
Checking pre-requisites...
Commencing build of native components for amd64/debug
Invoking cmake with arguments: /data/git/coreclr DEBUG
Detected Linux x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /data/git/coreclr/binaries/CMake
Executing make
[ 0%] Building CXX object src/pal/src/CMakeFiles/CoreClrPal.dir/exception/seh.cpp.o
...

结果。。。编译成功了!

[100%] Built target mscordaccore
Install the project...
-- Install configuration: "DEBUG"
-- Installing: /data/git/coreclr/binaries/Product/amd64/debug/./corerun
-- Installing: /data/git/coreclr/binaries/Product/amd64/debug/./libmscordaccore.so
-- Installing: /data/git/coreclr/binaries/Product/amd64/debug/./libcoreclr.so
Repo successfully built.
Product binaries are available at /data/git/coreclr/binaries/Product/amd64/debug

耶!大功告成!

/data/git/coreclr/binaries/Product/amd64/debug# ls
corerun libcoreclr.so libmscordaccore.so

【补充】

GitHub上已经有了专门的参考资料:Building and Running CoreCLR on Linux

最新文章

  1. Python 模块学习:os模块
  2. MD5算法的C语言实现
  3. pageX/Y, offset(), position(), scrollTop(), screenX/Y, clientX/Y, pageX/Y
  4. JAVA中使用FTPClient实现文件上传下载
  5. LeetCode----Copy List with Random Pointer 深度拷贝,浅度拷贝,Lazy拷贝解析
  6. poj 2411 Mondriaan's Dream(状态压缩dP)
  7. Splash and Wizard
  8. 免费主机kilu使用
  9. javascript返回顶部几种代码总结
  10. 老男孩python第六期
  11. jetty compile
  12. gridContro使用随记
  13. MySQL InnoDB 备份与恢复七种方式
  14. C.【转】C语言字符串与数字相互转换
  15. natapp 穿透访问 vue项目 Invalid Host header
  16. Vue项目打包常见问题整理
  17. 父类与子类this相关问题
  18. AOP-Advisor-笔记
  19. python 定时器schedule执行任务
  20. behavior

热门文章

  1. 命令行启动win7系统操作部分功能
  2. MySQL中如何插入反斜杠,反斜杠被吃掉,反斜杠转义
  3. select与poll函数介绍
  4. Daily Scrum 12.2
  5. KMP字符串匹配算法
  6. 今天想用jquery来实现div的拖放功能
  7. bugly使用
  8. IOS开发 模型赋值 runtime
  9. 第一个jsp代码实现简单计算器
  10. Oracle列操作(增加列,修改列,删除列)