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

Friendlier CMake output and ReadMe tips #949

Merged
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ if (BUILD_LLVM_UTILS OR BUILD_TV)
find_package(LLVM REQUIRED CONFIG)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

if (NOT LLVM_ENABLE_RTTI)
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,15 @@ To run translation validation on all the LLVM unit tests for IR-level
transformations:

```
$LLVM2_BUILD/bin/llvm-lit -vv -Dopt=$ALIVE2_HOME/alive2/build/opt-alive.sh $LLVM2_HOME/llvm/test/Transforms
$LLVM2_BUILD/bin/llvm-lit -s -Dopt=$ALIVE2_HOME/alive2/build/opt-alive.sh $LLVM2_HOME/llvm/test/Transforms
```

We run this command on the main LLVM branch each day, and keep track of the results
[here](https://web.ist.utl.pt/nuno.lopes/alive2/).
[here](https://web.ist.utl.pt/nuno.lopes/alive2/). To detect unsound transformations in a local run:

```
fgrep -r "(unsound)" $ALIVE2_HOME/alive2/build/logs/
```


Running Alive2 as a Clang Plugin
Expand Down Expand Up @@ -307,11 +311,15 @@ should be the only user of this server.

Troubleshooting
--------
Some combinations of Clang and MacOS versions may give link warnings
* Check the “LLVMConfig.cmake” and “CMAKE_PREFIX_PATH” output from CMake in case of build problems. CMake may look for configuration information in old installations of LLVM, e.g., under `/opt/`, if these are not set properly.
Copy link
Member

Choose a reason for hiding this comment

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

please wrap these lines so they are readable in a text editor.
Thank you!

* Some combinations of Clang and MacOS versions may give link warnings
“-undefined dynamic_lookup may not work with chained fixups,” and
runtime errors with “symbol not found in flat namespace.” Setting
[CMAKE_OSX_DEPLOYMENT_TARGET](https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html) as a cache entry to 11.0
or less at the beginning of CMakeLists.txt may work around this.
or less at the beginning of CMakeLists.txt may work around this.
* Building for Translation Validation requires enabling `BUILD_SHARED_LIBS`. For LLVM forks not normally built with the option, this may interfere with CMake files’ use of `USEDLIBS` and `LLVMLIBS` and perhaps `dd_llvm_target`.
* Building for Translation Validation is tightly coupled to LLVM top of tree source. Building a fork with older source may require reverting to the corresponding Alive2 commit. This in turn may require experimentation with Clang versions and vendors.
* Building older source on an up-to-date machine may require adjustments. For example, the now-deleted file `scripts/rewritepass.py` depended on the deprecated Python 2; update the shebang line to `python3`.

LLVM Bugs Found by Alive2
--------
Expand Down