llvm-config!

Hi,

I am trying to install a program that works just with llvm-2.8. I have installed it but while i am trying to run llvm-config it says no such file or directory:

bash: /usr/bin/llvm-config: No such file or directory Does any body know how to solve this problem? I can use apt-get but it gives me either 2.9 or 3.0 or higher versions.

Thank you,
Reza

Could you give us more information? If your package manager does not
have 2.8 (I would hope it doesn't! that version is very old!), I would
recommend downloading 2.8 from http://llvm.org/releases/, and then
building it yourself.

--Sean Silva

Reza Sheykhi <hajishey@msu.edu> writes:

I am trying to install a program that works just with llvm-2.8. I have
installed it but while i am trying to run llvm-config it says no such
file or directory:

bash: /usr/bin/llvm-config: No such file or directory Does any body
know how to solve this problem? I can use apt-get but it gives me
either 2.9 or 3.0 or higher versions.

Are the other llvm executables installed on /usr/bin ?

Does llvm-config exists on the `bin' subdirectory you used for
building LLVM? When you execute `make install' is it listed along the
other LLVM files that are copied to the destination directories?

And the basics: how are you building LLVM? (list explicit commands, etc)

Hi,

Thank you for your repky. I downloaded llvm-2.8 and installed it by first ./configure and then ./make it. It was installed in /usr/local as i expected. However, when i tried to run llvm-config-2.8, for example --version, it was not ran. Then, I used apt-get to installed the llvm-2.8-dev to have llvm-config. Did i do anything wrong? Also i do not know if these two installed llvms are linked together!

Thank you,
Reza

Quoting Sean Silva silvas@purdue.edu:

Reza Sheykhi <hajishey@msu.edu> writes:

Thank you for your repky. I downloaded llvm-2.8 and installed it by
first ./configure and then ./make it. It was installed in /usr/local
as i expected. However, when i tried to run llvm-config-2.8, for
example --version, it was not ran. Then, I used apt-get to installed
the llvm-2.8-dev to have llvm-config. Did i do anything wrong? Also i
do not know if these two installed llvms are linked together!

What's the output of this commands:

which perl

which llvm-config

which llvm-as

/usr/local/bin/llvm-config --version

/usr/bin/llvm-config --version

?

I got the following answers:

which perl
/usr/bin/perl

which llvm-config
/usr/local/bin/llvm-config

which llvm-as
/usr/local/bin/llvm-as

/usr/bin/llvm-confing --version
bash: /usr/bin/llvm-confing: No such file or directory

/usr/local/bin/llvm-config --version
2.8

Quoting Óscar Fuentes ofv@wanadoo.es:

Reza Sheykhi <hajishey@msu.edu> writes:

I got the following answers:

which perl
/usr/bin/perl

which llvm-config
/usr/local/bin/llvm-config

which llvm-as
/usr/local/bin/llvm-as

/usr/bin/llvm-confing --version
bash: /usr/bin/llvm-confing: No such file or directory

Uh, there is a typo on the command above, it should be

/usr/bin/llvm-config --version

/usr/local/bin/llvm-config --version
2.8

Okay, so lets suppose that something tried to use /usr/bin/llvm-config,
which doesn't exists, when it should use /usr/local/bin/llvm-config.

Do you see the message about the nonexistent /usr/bin/llvm-config when
you try to build or execute the other package that depends on LLVM?
Maybe it has the path to llvm-config hard-coded. Does it provide an
option for declaring where LLVM is installed? If no, you can solve the
problem with symlinks, although it may be tedious, or you may install
LLVM on /usr instead of /usr/local. This is achieved by configuring LLVM
with --prefix=/usr on your LLVM `configure' script invocation.

Hi,
Actyally you were right about the typo. When I fixid it, it worked and i could get 2.8 for the "llvm-config --version" command. So i could get 2.8 for both the path! What can be the problem then? I will copy the error that i get to the end of this email, but let me ask some other questions before copying it:

- How can I make sure that my LLVM is working correctly? I tried to run the hello-world example. I could get the exe file and execute it, but when I want to use the .bc file it gives me segmentation fault!

reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ clang hello.c -o hello
reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ls
hello hello.c
reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ./hello
hello world
reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ clang -O3 -emit-llvm hello.c -c -o hello.bc
reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ls
hello hello.bc hello.c
reza@ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ lli hello.bc
0 lli 0x0000000000a4f87f
1 lli 0x0000000000a4fd09
2 libpthread.so.0 0x00007fb0103e2cb0
3 lli 0x00000000004e6fcc llvm::BitcodeReader::ParseModule() + 284
4 lli 0x00000000004e8af1 llvm::BitcodeReader::ParseBitcodeInto(llvm::Module*) + 961
5 lli 0x00000000004e8fa6 llvm::getLazyBitcodeModule(llvm::MemoryBuffer*, llvm::LLVMContext&, std::string*) + 950
6 lli 0x00000000004d40f3 main + 259
7 libc.so.6 0x00007fb00f62376d __libc_start_main + 237
8 lli 0x00000000004ddbc5
Stack dump:
0. Program arguments: lli hello.bc
Segmentation fault (core dumped)

- Can I use llvm-g++ instead of clang? or any other instruction which was availble when llvm-2.8 was released?

- My ubuntu (wubi) is 64. Could the problem be related to it? or llvm works perfectly of 64 too?

- the error that i get for installing PinaVM, which can just use llvm-2.8, is about linking and is as follows:

reza@ubuntu:~/PinaVM/pinavm-pinavm$ ./install-pinavm.sh
+++ dirname ./install-pinavm.sh
++ cd .
++ pwd
+ SCRIPT_DIR=/home/reza/PinaVM/pinavm-pinavm
+ PINAVM_DIR=/home/reza/PinaVM/pinavm-pinavm
+ source /home/reza/PinaVM/pinavm-pinavm/scripts/install-lib.sh
+ cd /home/reza/PinaVM/pinavm-pinavm
+ make config.sh
+ source /home/reza/PinaVM/pinavm-pinavm/config.sh
++ export DOWNLOAD_AND_COMPILE_DIR=/home/reza/PinaVM/pinavm-pinavm/external/download
++ DOWNLOAD_AND_COMPILE_DIR=/home/reza/PinaVM/pinavm-pinavm/external/download
++ export INSTALL_PATH_LLVM=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8
++ INSTALL_PATH_LLVM=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8
++ export INSTALL_PATH_LLVMGCC=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-gcc
++ INSTALL_PATH_LLVMGCC=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-gcc
++ export INSTALL_PATH_SYSTEMC_LLVM=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-llvm