Skip to content

Commit f551717

Browse files
authored
Merge branch 'lcompilers:main' into feature/readme-installation
2 parents b0d74c5 + 5880e96 commit f551717

742 files changed

Lines changed: 11517 additions & 116953 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI.yml

Lines changed: 78 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v3
2626
with:
27+
submodules: true
2728
fetch-depth: 0
2829

30+
- name: Git Submodule Update
31+
shell: bash -e -l {0}
32+
run: |
33+
git submodule update --init --recursive
34+
2935
- name: Cache conda
3036
uses: actions/cache@v3
3137
env:
@@ -41,6 +47,7 @@ jobs:
4147
create-args: >-
4248
python=${{ matrix.python-version }}
4349
cmake=3.30.0
50+
nodejs=18.20.5
4451
4552
- name: Install Windows Conda Packages
4653
if: contains(matrix.os, 'windows')
@@ -50,7 +57,7 @@ jobs:
5057
- name: Install Linux / macOS Conda Packages
5158
if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
5259
shell: bash -e -l {0}
53-
run: micromamba install --freeze-installed bison=3.4 nodejs=18
60+
run: micromamba install --freeze-installed bison=3.4
5461

5562
- name: Conda info
5663
shell: bash -e -l {0}
@@ -121,8 +128,14 @@ jobs:
121128
steps:
122129
- uses: actions/checkout@v3
123130
with:
131+
submodules: true
124132
fetch-depth: 0
125133

134+
- name: Git Submodule Update
135+
shell: bash -e -l {0}
136+
run: |
137+
git submodule update --init --recursive
138+
126139
- uses: mamba-org/setup-micromamba@v1
127140
with:
128141
environment-file: ci/environment.yml
@@ -153,8 +166,8 @@ jobs:
153166
154167
./emsdk install 3.1.35
155168
./emsdk activate 3.1.35
156-
./emsdk install node-14.18.2-64bit
157-
./emsdk activate node-14.18.2-64bit
169+
./emsdk install node-18.20.3-64bit
170+
./emsdk activate node-18.20.3-64bit
158171
159172
- name: Show Emscripten and Node Info
160173
shell: bash -l {0}
@@ -181,16 +194,22 @@ jobs:
181194
source $HOME/ext/emsdk/emsdk_env.sh # Activate Emscripten
182195
which node
183196
node -v
184-
node --experimental-wasm-bigint src/lpython/tests/test_lpython.js
197+
node src/lpython/tests/test_lpython.js
185198
186199
test_pip_pkgs:
187200
name: Test PIP Installable Packages
188201
runs-on: ubuntu-latest
189202
steps:
190203
- uses: actions/checkout@v3
191204
with:
205+
submodules: true
192206
fetch-depth: 0
193207

208+
- name: Git Submodule Update
209+
shell: bash -e -l {0}
210+
run: |
211+
git submodule update --init --recursive
212+
194213
- uses: mamba-org/setup-micromamba@v1
195214
with:
196215
environment-file: ci/environment.yml
@@ -242,21 +261,27 @@ jobs:
242261
run: |
243262
python integration_tests/test_pip_import_01.py
244263
245-
- name: Test PIP Packages with LPython
246-
shell: bash -e -l {0}
247-
run: |
248-
pip_pkg_path=$(python -c "import site; print(site.getsitepackages()[0])")
249-
echo $pip_pkg_path
250-
./src/bin/lpython integration_tests/test_pip_import_01.py -I $pip_pkg_path
264+
# - name: Test PIP Packages with LPython
265+
# shell: bash -e -l {0}
266+
# run: |
267+
# pip_pkg_path=$(python -c "import site; print(site.getsitepackages()[0])")
268+
# echo $pip_pkg_path
269+
# ./src/bin/lpython integration_tests/test_pip_import_01.py -I $pip_pkg_path
251270

252271
debug:
253272
name: Check Debug build
254273
runs-on: ubuntu-latest
255274
steps:
256275
- uses: actions/checkout@v3
257276
with:
277+
submodules: true
258278
fetch-depth: 0
259279

280+
- name: Git Submodule Update
281+
shell: bash -e -l {0}
282+
run: |
283+
git submodule update --init --recursive
284+
260285
- uses: mamba-org/setup-micromamba@v1
261286
with:
262287
environment-file: ci/environment.yml
@@ -302,8 +327,14 @@ jobs:
302327
steps:
303328
- uses: actions/checkout@v3
304329
with:
330+
submodules: true
305331
fetch-depth: 0
306332

333+
- name: Git Submodule Update
334+
shell: bash -e -l {0}
335+
run: |
336+
git submodule update --init --recursive
337+
307338
- uses: mamba-org/setup-micromamba@v1
308339
with:
309340
environment-file: ci/environment.yml
@@ -350,8 +381,14 @@ jobs:
350381
steps:
351382
- uses: actions/checkout@v3
352383
with:
384+
submodules: true
353385
fetch-depth: 0
354386

