www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Error compiling ldc

reply "matovitch" <camille.brugel laposte.net> writes:
Hello,

I wanted to try ldc, but I got the following error :

[ 11%] Building CXX object CMakeFiles/ldc2.dir/driver/main.cpp.o
/home/ldc/driver/main.cpp: In function 'int main(int, char**)':
/home/ldc/driver/main.cpp:1001:33: error: no matching function 
for call to 'llvm::Linker::Linker(llvm::Module*&)'
/home/ldc/driver/main.cpp:1001:33: note: candidates are:
/usr/local/include/llvm/Linker.h:69:5: note: 
llvm::Linker::Linker(llvm::StringRef, llvm::Module*, unsigned int)
/usr/local/include/llvm/Linker.h:69:5: note:   candidate expects 
3 arguments, 1 provided
/usr/local/include/llvm/Linker.h:60:5: note: 
llvm::Linker::Linker(llvm::StringRef, llvm::StringRef, 
llvm::LLVMContext&, unsigned int)
/usr/local/include/llvm/Linker.h:60:5: note:   candidate expects 
4 arguments, 1 provided
/usr/local/include/llvm/Linker.h:35:7: note: 
llvm::Linker::Linker(const llvm::Linker&)
/usr/local/include/llvm/Linker.h:35:7: note:   no known 
conversion for argument 1 from 'llvm::Module*' to 'const 
llvm::Linker&'
/home/ldc/driver/main.cpp:1010:24: error: 'class llvm::Linker' 
has no member named 'linkInModule'

Any suggestions ?

(OS : Ubuntu 12.04 64 bits)
May 31 2013
parent reply "David Nadlinger" <code klickverbot.at> writes:
What LLVM version are you compiling against? /usr/local/include/ seems 
to indicate a custom install.

  — David
May 31 2013
parent reply "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 21:31:27 UTC, David Nadlinger wrote:
 What LLVM version are you compiling against? 
 /usr/local/include/ seems to indicate a custom install.

  — David
How fast. :o I have libllvm3.1 installed.
May 31 2013
next sibling parent "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 21:37:35 UTC, matovitch wrote:
 On Friday, 31 May 2013 at 21:31:27 UTC, David Nadlinger wrote:
 What LLVM version are you compiling against? 
 /usr/local/include/ seems to indicate a custom install.

 — David
How fast. :o I have libllvm3.1 installed.
I can't find the -dev equivalent (I missed this include I think...). Sorry to disturb (and for my english...it's quite late in France.).
May 31 2013
prev sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Friday, 31 May 2013 at 21:37:35 UTC, matovitch wrote:
 I have libllvm3.1 installed.
LLVM 3.1 should definitely work (it is tested by the Travis CI build bots). With libllvm3.1, do you mean an LLVM package from your distro? If so, the files in /usr/local are probably causing conflicts. Try manually specifying -DLLVM_CONFIG=<path_to_your_distros_llvm-config> at the CMake command line. If this is not the cause, please paste the full build log somewhere. — David
May 31 2013
next sibling parent "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 21:41:56 UTC, David Nadlinger wrote:
 On Friday, 31 May 2013 at 21:37:35 UTC, matovitch wrote:
 I have libllvm3.1 installed.
LLVM 3.1 should definitely work (it is tested by the Travis CI build bots). With libllvm3.1, do you mean an LLVM package from your distro? If so, the files in /usr/local are probably causing conflicts. Try manually specifying -DLLVM_CONFIG=<path_to_your_distros_llvm-config> at the CMake command line. If this is not the cause, please paste the full build log somewhere. — David
Ok. (I installed the .dev without any success for now...)
May 31 2013
prev sibling parent reply "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 21:41:56 UTC, David Nadlinger wrote:
 On Friday, 31 May 2013 at 21:37:35 UTC, matovitch wrote:
 I have libllvm3.1 installed.
