.NET跨平台:在Linux Ubuntu上编译coreclr/corefx/dnx(20150617)

编译时间:北京2015年6月17日上午

操作系统:Ubuntu 14.04.2 LTS

Mono版本:Mono JIT compiler version 4.3.0 (master/3445ac5 Tue Jun 16 20:43:48 CST 2015)

一、编译coreclr

成功!

Repo successfully built.
Product binaries are available at /data/git/coreclr/bin/Product/Linux.x64.Debug

二、编译corefx

失败!15231个错误,编译结果如下:

/data/git/corefx/bin/obj/Linux.AnyCPU.Debug/Microsoft.CSharp/_AssemblyInfo.cs(3,11):
error CS0246: The type or namespace name ‘AssemblyTitle‘ could not be found (are you missing a using directive or an assembly reference?)
[/data/git/corefx/src/Microsoft.CSharp/src/Microsoft.CSharp.csproj]

/data/git/corefx/bin/obj/Linux.AnyCPU.Debug/Microsoft.CSharp/_AssemblyInfo.cs(4,11):
error CS0246: The type or namespace name ‘AssemblyDescription‘ could not be found (are you missing a using directive or an assembly reference?)
[/data/git/corefx/src/Microsoft.CSharp/src/Microsoft.CSharp.csproj]

...

System/Numerics/Vector_Operations.cs(112,10):
error CS0246:
The type or namespace name ‘MethodImplAttribute‘ could not be found (are you missing a using directive or an assembly reference?)
[/data/git/corefx/src/System.Numerics.Vectors/src/System.Numerics.Vectors.csproj]

System/Numerics/Vector_Operations.cs(112,30):
error CS0518: Predefined type ‘System.Object‘ is not defined or imported
[/data/git/corefx/src/System.Numerics.Vectors/src/System.Numerics.Vectors.csproj]

System/Numerics/Vector_Operations.cs(112,30):
error CS0103: The name ‘MethodImplOptions‘ does not exist in the current context
[/data/git/corefx/src/System.Numerics.Vectors/src/System.Numerics.Vectors.csproj]

16 Warning(s)
15231 Error(s)

Time Elapsed 00:04:12.30
Build Exit Code = 1

问题未找到解决方法,在GitHub上提交了Issue:#2073 。

三、编译dnx

失败!

第一次build的第1个错误:

Determining latest version
Latest version is 1.0.0-beta6-12082
Downloading dnx-mono.1.0.0-beta6-12082 from https://www.myget.org/F/aspnetvnext/api/v2
Installing to /root/.dnx/runtimes/dnx-mono.1.0.0-beta6-12082
dnvm needs unzip to proceed.

再次build的第1个错误:

dnx-mono.1.0.0-beta6-12082 already installed.
Cannot find dnx-mono.1.0.0-beta6-12082, do you need to run ‘dnvm install 1.0.0-beta6-12082‘?

这个错误是由于Ubuntu上没有安装unzip,通过下面的命令解决了问题:

apt-get unzip
dnvm upgrade -u

接下来的编译错误未找到解决方法:

