halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.9k stars 1.07k forks source link

Failed in building halide using make #7572

Open Abderrahmene-KSM opened 1 year ago

Abderrahmene-KSM commented 1 year ago

After building llvm from sources , I am trying to build Halide using make. I have tried many version but I am getting this error :

Documents/Halide/src/CodeGen_Internal.cpp: In function ‘void Halide::Internal::embed_bitcode(llvm::Module, const string&)’: Documents/Halide/src/CodeGen_Internal.cpp:739:24: error: ‘static void llvm::GlobalVariable::operator delete(void)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 739 | module_constant); | ^ In file included from Documents/llvm-install/include/llvm/IR/Module.h:29, from Documents/llvm-install/include/llvm/IR/PassManager.h:46, from Documents/llvm-install/include/llvm/Analysis/AliasAnalysis.h:45, from Documents/Halide/src/LLVM_Headers.h:35, from Documents/Halide/src/CodeGen_Internal.cpp:7: Documents/llvm-install/include/llvm/IR/GlobalVariable.h:73:30: note: returned from ‘static void llvm::User::operator new(size_t, unsigned int)’ 73 | return User::operator new(s, 1); | ~~~~^~~~ Documents/Halide/src/CodeGen_Internal.cpp:759:56: error: ‘static void llvm::GlobalVariable::operator delete(void)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 759 | command_line_constant); | ^ In file included from Documents/llvm-install/include/llvm/IR/Module.h:29, from Documents/llvm-install/include/llvm/IR/PassManager.h:46, from Documents/llvm-install/include/llvm/Analysis/AliasAnalysis.h:45, from Documents/Halide/src/LLVM_Headers.h:35, from Documents/Halide/src/CodeGen_Internal.cpp:7: Documents/llvm-install/include/llvm/IR/GlobalVariable.h:73:30: note: returned from ‘static void llvm::User::operator new(size_t, unsigned int)’ 73 | return User::operator new(s, 1); | ~~~~^~~~ Documents/Halide/src/CodeGen_Internal.cpp:778:76: error: ‘static void llvm::GlobalVariable::operator delete(void)’ called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 778 | llvm::ConstantArray::get(ATy, used_array), "llvm.compiler.used"); | ^ In file included from Documents/llvm-install/include/llvm/IR/Module.h:29, from Documents/llvm-install/include/llvm/IR/PassManager.h:46, from Documents/llvm-install/include/llvm/Analysis/AliasAnalysis.h:45, from Documents/Halide/src/LLVM_Headers.h:35, from Documents/Halide/src/CodeGen_Internal.cpp:7: Documents/llvm-install/include/llvm/IR/GlobalVariable.h:73:30: note: returned from ‘static void* llvm::User::operator new(size_t, unsigned int)’ 73 | return User::operator new(s, 1); | ~~~~^~~~ At global scope: cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics cc1plus: all warnings being treated as errors make: *** [../Halide/Makefile:1213: bin/build/CodeGen_Internal.o] Error 1

I will be very grateful if some one can help me

abadams commented 1 year ago

I've seen this before. As far as I can tell it's something in the llvm headers that's tripping up gcc. I'd just turn off -Werror in the Makefile, or use the cmake build.