387+
- name: Git Submodule Update
388+
shell: bash -e -l {0}
389+
run: |
390+
git submodule update --init --recursive
391+
355392
- uses: mamba-org/setup-micromamba@v1
356393
with:
357394
environment-file: ci/environment.yml
@@ -394,8 +431,14 @@ jobs:
394431
steps:
395432
- uses: actions/checkout@v3
396433
with:
434+
submodules: true
397435
fetch-depth: 0
398436

437+
- name: Git Submodule Update
438+
shell: bash -e -l {0}
439+
run: |
440+
git submodule update --init --recursive
441+
399442
- uses: mamba-org/setup-micromamba@v1
400443
with:
401444
environment-file: ci/environment.yml
@@ -443,8 +486,14 @@ jobs:
443486
steps:
444487
- uses: actions/checkout@v3
445488
with:
489+
submodules: true
446490
fetch-depth: 0
447491

492+
- name: Git Submodule Update
493+
shell: bash -e -l {0}
494+
run: |
495+
git submodule update --init --recursive
496+
448497
- uses: mamba-org/setup-micromamba@v1
449498
with:
450499
environment-name: lp
@@ -506,8 +555,14 @@ jobs:
506555
steps:
507556
- uses: actions/checkout@v4
508557
with:
558+
submodules: true
509559
fetch-depth: 0
510560

561+
- name: Git Submodule Update
562+
shell: bash -e -l {0}
563+
run: |
564+
git submodule update --init --recursive
565+
511566
- uses: mamba-org/setup-micromamba@v1.8.0
512567
with:
513568
environment-file: ci/environment_linux_llvm.yml
@@ -551,8 +606,14 @@ jobs:
551606
steps:
552607
- uses: actions/checkout@v3
553608
with:
609+
submodules: true
554610
fetch-depth: 0
555611

612+
- name: Git Submodule Update
613+
shell: bash -e -l {0}
614+
run: |
615+
git submodule update --init --recursive
616+
556617
- uses: mamba-org/setup-micromamba@v1
557618
with:
558619
environment-file: ci/environment.yml
@@ -593,8 +654,14 @@ jobs:
593654
steps:
594655
- uses: actions/checkout@v4
595656
with:
657+
submodules: true
596658
fetch-depth: 0
597659

660+
- name: Git Submodule Update
661+
shell: bash -e -l {0}
662+
run: |
663+
git submodule update --init --recursive
664+
598665
- uses: mamba-org/setup-micromamba@v1
599666
with:
600667
environment-file: ci/environment.yml
@@ -605,7 +672,7 @@ jobs:
605672
shell: bash -e -l {0}
606673
run: |
607674
./build0.sh
608-
lpython_version=$(<version)
675+
lpython_version=$(<lp_version)
609676
ci/create_source_tarball.sh $lpython_version
610677
611678
- name: Upload Tarball to Release

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ CPackConfig.cmake
4040
CPackSourceConfig.cmake
4141
_CPack_Packages
4242
/CMakeSettings.json
43-
src/libasr/libasr.a.*
4443

4544
## libraries
4645
*.a
@@ -51,15 +50,11 @@ src/libasr/libasr.a.*
5150
*.dSYM
5251

