Opened 12 years ago

Closed 10 years ago

#34171 closed enhancement (wontfix)

root5: add cling variant

Reported by: cdeil (Christoph Deil) Owned by: mattiafrancescomoro@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: cjones051073 (Chris Jones), josephwinston (Joseph Winston), Mathias.Laurin+macports.org@…, mojca (Mojca Miklavec)
Port: root5

Description

Would it be possible to optionally enable cling via a Macports variant?

http://root.cern.ch/drupal/content/cling

Note that I haven't found out how to configure ROOT with --enable-cling yet.

I've asked for help in the ROOT forum: http://root.cern.ch/phpBB3/viewtopic.php?f=21&t=14550

Thanks!

Attachments (2)

configure.log (7.7 KB) - added by cdeil (Christoph Deil) 12 years ago.
make.log (131.7 KB) - added by cdeil (Christoph Deil) 12 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jonesc@… added
Owner: changed from macports-tickets@… to mattiafrancescomoro@…
Summary: Add cling variant to ROOT portroot: add cling variant

comment:2 Changed 12 years ago by cjones051073 (Chris Jones)

Its on my to do list, but I need macPorts to first provide support for the clang 3.1 compiler. If you look in the Portfile you will find

# variant clang31 conflicts gcc43 gcc44 gcc45 gcc46 description {EXPERIMENTAL - Compile using MacPorts clang 3.1} {
#     configure.compiler      macports-clang-3.1
#     depends_lib-append      port:clang-3.1
#     configure.args-append   --with-llvm-config="${prefix}/bin/llvm-config"
# }

# variant cling requires clang31 description {EXPERIMENTAL - Enable cling interpreter backend} {
#     configure.args-append --enable-cling
# }

As soon as the configure.compiler part works, this can be worked on.

Chris

comment:3 Changed 12 years ago by cdeil (Christoph Deil)

Wow, thanks very much.

Note that in the ROOT forum thread I mentioned above the ROOT devs said the problem might be the "mp" in the llvm binary names and they don't support that. Maybe you'll have to patch their configure script.

Again, thanks very much for looking into cling support, I'd really like to try it, but don't have time to try and install llvm / clang by hand.

comment:4 Changed 12 years ago by cjones051073 (Chris Jones)

The ROOT configure script supports the possibility that the gcc compiler binary names might be custom (as they are for MacPorts) with the options

             --with-cc=${configure.cc} \
             --with-cxx=${configure.cxx} \
             --with-ld=${configure.cxx} \
             --with-f77=${configure.f77}

The MacPorts clang and llvm binaries will have custom names, with mp in them, so if the ROOT devs decide not to provide a similar possibility here, there is not much we can do about it....

Chris

comment:5 Changed 12 years ago by cjones051073 (Chris Jones)

Looking at your post to the ROOT forum, I believe your configure arguments are wrong. You need to pass the full path to the 'llvm-config' script, not just the directory it is in. The following seems to work (well, at least configure, not tried building) for me

