-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from flax-lang/develop
- Loading branch information
Showing
189 changed files
with
12,011 additions
and
9,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: install dependencies | ||
run: | | ||
sudo echo "deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" | sudo tee -a /etc/apt/sources.list | ||
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
sudo apt -y update | ||
sudo apt-get -o Dpkg::Options::="--force-overwrite" --allow-unauthenticated -y install -y g++-9 llvm-11 llvm-11-dev libllvm11 libmpfr-dev libmpfr6 | ||
- name: build | ||
env: | ||
LLVM_CONFIG: llvm-config-11 | ||
CC: gcc-9 | ||
CXX: g++-9 | ||
run: make -j2 build | ||
- name: jit/llvm | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape -run -backend llvm build/tester.flx | ||
- name: jit/interp | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape -run -backend interp build/tester.flx | ||
- name: compile/llvm | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape build/tester.flx && ./tester | ||
|
||
build-macos: | ||
runs-on: macOS-10.15 | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: install dependencies | ||
run: | | ||
brew install mpfr llvm pkg-config | ||
- name: build | ||
env: | ||
LLVM_CONFIG: /usr/local/opt/llvm/bin/llvm-config | ||
run: PATH="$PATH:$(pwd)/llvm/11.0.0/bin" make -j2 build | ||
- name: jit/llvm | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape -run -backend llvm build/tester.flx | ||
- name: jit/interp | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape -run -backend interp build/tester.flx | ||
- name: compile/llvm | ||
run: build/sysroot/usr/local/bin/flaxc -sysroot build/sysroot -profile --ffi-escape build/tester.flx && ./tester | ||
|
||
build-windows: | ||
runs-on: windows-2019 | ||
env: | ||
MPIR_ROOT_DIR: C:/tmp/lib/mpir | ||
MPFR_ROOT_DIR: C:/tmp/lib/mpfr | ||
LLVM_ROOT_DIR: C:/tmp/lib/llvm | ||
LIBFFI_ROOT_DIR: C:/tmp/lib/libffi | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- uses: seanmiddleditch/gha-setup-ninja@v1 | ||
- uses: seanmiddleditch/gha-setup-vsdevenv@master | ||
- uses: actions/checkout@v1 | ||
- name: cache libraries | ||
uses: actions/[email protected] | ||
id: cache-libs | ||
with: | ||
path: C:/tmp/lib | ||
key: cached-libs | ||
- name: download libraries | ||
if: steps.cache-libs.outputs.cache-hit != 'true' | ||
run: | | ||
echo "root dirs:" $LLVM_ROOT_DIR | ||
echo "extraction: C:\tmp\lib" | ||
Invoke-WebRequest 'https://github.com/flax-lang/flax/releases/download/win-build-deps/libraries.zip' -OutFile 'libs.zip' | ||
7z x -y -o"C:\tmp\lib" libs.zip | ||
- name: install meson | ||
run: pip install meson | ||
- name: build | ||
run: | | ||
meson --buildtype=release build/meson-rel | ||
ninja -C build/meson-rel | ||
- name: copy stdlib | ||
run: | | ||
New-Item -Force -Path build\sysroot\usr\local\lib\flaxlibs -ItemType Directory | ||
Copy-Item -Recurse -Force libs\* build\sysroot\usr\local\lib\flaxlibs\ | ||
- name: jit/llvm | ||
run: build\meson-rel\flaxc.exe -sysroot build\sysroot -run -backend llvm --ffi-escape build\tester.flx | ||
- name: jit/interp | ||
run: build\meson-rel\flaxc.exe -sysroot build\sysroot -run -backend interp --ffi-escape build\tester.flx | ||
- name: compile/llvm | ||
run: | | ||
build\meson-rel\flaxc.exe -sysroot build\sysroot --ffi-escape build\tester.flx | ||
.\tester.exe | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// a.flx | ||
// Copyright (c) 2020, zhiayang | ||
// Licensed under the Apache License Version 2.0. | ||
|
||
// import libc as _ | ||
export a | ||
import libc | ||
|
||
import std::io as _ | ||
|
||
// import b | ||
// import d | ||
|
||
@entry fn main() | ||
{ | ||
print("uwu\n") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// b.flx | ||
// Copyright (c) 2020, zhiayang | ||
// Licensed under the Apache License Version 2.0. | ||
|
||
export a | ||
import libc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// ultratiny.flx | ||
// Copyright (c) 2019, zhiayang | ||
// Licensed under the Apache License Version 2.0. | ||
|
||
export ultratiny | ||
|
||
// import libc as _ | ||
import a | ||
|
||
@entry fn main() | ||
{ | ||
// printf("q = %d\n", 37) | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// d.flx | ||
// Copyright (c) 2020, zhiayang | ||
// Licensed under the Apache License Version 2.0. | ||
|
||
export a | ||
import libc |
Oops, something went wrong.