warn: Dynamic view compilation failed.
/tmp/6dc38ab7770645d48e9ae31c479dec2c-1.cs(10953,13): error CS0103: The name `IsBuildV2‘ does not exist in the current context
/tmp/6dc38ab7770645d48e9ae31c479dec2c-1.cs(10955,15): error CS0103: The name `DnuPack‘ does not exist in the current context
/tmp/6dc38ab7770645d48e9ae31c479dec2c-1.cs(10961,17): error CS0103: The name `DnuPack‘ does not exist in the current context

...

verbose: Stack trace:
  at Spark.Compiler.BatchCompiler.Compile (Boolean debug, System.String languageOrExtension, System.String[] sourceCode) <0x41536f50 + 0x010ae> in <filename unknown>:0
  at Spark.Compiler.CSharp.CSharpViewCompiler.CompileView (IEnumerable`1 viewTemplates, IEnumerable`1 allResources) <0x4152fc40 + 0x0009b> in <filename unknown>:0
  at Spark.SparkViewEngine.CreateEntryInternal (Spark.SparkViewDescriptor descriptor, Boolean compile) <0x4150b670 + 0x002a0> in <filename unknown>:0
  at Spark.SparkViewEngine.CreateEntry (Spark.SparkViewDescriptor descriptor) <0x4150b370 + 0x0005a> in <filename unknown>:0
  at Spark.SparkViewEngine.CreateInstance (Spark.SparkViewDescriptor descriptor) <0x4150b330 + 0x00019> in <filename unknown>:0
  at Sake.Engine.Loader.DefaultLoader.Load (Sake.Engine.Options options) <0x414f3580 + 0x004b0> in <filename unknown>:0
  at Sake.Engine.SakeEngine.Execute (Sake.Engine.Options options) <0x414f2f10 + 0x002e1> in <filename unknown>:0
  at Sake.Engine.SakeEngine.Execute (System.String[] args) <0x414c5fd0 + 0x00047> in <filename unknown>:0
  at Sake.Program.Main (System.String[] args) <0x414a8d80 + 0x000f7> in <filename unknown>:0 

在GitHub上提交了Issue:#2080

时间: 2024-08-05 07:11:24

.NET跨平台:在Linux Ubuntu上编译coreclr/corefx/dnx(20150617)的相关文章

在Linux CentOS上编译CoreCLR

经过几天的努力,终于解决了在CentOS上编译CoreCLR的问题.最终发现问题是CMAKE_C_FLAGS的设置引起的. 只要在“src/pal/tools/clang-compiler-override.txt”中删除“SET (CMAKE_C_FLAGS_INIT "-Wall -std=c11") ”,在“src/pal/tests/CMakeLists.txt”添加“SET (CMAKE_C_FLAGS "-Wall -std=c11")”,就能编译了.

在Linux Ubuntu上编译DNX

DNX是.NET Execution Environment,前身是XRE,XRE的前身是KRuntime,项目网址:https://github.com/aspnet/DNX . 签出DNX的代码: git clone https://github.com/aspnet/DNX.git --recursive 安装Mono: apt-get install mono-complete 运行./build.sh命令进行编译,出现错误: WARNING: Invalid certificate r

.NET跨平台:在Ubuntu上用自己编译的dnx运行ASP.NET 5示例程序

在 Linux Ubuntu 上成功编译 dnx 之后,会在 artifacts/build/ 文件夹中生成 dnx-coreclr-linux-x64/ 与 dnx-mono/ 这2个文件夹,前者是基于 coreclr 的 dnx ,后者是基于 mono 的 dnx . 这篇博文中我们将使用基于 coreclr 的 dnx 运行 ASP.NET 5 示例程序,而 dnx 以及它所需的一切都在 dnx-coreclr-linux-x64/ 的 bin/ 文件夹中,所以只需通过下面的命令就可以运行

在Mac/Linux/Windows上编译corefx遇到的问题及解决方法

这两天尝试在Mac/Linux/Windows三大平台上编译.NET跨平台三驾马车(coreclr/corefx/dnx)之一的corefx(.NET Core Framework),结果三个平台的编译都失败了.后来一一都解决了,在这篇博文中分享一下. (一) 在Mac上编译corefx遇到的错误如下: /git/dotnet/corefx/dir.props(214,5): warning : The Roslyn targets do not exist- Roslyn will not b

【转】Ubuntu 上编译Android出现cannot find -lstdc++解决办法

[转]Ubuntu 上编译Android出现cannot find -lstdc++解决办法 在Ubuntu 12.04 x86_64机器上编译Android出现下面错误,是因为找不到32bit的libstdc++.so库. /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incom

[转]Linux Ubuntu上架设FTP

Linux Ubuntu上架设FTP http://www.blogjava.net/stonestyle/articles/369104.html 操作系统:ubuntu (GNU/Linux) 为了在机子上架设ftp服务器,我们需要安装ftp服务器软件.Linux下具有代表性的ftp服务器软件有Wu-FTP,ProFTP和Vsftp.Wu-FTP(Washington University FTP)由美国华盛顿大学开发.它的功能强大,配置较复制.由于开发时间较早,应用十分广泛,也因此成为黑客

Linux上编译CoreCLR源代码

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

.NET跨平台:在CentOS上编译dnx并运行ASP.NET 5示例程序

在之前的博文中我们在 Ubuntu 上成功编译出了 dnx ,并且用它成功运行了 ASP.NET 5 示例程序.在这篇博文中我们将 Ubuntu 换成 CentOS. 目前 dnx 的编译需要用到 mono,所以先要安装 mono,而且最好是用最新的 mono 源代码进行编译并安装. 我们实际成功编译的操作步骤如下(假设将 mono 安装到 /data/mono_build 目录): mkdir /data/mono_build PATH=/data/mono_build/bin:$PATH g

在Linux CentOS上编译并安装Clang 3.5.0

编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装. (注:CentOS的版本是6.6) 一.安装libstdc++4.7 wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo yum install devtoolset-2-gcc dev