dhcp-128-232-140-137 ~/Projects/root > ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --enable-cling --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1
Checking for source directory ... /Users/chris/Projects/root
Configuring for macosx64
Checking for GNU Make version >= 3.80 ... ok
Checking for C compiler ... /opt/local/bin/clang-mp-3.1
Checking for C++ compiler ... /opt/local/bin/clang++-mp-3.1
Checking for linker (LD) ... /opt/local/bin/clang++-mp-3.1
Checking for F77 compiler ... gfortran
Checking for libX11 ... /opt/local/lib
Checking for X11/Xlib.h ... /opt/local/include
Checking for X11/xpm.h ... /opt/local/include
Checking for X11/Xft/Xft.h ... /opt/local/include
Checking for X11/extensions/shape.h ... /opt/local/include
Checking for libXpm ... /opt/local/lib
Checking for libXft ... /opt/local/lib
Checking for libXext ... /opt/local/lib
Checking for freetype-config ... /opt/local/bin/freetype-config
Checking for libfreetype version >= 9.3.0 ... ok
Checking whether to build included libfreetype6 ... no
Checking for pcre-config ... /opt/local/bin/pcre-config
Checking for libpcre version >= 3.9 ... ok
Checking whether to build included libpcre ... no
Checking for zlib.h ... /opt/local/include
Checking for libz ... /usr/lib
Checking whether to build included zlib ... no
Checking for lzma.h ... /opt/local/include
Checking for liblzma ... /opt/local/lib
Checking whether to build included lzma ... no
Checking for GL/gl.h ... /usr/X11/include
Checking for libGL, or libMesaGL ... /usr/X11R6/lib
Checking for libGLU, or libMesaGLU ... /usr/X11R6/lib
Checking for GL/glew.h ... no
Checking for libGLEW ... no
Checking whether to build included GLEW ... yes
Checking for pkg-config ... /opt/local/bin/pkg-config
Checking for libftgl ... ok
Checking for ftgl version > 2.1.2 ... ok
Checking whether to build included libftgl ... no
Checking for mysql_config ... not found
Checking for mysql.h ... no
Checking for libmysqlclient_r, libmysqlclient, or mysqlclient ... no
Checking for occi.h ... no
Checking for libclntsh, or oci ... no
Checking for libocci, or oraocci10 ... no
Checking for libpq-fe.h ... /usr/include
Checking for libpq ... /usr/lib
Checking for sql.h ... /opt/local/include
Checking for libsqlod ... no
Checking for sqlext.h ... /opt/local/include
Checking for libiodbc, libodbc, or odbc32 ... /opt/local/lib
Checking for rfio_api.h ... no
Checking for librfio, libdpm, libcastorrfio, libshift, shiftmd, or shift ... no
Checking for rfio_api.h ... no
Checking for stager_api.h ... no
Checking for libcastorrfio, libshift, shiftmd, or shift ... no
Checking for gfal_api.h ... no
Checking for libgfal ... no
Checking for ApMon.h ... no
Checking for libapmoncpp ... no
Checking for fftw3.h ... /opt/local/include
Checking for libfftw3, or libfftw3-3 ... /opt/local/lib
Checking for fitsio.h ... /opt/local/include
Checking for libcfitsio, or cfitsio ... /opt/local/lib
Checking for gvc.h ... /opt/local/include/graphviz
Checking for libgvc, or gvc ... /opt/local/lib
Checking for libgraph, or graph ... /opt/local/lib
Checking for libcdt, or cdt ... /opt/local/lib
Checking for libpathplan, or pathplan ... /opt/local/lib
Checking for libexpat, or expat ... /opt/local/lib
Checking for libgvplugin_dot_layout, or gvplugin_dot_layout ... /opt/local/lib/graphviz
Checking for libPythia6 ... no
Checking for Pythia.h ... no
Checking for libpythia8 ... no
Checking for dcap.h ... no
Checking for libdcap ... no
Checking for chirp_reli.h ... no
Checking for libchirp_client ... no
Checking for hdfs.h ... no
Checking for jni.h ... no
Checking for libhdfs ... no
Checking for libjvm ... no
Checking for libglite-api-wrapper ... no
Checking for gapiUI.h ... no
Checking for libgapiUI ... no
Checking for jpeglib.h ... /opt/local/include
Checking for png.h ... /opt/local/include
Checking for tiffio.h ... /opt/local/include
Checking for gif_lib.h ... /opt/local/include
Checking for libjpeg ... /opt/local/lib
Checking for libtiff ... /opt/local/lib
Checking for libungif ... no
Checking for libz ... /opt/local/lib
Checking for libpng ... /opt/local/lib
Checking whether to build included libAfterImage ... yes
Checking for ldap.h ... /opt/local/include
Checking for libldap ... /opt/local/lib
Checking for liblber ... /opt/local/lib
Checking for Python.h ... /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Checking for python2.7, libpython2.7, libpython, python, or Python ... /opt/local/Library/Frameworks/Python.framework/Versions/2.7
Checking for xml2-config ... /usr/bin/xml2-config
Checking for libxml2 version >= 2.4.x ... ok
Checking for XrdVersion.hh ... no
Checking for libssl ... /opt/local/lib
Checking for libcrypto ... /opt/local/lib
Checking for openssl/bio.h ... /opt/local/include
Checking for openssl/blowfish.h ... /opt/local/include
Checking for openssl/err.h ... /opt/local/include
Checking for openssl/pem.h ... /opt/local/include
Checking for openssl/rand.h ... /opt/local/include
Checking for openssl/rsa.h ... /opt/local/include
Checking for t_server.h ... no
Checking for libsrp ... no
Checking for libgmp ... no
Checking for libmisc ... no
Checking for pwauth.h ... no
Checking for krb5.h ... /usr/include
Checking for krb5.h redirect ... /usr/include/krb5/krb5.h
Checking for krb5_c_valid_cksumtype in krb5.h ... yes
Checking for valid_cksumtype in krb5.h ... no
Checking for libk5crypto ... /usr/lib
Checking whether we're using MIT Kerberos ... yes
Checking for krb5_c_valid_cksumtype in /usr/lib/libk5crypto.dylib ... ok
Checking for valid_cksumtype in /usr/lib/libk5crypto.dylib ... ok
Checking for libkrb5 ... /usr/lib
Checking for kinit ... /usr/bin/kinit
Checking for libcom_err ... /usr/lib
Checking for shadow passwords ... no
Checking for gsl/gsl_version.h ... /opt/local/include
Checking for GSL version >= 1.8 ... ok
Checking for libgsl, gslML, or gsl ... /opt/local/lib
Checking for libgslcblas, gslcblasML, gslcblas, or cblas ... /opt/local/lib
Checking whether /opt/local/lib/libgsl.a is compiled with -fPIC ... yes
Checking whether /opt/local/lib/libgslcblas.a is compiled with -fPIC ... yes
Checking whether to build libMathMore ... yes
Checking whether to build libGenVector ... yes
Checking whether to build libCintex ... yes
Checking whether to build libReflex ... yes
Checking whether to build libRooFit ... no
Checking whether to build libMinuit2 ... no
Checking whether to build libUnuran ... no
Checking whether to build libGdml ... no
Checking whether to build libTable ... no
Checking whether to build libTMVA ... yes
Checking whether to build libMemStat ... yes
Checking for Clarens support ... yes
Checking for PEAC support ... yes
Checking whether to build afdsmgrd ... no
Checking whether to integrate experimental cling ... yes
Checking what type of dictionaries to build ... cint
Writing config/Makefile.config ... done
Writing config/Makefile.comp ... done
Writing include/RConfigure.h ... done
Writing include/RConfigOptions.h ... done
Writing bin/root-config ... done
Writing etc/system.rootrc ... done
Writing etc/system.rootauthrc ... done
Writing etc/system.rootdaemonrc ... done
Writing etc/root.mimes ... done
Writing etc/daemons/rootd.rc.d ... done
Writing etc/daemons/rootd.xinetd ... done
Writing etc/daemons/proofd.rc.d ... done
Writing etc/daemons/proofd.xinetd ... done
Writing main/src/proofserv.sh ... done
Writing main/src/roots.sh ... done
Writing bin/memprobe ... done
Writing build/misc/root-help.el ... done
Writing macros/html.C ... done
Writing bin/thisroot.sh ... done
Writing bin/thisroot.csh ... done
Writing bin/setxrd.sh ... done
Writing bin/setxrd.csh ... done
Writing bin/genreflex ... done
Writing bin/genreflex-rootcint ... done
Writing config.status ... done

