Comments (6)
next problem you'll probably hit is missing symbol __stderrp
because its a bsdim as far as i can tell (stdio.h macro's stdout/stderr to __stdoutp and __stderrp) on linux its just stderr and stdout. i'm not sure if there's any machinery to do per platform compilation to use just the one var, but a quick fix to run the native demo on linux
diff --git a/demo-native/smallpt.scala b/demo-native/smallpt.scala
index a8f5372..69a57b3 100644
--- a/demo-native/smallpt.scala
+++ b/demo-native/smallpt.scala
@@ -163,7 +163,7 @@ object Main {
val Xi = malloc(sizeof[Short] * 3).cast[Ptr[Short]]
var y = 0
while (y < H) {
- fprintf(__stderrp, c"\rRendering (%d spp) %5.2f%%", SAMPLES * 4, 100.0 * y/(H-1))
+ fprintf(stderr, c"\rRendering (%d spp) %5.2f%%", SAMPLES * 4, 100.0 * y/(H-1))
Xi(0) = 0.toShort
Xi(1) = 0.toShort
Xi(2) = (y * y * y).toShort
diff --git a/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala b/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
index a5b8763..2836bfb 100644
--- a/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
+++ b/nativelib/src/main/scala/scala/scalanative/native/stdlib.scala
@@ -2,8 +2,8 @@ package scala.scalanative
package native
@extern object stdlib {
- var __stderrp: Ptr[_] = extern
- var __stdoutp: Ptr[_] = extern
+ var stderr: Ptr[_] = extern
+ var stdout: Ptr[_] = extern
def fopen(filename: CString, mode: CString): Ptr[_] = extern
def fprintf(stream: Ptr[_], format: CString, args: Any*): CInt = extern
def malloc(size: Word): Ptr[_] = extern
from scala-native.
Added a PR for what you suggested:
from scala-native.
Getting things build on Linux a bit complicated at the moment, @andreaTP's docker script is the easiest way to do it semi-automatically right now. We're currently working on making it easier. I've gathered all the common issues people are hitting in #102 , follow that ticket for updates.
from scala-native.
running publishLocal
on both projects fixed it for me
➜ scala-native git:(master) ✗ ./sbt test
[error] (nativelib/*:update) sbt.ResolveException: unresolved dependency: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[error] unresolved dependency: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[error] Total time: 4 s, completed 12/05/2016 12:34:10 PM
➜ scala-native git:(master) ✗ ./sbt
> rtlib/publishLocal
[info] Wrote /home/ashleyis/Development/repos/scala-native/rtlib/target/scala-2.11/rtlib_2.11-0.1-SNAPSHOT.pom
....
[success] Total time: 1 s, completed 12/05/2016 12:36:17 PM
> nscplugin/publishLocal
[info] Packaging /home/ashleyis/Development/repos/scala-native/nscplugin/target/scala-2.11/nscplugin_2.11-0.1-SNAPSHOT-sources.jar ...
[success] Total time: 0 s, completed 12/05/2016 12:36:29 PM
> test
...
[success] Total time: 144 s, completed 12/05/2016 12:38:55 PM
from scala-native.
I am facing the same issue:
sbt package
[info] Loading global plugins from /home/saleem/.sbt/0.13/plugins
[info] Loading project definition from /home/saleem/work/scala-native/project
[info] Set current project to scala-native (in build file:/home/saleem/work/scala-native/)
[info] Updating {file:/home/saleem/work/scala-native/}nativelib...
[info] Resolving org.scala-native#rtlib_2.11;0.1-SNAPSHOT ...
[warn] module not found: org.scala-native#rtlib_2.11;0.1-SNAPSHOT
[warn] ==== local: tried
[warn] /home/saleem/.ivy2/local/org.scala-native/rtlib_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== jcenter: tried
[warn] https://jcenter.bintray.com/org/scala-native/rtlib_2.11/0.1-SNAPSHOT/rtlib_2.11-0.1-SNAPSHOT.pom
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/scala-native/rtlib_2.11/0.1-SNAPSHOT/rtlib_2.11-0.1-SNAPSHOT.pom
[info] Resolving org.scala-native#nscplugin_2.11;0.1-SNAPSHOT ...
[warn] module not found: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT
[warn] ==== local: tried
[warn] /home/saleem/.ivy2/local/org.scala-native/nscplugin_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== jcenter: tried
[warn] https://jcenter.bintray.com/org/scala-native/nscplugin_2.11/0.1-SNAPSHOT/nscplugin_2.11-0.1-SNAPSHOT.pom
[warn] ==== public: tried
[warn] https://repo1.maven.org/maven2/org/scala-native/nscplugin_2.11/0.1-SNAPSHOT/nscplugin_2.11-0.1-SNAPSHOT.pom
[info] Resolving com.github.scopt#scopt_2.11;3.3.0 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
[warn] :: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] org.scala-native:rtlib_2.11:0.1-SNAPSHOT ((scala.scalanative.sbtplugin.ScalaNativePluginInternal) ScalaNativePluginInternal.scala#L57)
[warn] +- org.scala-native:nativelib_2.11:0.1-SNAPSHOT
[warn] org.scala-native:nscplugin_2.11:0.1-SNAPSHOT ((sbt.BuildExtra) Defaults.scala#L1850)
[warn] +- org.scala-native:nativelib_2.11:0.1-SNAPSHOT
[info] Packaging /home/saleem/work/scala-native/sbtplugin/target/scala-2.10/sbt-0.13/sbtplugin-0.1-SNAPSHOT.jar ...
[info] Done packaging.
sbt.ResolveException: unresolved dependency: org.scala-native#rtlib_2.11;0.1-SNAPSHOT: not found
unresolved dependency: org.scala-native#nscplugin_2.11;0.1-SNAPSHOT: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:294)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:191)
at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:168)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:155)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:132)
at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
from scala-native.
Did you try
> rtlib/publishLocal
> nscplugin/publishLocal
from scala-native.
Related Issues (20)
- sbt verbose logging no longer translates to tools debug logging HOT 2
- could not build scalacheck with scala-native 0.5.0 HOT 1
- OS-Lib subprocess tests fail on Scala-Native 0.5.0 HOT 1
- (playdate support) Missing `pthread` APIs in `ThreadUtil` HOT 4
- `java.nio.file.Files.delete` misbehaves on broken symlinks HOT 1
- `Files.walkFileTree` silently swallows `NoSuchFileException` HOT 3
- Ignore incompatible NIR files instead of crashing
- (playdate support) delimcc.c is compiled even if Continuations isn't used HOT 4
- Explore the possibility to emit compiler warnings for missing javalib classes HOT 1
- javalib Files#walkFileTree method has mutiple opportunities for improvement
- javalib Files#list result stream is not lazy on non-Windows
- posixlib dirent.scala is missing the declaration of POSIX readdir() HOT 1
- Static library can't use exceptions internally with GNU C++ toolchain HOT 5
- javalib Files#list result stream is not lazy on Windows
- javalib Files#list result stream is not lazy on Windows HOT 1
- javalib Files.move does not follow JVM practice when target is a directory with contents. HOT 1
- Hide/deal with posix.sys.stat as it's not binary compatible with POSIX standard HOT 4
- javalib Files#walk FileSystemLoop detection is probably wrong/broken.
- Please take over Scala Native java.util.logging port HOT 3
- Implementations of javalib `fileKey` has at least two defects. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scala-native.