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

Rename --ast-dump, --asr-dump to --show-ast, --show-asr #55

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

Shaikh-Ubaid
Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid commented Jan 7, 2024

fixes #34

@@ -0,0 +1,3 @@
LCOMPILERS_ASSERT failed: $DIR/src/libasr/../libasr/asr.h
function down_cast(), line number 40 at
f != nullptr
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone help me update the reference tests, please? I attempted installing ubuntu 22.04 and 20.04 in a virtual machine, so I could install mamba in it and update the references, but none of the ubuntu installations work for me.

@Shaikh-Ubaid
Copy link
Collaborator Author

This is ready, but I need help in updating the references.

@Shaikh-Ubaid
Copy link
Collaborator Author

I attemped another Ubuntu installation and this time Ubuntu works. I installed mamba (or miniforge) inside it. Currently it fails to build the project:

(lc) ubaid@ubaid-QEMU-Virtual-Machine:~/Desktop/lc$ ./build.sh 
+ python src/libasr/asdl_cpp.py src/libasr/ASR.asdl src/libasr/asr.h
+ python src/libasr/wasm_instructions_visitor.py
/home/ubaid/Desktop/lc/src/libasr/wasm_instructions_visitor.py:174: SyntaxWarning: invalid escape sequence '\.'
  splitted_name = re.split("[\._]", func)
Assuming default values of wasm_instructions.txt and wasm_visitor.h
+ cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_LLVM=yes -DCMAKE_INSTALL_PREFIX=/home/ubaid/miniforge3/envs/lc .
-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/ubaid/miniforge3/envs/lc/bin/aarch64-conda-linux-gnu-cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/ubaid/miniforge3/envs/lc/bin/aarch64-conda-linux-gnu-c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /home/ubaid/miniforge3/envs/lc/lib/libz.so (found version "1.2.13")  
-- Found zstd: /home/ubaid/miniforge3/envs/lc/lib/libzstd.so  
-- Found LibXml2: /home/ubaid/miniforge3/envs/lc/lib/libxml2.so (found version "2.12.3") 
-- Found LLVM 16.0.6
-- Using LLVMConfig.cmake in: /home/ubaid/miniforge3/envs/lc/lib/cmake/llvm
-- Found clang: /home/ubaid/miniforge3/envs/lc/lib/libclangFrontendTool.a;/home/ubaid/miniforge3/envs/lc/lib/libclangCodeGen.a;/home/ubaid/miniforge3/envs/lc/lib/libclangFrontend.a;/home/ubaid/miniforge3/envs/lc/lib/libclangDriver.a;/home/ubaid/miniforge3/envs/lc/lib/libclangSerialization.a;/home/ubaid/miniforge3/envs/lc/lib/libclangSema.a;/home/ubaid/miniforge3/envs/lc/lib/libclangStaticAnalyzerFrontend.a;/home/ubaid/miniforge3/envs/lc/lib/libclangStaticAnalyzerCheckers.a;/home/ubaid/miniforge3/envs/lc/lib/libclangStaticAnalyzerCore.a;/home/ubaid/miniforge3/envs/lc/lib/libclangAnalysis.a;/home/ubaid/miniforge3/envs/lc/lib/libclangASTMatchers.a;/home/ubaid/miniforge3/envs/lc/lib/libclangCrossTU.a;/home/ubaid/miniforge3/envs/lc/lib/libclangAST.a;/home/ubaid/miniforge3/envs/lc/lib/libclangParse.a;/home/ubaid/miniforge3/envs/lc/lib/libclangSema.a;/home/ubaid/miniforge3/envs/lc/lib/libclangBasic.a;/home/ubaid/miniforge3/envs/lc/lib/libclangEdit.a;/home/ubaid/miniforge3/envs/lc/lib/libclangLex.a;/home/ubaid/miniforge3/envs/lc/lib/libclangARCMigrate.a;/home/ubaid/miniforge3/envs/lc/lib/libclangRewriteFrontend.a;/home/ubaid/miniforge3/envs/lc/lib/libclangRewrite.a;/home/ubaid/miniforge3/envs/lc/lib/libclangIndex.a;/home/ubaid/miniforge3/envs/lc/lib/libclangToolingCore.a;/home/ubaid/miniforge3/envs/lc/lib/libclangToolingSyntax.a;/home/ubaid/miniforge3/envs/lc/lib/libclangTooling.a;/home/ubaid/miniforge3/envs/lc/lib/libclangExtractAPI.a;/home/ubaid/miniforge3/envs/lc/lib/libclangSupport.a (Required is at least version "15") 