Enabled support for asimage, astiff, bonjour, builtin_afterimage, builtin_glew, cintex, clarens, cling, exceptions, explicitlink, fftw3, fitsio, gviz, genvector, krb5, ldap, mathmore, memstat, odbc, opengl, peac, pgsql, python, reflex, rpath, shared, ssl, tmva, x11, xft, xml.

To build ROOT type:

   make 

Please try the same, and report back if it builds or not ;)

Chris

comment:6 Changed 12 years ago by cjones051073 (Chris Jones)

OK, seeing as I had already configured root, it seemed rude not to try and build it ...

Bottom line is I can build root fine with MacPorts clang version, using

 > ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1 --enable-builtin-glew 

However, if I try and enable cling I get

/opt/local/bin/clang++-mp-3.1 -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     -pthread -I/opt/local/libexec/llvm-3.1/include -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -g -fvisibility-inlines-hidden -fno-common -Woverloaded-virtual -Wcast-qual -I/Users/chris/Projects/root/cint/cling/include '-DR__LLVMDIR="/opt/local/libexec/llvm-3.1"' -o core/meta/src/TCintWithCling.o -c /Users/chris/Projects/root/core/meta/src/TCintWithCling.cxx
bin/rmkdepend -R -fcore/meta/src/TClass.d -Y -w 1000 -- -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     -pthread -D__cplusplus -- /Users/chris/Projects/root/core/meta/src/TClass.cxx
/opt/local/bin/clang++-mp-3.1 -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     -pthread -o core/meta/src/TClass.o -c /Users/chris/Projects/root/core/meta/src/TClass.cxx
bin/rmkdepend -R -fcore/meta/src/TClassGenerator.d -Y -w 1000 -- -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     -pthread -D__cplusplus -- /Users/chris/Projects/root/core/meta/src/TClassGenerator.cxx
/opt/local/bin/clang++-mp-3.1 -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     -pthread -o core/meta/src/TClassGenerator.o -c /Users/chris/Projects/root/core/meta/src/TClassGenerator.cxx
/Users/chris/Projects/root/core/meta/src/TCintWithCling.cxx:26:10: fatal error: 'clang/AST/ASTContext.h' file not found
#include "clang/AST/ASTContext.h"
         ^

