zoukankan      html  css  js  c++  java
  • .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 。

    更新:这是 corefx 的一个bug,后来被修复了。

    三、编译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

    更新:删除dnx文件夹并重新git clone后问题解决。

    rm -rf dnx/
    git clone --recursive https://github.com/aspnet/dnx.git
    cd dnx
    ./build.sh
  • 相关阅读:
    [国家集训队]拉拉队排练 Manancher_前缀和_快速幂
    高手过愚人节 Manancher模板题_双倍经验
    [模板]manacher算法
    [POI2011]MET-Meteors 整体二分_树状数组_卡常
    [国家集训队]矩阵乘法 整体二分
    三维偏序(陌上花开) CDQ分治
    博客园美化之旅第一天(CSS图层关系,背景相关设置,字体相关设置)
    力扣题目解答自我总结(反转类题目)
    python插件,pycharm基本用法,markdown文本编写,jupyter notebook的基本操作汇总
    关于小程序websocket全套解决方案,Nginx代理wss
  • 原文地址:https://www.cnblogs.com/dudu/p/4582894.html
Copyright © 2011-2022 走看看