Skip to content

fix the enzyme to work again with rust and llvm 20 #2248

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

Merged
merged 1 commit into from
Feb 21, 2025
Merged

Conversation

ZuseZ4
Copy link
Collaborator

@ZuseZ4 ZuseZ4 commented Feb 20, 2025

@wsmoses While trying to remove the plugin dependency I ran into this issue.

running: cd "/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build" && CMAKE_PREFIX_PATH="" DESTDIR="" LLVM_CONFIG_REAL="/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-config" "cmake" "/home/manuel/prog/rust-new/src/tools/enzyme/enzyme/" "-G" "Ninja" "-DCMAKE_INSTALL_MESSAGE=LAZY" "-DCMAKE_C_COMPILER=cc" "-DCMAKE_CXX_COMPILER=c++" "-DCMAKE_ASM_COMPILER=cc" "-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_SHARED_LINKER_FLAGS=" "-DCMAKE_MODULE_LINKER_FLAGS=" "-DCMAKE_EXE_LINKER_FLAGS=" "-DLLVM_ENABLE_ASSERTIONS=ON" "-DENZYME_EXTERNAL_SHARED_LIB=ON" "-DENZYME_RUNPASS=ON" "-DENZYME_CLANG=OFF" "-DLLVM_DIR=/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm" "-DENZYME_CLANG=OFF" "-DCMAKE_INSTALL_PREFIX=/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_BUILD_TYPE=Release"
LLVM_SHLIBEXT=.so
LLVM ABS DIR /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/lib/cmake/llvm
CMAKE_PREFIX_PATH 
found llvm lit /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build/lit
LLVM dir /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/lib/cmake/llvm
clang dir 
mlir dir 
found Clang 0
found MLIR 0
LLVM_INSTALL_PREFIX: /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm
LLVM_INCLUDE_DIRS: /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/include
found LLVM definitions -D_GNU_SOURCE -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
found LLVM version 20
first llvm include directory/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/include
MPFR lib: MPFR_LIB_PATH-NOTFOUND
MPFR header: 
-- Configuring done (0.0s)

// <Warnings>

-- Generating done (0.0s)
-- Build files have been written to: /home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build
running: cd "/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build" && DESTDIR="" LLVM_CONFIG_REAL="/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/bin/llvm-config" "cmake" "--build" "." "--target" "install" "--config" "Release" "--" "-j" "16"
[0/2] Re-checking globbed directories...
[1/25] Building CXX object Enzyme/CMakeFiles/Enzyme-20.dir/JLInstSimplify.cpp.o
FAILED: Enzyme/CMakeFiles/Enzyme-20.dir/JLInstSimplify.cpp.o 
/usr/bin/c++ -DENZYME_VERSION_MAJOR=0 -DENZYME_VERSION_MINOR=0 -DENZYME_VERSION_PATCH=79 -DEnzyme_20_EXPORTS -I/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/llvm/include -I/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build/include -I/home/manuel/prog/rust-new/build/x86_64-unknown-linux-gnu/enzyme/build/Enzyme -Wall -fno-rtti -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu -Werror=unused-variable -Werror=dangling-else -Werror=unused-but-set-variable -Werror=return-type -Werror=nonnull -Werror=unused-result -Werror=reorder -Werror=switch -O2 -std=gnu++17 -fPIC   -D_GNU_SOURCE -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT Enzyme/CMakeFiles/Enzyme-20.dir/JLInstSimplify.cpp.o -MF Enzyme/CMakeFiles/Enzyme-20.dir/JLInstSimplify.cpp.o.d -o Enzyme/CMakeFiles/Enzyme-20.dir/JLInstSimplify.cpp.o -c /home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/JLInstSimplify.cpp
In file included from /home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/JLInstSimplify.cpp:52:
In file included from /home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/LibraryFuncs.h:33:
/home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/Utils.h:2076:52: error: no member named 'none' in 'llvm::CaptureInfo'
 2076 |                                 llvm::CaptureInfo::none().toIntValue()));
      |                                 ~~~~~~~~~~~~~~~~~~~^
/home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/Utils.h:2086:52: error: no member named 'none' in 'llvm::CaptureInfo'
 2086 |                                 llvm::CaptureInfo::none().toIntValue()));
      |                                 ~~~~~~~~~~~~~~~~~~~^
/home/manuel/prog/rust-new/src/tools/enzyme/enzyme/Enzyme/Utils.h:2100:47: error: no member named 'none' in 'llvm::CaptureInfo'
 2100 |                            llvm::CaptureInfo::none().toIntValue()));
      |                            ~~~~~~~~~~~~~~~~~~~^
3 errors generated.

I think this PR broke it: #2237
See.
https://github.com/llvm/llvm-project/blame/main/llvm/include/llvm/Support/ModRef.h#L348
and
https://github.com/EnzymeAD/Enzyme/blame/69e20cccdaad0506b6788b274fc9762d36785ae6/enzyme/Enzyme/Utils.h#L2073

@ZuseZ4 ZuseZ4 requested a review from wsmoses February 20, 2025 02:52
Copy link
Member

@wsmoses wsmoses left a comment

Choose a reason for hiding this comment

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

I don't think this is right, since LLVM 20 hasn't released yet and this is needed to build against LLVM main, right?

@ZuseZ4
Copy link
Collaborator Author

ZuseZ4 commented Feb 21, 2025

llvm/llvm-project#123181 (comment)
nikita:

Thanks for the reviews! I plan to land this after LLVM 20 branches next week, to avoid unnecessary last-minute disruption for the release.

So I think this means it's correct? Or do you want to also check for minor versions.

@wsmoses
Copy link
Member

wsmoses commented Feb 21, 2025

oh sure then

@wsmoses wsmoses merged commit 759f490 into main Feb 21, 2025
16 of 23 checks passed
@ZuseZ4 ZuseZ4 deleted the fix-llvm-20 branch February 21, 2025 03:32
gbaraldi pushed a commit to gbaraldi/Enzyme that referenced this pull request Jun 27, 2025
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.

2 participants