Build error

make[4]: Entering directory /home/ojohnson/OpenSource/cling/build/tools/clang/lib/Parse' llvm[4]: Compiling ParseAST.cpp for Release+Asserts build In file included from /home/ojohnson/OpenSource/cling/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h:22:0, from /home/ojohnson/OpenSource/cling/llvm/tools/clang/lib/Parse/ParseAST.cpp:21: /home/ojohnson/OpenSource/cling/llvm/tools/clang/lib/Parse/../../include/clang/Sema/Sema.h:528:9: error: redefinition of ‘class clang::Sema::ContextAndScopeRAII’ /home/ojohnson/OpenSource/cling/llvm/tools/clang/lib/Parse/../../include/clang/Sema/Sema.h:493:9: error: previous definition of ‘class clang::Sema::ContextAndScopeRAII’ /usr/bin/rm: cannot remove/home/ojohnson/OpenSource/cling/build/tools/clang/lib/Parse/Release+Asserts/ParseAST.d.tmp’: No such file or directory
make[4]: *** [/home/ojohnson/OpenSource/cling/build/tools/clang/lib/Parse/Release+Asserts/ParseAST.o] Error 1
make[4]: Leaving directory `/home/ojohnson/OpenSource/cling/build/tools/clang/lib/Parse’

Hi,
Looks like you have applied twice one of the patches we have…
Could you revert and reapply them again?
Cheers,
Vassil

Given the following:

[ojohnson@localhost llvm]$ uname -a
Linux localhost.localdomain 3.6.11-5.fc17.x86_64 #1 SMP Tue Jan 8 21:40:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[ojohnson@localhost cling]$ pwd
/home/ojohnson/OpenSource/cling

svn co -r 165095 llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co -r 165095 llvm.org/svn/llvm-project/llvm/trunk clang
svn co -r 48339 root.cern.ch/svn/root/trunk/interpreter/cling

cd …

cat tools/cling/patches/*.diff | patch -p0

How do I determine which patches to accept?

What does
cat tools/clang/include/clang/Sema/Sema.h | grep ContextAndScopeRAII
say?

In terms of the initial downloads, are these the correct revisions:

svn co -r 165095 llvm.org/svn/llvm-project/llvm/trunk llvm
svn co -r 165095 llvm.org/svn/llvm-project/llvm/trunk clang
svn co -r 48339 root.cern.ch/svn/root/trunk/interpreter/cling

http://solarianprogrammer.com/2012/09/02/building-cling-cpp-interpreter-windows/, I was able to build it using the instructions from this posts.

Good! What was the issue in the end?

The posts stated which revisions were being used such that “cat tools/cling/patches/*.diff | patch -p0” was successful.

Hi,
Great!
Thanks,
Vassil

I’m using r163370 llvm/clang and r45925 cling I would like to use the latest revision. Which of the following is recommended in terms of a successful execution of “cat tools/cling/patches/*.diff | patch -p0”

  1. r165095 llvm/clang and r48339.cling, same as nightly binary snapshots
    or
  2. r165095 llvm/clang and r48358 cling, latest revision

thanks,
oran

Hi,
The later, the better. Use cling’s trunk please.
Vassil

I got the following error, using r165095 llvm/clang and r48360 (/trunk/interpreter/cling):

touch /home/ojohnson/OpenSource/clingsrc/llvm/tools/cling/lib/UserInterface/textinput/Makefile.d
make[4]: Leaving directory /home/ojohnson/OpenSource/clingsrc/build/tools/cling/lib/UserInterface' make[4]: Entering directory/home/ojohnson/OpenSource/clingsrc/build/tools/cling/lib/UserInterface’
llvm[4]: Compiling UserInterface.cpp for Release+Asserts build
/home/ojohnson/OpenSource/clingsrc/llvm/tools/cling/lib/UserInterface/UserInterface.cpp: In constructor ‘cling::UserInterface::UserInterface(cling::Interpreter&)’:
/home/ojohnson/OpenSource/clingsrc/llvm/tools/cling/lib/UserInterface/UserInterface.cpp:39:43: error: ‘STDOUT_FILENO’ was not declared in this scope
/usr/bin/rm: cannot remove `/home/ojohnson/OpenSource/clingsrc/build/tools/cling/lib/UserInterface/Release+Asserts/UserInterface.d.tmp’: No such file or directory
make[4]: *** [/home/ojohnson/OpenSource/clingsrc/build/tools/cling/lib/UserInterface/Release+Asserts/UserInterface.o] Error 1

Regards,
Oran

//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :slight_smile:
// version: $Id: UserInterface.cpp 48339 2013-01-18 16:20:34Z vvassilev $
// author: Axel Naumann axel@cern.ch
//–

I commented out the following “ifdef” and it worked:

// Fragment copied from LLVM’s raw_ostream.cpp
//#if defined(HAVE_UNISTD_H)

include <unistd.h>

//#endif

Hi,
Good that you sorted that out! It is a known issue and Axel will fix it soon.
Sorry for the inconvenience!
Vassil

Hi,
Should be fixed now!
Vassil

thanks.