[LLVMdev] llvm-config!

1,616 views
Skip to first unread message

Reza Sheykhi

unread,
Sep 19, 2012, 6:31:52 PM9/19/12
to llv...@cs.uiuc.edu

 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

Sean Silva

unread,
Sep 19, 2012, 8:14:12 PM9/19/12
to Reza Sheykhi, llv...@cs.uiuc.edu
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
> _______________________________________________
> LLVM Developers mailing list
> LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Óscar Fuentes

unread,
Sep 19, 2012, 8:16:18 PM9/19/12
to llv...@cs.uiuc.edu
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)

Reza Sheykhi

unread,
Sep 23, 2012, 8:45:50 PM9/23/12
to Sean Silva, llv...@cs.uiuc.edu
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

Óscar Fuentes

unread,
Sep 23, 2012, 9:01:17 PM9/23/12
to Reza Sheykhi, llv...@cs.uiuc.edu
Reza Sheykhi <haji...@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


?

Reza Sheykhi

unread,
Sep 23, 2012, 10:18:53 PM9/23/12
to Óscar Fuentes, llv...@cs.uiuc.edu
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

Óscar Fuentes

unread,
Sep 23, 2012, 11:15:24 PM9/23/12
to Reza Sheykhi, llv...@cs.uiuc.edu
Reza Sheykhi <haji...@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.

Reza Sheykhi

