TFile LLVM Symbols Exposed

Dear ROOTers,

I noticed an issue with the way TFile pointers are declared and defined in ROOT v6 on Mac OSV 10.9. The following line of code produces the below error:

[code]TFile *OutFile = new TFile(“outfile.root”, “recreate”);

Error in UnknownClass::InitInterpreter(): LLVM SYMBOLS ARE EXPOSED TO CLING! This will cause problems; please hide them or dlopen() them after the call to TROOT::InitInterpreter()![/code]

However the following lines DO NOT produce the error:

TFile *OutFile = new TFile(); OutFile -> SetName("outfile.root"); OutFile -> SetOption("recreate");

In both cases the code will compile and run. Any thoughts on what the problem might be?

Hi,

I tried to reproduce the issue but I failed.
What version are you exactly using? COuld you try with the latest (root.cern.ch/drupal/content/patc … 1-18062014) ?

Cheers,
Danilo

Hi,

This indicates a build issue. I need to know:

  • How you built root
  • whether any input line causes this or just opening a TFile
  • what otool -L $ROOTSYS/lib/libRIO.so says for you.

Cheers, Axel

Dear Axel,

  1. I believe I built root from source. I downloaded the source files from git for version 6.00/00 and built ROOT on Mac OSX 10.9.3 using the configure method. I checked that I have the build prerequisites and, indeed, I do (Xcode developer package and XQuartz). I configured ROOT in the following way:
    ./configure macosx --all

  2. I have attached the code that I am running which produces the error (please ignore the name of the file).

  3. Running otool -L $ROOTSYS/lib/libRIO.so in a terminal window produces:

~$ otool -L $ROOTSYS/lib/libRIO.so
/Users/alexclifton/ROOT2/root/lib/libRIO.so:
@rpath/libRIO.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
@rpath/libThread.so (compatibility version 0.0.0, current version 0.0.0)
@rpath/libCore.so (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)

If there is any other information that is needed, please let me know.

As an aside, I was able to get 6.00/001 from git and configured this version of ROOT in the exact same way as described above. The following error was produced after running make:
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [core/utils/src/rootcling_tmp] Error 1
test_delete1.cxx (195 Bytes)

Hi,

I agree that what you did ought to work.

Could you try to configure without specifying macosx to configure? It will allow it to guess; I’d assume it will choose a 64 bit build.

What does clang --version say for you? Could you attach config.log?

Cheers, Axel

Hi,

O and how did you build your binary? And what does otool -L say for it?

Cheers, Axel

Hi Axel,

Thank you for your responses:

  1. I have tried to configure with both macosx and macosx64 architectures. I will try to leave the architecture field blank and see what happens.

  2. Here is what clang --version says for me:

clang --version Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.2.0 Thread model: posix

I am not quite sure I understand what you mean here. I use git to obtain the files from the git repository and then run the configure file followed by make. If this does not answer your question, please let me know.

Sure thing. It is attached to this post. The log file is not the file from configuring ROOT with the architecture field empty. It is from using the macosx option. I could not upload the log file so I converted it to a txt file and uploaded that instead.

  1. I also tried downloading the tar file directly from the ROOT website instead of using git. This did not work, just FYI. I run into the same issue.

  2. Incase you did not see my comment about the error during creation of the binary, below is the error that is returned:

ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [core/utils/src/rootcling_tmp] Error 1
config.txt (200 KB)

Sorry, I forgot one of your requests:

Here is what it says for me:

otool -L error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: at least one file must be specified Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool [-arch arch_type] [-fahlLDtdorSTMRIHGvVcXmqQjC] [-mcpu=arg] <object file> ... -f print the fat headers -a print the archive header -h print the mach header -l print the load commands -L print shared libraries used -D print shared library id name -t print the text section (disassemble with -v) -p <routine name> start dissassemble from routine name -s <segname> <sectname> print contents of section -d print the data section -o print the Objective-C segment -r print the relocation entries -S print the table of contents of a library -T print the table of contents of a dynamic shared library -M print the module table of a dynamic shared library -R print the reference table of a dynamic shared library -I print the indirect symbol table -H print the two-level hints table -G print the data in code table -v print verbosely (symbolically) when possible -V print disassembled operands symbolically -c print argument strings of a core file -X print no leading addresses or headers -m don't use archive(member) syntax -B force Thumb disassembly (ARM objects only) -q use llvm's disassembler (the default) -Q use otool(1)'s disassembler -mcpu=arg use `arg' as the cpu for disassembly -j print opcode bytes -C print linker optimization hints

Hi,

How do you run your code?

I assumed it’s a binary because your source code contains a main() function. If you run this within the ROOT binary itself then you should not call it main() but e.g. “test_delete1()” which will allow you to run it as “.x test_delet1.C”.

Cheers, Axel.

As you mentioned, I run my code as a binary. I use CMake to generate an executable then run the executable. I never run my code using ROOT.

Hi,

How do you link your binary, what’s the exact linker invocation?

Cheers, Axel.

Hi Axel,

I use CMAKE to create my executable and link the necessary libraries. In the parent directory of my project I have a CMakeLists.txt file that reads:

[code]cmake_minimum_required(VERSION 2.6)
project(ANALYSIS_PROJECT)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY $ENV{ANALYSIS_DIR}/exe/)
add_subdirectory($ENV{ANALYSIS_SRC_DIR})

include_directories(
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include, /Users/alexclifton/ROOT2/root/include)

link_directories(/Users/alexclifton/ROOT2/root/lib)[/code]

In the /src directory where I keep my source code, there is another CMakeLists.txt file that reads:

[code]include_directories(
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include, /Users/alexclifton/ROOT2/root/include)

link_directories(/Users/alexclifton/ROOT2/root/lib)
set (PROGRAMS analysis_prgrm)

foreach(program ${PROGRAMS})
add_executable(${program}.exe $ENV{ANALYSIS_SRC_DIR}/${program}.cxx)
target_link_libraries(${program}.exe
Cling
Core
FFTW
Gpad
Graf
Graf3d
Gui
Hist
Hist
MathCore
Matrix
Minuit
Net
Physics
Postscript
Rint
RIO
Thread
Tree
)
endforeach(program)
[/code]

The version of CMAKE that I am using is 3.0.0

Hi,

Don’t link cling in. It will be dynamically loaded (to hide its symbols).

Cheers, Axel.

Hi Experts,

I am new to using ROOT and I have the same issue regarding the LLVM symbols being exposed to Cling. I am trying to integrate ROOT into my Geant4 application. The current CMakeLists builds and compiles fine but gives me the error when I execute the program. I strongly believe that the error I am having has to do with the way I link ROOT libraries in. Please, can anyone point out what I might be doing wrong, I have included a section of my CMakeLists text file. Thank you so much. Cheers.

find_package(ROOT REQUIRED)

#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
# Setup include directory for this project
#
if(ROOT_FOUND)
add_definitions(-DG4ANALYSIS_USE_ROOT)
include(${ROOT_USE_FILE})
include(${Geant4_USE_FILE})
include_directories(${ROOT_INCLUDE_DIR} ${Geant4_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
else()
include(${Geant4_USE_FILE})
include_directories(${Geant4_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/include)
endif()


#----------------------------------------------------------------------------
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)

#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(JCC71 JCC71.cc ${sources} ${headers})


if(ROOT_FOUND)
target_link_libraries(JCC71 ${ROOT_LIBRARIES})
target_link_libraries(JCC71 ${Geant4_LIBRARIES})
else()
target_link_libraries(JCC71 ${Geant4_LIBRARIES})
endif()