From 4b58f7cd85e403de571755cdfa93b05696294c87 Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 26 Mar 2025 23:17:47 +0530 Subject: [PATCH 1/2] enh: add LFortran as submodule with sparse checkout for src/libasr --- .gitmodules | 3 +++ lfortran | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 lfortran diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..77c873ae5a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lfortran"] + path = lfortran + url = https://github.com/lfortran/lfortran.git diff --git a/lfortran b/lfortran new file mode 160000 index 0000000000..40d6271d9f --- /dev/null +++ b/lfortran @@ -0,0 +1 @@ +Subproject commit 40d6271d9ff3a19e0903a351ea448169e14eac56 From df5fbf32ea966ffb70872bdf02fd7e9a79dd10ef Mon Sep 17 00:00:00 2001 From: Pranavchiku Date: Wed, 26 Mar 2025 23:27:29 +0530 Subject: [PATCH 2/2] enh: setup build0.sh and src/CMakelists.txt --- build0.sh | 8 ++++---- src/CMakeLists.txt | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build0.sh b/build0.sh index a69126a45e..c15e44777a 100755 --- a/build0.sh +++ b/build0.sh @@ -10,11 +10,11 @@ python grammar/asdl_py.py # Generate a Python AST from Python.asdl (C++) python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h # Generate a Fortran ASR from ASR.asdl (C++) -python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h -# Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++) -python src/libasr/wasm_instructions_visitor.py +python lfortran/src/libasr/asdl_cpp.py lfortran/src/libasr/ASR.asdl lfortran/src/libasr/asr.h +# Generate a wasm_visitor.h from lfortran/src/libasr/wasm_instructions.txt (C++) +python lfortran/src/libasr/wasm_instructions_visitor.py # Generate the intrinsic_function_registry_util.h (C++) -python src/libasr/intrinsic_func_registry_util_gen.py +python lfortran/src/libasr/intrinsic_func_registry_util_gen.py # Generate the tokenizer and parser (cd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 061b942762..4d5fff6c46 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,5 @@ -add_subdirectory(libasr) +# add_subdirectory(libasr) +add_subdirectory(${CMAKE_SOURCE_DIR}/lfortran/src/libasr ${CMAKE_BINARY_DIR}/libasr) add_subdirectory(tests) add_subdirectory(lpython) add_subdirectory(bin)