I'm not sure, but it looks like this file is part of clang's API

http://clang.llvm.org/doxygen/ASTContext_8h-source.html

But, its missing on my system.

Does anyone know if Macports clang ports install the API headers etc. ??

Chris

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 Changed 12 years ago by cdeil (Christoph Deil)

First thing I noticed was that my clang wasn't active:

$ port installed '*llvm*'
The following ports are currently installed:
  llvm-3.0 @3.0_3
  llvm-3.0 @3.0_4 (active)
  llvm-3.1 @3.1-r153370_0
  llvm-3.1 @3.1-r153754_0+assertions
  llvm-3.1 @3.1-r154872_0+assertions (active)
  llvm_select @0.2_0 (active)
$ port installed '*clang*'
The following ports are currently installed:
  clang-3.1 @3.1-r151504_1+analyzer
  clang-3.1 @3.1-r153370_1+analyzer
  clang-3.1 @3.1-r153754_1+analyzer+assertions
  clang_select @0.1_0 (active)

So I did activate it like so:

sudo port activate clang-3.1@3.1-r153370_1+analyzer

Now for me ROOT configure also enables cling, but when I type make the first call to clang crashes like this:

$ ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --enable-cling --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1
$ make
...
cp /Users/deil/bin/root/root_v5.32.02.source_cling/tmva/inc/TMVA/Volume.h include/TMVA/Volume.h
cp /Users/deil/bin/root/root_v5.32.02.source_cling/math/genetic/inc/Math/GeneticMinimizer.h include/Math/GeneticMinimizer.h
/opt/local/bin/clang-mp-3.1 -O2 -m64 -pipe -Wshadow -W -Wall -fsigned-char -fno-common -Iinclude    -pthread -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".o\" -o build/rmkdepend/cppsetup.o -c /Users/deil/bin/root/root_v5.32.02.source_cling/build/rmkdepend/cppsetup.c
0  libLLVM-3.1svn.dylib 0x0000000105d8b652 _ZL15PrintStackTracePv + 34
1  libLLVM-3.1svn.dylib 0x0000000105d8bb69 _ZL13SignalHandleri + 697
2  libsystem_c.dylib    0x00007fff8a793cfa _sigtramp + 26
3  libsystem_c.dylib    000000000000000000 _sigtramp + 18446603338192962336
4  clang                0x0000000104b43419 llvm::FoldingSet<clang::PointerType>::NodeEquals(llvm::FoldingSetImpl::Node*, llvm::FoldingSetNodeID const&, llvm::FoldingSetNodeID&) const + 25
5  libLLVM-3.1svn.dylib 0x0000000105d7996a llvm::FoldingSetImpl::FindNodeOrInsertPos(llvm::FoldingSetNodeID const&, void*&) + 154
6  clang                0x0000000104b23fee clang::ASTContext::getPointerType(clang::QualType) const + 110
7  clang                0x00000001047e0cf7 clang::Sema::BuildPointerType(clang::QualType, clang::SourceLocation, clang::DeclarationName) + 487
8  clang                0x00000001047e682a _ZL24GetFullTypeForDeclaratorRN12_GLOBAL__N_119TypeProcessingStateEN5clang8QualTypeEPNS2_14TypeSourceInfoE + 2426
9  clang                0x00000001047e3bcc clang::Sema::GetTypeForDeclarator(clang::Declarator&, clang::Scope*) + 668
10 clang                0x00000001045e3f69 clang::Sema::HandleField(clang::Scope*, clang::RecordDecl*, clang::SourceLocation, clang::Declarator&, clang::Expr*, bool, clang::AccessSpecifier) + 105
11 clang                0x00000001045e3ed5 clang::Sema::ActOnField(clang::Scope*, clang::Decl*, clang::SourceLocation, clang::Declarator&, clang::Expr*) + 53
12 clang                0x00000001044e53e5 clang::Parser::ParseStructUnionBody(clang::SourceLocation, unsigned int, clang::Decl*)::CFieldCallback::invoke(clang::FieldDeclarator&) + 53
13 clang                0x00000001044dece2 clang::Parser::ParseStructDeclaration(clang::DeclSpec&, clang::Parser::FieldCallback&) + 1250
14 clang                0x00000001044df3f6 clang::Parser::ParseStructUnionBody(clang::SourceLocation, unsigned int, clang::Decl*) + 1558
15 clang                0x00000001044ec203 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext) + 5843
16 clang                0x00000001044d9273 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, llvm::SmallVector<clang::Parser::LateParsedAttribute*, 2u>*) + 6595
17 clang                0x00000001044d777f clang::Parser::ParseSimpleDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*) + 303
18 clang                0x00000001044d73e5 clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, unsigned int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 325
19 clang                0x000000010452f743 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 1747
20 clang                0x000000010452eff1 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 321
21 clang                0x00000001044cf355 clang::ParseAST(clang::Sema&, bool) + 309
22 clang                0x00000001044984e9 clang::CodeGenAction::ExecuteAction() + 1257
23 clang                0x000000010428d218 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 952
24 clang                0x00000001042744c8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3144
25 clang                0x000000010426b63d cc1_main(char const**, char const**, char const*, void*) + 5341
26 clang                0x0000000104270857 main + 663
27 clang                0x000000010426a154 start + 52
28 clang                0x0000000000000036 start + 18446744069344943894
Stack dump:
0.	Program arguments: /opt/local/libexec/llvm-3.1/bin/clang -cc1 -triple x86_64-apple-macosx10.7.0 -emit-obj -disable-free -main-file-name cppsetup.c -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -coverage-file build/rmkdepend/cppsetup.o -resource-dir /opt/local/libexec/llvm-3.1/bin/../lib/clang/3.1 -D INCLUDEDIR="/usr/include" -D OBJSUFFIX=".o" -I include -fmodule-cache-path /var/folders/9v/3cf9p8mx0n1gzcsq3mw9799m0000gn/T/clang-module-cache -O2 -Wshadow -W -Wall -fdebug-compilation-dir /Users/deil/bin/root/root_v5.32.02.source_cling -ferror-limit 19 -fmessage-length 196 -pthread -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fno-common -fdiagnostics-show-option -fcolor-diagnostics -o build/rmkdepend/cppsetup.o -x c /Users/deil/bin/root/root_v5.32.02.source_cling/build/rmkdepend/cppsetup.c 
1.	<built-in>:105:98: current parser token ';'
2.	<built-in>:105:9: parsing struct/union body '__va_list_tag'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/9v/3cf9p8mx0n1gzcsq3mw9799m0000gn/T/cppsetup-SPesDj.i
clang: note: diagnostic msg: /var/folders/9v/3cf9p8mx0n1gzcsq3mw9799m0000gn/T/cppsetup-SPesDj.sh
Running /Users/deil/bin/root/root_v5.32.02.source_cling/build/unix/compiledata.sh
Making include/compiledata.h
Running /Users/deil/bin/root/root_v5.32.02.source_cling/cint/ROOT/configcint.mk
Making cint/cint/inc/configcint.h
bin/rmkdepend -R -fcint/cint/src/g__cfunc.d -Y -w 1000 -- -m64 -pipe -W -Wall -fsigned-char -fno-common -Iinclude   -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__ROOT -DG__REDIRECTIO -DG__OSFDLL -DG__STD_EXCEPTION  -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY  -I/Users/deil/bin/root/root_v5.32.02.source_cling/cint/cint/inc -I/Users/deil/bin/root/root_v5.32.02.source_cling/cint/cint/src -I/Users/deil/bin/root/root_v5.32.02.source_cling/cint/cint/src/dict -pthread -I. -- /Users/deil/bin/root/root_v5.32.02.source_cling/cint/cint/src/g__cfunc.c
make: bin/rmkdepend: No such file or directory
make: *** [cint/cint/src/g__cfunc.o] Error 1