LLVM 3.1 should definitely work (it is tested by the Travis CI build bots). With libllvm3.1, do you mean an LLVM package from your distro? If so, the files in /usr/local are probably causing conflicts. Try manually specifying -DLLVM_CONFIG=<path_to_your_distros_llvm-config> at the CMake command line. If this is not the cause, please paste the full build log somewhere. — David
llvm-config path was : /usr/local/bin/llvm-config and llvm-config --version give me 3.3svn (so I think I have recently compile llvm). I get the same error... [ 0%] [ 0%] Built target idgen Built target impcnvgen [ 0%] Built target gen_gccbuiltins [ 0%] Built target ldmd2 [ 11%] Built target LDCShared [ 11%] Building CXX object CMakeFiles/ldc2.dir/driver/main.cpp.o /home/camille/Téléchargements/ldc/driver/main.cpp: In function 'int main(int, char**)': /home/camille/Téléchargements/ldc/driver/main.cpp:1001:33: error: no matching function for call to 'llvm::Linker::Linker(llvm::Module*&)' /home/camille/Téléchargements/ldc/driver/main.cpp:1001:33: note: candidates are: /usr/local/include/llvm/Linker.h:69:5: note: llvm::Linker::Linker(llvm::StringRef, llvm::Module*, unsigned int) /usr/local/include/llvm/Linker.h:69:5: note: candidate expects 3 arguments, 1 provided /usr/local/include/llvm/Linker.h:60:5: note: llvm::Linker::Linker(llvm::StringRef, llvm::StringRef, llvm::LLVMContext&, unsigned int) /usr/local/include/llvm/Linker.h:60:5: note: candidate expects 4 arguments, 1 provided /usr/local/include/llvm/Linker.h:35:7: note: llvm::Linker::Linker(const llvm::Linker&) /usr/local/include/llvm/Linker.h:35:7: note: no known conversion for argument 1 from 'llvm::Module*' to 'const llvm::Linker&' /home/camille/Téléchargements/ldc/driver/main.cpp:1010:24: error: 'class llvm::Linker' has no member named 'linkInModule' make[2]: *** [CMakeFiles/ldc2.dir/driver/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/ldc2.dir/all] Error 2 make: *** [all] Error 2
May 31 2013
parent reply "David Nadlinger" <see klickverbot.at> writes:
On Friday, 31 May 2013 at 21:55:30 UTC, matovitch wrote:
 llvm-config path was : /usr/local/bin/llvm-config

 and llvm-config --version give me 3.3svn (so I think I have 
 recently compile llvm).
If you don't want to use the 3.1 package from your distro, please try the latest LLVM revision from the 3.3 branch then. It definitely compiles, as I have been testing the release on all three OSes during the last few days. LLVM trunk might work as well. — David
May 31 2013
parent reply "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 21:58:07 UTC, David Nadlinger wrote:
 On Friday, 31 May 2013 at 21:55:30 UTC, matovitch wrote:
 llvm-config path was : /usr/local/bin/llvm-config

 and llvm-config --version give me 3.3svn (so I think I have 
 recently compile llvm).
If you don't want to use the 3.1 package from your distro, please try the latest LLVM revision from the 3.3 branch then. It definitely compiles, as I have been testing the release on all three OSes during the last few days. LLVM trunk might work as well. — David
I will try this tomorrow as I'm too tired to stay awake during the compilation. ;-) Thanks a lot for your support.
May 31 2013
parent reply "matovitch" <camille.brugel laposte.net> writes:
On Friday, 31 May 2013 at 22:02:02 UTC, matovitch wrote:

 I will try this tomorrow as I'm too tired to stay awake during 
 the compilation. ;-)
 Thanks a lot for your support.
It works ! :-)
May 31 2013
parent reply "David Nadlinger" <code klickverbot.at> writes:
On 1 Jun 2013, at 1:28, matovitch wrote:
 It works ! :-)
Glad to hear! I wonder whether we could add some general advice for such problem to the wiki… — David
Jun 01 2013
parent "matovitch" <camille.brugel laposte.net> writes:
On Saturday, 1 June 2013 at 10:48:48 UTC, David Nadlinger wrote:
 On 1 Jun 2013, at 1:28, matovitch wrote:
 It works ! :-)
Glad to hear! I wonder whether we could add some general advice for such problem to the wiki… — David
I hadn't see the wiki and I think that's why I got into some troubles. It seems quite complete to me (that's approximately what I've been doing).
Jun 01 2013