[haskell-llvm] MathExtras.h: error: there are no arguments to ‘INT64_C’ that depend on a template parameter, so a declaration of ‘INT64_C’ must be available

Henning Thielemann schlepptop at henning-thielemann.de
Sun Apr 29 23:52:00 BST 2012


I have now installed LLVM-3.0 and try to compile llvm-base from git
repository.

llvm-3.0-git/base> cabal install
Resolving dependencies...
Configuring llvm-base-3.0.0.0...
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for llvm-config... /usr/local/bin/llvm-config
Target platform inferred as: i386-unknown-linux
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking llvm-c/Core.h usability... yes
checking llvm-c/Core.h presence... yes
checking for llvm-c/Core.h... yes
checking llvm/ADT/StringRef.h usability... yes
checking llvm/ADT/StringRef.h presence... yes
checking for llvm/ADT/StringRef.h... yes
checking for llvm/Support/DynamicLibrary.h... no
checking for LLVMModuleCreateWithName in -lLLVMCore... yes
configure: creating ./config.status
config.status: creating llvm-base.buildinfo
config.status: creating include/hs_llvm_config.h
config.status: include/hs_llvm_config.h is unchanged
Building llvm-base-3.0.0.0...
Preprocessing library llvm-base-3.0.0.0...
In file included from /usr/local/llvm-3.0/include/llvm/ADT/APInt.h:19,
                 from /usr/local/llvm-3.0/include/llvm/Constants.h:26,

                 from cbits/extra.cpp:53:0:
/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isInt(int64_t)’:

/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h:38:0:
     error: there are no arguments to ‘INT64_C’ that depend on a
template parameter, so a declaration of ‘INT64_C’ must be available

/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h:38:0:
     error: (if you use ‘-fpermissive’, G++ will accept your code, but
allowing the use of an undeclared name is deprecated)

/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h:38:0:
     error: there are no arguments to ‘INT64_C’ that depend on a
template parameter, so a declaration of ‘INT64_C’ must be available
/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isUInt(uint64_t)’:

/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h:57:0:
     error: there are no arguments to ‘UINT64_C’ that depend on a
template parameter, so a declaration of ‘UINT64_C’ must be available
/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isIntN(unsigned int, int64_t)’:

/usr/local/llvm-3.0/include/llvm/Support/MathExtras.h:82:0:
     error: ‘INT64_C’ was not declared in this scope
cabal: Error: some packages failed to install:
llvm-base-3.0.0.0 failed during the building phase. The exception was:
ExitFailure 1




I can reproduce these errors when I compile extra.cpp alone:
llvm-3.0-git/base> g++ -c -I include/ cbits/extra.cpp
In file included from /usr/local/include/llvm/ADT/APInt.h:18,
                 from /usr/local/include/llvm/Constants.h:26,
                 from cbits/extra.cpp:53:
/usr/local/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isInt(int64_t)’:
/usr/local/include/llvm/Support/MathExtras.h:38: error: there are no
arguments to ‘INT64_C’ that depend on a template parameter, so a
declaration of ‘INT64_C’ must be available
/usr/local/include/llvm/Support/MathExtras.h:38: error: (if you use
‘-fpermissive’, G++ will accept your code, but allowing the use of an
undeclared name is deprecated)
/usr/local/include/llvm/Support/MathExtras.h:38: error: there are no
arguments to ‘INT64_C’ that depend on a template parameter, so a
declaration of ‘INT64_C’ must be available
/usr/local/include/llvm/Support/MathExtras.h: In function ‘bool
llvm::isUInt(uint64_t)’:
/usr/local/include/llvm/Support/MathExtras.h:57: error: there are no
arguments to ‘UINT64_C’ that depend on a template parameter, so a
declaration of ‘UINT64_C’ must be available
cbits/extra.cpp: In function ‘LLVMOpaqueValue*
LLVMGetIntrinsic(LLVMOpaqueModule*, int, LLVMOpaqueType**, unsigned int)’:
cbits/extra.cpp:365: error: cannot convert ‘std::vector<llvm::Type*,
std::allocator<llvm::Type*> >’ to ‘const llvm::Type**’ for argument ‘3’
to ‘llvm::Function* llvm::Intrinsic::getDeclaration(llvm::Module*,
llvm::Intrinsic::ID, const llvm::Type**, unsigned int)’
cbits/extra.cpp: In function ‘unsigned int
LLVMLinkModules(LLVMOpaqueModule*, LLVMOpaqueModule*, unsigned int,
char**)’:
cbits/extra.cpp:427: error: no matching function for call to
‘llvm::Linker::LinkModules(llvm::Module*&, llvm::Module*&, unsigned
int&, std::string*)’
/usr/local/include/llvm/Linker.h:262: note: candidates are: static bool
llvm::Linker::LinkModules(llvm::Module*, llvm::Module*, std::string*)




The INT64 errors go away, when I pass cppflags from llvm-config:

llvm-3.0-git/base> g++ `llvm-config --cppflags` -c -I include/
cbits/extra.cpp
cbits/extra.cpp:45:1: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
cbits/extra.cpp:46:1: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
cbits/extra.cpp: In function ‘LLVMOpaqueValue*
LLVMGetIntrinsic(LLVMOpaqueModule*, int, LLVMOpaqueType**, unsigned int)’:
cbits/extra.cpp:365: error: cannot convert ‘std::vector<llvm::Type*,
std::allocator<llvm::Type*> >’ to ‘const llvm::Type**’ for argument ‘3’
to ‘llvm::Function* llvm::Intrinsic::getDeclaration(llvm::Module*,
llvm::Intrinsic::ID, const llvm::Type**, unsigned int)’
cbits/extra.cpp: In function ‘unsigned int
LLVMLinkModules(LLVMOpaqueModule*, LLVMOpaqueModule*, unsigned int,
char**)’:
cbits/extra.cpp:427: error: no matching function for call to
‘llvm::Linker::LinkModules(llvm::Module*&, llvm::Module*&, unsigned
int&, std::string*)’
/usr/local/include/llvm/Linker.h:262: note: candidates are: static bool
llvm::Linker::LinkModules(llvm::Module*, llvm::Module*, std::string*)


Are the `llvm-config --cppflags` missing when cabal runs g++?
What about the remaining errors on mismatching types?





More information about the Haskell-llvm mailing list