Compilation error with llvm-6

67 views
Skip to first unread message

Adam Antonik

unread,
Oct 9, 2020, 5:35:42 AM10/9/20
to Enzyme AD

Hi,

I've tried building this against llvm-6.0, but it fails pretty quickly with `error: no matching function for call to ‘llvm::PostDominatorTree::PostDominatorTree(llvm::Function&)`
The full output is below.  I'd appreciate any hints you could give on getting this to go, as trying to get anything to build against llvm always seems to end up being a rather "interesting" exercise.
Thanks.  This certainly looks like a very nice project.

Regards,
Adam Antonik


$ cmake .. -DLLVM_DIR=/usr/lib/llvm-6.0/lib/cmake/llvm
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
LLVM_SHLIBEXT=.so
found llvm dir /usr/lib/llvm-6.0/lib/cmake/llvm
found llvm lit /home/adam/v2/Enzyme/enzyme/build
CMAKE_PREFIX_PATH /usr/lib/llvm-6.0/lib/cmake/llvm
-- Linker detection: GNU ld
LLVM_INSTALL_PREFIX: /usr/lib/llvm-6.0
LLVM_INCLUDE_DIRS: /usr/lib/llvm-6.0/include
found llvm definitions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
found llvm version 6
first llvm include directory/usr/lib/llvm-6.0/include
found enzyme sources ActivityAnalysis.cppCacheUtility.cppEnzyme.cppEnzymeLogic.cppFunctionUtils.cppGradientUtils.cppMustExitScalarEvolution.cppUtils.cppSCEV/ScalarEvolutionExpander.cppTypeAnalysis/TypeTree.cppTypeAnalysis/TypeAnalysis.cppTypeAnalysis/TypeAnalysisPrinter.cpp
found bench flags: -I/home/adam/v2/Enzyme/enzyme/build/benchmarks/adept2/src/adept2/include -I/home/adam/v2/Enzyme/enzyme/build/benchmarks/tapenade/src/tapenade
-- Configuring done
-- Generating done
-- Build files have been written to: /home/adam/v2/Enzyme/enzyme/build
$ make
Scanning dependencies of target intrinsics_gen
[  0%] Built target intrinsics_gen
Scanning dependencies of target LLVMEnzyme-6
[  7%] Building CXX object Enzyme/CMakeFiles/LLVMEnzyme-6.dir/ActivityAnalysis.cpp.o
[ 15%] Building CXX object Enzyme/CMakeFiles/LLVMEnzyme-6.dir/CacheUtility.cpp.o
[ 23%] Building CXX object Enzyme/CMakeFiles/LLVMEnzyme-6.dir/Enzyme.cpp.o
In file included from /home/adam/v2/Enzyme/enzyme/Enzyme/Enzyme.cpp:51:0:
/home/adam/v2/Enzyme/enzyme/Enzyme/GradientUtils.h: In constructor ‘GradientUtils::GradientUtils(llvm::Function*, llvm::Function*, llvm::TargetLibraryInfo&, TypeAnalysis&, llvm::AAResults&, llvm::ValueToValueMapTy&, const llvm::SmallPtrSetImpl<llvm::Value*>&, const llvm::SmallPtrSetImpl<llvm::Value*>&, bool, llvm::ValueToValueMapTy&, DerivativeMode)’:
/home/adam/v2/Enzyme/enzyme/Enzyme/GradientUtils.h:438:24: error: no matching function for call to ‘llvm::PostDominatorTree::PostDominatorTree(llvm::Function&)’
         AA(AA_), TA(TA_) {
                        ^
In file included from /home/adam/v2/Enzyme/enzyme/Enzyme/GradientUtils.h:55:0,
                 from /home/adam/v2/Enzyme/enzyme/Enzyme/Enzyme.cpp:51:
/usr/lib/llvm-6.0/include/llvm/Analysis/PostDominators.h:29:8: note: candidate: llvm::PostDominatorTree::PostDominatorTree()
 struct PostDominatorTree : public PostDomTreeBase<BasicBlock> {
        ^~~~~~~~~~~~~~~~~
/usr/lib/llvm-6.0/include/llvm/Analysis/PostDominators.h:29:8: note:   candidate expects 0 arguments, 1 provided
/usr/lib/llvm-6.0/include/llvm/Analysis/PostDominators.h:29:8: note: candidate: llvm::PostDominatorTree::PostDominatorTree(llvm::PostDominatorTree&&)
/usr/lib/llvm-6.0/include/llvm/Analysis/PostDominators.h:29:8: note:   no known conversion for argument 1 from ‘llvm::Function’ to ‘llvm::PostDominatorTree&&’
Enzyme/CMakeFiles/LLVMEnzyme-6.dir/build.make:107: recipe for target 'Enzyme/CMakeFiles/LLVMEnzyme-6.dir/Enzyme.cpp.o' failed
make[2]: *** [Enzyme/CMakeFiles/LLVMEnzyme-6.dir/Enzyme.cpp.o] Error 1
CMakeFiles/Makefile2:515: recipe for target 'Enzyme/CMakeFiles/LLVMEnzyme-6.dir/all' failed
make[1]: *** [Enzyme/CMakeFiles/LLVMEnzyme-6.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

William Moses

unread,
Oct 13, 2020, 6:00:30 PM10/13/20
to Enzyme AD

Pardon the potential double post, but it seems this wasn't being sent to the Google Group. Hopefully it goes through this time.

---------- Forwarded message ---------
From: William Moses <wmo...@mit.edu>
Date: Mon, Oct 12, 2020 at 2:23 PM
Subject: Re: Compilation error with llvm-6
To: William Moses <wmo...@mit.edu>
Cc: Adam Antonik <adam.a...@gmail.com>, Enzyme AD <enzym...@googlegroups.com>


Hi again Adam,

I've gone ahead and updated Enzyme to make sure it builds against LLVM 6.

However, I'd still strongly recommend using LLVM 7 if possible. In particular, Clang 6 has some bugs that trigger errors in our tests at lower optimization levels.

On Fri, Oct 9, 2020 at 9:52 AM William Moses <wmo...@mit.edu> wrote:
I see what happened.

When Julia upgraded it's version of LLVM we accidentally stopped testing against LLVM 6 in CI (instead just testing LLVM 7, 8, 9, 10, and 11).

For an immediate fix, use LLVM-7 or higher and in the meantime I'll go fix LLVM 6 support.

Right now LLVM-7 has the best plugin support so I'd recommend it over others. Otherwise you may run into one of the issues described in the FAQ: https://enzyme.mit.edu/getting_started/Faq/

--
You received this message because you are subscribed to the Google Groups "Enzyme AD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enzyme-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/enzyme-dev/ede354ef-cd29-456c-a992-e2401132edebn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Antonik

unread,
Oct 15, 2020, 4:22:32 AM10/15/20
to Enzyme AD
Thanks, that does indeed build now for me.
Reply all
Reply to author
Forward
0 new messages