banach-space / llvm-tutor

A collection of out-of-tree LLVM passes for teaching and learning
MIT License
2.95k stars 393 forks source link

AttributeError: 'NoneType' object has no attribute 'use_lit_shell' #97

Open sunheyi6 opened 1 year ago

sunheyi6 commented 1 year ago

image

@banach-space I followed the instructions in the README and proceeded with the operation. First,

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo apt-get update
sudo apt-get install -y llvm-16 llvm-16-dev llvm-16-tools clang-16

Second,

cd /root/llvm-tutor/build/
cmake -DLT_LLVM_INSTALL_DIR=/usr/lib/llvm-16 /root/llvm-tutor
make

Third

root@LAPTOP-OJLO0M82:~/llvm-tutor/build# ls
CMakeCache.txt  CMakeFiles  Makefile  cmake_install.cmake  input_for_hello.ll
root@LAPTOP-OJLO0M82:~/llvm-tutor/build# lit --version
lit 16.0.6
root@LAPTOP-OJLO0M82:~/llvm-tutor/build# lit ../test
lit: /usr/local/lib/python3.10/dist-packages/lit/TestingConfig.py:140: fatal: unable to parse config file '/root/llvm-tutor/test/lit.cfg.py', traceback: Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/lit/TestingConfig.py", line 129, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/root/llvm-tutor/test/lit.cfg.py", line 22, in <module>
    config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
AttributeError: 'NoneType' object has no attribute 'use_lit_shell'
banach-space commented 1 year ago

That's not what the README says:

lit ../test

Please use this instead:

$ lit <build_dir>/test

where "" is where you build all of llvm-tutor.

-Andrzej