Cling Build problem

Hi
I have installed root 5.28.00, and I decided to build cling.
I have installed llvm as described in clang.llvm.org/get_started.html,
then page root.cern.ch/drupal/content/clin … structions

When I type cat tools/cling/patches/*.diff | patch -p0
I get the following error
patching file clang/lib/Sema/SemaExpr.cpp
Hunk #1 FAILED at 1495.
patch: **** Can’t create file clang/lib/Sema/SemaExpr.cpp.orig : No such file or directory

Could you please help me to solve this problem ?

Yours

Hi,

fixed, thanks! I.e. please update and the re-apply the patches.

Cheers, Axel.

Hi Axel
I have updated it by typing (I removed the old one)
sudo svn co root.cern.ch/svn/root/branches/dev/cling
I received
Checked out revision 37618. [is it the correct one ]
then
cd …
then
sudo cat tools/cling/patches/*.diff | patch -p0
I received
patching file tools/clang/lib/Sema/SemaExpr.cpp
patch: **** Can’t remove file tools/clang/lib/Sema/SemaExpr.cpp : Permission denied

Hi,
“patch” command doesn’t have the enough privileges, because everything else is done as sudo (root).
You shouldn’t use sudo neither for checkout nor for patching.
Cheers, Vassil

Hi
But What shall I do if I want to install it under
/usr/local/
I think that I need sudo !
is not true?

Hi,

[quote=“mhoroub”]Hi
But What shall I do if I want to install it under
/usr/local/
I think that I need sudo !
is not true?[/quote]
Yes you do. Just run patch as sudo. Like:
sudo cat tools/cling/patches/*.diff | sudo patch -p0
Cheers, Vassil

Hi
I I have built it in my home directory where I do not need sudo,
I have installed llvm, clang and cling in /usr/local/bin
I downloaded root to /usr/local/ as usual
I unttared it, then cd cint
svn co root.cern.ch/svn/root/branches/d … ing/cling/ cling
export export LLVMDIR=…/…/bin/
cd …
sudo ./configure (no problems)
sudo make -j2
ERROR: you forgot to define LLVMDIR!
/usr/local/root/cint/cling/Module.mk:50: *** missing separator. Stop.

Hi,

building ROOT with cling is a bit awkward for the time being…

Assuming you have updated ROOT, cling, clang and llvm to the latest version:
export LLVMDIR=/usr/local
(you had “export” twice, and it should point to where bin is in, not to bin itself)

Cheers, Axel.

Hi
I have reinstalled llvm, clang, and I checked out root, every thing went smoothly! then
cd root/cint
svn co root.cern.ch/svn/root/branches/d … ing/cling/ cling
export LLVMDIR=/usr/local
cd …
sudo ./configure (up to now no problem)
sudo make

The same as before !!

[quote=“Axel”]Hi,

building ROOT with cling is a bit awkward for the time being…

Assuming you have updated ROOT, cling, clang and llvm to the latest version:
export LLVMDIR=/usr/local
(you had “export” twice, and it should point to where bin is in, not to bin itself)

Cheers, Axel.[/quote]

Hi,

which shell do you use? What does “echo $LLVMDIR” show after you exported it?

Cheers, Axel.

Hi
I am using bach,
when I type echo $LLVMDIR, I get /user/local

Hi,

you’re still running sudo make. That means you change the user to root (the super user), and you use his environment variables. Instead either calls sudo make LLVMDIR=/usr/local or better yet don’t build as root (i.e. just make, not sudo make). You should not need sudo make - but your file permissions might now be screwed up such that regular users cannot access things anymore. If so, run sudo chown -R : where is your user id, in the directory you used to run “sudo make” to build ROOT with cling.

Cheers, Axel.

Hi
I have done everything in my home directory, where I do not need to use “sudo”.
I have the same problem!
I gave up now.

[quote=“mhoroub”]Hi
I have done everything in my home directory, where I do not need to use “sudo”.
I have the same problem!
I gave up now.[/quote]
Please don’t! :wink:
Perhaps you are missing something small… You are still having problems with patching, aren’t you?
Cheers,
Vassil

No, my problem comes with compiling

Can you build Cling, LLVM and Clang together? Can you start Cling outside ROOT?

Hi
I am trying to build cling for the second time!
it went okay this time, but when I try to compile cint I get the following

/usr/local/root/cint/cling/src/rootcling.cxx:37:38: error: llvm/Target/TargetSelect.h: No such file or directory
/usr/local/root/cint/cling/src/rootcling.cxx: In function ‘void info(std::string)’:
/usr/local/root/cint/cling/src/rootcling.cxx:75: warning: format not a string literal and no format arguments
/usr/local/root/cint/cling/src/rootcling.cxx: In function ‘void error(std::string)’:
/usr/local/root/cint/cling/src/rootcling.cxx:80: warning: format not a string literal and no format arguments
make: *** [cint/cling/src/rootcling.o] Error 1

see answer in your other post: Cling compiling

Philippe.