unread,
Sep 27, 2012, 6:55:02 PM9/27/12
to Óscar Fuentes, llv...@cs.uiuc.edu
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
++
INSTALL_PATH_SYSTEMC_LLVM=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-llvm
++ export
INSTALL_PATH_SYSTEMC_GCC=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-gcc
++
INSTALL_PATH_SYSTEMC_GCC=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-gcc
++ export SRC_ROOT_DIR=/home/reza/PinaVM/pinavm-pinavm
++ SRC_ROOT_DIR=/home/reza/PinaVM/pinavm-pinavm
++ export LLVMBACKENDSHEADERS=/home/reza/PinaVM/pinavm-pinavm/SimpleBackend
++ LLVMBACKENDSHEADERS=/home/reza/PinaVM/pinavm-pinavm/SimpleBackend
++ export LLVMBACKENDS=/home/reza/PinaVM/pinavm-pinavm/SimpleBackend
++ LLVMBACKENDS=/home/reza/PinaVM/pinavm-pinavm/SimpleBackend
++ export SYSTEMCFRONTEND=/home/reza/PinaVM/pinavm-pinavm/frontend
++ SYSTEMCFRONTEND=/home/reza/PinaVM/pinavm-pinavm/frontend
++ export
SYSTEMCROOT=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-gcc
++ SYSTEMCROOT=/home/reza/PinaVM/pinavm-pinavm/external/lib/systemc-2.2.0-gcc
+
PATH=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-gcc/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+
PATH=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/bin:/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-gcc/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
+ export PATH
+
llvm_configure_flags='--prefix=/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8 --enable-debug-runtime --disable-optimized --enable-checking --enable-bindings=none
--enable-libffi=no'
+ llvm-gcc --version
++ llvm-config --includedir
+ '[' '!' -r
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/include/llvm/LLVMContext.h
']'
++ which llvm-config
+ echo 'Using llvm-config:
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/bin/llvm-config'
Using llvm-config:
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/bin/llvm-config
++ llvm-config --version
++ sed s/svn//
+ '[' 2.8 = 2.8 ']'
+ cd /home/reza/PinaVM/pinavm-pinavm
+ cmake .
PinaVM's dependancies are OK, you will be able to launch the build
when cmake is done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/reza/PinaVM/pinavm-pinavm
+ make
[ 1%] Built target systemc-all
[ 9%] Built target tweto
[ 66%] Built target frontend
[ 67%] Built target utils
[ 72%] Built target tlm-basic
[ 81%] Built target quarantedeux
[ 89%] Built target promela
[ 96%] Built target simple
Linking CXX executable pinavm
/home/reza/PinaVM/pinavm-pinavm/external/systemc-2.2.0/objdir-gcc/src/sysc/kernel/sc_cor_pthread.o: In function `sc_core::sc_cor_pkg_pthread::create(unsigned long, void (*)(void*),
void*)':
/home/reza/PinaVM/pinavm-pinavm/external/systemc-2.2.0/objdir-gcc/src/sysc/kernel/../../../../src/sysc/kernel/sc_cor_pthread.cpp:211: undefined reference to
`pthread_attr_setstacksize'
/home/reza/PinaVM/pinavm-pinavm/external/systemc-2.2.0/objdir-gcc/src/sysc/kernel/../../../../src/sysc/kernel/sc_cor_pthread.cpp:231: undefined reference to
`pthread_create'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(DynamicLibrary.o): In function `llvm::sys::DynamicLibrary::LoadLibraryPermanently(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char>
>*)':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/DynamicLibrary.cpp:68: undefined reference to
`dlopen'
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/DynamicLibrary.cpp:70: undefined reference to
`dlerror'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(DynamicLibrary.o): In function `llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(char
const*)':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/DynamicLibrary.cpp:117: undefined reference to
`dlsym'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(Mutex.o): In function
`MutexImpl':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Mutex.cpp:69: undefined reference to
`pthread_mutexattr_init'
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Mutex.cpp:75: undefined reference to
`pthread_mutexattr_settype'
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Mutex.cpp:80: undefined reference to
`pthread_mutexattr_setpshared'
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Mutex.cpp:88: undefined reference to
`pthread_mutexattr_destroy'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(Mutex.o): In function
`llvm::sys::MutexImpl::tryacquire()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Mutex.cpp:142: undefined reference to
`pthread_mutex_trylock'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`RWMutexImpl':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:75: undefined reference to
`pthread_rwlock_init'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`~RWMutexImpl':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:91: undefined reference to
`pthread_rwlock_destroy'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`llvm::sys::RWMutexImpl::reader_acquire()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:104: undefined reference to
`pthread_rwlock_rdlock'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`llvm::sys::RWMutexImpl::reader_release()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:117: undefined reference to
`pthread_rwlock_unlock'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`llvm::sys::RWMutexImpl::writer_acquire()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:130: undefined reference to
`pthread_rwlock_wrlock'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(RWMutex.o): In function
`llvm::sys::RWMutexImpl::writer_release()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/RWMutex.cpp:143: undefined reference to
`pthread_rwlock_unlock'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(Signals.o): In function
`PrintStackTrace':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Unix/Signals.inc:219: undefined reference to
`dladdr'
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/Unix/Signals.inc:231: undefined reference to
`dladdr'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(ThreadLocal.o): In function
`ThreadLocalImpl':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/ThreadLocal.cpp:45: undefined reference to
`pthread_key_create'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(ThreadLocal.o): In function
`~ThreadLocalImpl':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/ThreadLocal.cpp:53: undefined reference to
`pthread_key_delete'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(ThreadLocal.o): In function `llvm::sys::ThreadLocalImpl::setInstance(void
const*)':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/ThreadLocal.cpp:61: undefined reference to
`pthread_setspecific'
/home/reza/PinaVM/pinavm-pinavm/external/lib/llvm-2.8/lib/libLLVMSystem.a(ThreadLocal.o): In function
`llvm::sys::ThreadLocalImpl::getInstance()':
/home/reza/PinaVM/pinavm-pinavm/external/download/llvm-2.8/lib/System/ThreadLocal.cpp:68: undefined reference to
`pthread_getspecific'
collect2: ld returned 1 exit status
make[2]: *** [toplevel/pinavm] Error 1
make[1]: *** [toplevel/CMakeFiles/pinavm.dir/all] Error 2
make: *** [all] Error 2
++ echo 'Error detected! End of script.'
Error detected! End of script.
++ exit 1


Sorry for the long email.

Thank you,
Reza
Reply all
Reply to author
Forward
0 new messages