我试图遵循有关使用Delite + LMS编译简单DSL的教程。我成功地编译了LMS和Delite。现在,请紧跟本教程:http://stanford-ppl.github.io/Delite/myfirstdsl.html尝试构建概要分析dsl时遇到问题。似乎编译器找不到delite-collection类:

felix@felix-UX32VD:~/Documents/phd/delite/Delite$ sbt compile
Loading /home/felix/sbt/bin/sbt-launch-lib.bash
[info] Loading project definition from /home/felix/Documents/phd/delite/Delite/project
[info] Set current project to delite (in build file:/home/felix/Documents/phd/delite/Delite/)
[info] Compiling 5 Scala sources to /home/felix/Documents/phd/delite/Delite/dsls/profiling/target/scala-2.10/classes...
[error] /home/felix/Documents/phd/delite/Delite/dsls/profiling/src/example/profiling/Profile.scala:7: object DeliteCollection is not a member of package ppl.delite.framework.datastruct.scala
[error] import ppl.delite.framework.datastruct.scala.DeliteCollection
[error]        ^
[error] /home/felix/Documents/phd/delite/Delite/dsls/profiling/src/example/profiling/Profile.scala:69: not found: type ScalaGenProfileArrayOps
[error]   with ScalaGenDeliteOps with ScalaGenProfileOps with ScalaGenProfileArrayOps
[error]

                                             ^

有人对我做错了什么有洞见吗?

最佳答案

从SBT手册:

无论如何,在框架项目中添加代码都是一个坏主意,因为您将不得不更改构建过程(例如,添加一个额外的模块)。另外,您可能必须重新编译框架的所有代码,这将非常慢。
根据框架制作代码的正确方法是:

  • 将库作为托管依赖项引用,该库在某种存储库中可用(最佳解决方案)。
  • 将jar复制到项目的lib文件夹中,并将其添加为非托管依赖项。

  • 由于显然Delite在任何Ivy仓库中均不可用,因此最好的方法是克隆Git仓库并在本地发布。参见http://www.scala-sbt.org/release/docs/Detailed-Topics/Publishing.html

    关于scala - 在Delite中编译我的第一个DSL,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21157985/

    10-13 07:18