Commit 7e06b6a8 authored by Javad Ebrahimian Amiri's avatar Javad Ebrahimian Amiri

Merge remote-tracking branch 'origin/rtmu-dev' into rtmu-dev

parents fc8c0773 8d9f5910
......@@ -9,15 +9,14 @@ before_script:
- export ZEBU_BUILD=release
- export CARGO_HOME=.cargo
- export CC=clang
- export CXX=clang++
- export RUST_TEST_THREADS=1
- export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD:$LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
- source /home/gitlab-runner/ci/bin/activate
build:
stage: build
script:
- rustup show
- rustup run 1.30.1-x86_64-unknown-linux-gnu rustc --version
- rustup run 1.30.1-x86_64-unknown-linux-gnu cargo clean
- time rustup run 1.30.1-x86_64-unknown-linux-gnu cargo test -j6 --release --no-run --color=always
artifacts:
......@@ -51,8 +50,12 @@ test:cargo:runtime:
cd tests/test_muc
git clone https://gitlab.anu.edu.au/mu/mu-tool-compiler
cd mu-tool-compiler
export ANTLR_HOME=/home/gitlab-runner/antlr4/runtime/Cpp/run
mkdir lib
ln -s $MU_ZEBU/target/release/libmu.so lib/
cp -r $ANTLR_HOME/usr/local/lib/* $PWD/lib/
cp -r $MU_ZEBU/target/release/deps/* $PWD/lib/
export CC=clang
export CXX=clang++
make
cd ..
......@@ -61,46 +64,39 @@ testmuc:test_simple:
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_simple.py -v
allow_failure: true
testmuc:test_swapstack:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_thread_and_stack.py -v
allow_failure: true
testmuc:test_cmp:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_cmp.py -v
allow_failure: true
testmuc:test_binop:
stage: test
script:
- *build_muc
- LD_LIBRARY_PATH=mu-tool-compiler/lib/ MUC=mu-tool-compiler/muc python2 -m pytest test_binop.py -v
allow_failure: true
testjit:milestones:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
allow_failure: true
testjit:binops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_binops.py -v --color=yes
allow_failure: true
testjit:cmpops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_cmpops.py -v --color=yes
allow_failure: true
testjit:controlflow:
stage: test
......@@ -109,37 +105,31 @@ testjit:controlflow:
# as a C source file is expected in a relative path to current working directory
- cd tests/test_jit
- RUST_BACKTRACE=1 pytest test_controlflow.py -v --color=yes
allow_failure: true
testjit:convops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_convops.py -v --color=yes
allow_failure: true
testjit:double:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_double.py -v --color=yes
allow_failure: true
testjit:memops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_memops.py -v --color=yes
allow_failure: true
testjit:milestones:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_milestones.py -v --color=yes
allow_failure: true
testjit:otherops:
stage: test
script:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v --color=yes
allow_failure: true
testjit:rpython:
stage: test
......@@ -151,7 +141,6 @@ testjit:rpython:
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v --color=yes
allow_failure: true
testjit:som:
stage: test
......@@ -166,7 +155,6 @@ testjit:som:
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v --color=yes
allow_failure: true
mubench:
stage: mubench
......
......@@ -29,11 +29,16 @@ are not compliant to Mu spec.
## Building
You will need:
* rust version 1.20 (f3d6973f4 2017-08-27)
* rust version 1.28.0 or newer (2018-08-02)
* clang 4.0+
* cmake 3.8+ (we do not depend on cmake, but some Rust crates use it)
* internet connection (as Rust will download dependencies)
We have tested these specific versions:
* rust `stable-2018-11-08` and `nightly-2019-02-15`
* clang `6.0.0`
* cmake `3.10.2`
To build Zebu with release build,
```
cd path/to/zebu
......@@ -97,6 +102,7 @@ Running pytest (you will need Python 2.7 with pytest module)
export SPAWN_PROC=1
python2 -m pytest test*.py -v
```
* We only tested python `2.7.15-rc1` successfully.
## Using Zebu for your language implementation
......
......@@ -18,7 +18,7 @@ export MU_LOG_LEVEL=none
export RUST_TEST_THREADS=1
export RUST_BACKTRACE=0
export PYTHONPATH="$MU_ZEBU/tests/test_jit/mu-client-pypy/:$MU_ZEBU/tests/test_jit/RPySOM/src"
export LD_LIBRARY_PATH="$MU_ZEBU/target/$ZEBU_BUILD:$MU_ZEBU/tests/test_jit/:$MU_ZEBU/tests/test_jit/emit/:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$MU_ZEBU/target/$ZEBU_BUILD/deps/:$MU_ZEBU/tests/test_jit/:$MU_ZEBU/tests/test_jit/emit/:$LD_LIBRARY_PATH"
export ZEBU_BUILD=release
rm -rf $MU_ZEBU/emit
......
#!/bin/sh
export MU_ZEBU=$PWD
export ZEBU_BUILD=release
export CARGO_HOME=~/.cargo
export CC=clang
export CXX=clang++
export RUST_TEST_THREADS=1
export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps/:$LD_LIBRARY_PATH
......@@ -74,6 +74,9 @@ pub fn exec_path_nocheck(executable: PathBuf) -> Output {
/// panics if this command does not finish normally
fn exec_cmd(cmd: Command) -> Output {
let output = exec_cmd_nocheck(cmd);
if !output.status.success() {
println!("{}", String::from_utf8(output.stderr.clone()).unwrap());
}
assert!(output.status.success());
output
}
......
#!/usr/bin/env bash
export MU_ZEBU=$PWD/../../../mu-impl-fast/
export ZEBU_BUILD=release
export DYLD_LIBRARY_PATH=$PWD
export LD_LIBRARY_PATH=$MU_ZEBU/target/$ZEBU_BUILD/deps:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./emit:$LD_LIBRARY_PATH
export usess=none
#export PYTHONPATH=mu-client-pypy:RPySOM/src
export RPYSOM=RPySOM
export CC=clang
export SPAWN_PROC=1
export RUST_BACKTRACE=1
export RUST_TEST_THREADS=1
============================= test session starts ==============================
platform linux2 -- Python 2.7.15rc1, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 -- /usr/bin/python2
cachedir: .cache
rootdir: /home/javadamiri/myFiles/Src/mu-impl-fast/tests/test_jit, inifile:
collecting ... collected 30 items
test_rpython.py::test_throw <- util.py PASSED
test_rpython.py::test_find_min <- util.py PASSED
test_rpython.py::test_exception_stack_unwind <- util.py PASSED
test_rpython.py::test_partition_in_quicksort <- util.py PASSED
test_rpython.py::test_dtoa <- util.py PASSED
test_rpython.py::test_rpytarget_print_argv <- util.py PASSED
test_rpython.py::test_rpytarget_richards_measure_time <- util.py PASSED
test_rpython.py::test_float <- util.py PASSED
test_rpython.py::test_add <- util.py PASSED
test_rpython.py::test_linkedlist_reversal <- util.py PASSED
test_rpython.py::test_quicksort <- util.py PASSED
test_rpython.py::test_open_file_as_stream <- util.py PASSED
test_rpython.py::test_rpython_main <- util.py PASSED
test_rpython.py::test_nbody <- util.py PASSED
test_rpython.py::test_rpython_time_diff <- util.py PASSED
test_rpython.py::test_new_cmpeq <- util.py PASSED
test_rpython.py::test_rpython_print_number <- util.py PASSED
test_rpython.py::test_rpytarget_richards0 <- util.py PASSED
test_rpython.py::test_rpytarget_sha1sum <- util.py PASSED
test_rpython.py::test_new <- util.py PASSED
test_rpython.py::test_vec3prod <- util.py PASSED
test_rpython.py::test_make_boot_image_simple <- util.py PASSED
test_rpython.py::test_threadtran_fib <- util.py PASSED
test_rpython.py::test_rpython_rethrow <- util.py PASSED
test_rpython.py::test_rpython_helloworld <- util.py PASSED
test_rpython.py::test_arraysum <- util.py PASSED
test_rpython.py::test_rpython_print_time <- util.py PASSED
test_rpython.py::test_rpytarget_testdicts <- util.py PASSED
test_rpython.py::test_rpython_print_fmt <- util.py PASSED
test_rpython.py::test_linked_list <- util.py PASSED
========================= 30 passed in 190.17 seconds ==========================
......@@ -36,7 +36,7 @@ elif sys.platform.startswith('linux'):
else:
libext = '.dll'
libmu_build = os.environ.get('ZEBU_BUILD', 'debug')
libmu_build = os.environ.get('ZEBU_BUILD', 'debug') + '/deps'
libmu_dir_path = proj_dir.join('target', libmu_build)
libmu_dylib_path = proj_dir.join('target', libmu_build, 'libmu' + libext)
......
......@@ -20,7 +20,7 @@ emit = os.environ.get('MU_EMIT_DIR', 'emit'); #type: str
libext = '.dylib' if sys.platform.startswith('darwin') else \
'.so' if sys.platform.startswith('linux') else sys.exit("Unsupported platform"); #type: str
libmu = os.path.join(os.environ.get('MU_ZEBU', os.path.dirname(os.path.dirname(os.getcwd()))),
'target', os.environ.get('ZEBU_BUILD', 'debug'),
'target', os.environ.get('ZEBU_BUILD', 'debug'), 'deps',
"libmu" + libext); #type: str
prelude = """
/*--------------------------------------------------------*/
......@@ -54,8 +54,14 @@ def execute_muc(bundle, name, primordial=None): # type: (str, str, Optional[str]
muc_proc = subprocess.Popen([muc, "-r"]
+ (["-f", primordial] if primordial is not None else [])
+ ["/dev/stdin", get_output_file(name)],
stdin = subprocess.PIPE); #type: subprocess.Popen
muc_proc.communicate(bundle); # Send the bundle to muc
stdin = subprocess.PIPE,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE); #type: subprocess.Popen
stdoutdata, stderrdata = muc_proc.communicate(bundle); # Send the bundle to muc
print("errors:\n\n")
print(stderrdata);
print("outputs:\n\n")
print(stdoutdata);
assert (muc_proc.returncode == 0); # Check that muc worked
def compile_bundle(bundle, name, main = None): # type: (str, str, Optional[str]) -> None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment