Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate kompile and llvm-kompile #119

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
simple-tests:
runs-on: [self-hosted, linux, normal]
name: 'Simple Tests'
timeout-minutes: 30
timeout-minutes: 40
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
runs-on: [self-hosted, linux, normal]
name: 'Custom Contract Tests'
needs: [feature-tests]
timeout-minutes: 30
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

.PHONY: all clean deps wasm-deps \
build build-llvm build-haskell \
plugin-deps libff libcryptopp libsecp256k1 \
plugin-deps libff libcryptopp libsecp256k1 \
elrond-clean-sources elrond-loaded \
test unittest-python mandos-test test-elrond-contracts \
test-elrond-adder test-elrond-crowdfunding-esdt \
Expand Down Expand Up @@ -62,6 +62,9 @@ all: build
clean:
rm -rf $(BUILD_DIR)

clean-defn:
rm -rf $(DEFN_DIR)

# Non-K Dependencies
# ------------------

Expand Down Expand Up @@ -110,7 +113,9 @@ $(libsecp256k1_out): $(PLUGIN_SUBMODULE)/deps/secp256k1/autogen.sh
&& $(MAKE) \
&& $(MAKE) install

plugin-deps: libff libcryptopp libsecp256k1
PLUGIN_DEPS := $(libff_out) $(libcryptopp_out) $(libsecp256k1_out)

plugin-deps: $(PLUGIN_DEPS)

# Build Dependencies (K Submodule)
# --------------------------------
Expand All @@ -135,7 +140,7 @@ endif
LLVM_KOMPILE_OPTS := -L$(LOCAL_LIB) \
-I$(LOCAL_INCLUDE) \
-I/usr/include \
$(PLUGIN_SUBMODULE)/plugin-c/plugin_util.cpp \
$(PLUGIN_SUBMODULE)/plugin-c/plugin_util.cpp \
$(PLUGIN_SUBMODULE)/plugin-c/crypto.cpp \
$(PLUGIN_SUBMODULE)/plugin-c/blake2.cpp \
-g -std=c++17 -lff -lcryptopp -lsecp256k1 \
Expand Down Expand Up @@ -169,15 +174,19 @@ llvm_kompiled := $(llvm_dir)/mandos-kompiled/interpreter

build-llvm: $(llvm_kompiled)

$(llvm_kompiled): $(ELROND_FILES_KWASM_DIR) $(PLUGIN_FILES_KWASM_DIR) plugin-deps
$(llvm_kompiled): $(ELROND_FILES_KWASM_DIR) $(PLUGIN_FILES_KWASM_DIR) $(PLUGIN_DEPS)
$(KWASM_MAKE) build-llvm \
DEFN_DIR=../../$(DEFN_DIR)/$(SUBDEFN) \
llvm_main_module=$(MAIN_MODULE) \
llvm_syntax_module=$(MAIN_SYNTAX_MODULE) \
llvm_main_file=$(MAIN_DEFN_FILE) \
EXTRA_SOURCE_FILES="$(EXTRA_SOURCES)" \
KOMPILE_OPTS="$(KOMPILE_OPTS)" \
LLVM_KOMPILE_OPTS="$(LLVM_KOMPILE_OPTS)"
KOMPILE_OPTS="$(KOMPILE_OPTS) --no-llvm-kompile"

llvm-kompile $(llvm_dir)/mandos-kompiled/definition.kore \
$(llvm_dir)/mandos-kompiled/dt main \
-- -o $(llvm_dir)/mandos-kompiled/interpreter \
$(LLVM_KOMPILE_OPTS)

$(KWASM_SUBMODULE)/%.md: %.md
cp $< $@
Expand Down