我正在尝试按照使用 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 手册:
Library dependencies can be added in two ways:
unmanaged dependencies are jars dropped into the lib directory
managed dependencies are configured in the build definition and downloaded automatically from repositories (through Apache Ivy, exactly like Maven)
在任何情况下,在框架项目中添加代码都是一个坏主意,因为您将不得不更改构建过程(例如,添加额外的模块)。此外,您可能必须重新编译框架的所有代码,这会非常慢。
根据框架制作代码的正确方法是:
由于显然 Delite 在任何 Ivy 存储库中都不可用,因此最好的方法是克隆 Git 存储库并在本地发布它。见 http://www.scala-sbt.org/release/docs/Detailed-Topics/Publishing.html
Publishing Locally
The publishLocal command will publish to the local Ivy repository. By default, this is in ${user.home}/.ivy2/local. Other projects on the same machine can then list the project as a dependency. For example, if the SBT project you are publishing has configuration parameters like:
name := 'My Project'
organization := 'org.me'
version := '0.1-SNAPSHOT'
Then another project can depend on it:
libraryDependencies += "org.me" %% "my-project" % "0.1-SNAPSHOT"
关于scala - 在 Delite 中编译我的第一个 DSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21157985/