GithubHelp home page GithubHelp logo

whitemike889 / kotlin-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetbrains/kotlin-native

0.0 0.0 0.0 81.4 MB

Kotlin/Native infrastructure

License: Apache License 2.0

Kotlin 61.65% C 1.01% Shell 0.08% Java 0.01% C++ 6.25% Groovy 0.86% Pascal 0.01% Batchfile 0.05% JavaScript 0.13% Objective-C 0.66% Objective-C++ 0.68% Python 0.10% HTML 0.04% Swift 28.44% Dockerfile 0.02% CSS 0.01%

kotlin-native's Introduction

official project version

Kotlin/Native

Kotlin/Native is an LLVM backend for the Kotlin compiler, runtime implementation, and native code generation facility using the LLVM toolchain.

Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS or embedded targets), or where a developer is willing to produce a reasonably-sized self-contained program without the need to ship an additional execution runtime.

Prerequisites:

  • install JDK for your platform, instead of JRE. The build requires tools.jar, which is not included in JRE;
  • on macOS install Xcode 11
  • on Fedora 26+ yum install ncurses-compat-libs may be needed
  • on recent Ubuntu apt install libncurses5 is needed

To compile from sources use following steps:

First, download dependencies:

./gradlew dependencies:update

Then, build the compiler and libraries:

./gradlew bundle

To build with experimental targets support compile with -Porg.jetbrains.kotlin.native.experimentalTargets.

The build can take about an hour on a Macbook Pro. To run a shorter build with only the host compiler and libraries, run:

./gradlew dist distPlatformLibs

To include Kotlin compiler in composite build and build against it, use the kotlinProjectPath project property:

./gradlew dist -PkotlinProjectPath=path/to/kotlin/project

It's possible to include in a composite build both Kotlin compiler and Kotlin/Native Shared simultaneously.

After that, you should be able to compile your programs like this:

export PATH=./dist/bin:$PATH
kotlinc hello.kt -o hello

For an optimized compilation, use -opt:

kotlinc hello.kt -o hello -opt

For tests, use:

./gradlew backend.native:tests:run

To generate interoperability stubs, create a library definition file (refer to samples/tetris/.../sdl.def), and run the cinterop tool like this:

cinterop -def lib.def

See the provided samples and INTEROP.md for more details.

The Interop tool generates a library in the .klib library format. See LIBRARIES.md for more details on this file format.

kotlin-native's People

Contributors

svyatoslavscherbina avatar ilmat192 avatar vvlevchenko avatar olonho avatar homuroll avatar alexander-gorshenev avatar konstantinanisimov avatar dead-off avatar pavelpunegov avatar alejes avatar e5l avatar sbogolepov avatar dsavvinov avatar ilya-g avatar ddolovov avatar msink avatar eabatalov avatar matklad avatar alexanderprendota avatar knebekaizer avatar qurbonzoda avatar stefma avatar b1ggdave avatar kishmakov avatar alefas avatar romanart avatar jonnyzzz avatar udalov avatar maxmedvedev avatar sandwwraith avatar

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.