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 at ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$
clang hello.c -o hello
reza at ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ls
hello hello.c
reza at ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ./hello
hello world
reza at ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$
clang -O3 -emit-llvm hello.c -c -o hello.bc
reza at ubuntu:~/PinaVM/pinavm-pinavm/external/download/llvm-2.8/hello$ ls
hello hello.bc hello.c
reza at 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 at 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
Quoting Óscar Fuentes <ofv at wanadoo.es>:
> Reza Sheykhi <hajishey at 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.
>