Giter VIP home page Giter VIP logo

scala-native.g8's Introduction

Scala Native Getting Started Template

CI

This is a minimal Giter8 template for Scala Native.

Scala Native is an optimizing ahead-of-time compiler and lightweight managed runtime designed specifically for Scala.

Documentation


Getting Started and full documentation can be found at https://www.scala-native.org/.

Once the prerequisites are installed, run the following at your command line.

sbt new scala-native/scala-native.g8

As an alternative, you can use scala-cli.

License


Created by EPFL: 2017-2023

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. This template is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/.

scala-native.g8's People

Contributors

amaya382 avatar andreatp avatar densh avatar ekrich avatar frgomes avatar leetibbert avatar masseguillaume avatar mox692 avatar piotrkwiecinski avatar raboof avatar scala-steward avatar sh0hei avatar virtualirfan avatar xuwei-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scala-native.g8's Issues

Travis CI

This repo badly needs some continuous integration.

Basic string operations won't compile

I managed to get this working, rendering works etc. Now I tried to replace the Main object with simpler hello world stuff like this:

package demo

object Main {
 def main(a:Array[String]) = {
   println("woowowo")
 }
}

And everything worked as expected. But as soon as I complicated it a tiny bit, it didn't compile anymore. Did I miss something?

package demo

object Main {
 def main(a:Array[String]) = {
   println("woowowo".replaceAll("w","Y"))
 }
}

output

$ sbt run
[info] Loading project definition from /private/tmp/scala-native-example/project
[info] Set current project to scala-native-example (in build file:/private/tmp/scala-native-example/)
[info] Compiling 1 Scala source to /private/tmp/scala-native-example/target/scala-2.11/classes...
[info] Linking NIR (686 ms)
[error] cannot link: @java.util.regex.Matcher
[error] cannot link: @java.util.regex.Matcher::replaceAll_class.java.lang.String_class.java.lang.String
[error] cannot link: @java.util.regex.Pattern
[error] cannot link: @java.util.regex.Pattern$
[error] cannot link: @java.util.regex.Pattern$::compile_class.java.lang.String_class.java.util.regex.Pattern
[error] cannot link: @java.util.regex.Pattern::matcher_trait.java.lang.CharSequence_class.java.util.regex.Matcher
[error] unable to link
[error] (*:nativeLink) unable to link
[error] Total time: 5 s, completed 14-Mar-2017 15:29:27

Produces broken image

Hi,
I just cloned this project (to Ubuntu 16.04)
It builds fine, and runs, but the image0.ppm file is reporting its height as 22331248

the top 2 lines of the output are:

P3
800 22331248

If I edit the height to be 600, to match the scala src, I can then open the file, although the colours are very diifferent from the png file supplied.

If I explicitly set the type of W and H to Int, it runs quicker, (42s vs 64s) and the width reported is:

P3
800 18177904

again if I edit the height to be 600, I get (nearly) the same png, but still very different colours to the example supplied.

Nothing obviously wrong in the source scala. I haven't changed any of the project files, and just did:

sbt run

Compilation error relative to RE2

Hi there,

I'm trying to compile this project on an ubuntu x64 virutal machine (Ubuntu 14.04.3 LTS).
I have followed the scala native installation instructions.

I had some issues relative to the RE2 library. The package libre2-dev was not available for this version of ubuntu. So I used the unstable debian package instead.

However I'm still having an error during the compilation (sbt run):

[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_new':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x281): undefined reference to `re2::RE2::RE2(re2::StringPiece const&, re2::RE2::Options const&)'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x29a): undefined reference to `re2::RE2::RE2(re2::StringPiece const&)'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_delete':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x2dd): undefined reference to `re2::RE2::~RE2()'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_num_capturing_groups':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x321): undefined reference to `re2::RE2::NumberOfCapturingGroups() const'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_find_named_capturing_groups':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x33d): undefined reference to `re2::RE2::NamedCapturingGroups() const'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_match':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x45e): undefined reference to `re2::RE2::Match(re2::StringPiece const&, unsigned long, unsigned long, re2::RE2::Anchor, re2::StringPiece*, int) const'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_replace_re':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x57c): undefined reference to `re2::RE2::Replace(std::string*, re2::RE2 const&, re2::StringPiece const&)'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_global_replace_re':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x6ec): undefined reference to `re2::RE2::GlobalReplace(std::string*, re2::RE2 const&, re2::StringPiece const&)'
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp.o: In function `scalanative_cre2_quote_meta':
[error] /home/ubuntu/workspace/scala-native.g8/target/scala-2.11/native/lib/cre2.cpp:(.text+0x845): undefined reference to `re2::RE2::QuoteMeta(re2::StringPiece const&)'

It seems that some RE2 files are not accessible or missing.
Any help is welcomed!

Thanks.

Build fails after recent changes in build.sbt

The following instructions should just work:

$ find $HOME/.ivy2 -type d -name '*scala-native*' | xargs rm -r -f
$ sbt clean package nativeLink

Observe that I'm making sure that we clean whatever we have in the local Ivy repository before we start. This is a critical step! i.e: always, always! make sure we build from a clean slate!

People trying Scala Native for the first time will be building their first app from a completely clean slate. So we must guarantee we test our build from a complete clean slate.

By the way, it's critical that the documentation is always in sync with the build script. Otherwise, people trying Scala Native for the first time will have troubles, will not be able to fix it (obviously, since they are complete newbies on the matter!) and will end up asking things in the gitter room.

In other words, before commiting changes, the entire build must be performed in a clean slate. If things fail (which is the case at the moment), the change cannot be pushed onto the repository otherwise new users (and even regular users!) will be doomed to face troubles.

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.