Maybe now I have incompatible llvm and clang options active? Or is this an actual clang bug? (... a compiler shouldn't crash on any input ...)

I couldn't figure out the syntax on how to use port select clang, maybe that's what I need to do?

Let me know if there is something you want me to test.

comment:8 Changed 12 years ago by cjones051073 (Chris Jones)

Root built fine for me with the configure options

./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1

Please try again, in a completely cleanly unpacked root directory, and pipe the output from configure and make to file, and attach it to this report.

Chris

comment:9 Changed 12 years ago by cdeil (Christoph Deil)

Here's what I did:

$ history
...
  519  tar zxvf root_v5.32.02.source.tar.gz 
  520  cd root
  521  ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1 2>&1 | tee configure.log
  522  make 2>&1 | tee make.log
...

I'll attach configure.log and make.log now.

Changed 12 years ago by cdeil (Christoph Deil)

Attachment: configure.log added

Changed 12 years ago by cdeil (Christoph Deil)

Attachment: make.log added

comment:10 Changed 12 years ago by cjones051073 (Chris Jones)

I suspect your problem is you have a rogue installation of LLVM somewhere that is being picked up, outside of the MacPorts one, and conflicting.

Where is the library 'libLLVM-3.1svn.dylib' that the build log refers to.

Clean out all other llvm and clang installations other than the 'official' MacPorts ones, and try again.

Chris

comment:11 Changed 12 years ago by cjones051073 (Chris Jones)

Also, why did you select an old llvm version to activate, instead of the latest ?

I have

llvm-3.1 @3.1-r154872_0+assertions 
clang-3.1 @3.1-r154872_0+analyzer+assertions 

Please completely uninstall all your llvm and clang versions, make sure you have the latest port versions installed, and try again.

Chris

comment:12 in reply to:  10 Changed 12 years ago by cdeil (Christoph Deil)

Replying to jonesc@…:

I suspect your problem is you have a rogue installation of LLVM somewhere that is being picked up, outside of the MacPorts one, and conflicting.

Where is the library 'libLLVM-3.1svn.dylib' that the build log refers to.

Here: /opt/local/libexec/llvm-3.1/lib/libLLVM-3.1svn.dylib

Macports must have put it there, I don't know how to check which variant exactly and why.

Clean out all other llvm and clang installations other than the 'official' MacPorts ones, and try again.

I don't think I have other llvm and clang installations besides the ones from Apple and Macports. But I might have trief to build llvm by hand a year ago and simply don't remember anymore.

I'll try what you suggest. Thanks!

comment:13 Changed 12 years ago by cjones051073 (Chris Jones)

OK thanks.

My next guess is you have an incompatible mixture of old llvm and clang versions. make sure you have the very latest of both, and try again.

Chris

comment:14 Changed 12 years ago by cdeil (Christoph Deil)

I did uninstall all llvm and clang port variants I had except I couldn't get rid of llvm-3.0 @3.0_4:

--->  Unable to uninstall llvm-3.0 @3.0_4, the following ports depend on it:
--->  	cctools @822_1
--->  	cctools @822_2+llvm30

--->  Unable to uninstall cctools @822_2+llvm30, the following ports depend on it:
--->  	gcc44 @4.4.7_1
--->  	gcc45 @4.5.3_3
--->  	gcc46 @4.6.3_1
--->  	gcc47 @4.7.0_2

Nevertheless I did re-install the current versions of llvm-3.1 and clang-3.1:

$ port installed '*llvm*'
The following ports are currently installed:
  llvm-3.0 @3.0_4 (active)
  llvm-3.1 @3.1-r154872_0+assertions (active)
  llvm_select @0.2_0 (active)
$ port installed '*clang*'
The following ports are currently installed:
  clang-3.1 @3.1-r154872_0+analyzer+assertions (active)
  clang_select @0.1_0 (active)

Now I see the same 'clang/AST/ASTContext.h' file not found error as you.

comment:15 Changed 12 years ago by cjones051073 (Chris Jones)

FYI, I've submitted an enhancement request against clang, to get the missing headers included in the installation.

#34214

Chris

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:16 Changed 12 years ago by cdeil (Christoph Deil)

Thanks to ticket #34214 the clang header files are now installed by Macports.

I now see the same build error you mention in ticket #34214 for ROOT 5.32.02 and a different error for ROOT SVN trunk r44006:

$ ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --enable-cling --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1
...
$ make
...
/opt/local/bin/clang++-mp-3.1 -dynamiclib -single_module -Wl,-dead_strip_dylibs -install_name @rpath/libCling.so -O2 -m64 -mmacosx-version-min=10.7 -o lib/libCling.so cint/cling/lib/Interpreter/ASTDumper.o cint/cling/lib/Interpreter/ASTNodeEraser.o cint/cling/lib/Interpreter/ASTUtils.o cint/cling/lib/Interpreter/CIFactory.o cint/cling/lib/Interpreter/ChainedConsumer.o cint/cling/lib/Interpreter/DeclExtractor.o cint/cling/lib/Interpreter/DynamicLookup.o cint/cling/lib/Interpreter/ExecutionContext.o cint/cling/lib/Interpreter/IncrementalParser.o cint/cling/lib/Interpreter/Interpreter.o cint/cling/lib/Interpreter/InvocationOptions.o cint/cling/lib/Interpreter/ValuePrinter.o cint/cling/lib/Interpreter/ValuePrinterInfo.o cint/cling/lib/Interpreter/ValuePrinterSynthesizer.o cint/cling/lib/Interpreter/VerifyingSemaConsumer.o cint/cling/lib/MetaProcessor/InputValidator.o cint/cling/lib/MetaProcessor/MetaProcessor.o -ldl -L/opt/local/libexec/llvm-3.1/lib -lclangFrontend -lclangSerialization -lclangDriver -lclangCodeGen -lclangParse -lclangSema -lclangAnalysis -lclangRewrite -lclangAST -lclangLex -lclangBasic -lclangEdit -lLLVMHexagonCodeGen -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMHexagonAsmPrinter -lLLVMPTXCodeGen -lLLVMPTXDesc -lLLVMPTXInfo -lLLVMPTXAsmPrinter -lLLVMMBlazeCodeGen -lLLVMMBlazeDesc -lLLVMMBlazeInfo -lLLVMMBlazeAsmPrinter -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMCellSPUCodeGen -lLLVMCellSPUDesc -lLLVMCellSPUInfo -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMDebugInfo -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMLinker -lLLVMTransformUtils -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMArchive -lLLVMBitReader -lLLVMCore -lLLVMSupport -L/opt/local/libexec/llvm-3.1/lib -lpthread -lffi -lm
ld: library not found for -lclangFrontend
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libCling.so] Error 1
rm core/utils/src/rootcling_tmp.cxx core/utils/src/LinkdefReader_tmp.cxx core/utils/src/Scanner_tmp.cxx core/utils/src/SelectionRules_tmp.cxx core/utils/src/VariableSelectionRule_tmp.cxx core/utils/src/ClassSelectionRule_tmp.cxx core/utils/src/XMLReader_tmp.cxx core/utils/src/BaseSelectionRule_tmp.cxx core/utils/src/RClStl_tmp.cxx