5352
## Generated files
54-
version
53+
lp_version
5554
lpython/ast/ast.py
5655
lpython/asr/asr.py
5756
src/lpython/ast.h
5857
src/lpython/asr.h
59-
src/libasr/asr.h
60-
src/libasr/wasm_visitor.h
61-
src/libasr/pass/intrinsic_function_registry_util.h
62-
src/libasr/config.h
6358
share/jupyter/kernels/fortran/kernel.json
6459
share/jupyter/kernels/lpython/kernel.json
6560
src/runtime/*.o.empty.c

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "libasr"]
2+
path = libasr
3+
url = https://github.com/lfortran/lfortran.git

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (LPYTHON_BUILD_ALL)
77
execute_process(COMMAND "build0.sh")
88
endif()
99

10-
file(STRINGS "version" LFORTRAN_VERSION)
10+
file(STRINGS "lp_version" LFORTRAN_VERSION)
1111

1212
project(lpython LANGUAGES C CXX)
1313

build0.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ ci/version.sh
88
# Generate a Python AST from Python.asdl (Python)
99
python grammar/asdl_py.py
1010
# Generate a Python AST from Python.asdl (C++)
11-
python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
11+
python libasr/src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
1212
# Generate a Fortran ASR from ASR.asdl (C++)
13-
python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
14-
# Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++)
15-
python src/libasr/wasm_instructions_visitor.py
13+
python libasr/src/libasr/asdl_cpp.py libasr/src/libasr/ASR.asdl libasr/src/libasr/asr.h
14+
# Generate a wasm_visitor.h from libasr/src/libasr/wasm_instructions.txt (C++)
15+
python libasr/src/libasr/wasm_instructions_visitor.py
1616
# Generate the intrinsic_function_registry_util.h (C++)
17-
python src/libasr/intrinsic_func_registry_util_gen.py
17+
python libasr/src/libasr/intrinsic_func_registry_util_gen.py
1818

1919
# Generate the tokenizer and parser
2020
(cd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp)

build0_win.xsh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ echo @(version) > version
77
# Generate a Python AST from Python.asdl (Python)
88
python grammar/asdl_py.py
99
# Generate a Python AST from Python.asdl (C++)
10-
python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
10+
python libasr/src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
1111
# Generate a Fortran ASR from ASR.asdl (C++)
12-
python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
13-
# Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++)
14-
python src/libasr/wasm_instructions_visitor.py
12+
python libasr/src/libasr/asdl_cpp.py libasr/src/libasr/ASR.asdl libasr/src/libasr/asr.h
13+
# Generate a wasm_visitor.h from libasr/src/libasr/wasm_instructions.txt (C++)
14+
python libasr/src/libasr/wasm_instructions_visitor.py
1515
# Generate the intrinsic_function_registry_util.h (C++)
16-
python src/libasr/intrinsic_func_registry_util_gen.py
16+
python libasr/src/libasr/intrinsic_func_registry_util_gen.py
1717

1818
# Generate the tokenizer and parser
1919
pushd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd

ci/build.xsh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ llvm-config --components
2727
bash ci/version.sh
2828

2929
# Generate a Fortran ASR from ASR.asdl (C++)
30-
python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
30+
python libasr/src/libasr/asdl_cpp.py libasr/src/libasr/ASR.asdl libasr/src/libasr/asr.h
3131
# Generate a Python AST from Python.asdl (C++)
32-
python src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
32+
python libasr/src/libasr/asdl_cpp.py grammar/Python.asdl src/lpython/python_ast.h
3333
# Generate a Python AST from Python.asdl (Python)
3434
python grammar/asdl_py.py
35-
# Generate a wasm_visitor.h from src/libasr/wasm_instructions.txt (C++)
36-
python src/libasr/wasm_instructions_visitor.py
35+
# Generate a wasm_visitor.h from libasr/src/libasr/wasm_instructions.txt (C++)
36+
python libasr/src/libasr/wasm_instructions_visitor.py
3737
# Generate the intrinsic_function_registry_util.h (C++)
38-
python src/libasr/intrinsic_func_registry_util_gen.py
38+
python libasr/src/libasr/intrinsic_func_registry_util_gen.py
3939

4040
# Generate the tokenizer and parser
4141
pushd src/lpython/parser && re2c -W -b tokenizer.re -o tokenizer.cpp && popd
4242
pushd src/lpython/parser && bison -Wall -d -r all parser.yy && popd
4343

44-
$lpython_version=$(cat version).strip()
44+
$lpython_version=$(cat lp_version).strip()
4545
$dest="lpython-" + $lpython_version
4646
bash ci/create_source_tarball0.sh
4747
tar xzf dist/lpython-$lpython_version.tar.gz

ci/create_source_tarball0.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ cmake -E copy_directory src $dest/src
99
cmake -E copy_directory share $dest/share
1010
cmake -E copy_directory cmake $dest/cmake
1111
cmake -E copy_directory examples $dest/examples
12+
cmake -E copy_directory libasr/src/libasr $dest/libasr/src/libasr
1213

1314
# Copy Files:
14-
cmake -E copy CMakeLists.txt README.md LICENSE version $dest
15+
cmake -E copy CMakeLists.txt README.md LICENSE lp_version $dest
1516

1617
# Create the tarball
1718
cmake -E make_directory dist

ci/test.xsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ src/bin/lpython -o expr2 expr2.o
1313
# Test the new Python frontend, manually for now:
1414
src/bin/lpython --show-ast tests/doconcurrentloop_01.py
1515
src/bin/lpython --show-asr tests/doconcurrentloop_01.py
16-
src/bin/lpython --show-cpp tests/doconcurrentloop_01.py
16+
# src/bin/lpython --show-cpp tests/doconcurrentloop_01.py
1717

1818
if $WIN == "1":
1919
python run_tests.py --skip-run-with-dbg --no-color

ci/version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ set -ex
1515

1616
version=$(git describe --tags --dirty)
1717
version="${version:1}"
18-
echo $version > version
18+
echo $version > lp_version

0 commit comments

Comments
 (0)