Giter VIP home page Giter VIP logo

Comments (6)

aktowns avatar aktowns commented on May 14, 2024 1

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.

tuxdna avatar tuxdna commented on May 14, 2024 1

Added a PR for what you suggested:

from scala-native.

densh avatar densh commented on May 14, 2024 1

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.

aktowns avatar aktowns commented on May 14, 2024

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.

tuxdna avatar tuxdna commented on May 14, 2024

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.

aktowns avatar aktowns commented on May 14, 2024

Did you try

> rtlib/publishLocal
> nscplugin/publishLocal

from scala-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.