comment:17 Changed 12 years ago by cjones051073 (Chris Jones)

I think you need to follow this up with the clang/llvm maintainer as well, as it looks to me like some libraries are missing.

cheers Chris

comment:18 Changed 12 years ago by cdeil (Christoph Deil)

Ticket #34214 is fixed.

I tried building root_v5-34-00-patches and root_trunk with this command (outside macports, but using the macports llvm / clang):

./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-3.1 --with-clang --enable-cling --with-cc=/opt/local/bin/clang-mp-3.1 --with-cxx=/opt/local/bin/clang++-mp-3.1 --with-ld=/opt/local/bin/clang++-mp-3.1
make

Both ROOT versions fail when trying to create core/utils/src/rootcling_tmp.o.

This is the command and first error for root_v5-34-00-patches:

cp /Users/deil/bin/root/root_v5-34-00-patches/core/utils/src/rootcling.cxx core/utils/src/rootcling_tmp.cxx
bin/rmkdepend -R -fcore/utils/src/rootcling_tmp.d -Y -w 1000 -- -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude      -pthread -UR__HAVE_CONFIG -DROOTBUILD -I/Users/deil/bin/root/root_v5-34-00-patches/core/utils/src -I/opt/local/libexec/llvm-3.1/include -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -g -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -I/Users/deil/bin/root/root_v5-34-00-patches/cint/cling/include '-DR__LLVMDIR="/opt/local/libexec/llvm-3.1"' '-DR__CLANG="/opt/local/bin/llvm-config-mp-3.1"' -D__cplusplus -- core/utils/src/rootcling_tmp.cxx
/opt/local/bin/clang++-mp-3.1 -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude      -pthread -UR__HAVE_CONFIG -DROOTBUILD -I/Users/deil/bin/root/root_v5-34-00-patches/core/utils/src -I/opt/local/libexec/llvm-3.1/include -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -g -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -I/Users/deil/bin/root/root_v5-34-00-patches/cint/cling/include '-DR__LLVMDIR="/opt/local/libexec/llvm-3.1"' '-DR__CLANG="/opt/local/bin/llvm-config-mp-3.1"' -o core/utils/src/rootcling_tmp.o -c core/utils/src/rootcling_tmp.cxx
core/utils/src/rootcling_tmp.cxx:851:41: error: address expression must be an lvalue or a function designator
            if (is_operator_new) return &*iter;
                                        ^~~~~~

For root_trunk I get

make: *** No rule to make target `/Users/deil/bin/root/root_trunk/core/utils/src/rootcling_tmp.cxx', needed by `core/utils/src/rootcling_tmp.o'.  Stop.

I can try other configure args or post full build logs if it would help.

comment:19 Changed 12 years ago by josephwinston (Joseph Winston)

Cc: josephwinston@… added

Cc Me!

comment:20 Changed 10 years ago by Mathias.Laurin+macports.org@…

Cc: Mathias.Laurin+macports.org@… added

Cc Me!

comment:21 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added
Port: root5 added; root removed
Resolution: wontfix
Status: newclosed
Summary: root: add cling variantroot5: add cling variant
Version: 2.0.4

New ROOT 6 port with cling enable by default has been committed in r119871.

A request to include a standalone cling has been submitted in #43530.

At the moment I don't see any need to try to make cling work with ROOT 5, so I'm closing the ticket. (You may also treat the issue as solved since you can use cling now.)

Note: See TracTickets for help on using tickets.