-
Notifications
You must be signed in to change notification settings - Fork 112
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
Does multisource work? #1462
Comments
Hi. Could you please give the concrete error messages you are reading and your compiler version, is it build from source? MultisourceAD works for C++, but if you have functions spanning multiple compilation units (in general .cpp files), you will need to use LDEnzyme, not ClangEnzyme. Depending on your system the docs might need some updates, but for the projects I work on it works, so without more information unfortunately I can't say whats the issue |
Ah my bad, I saw you opened an issuenon the tutorial repo. |
Many thanks @ZuseZ4 Unfortunately that still does not work. I barely changed the
(I added the
As you can see I am using spack for some of the installs, but that's irrelevant (those installation are solid and I use them for many other things with no problems). The only thing that I'm uncertain is the picking up of the (system-provided) install of gcc. Is that what one would expect? Finally, perhaps useless information and normal way in which Enzyme works, since it needs to do some "magic" to create those missing symbols, but in case it's helpful
|
Duplicate of #1389 (comment) Unfortunately upstream LLVM 16+ dropped support for the old pass manager, and doesn't have support for plugins in the new pass manager yet. If you use LLVM < that version LLDEnzyme should be fine. Upstream issue in LLVM: llvm/llvm-project#65085 (comment) |
Oh sorry to clarify, what OS are you on? The above comment only applies to macos. Linux should be fine. |
The example above is on Linux RH8.8 and as you see it's not fine. I probably made some mistake myself in compiling or utilizing Enzyme, but I can't figure out what. I have LLVM 14 installed and I could recompile Enzyme against that, but I was hoping to use a newer version (I don't have LLVM 15 installed). |
Can you run test-cmake on your Enzmye build. That will test ClangEnzyme and LLDEnzyme (multisource). Does that fail or suceed? |
Sure, happy to run those tests, but which ones? Do you mean run Thanks! |
Enzyme/enzyme/test/CMakeLists.txt Line 16 in 07f3e71
|
Just this?
|
I am using LLVM 14 with LTO. Here is a snippet from my CMake config: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -Wl,--lto-legacy-pass-manager,--disable-new-dtags,-mllvm=-load=/local/Enzyme/build/Enzyme/LLDEnzyme-14.so,-mllvm=-enzyme-attributor=0")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld -Wl,--lto-legacy-pass-manager,--disable-new-dtags,-mllvm=-load=/local/Enzyme/build/Enzyme/LLDEnzyme-14.so,-mllvm=-enzyme-attributor=0") |
Ok the fact that the previous test worked means that lldenzyme successfully
compiled a multi source program on your system.
Can you make a zip of your mini repo and upload it?
…On Fri, Oct 6, 2023 at 12:17 PM Tim Gymnich ***@***.***> wrote:
I am using LLVM 14 with LTO. Here is a snippet from my CMake config:
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld -Wl,--lto-legacy-pass-manager,--disable-new-dtags,-mllvm=-load=/local/Enzyme/build/Enzyme/LLDEnzyme-14.so,-mllvm=-enzyme-attributor=0,-mllvm=-enzyme-max-type-offset=25,-mllvm=-enzyme-max-type-depth=2,-mllvm=-enzyme-max-int-offset=10,-mllvm=-enzyme-loose-types=false")set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=lld -Wl,--lto-legacy-pass-manager,--disable-new-dtags,-mllvm=-load=/local/Enzyme/build/Enzyme/LLDEnzyme-14.so,-mllvm=-enzyme-attributor=0,-mllvm=-enzyme-max-type-offset=25,-mllvm=-enzyme-max-type-depth=2,-mllvm=-enzyme-max-int-offset=10,-mllvm=-enzyme-loose-types=false")
—
Reply to this email directly, view it on GitHub
<#1462 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTUXG5MG2KP7JMTZEVDH3X6A4L5AVCNFSM6AAAAAA5RUHTROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRGEZTSNJZGQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Thanks. The
Fantastic, where is it? Looking at
Sure I can, but
Thanks again! |
Ah I see the problem. Since you're manually adding the flags to your Makefile you're missing some flags that depend on LLVM Version (these are automatically added with LLDEnzymeFlags in the cmake template here: Enzyme/enzyme/Enzyme/CMakeLists.txt Line 165 in 07f3e71
Can you also add |
My Makefile (diff from the original in a comment above, perhaps the In all cases it always fail with
for reference, this is
|
Sorry can you try with two dashes ( |
Thanks for keep trying, and for your patience with me, really appreciated. That didn't work either, but I digging into
For other poor souls struggling with the same problem, and landing on this issue in the future, do note the absence of As far as I'm concerned, this can be closed. I'm not closing it myself in case we want to keep it around as a reminder to put this into the documentation, as @ZuseZ4 suggested. I'll try to find time to make such a PR myself. |
@davidedelvento Ping in case you have some time to update the docs to cover your issue. |
Sorry this fell through the cracks. Yes, I will update the docs from https://github.com/EnzymeAD/www/blob/www/content/getting_started/ making sure they work with LLVM 16 and make a PR for needed changes. Let me know if you intended something different instead |
Awesome, thanks! Nothing else, I mostly hope that step by step we will get to cover all Enzyme+LLVM versions. |
So you'd prefer me leaving what is there already for LLVM 15 and perhaps with a prefix or tab option selecting version having the LLVM 16 in addition not instead, correct? |
Yes, we officially support LLVM 11-18, so please don't delete comments for older versions. |
Sounds good. The nice tab-based switching among languages seems more complicated than I hoped in hugo so I will just make regular code sections and leave the code-toggle to someone who knows their way in hugo better than I |
Yes no worries, any improvement is welcome. We had been working on a completely new website for Enzyme Core using a newer template, but no one had the time to finish that. Please also assign me or wsmoses as a reviewer, to make sure that the PR doesn't get lost. |
@ZuseZ4 perhaps you have been already notified by either the PR itself or the automatic comment/mention in this thread, but I guess it can't hurt to further ping you about it explicitly. Hopefully EnzymeAD/www#23 is a decent enough improvement. Thanks again to everybody for maintaining such a great project! |
This is resolved and the above-mentioned documentation hopefully will help others from stumbling on the same block. |
I am unable to get multisource work with current version of Enzyme, or finding any up-to-date documentation about it.
For older versions, one could do what's described at https://github.com/EnzymeAD/Enzyme-Tutorial/blob/main/9_multisource/Makefile but that does not work anymore as described at EnzymeAD/Enzyme-Tutorial#6
Is it something which is currently broken, or is it just missing from the documentation? Either way, can it be fixed?
TIA!
The text was updated successfully, but these errors were encountered: