Included more math functions to Windows's entrypoints
and made a cmake option (-DLLVM_LIBC_MPFR_INSTALL_PATH)
where the user can specify the install path where the MPFR
library was built so it can be linked. The try_compile was
moved to LLVMLibCCheckMPFR.cmake, so the variable that is
set after this process can retain its value in other files
of the same parent file. A direct reason for this is for
LIBC_TESTS_CAN_USE_MPFR to be true when the user specifies
MPFR's path and retain its value even after leaving the file.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/cmake/modules/LLVMLibCCheckMPFR.cmake | ||
---|---|---|
4 | The issue with it was that once set to true, if the path to MPFR was given, that value was not saved and evaluated False in libc/test/src/CMakeLists.txt and messages displayed that "WARNING: Math test...will be skipped as MPFR library is not available"; the test that needed MPFR did not ran. A way around it was to set it to the value in a cmake file separately and that variable will be carried to the subdirectorys utils and test. Hence carrying the True value in both the CMakeLists.txt in MPFRWrapper and on the one in test/src. Value was not being shared between two CMakeLists.txt siblings but they were passed from parent to child. |
libc/cmake/modules/LLVMLibCCheckMPFR.cmake | ||
---|---|---|
2 | ... where MPFR _is_ installed ... ? Also, it would be nice if you can add something about this flag to step #9 here: https://github.com/llvm/llvm-project/tree/main/libc/config/windows#readme |
[libc] Fixed the summary of LLVM_LIBC_MPFR_INSTALL_PATH and explained this option in README.md
A suggestion on the wording but good to go.
libc/config/windows/README.md | ||
---|---|---|
65 ↗ | (On Diff #362144) | You don't have line breaks in this big chunk of text! I have a suggestion wrt the wording: Some LLVM libc math unittests test correctness/accuracy against results from the [GNU MPFR library](https://www.mpfr.org/). If you want to run math tests which use MPFR, and if MPFR on your machine is not installed in the default include and linker lookup directories, then you can specify the MPFR install directory by passing an additional CMake option as follows: -DLLVM_LIBC_MPFR_INSTALL_PATH=<path/mpfr/install/dir> If the above option is specified, then `${LLVM_LIBC_MPFR_INSTALL_PATH}/include` will be added to the include directories, and `${LLVM_LIBC_MPFR_INSTALL_PATH}/lib` will be added to the linker lookup directories. NOTE: The GNU MPFR library depends on the [GNU GMP library](https://gmplib.org/). If you specify the above option, then it will be assumed that GMP is also installed in the same directory or availabe in the default paths. |
libc/config/windows/README.md | ||
---|---|---|
65 ↗ | (On Diff #362144) | I agree, the message conveys more clearly the prerequisites for this CMake option. |
can you add an extra line after this?
and also at the very end of this file