Configuration results
---------------------
C compiler      : /home/ubaid/miniforge3/envs/lc/bin/aarch64-conda-linux-gnu-cc
C++ compiler    : /home/ubaid/miniforge3/envs/lc/bin/aarch64-conda-linux-gnu-c++
Build type: Debug
C compiler flags      : -g
C++ compiler flags    : -g
Installation prefix: /home/ubaid/miniforge3/envs/lc
WITH_LLVM: yes
WITH_TARGET_AARCH64: yes
WITH_TARGET_X86: no
WITH_TARGET_WASM: no
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ubaid/Desktop/lc
+ cmake --build . -j16 --target install
[  1%] Building C object src/runtime/legacy/CMakeFiles/lc_runtime_static.dir/__/__/libasr/runtime/lfortran_intrinsics.c.o
[  2%] Building C object src/runtime/legacy/CMakeFiles/lc_runtime.dir/__/__/libasr/runtime/lfortran_intrinsics.c.o
[  4%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_cpp.cpp.o
[  5%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_julia.cpp.o
[  6%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_c.cpp.o
[  8%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_fortran.cpp.o
[  9%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_py.cpp.o
[ 11%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/x86_assembler.cpp.o
[ 12%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_x86.cpp.o
[ 13%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/asr_to_wasm.cpp.o
[ 15%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_wat.cpp.o
[ 16%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_x86.cpp.o
[ 18%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/nested_vars.cpp.o
[ 19%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_utils.cpp.o
[ 20%] Building CXX object src/libasr/CMakeFiles/asr.dir/codegen/wasm_to_x64.cpp.o
[ 22%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/where.cpp.o
[ 23%] Linking C shared library ../liblc_runtime.so
[ 23%] Built target lc_runtime
[ 25%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/param_to_const.cpp.o
[ 26%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/do_loops.cpp.o
[ 27%] Linking C static library ../liblc_runtime_static.a
[ 27%] Built target lc_runtime_static
[ 29%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/for_all.cpp.o
[ 30%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/select_case.cpp.o
[ 31%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/global_stmts.cpp.o
[ 33%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/init_expr.cpp.o
[ 34%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/implied_do_loops.cpp.o
[ 36%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/array_op.cpp.o
[ 37%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/subroutine_from_function.cpp.o
[ 38%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/transform_optional_argument_functions.cpp.o
[ 40%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/class_constructor.cpp.o
[ 41%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/arr_slice.cpp.o
[ 43%] Building CXX object src/libasr/CMakeFiles/asr.dir/pass/print_arr.cpp.o
{standard input}: Assembler messages:
{standard input}:72491: Warning: end of file not at end of a line; newline inserted
{standard input}:73247: Error: unknown pseudo-op: `.l'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
aarch64-conda-linux-gnu-c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [src/libasr/CMakeFiles/asr.dir/build.make:76: src/libasr/CMakeFiles/asr.dir/codegen/asr_to_cpp.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:332: src/libasr/CMakeFiles/asr.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
(lc) ubaid@ubaid-QEMU-Virtual-Machine:~/Desktop/lc$ 

@certik
Copy link
Contributor

certik commented Jan 7, 2024

It seems your Qemu installation is incorrect and the compilers can't compile for your architecture. You need to install Ubuntu in such a way so that it isn't corrupted.

@Shaikh-Ubaid
Copy link
Collaborator Author

Ready.

@certik certik merged commit 9c855f9 into lcompilers:main Jan 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename --ast/r-dump to --show-ast/r
2 participants