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'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.
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 1I will be very grateful if some one can help me