Unable to plot simple function

I installed root and when I try and run the following commands:

TF1 f1("f1", "sin(x)/x", 0.,10.); f1.Draw();

I get the following errors:

Error in <TUnixSystem::FindDynamicLibrary>: libASImage.so does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
Error in <TUnixSystem::FindDynamicLibrary>: ASImage[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TUnixSystem::FindDynamicLibrary>: libASImage.so does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
Error in <TUnixSystem::FindDynamicLibrary>: ASImage[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TGHScrollBar::TGHScrollBar>: arrow_*.xpm not found
Error in <TUnixSystem::FindDynamicLibrary>: libASImage.so does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
Error in <TUnixSystem::FindDynamicLibrary>: ASImage[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TUnixSystem::FindDynamicLibrary>: libASImage.so does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
Error in <TUnixSystem::FindDynamicLibrary>: ASImage[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TGVScrollBar::TGVScrollBar>: arrow_*.xpm not found
Error in <TUnixSystem::FindDynamicLibrary>: libASImage.so does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
Error in <TUnixSystem::FindDynamicLibrary>: ASImage[.so | .dll | .dylib | .sl | .dl | .a] does not exist in /usr/local/share/root-6.08.06/builddir/lib:/usr/local/share/pro/builddir/lib:/usr/local/share/pro/builddir/lib:.:/usr/local/share/root-6.08.06/builddir/lib:/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f77b926758a in waitpid () from /lib64/libc.so.6
#1  0x00007f77b91e042b in do_system () from /lib64/libc.so.6
#2  0x00007f77ba2f6182 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0xb954f0) at /usr/local/share/pro/core/unix/src/TUnixSystem.cxx:2118
#3  TUnixSystem::StackTrace (this=0xb954f0) at /usr/local/share/pro/core/unix/src/TUnixSystem.cxx:2405
#4  0x00007f77ba2f867c in TUnixSystem::DispatchSignals (this=0xb954f0, sig=kSigSegmentationViolation) at /usr/local/share/pro/core/unix/src/TUnixSystem.cxx:3625
#5  <signal handler called>
#6  TGHScrollBar::SetPosition (this=0x184e290, pos=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGScrollBar.cxx:664
#7  0x00007f77ad06c96b in TGCanvas::Layout (this=0x1a46d80) at /usr/local/share/pro/gui/gui/src/TGCanvas.cxx:2316
#8  0x00007f77ad0a9cc4 in TGCompositeFrame::MapSubwindows (this=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGFrame.cxx:1162
#9  0x00007f77ad0a9cc4 in TGCompositeFrame::MapSubwindows (this=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGFrame.cxx:1162
#10 0x00007f77ad16ab88 in TRootCanvas::CreateCanvas (this=this
entry=0x19aae40, name=name
entry=0x18e83d0 "c1") at /usr/local/share/pro/gui/gui/src/TRootCanvas.cxx:600
#11 0x00007f77ad16b66c in TRootCanvas::TRootCanvas (this=0x19aae40, c=0x18cf760, name=0x18e83d0 "c1", x=10, y=10, width=700, height=500) at /usr/local/share/pro/gui/gui/src/TRootCanvas.cxx:321
#12 0x00007f77ad17588e in TRootGuiFactory::CreateCanvasImp (this=<optimized out>, c=0x18cf760, title=0x18e83d0 "c1", x=10, y=10, width=700, height=500) at /usr/local/share/pro/gui/gui/src/TRootGuiFactory.cxx:71
#13 0x00007f77ae657682 in TCanvas::Constructor (this=0x18cf760, name=0x18e83d0 "c1", title=0x18e83d0 "c1", form=<optimized out>) at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:286
#14 0x00007f77ae6587e4 in TCanvas::TCanvas (this=0x18cf760, name=0x18e83d0 "c1", title=0x18e83d0 "c1", form=1) at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:226
#15 0x00007f77ae658922 in TCanvas::MakeDefCanvas () at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:1417
#16 0x00007f77baa8c031 in ?? ()
#17 0x00007fffc2d6c178 in ?? ()
#18 0x00007fffc2d6c550 in ?? ()
#19 0x00007f77baa8c000 in ?? ()
#20 0x00007fffc2d6c550 in ?? ()
#21 0x0000000000bf6100 in ?? ()
#22 0x00007fffc2d6c550 in ?? ()
#23 0x00007f77baa8c000 in ?? ()
#24 0x00007f77b691646a in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#25 0x00007f77b6917e2d in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#26 0x00007f77b69180b4 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#27 0x00007f77b69a736f in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#28 0x00007f77b6883d46 in HandleInterpreterException (metaProcessor=<optimized out>, input_line=<optimized out>, compRes=
0x7fffc2d6c42c: cling::Interpreter::kSuccess, result=result
entry=0x7fffc2d6c550) at /usr/local/share/pro/core/meta/src/TCling.cxx:1883
#29 0x00007f77b6893fcd in TCling::ProcessLine (this=0xbef350, line=<optimized out>, error=0x0) at /usr/local/share/pro/core/meta/src/TCling.cxx:2049
#30 0x00007f77ba1ea548 in TApplication::ProcessLine (this=0xbe0050, line=<optimized out>, sync=<optimized out>, err=0x0) at /usr/local/share/pro/core/base/src/TApplication.cxx:1005
#31 0x00007f77ba1775cd in TROOT::ProcessLine (this=0x7f77ba61c960 <ROOT::Internal::GetROOT1()::alloc>, line=line
entry=0x7f77ba335949 "TCanvas::MakeDefCanvas();", error=error
entry=0x0) at /usr/local/share/pro/core/base/src/TROOT.cxx:2179
#32 0x00007f77ba17762e in TROOT::MakeDefCanvas (this=<optimized out>) at /usr/local/share/pro/core/base/src/TROOT.cxx:1389
#33 0x00007f77ba21c605 in TObject::AppendPad (this=0x7f77baa93040, option=0x7f77baa8d000 "") at /usr/local/share/pro/core/base/src/TObject.cxx:168
#34 0x00007f77aeda226c in TF1::Draw (this=0x7f77baa93040, option=0x7f77baa8d000 "") at /usr/local/share/pro/hist/hist/src/TF1.cxx:1087
#35 0x00007f77baa8e074 in ?? ()
#36 0x00000000baa8e000 in ?? ()
#37 0x0000000000c48e50 in ?? ()
#38 0x00007f77b6981420 in ?? () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#39 0x00007fffc2d6ce70 in ?? ()
#40 0x00007f77baa8e000 in ?? ()
#41 0x00007f77b691646a in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#42 0x00007f77b6917e2d in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#43 0x00007f77b69180b4 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#44 0x00007f77b69a736f in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#45 0x00007f77b6883d46 in HandleInterpreterException (metaProcessor=<optimized out>, input_line=<optimized out>, compRes=
0x7fffc2d6cd4c: cling::Interpreter::kSuccess, result=result
entry=0x7fffc2d6ce70) at /usr/local/share/pro/core/meta/src/TCling.cxx:1883
#46 0x00007f77b6893fcd in TCling::ProcessLine (this=0xbef350, line=<optimized out>, error=0x7fffc2d6d25c) at /usr/local/share/pro/core/meta/src/TCling.cxx:2049
#47 0x00007f77ba1ea548 in TApplication::ProcessLine (this=this
entry=0xbe0050, line=<optimized out>, sync=sync
entry=false, err=err
entry=0x7fffc2d6d25c) at /usr/local/share/pro/core/base/src/TApplication.cxx:1005
#48 0x00007f77ba65e3fe in TRint::ProcessLineNr (this=this
entry=0xbe0050, filestem=filestem
entry=0x7f77ba66c972 "ROOT_prompt_", line=0x7fffc2d6d319 "f1.Draw();", error=0x7fffc2d6d25c, error
entry=0x0) at /usr/local/share/pro/core/rint/src/TRint.cxx:749
#49 0x00007f77ba65e74f in TRint::HandleTermInput (this=0xbe0050) at /usr/local/share/pro/core/rint/src/TRint.cxx:610
#50 0x00007f77ba2f7c3d in TUnixSystem::CheckDescriptors (this=this
entry=0xb954f0) at /usr/local/share/pro/core/unix/src/TUnixSystem.cxx:1321
#51 0x00007f77ba2f8f0b in TUnixSystem::DispatchOneEvent (this=0xb954f0, pendingOnly=<optimized out>) at /usr/local/share/pro/core/unix/src/TUnixSystem.cxx:1076
#52 0x00007f77ba245ee4 in TSystem::InnerLoop (this=0xb954f0) at /usr/local/share/pro/core/base/src/TSystem.cxx:408
#53 0x00007f77ba244aff in TSystem::Run (this=0xb954f0) at /usr/local/share/pro/core/base/src/TSystem.cxx:358
#54 0x00007f77ba1e7adf in TApplication::Run (this=this
entry=0xbe0050, retrn=retrn
entry=false) at /usr/local/share/pro/core/base/src/TApplication.cxx:1157
#55 0x00007f77ba65fc6e in TRint::Run (this=this
entry=0xbe0050, retrn=retrn
entry=false) at /usr/local/share/pro/core/rint/src/TRint.cxx:463
#56 0x000000000040106c in main (argc=<optimized out>, argv=0x7fffc2d6f6a8) at /usr/local/share/pro/main/src/rmain.cxx:30
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  TGHScrollBar::SetPosition (this=0x184e290, pos=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGScrollBar.cxx:664
#7  0x00007f77ad06c96b in TGCanvas::Layout (this=0x1a46d80) at /usr/local/share/pro/gui/gui/src/TGCanvas.cxx:2316
#8  0x00007f77ad0a9cc4 in TGCompositeFrame::MapSubwindows (this=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGFrame.cxx:1162
#9  0x00007f77ad0a9cc4 in TGCompositeFrame::MapSubwindows (this=<optimized out>) at /usr/local/share/pro/gui/gui/src/TGFrame.cxx:1162
#10 0x00007f77ad16ab88 in TRootCanvas::CreateCanvas (this=this
entry=0x19aae40, name=name
entry=0x18e83d0 "c1") at /usr/local/share/pro/gui/gui/src/TRootCanvas.cxx:600
#11 0x00007f77ad16b66c in TRootCanvas::TRootCanvas (this=0x19aae40, c=0x18cf760, name=0x18e83d0 "c1", x=10, y=10, width=700, height=500) at /usr/local/share/pro/gui/gui/src/TRootCanvas.cxx:321
#12 0x00007f77ad17588e in TRootGuiFactory::CreateCanvasImp (this=<optimized out>, c=0x18cf760, title=0x18e83d0 "c1", x=10, y=10, width=700, height=500) at /usr/local/share/pro/gui/gui/src/TRootGuiFactory.cxx:71
#13 0x00007f77ae657682 in TCanvas::Constructor (this=0x18cf760, name=0x18e83d0 "c1", title=0x18e83d0 "c1", form=<optimized out>) at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:286
#14 0x00007f77ae6587e4 in TCanvas::TCanvas (this=0x18cf760, name=0x18e83d0 "c1", title=0x18e83d0 "c1", form=1) at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:226
#15 0x00007f77ae658922 in TCanvas::MakeDefCanvas () at /usr/local/share/pro/graf2d/gpad/src/TCanvas.cxx:1417
#16 0x00007f77baa8c031 in ?? ()
#17 0x00007fffc2d6c178 in ?? ()
#18 0x00007fffc2d6c550 in ?? ()
#19 0x00007f77baa8c000 in ?? ()
#20 0x00007fffc2d6c550 in ?? ()
#21 0x0000000000bf6100 in ?? ()
#22 0x00007fffc2d6c550 in ?? ()
#23 0x00007f77baa8c000 in ?? ()
#24 0x00007f77b691646a in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#25 0x00007f77b6917e2d in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#26 0x00007f77b69180b4 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#27 0x00007f77b69a736f in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /usr/local/share/root-6.08.06/builddir/lib/libCling.so
#28 0x00007f77b6883d46 in HandleInterpreterException (metaProcessor=<optimized out>, input_line=<optimized out>, compRes=
0x7fffc2d6c42c: cling::Interpreter::kSuccess, result=result
entry=0x7fffc2d6c550) at /usr/local/share/pro/core/meta/src/TCling.cxx:1883
===========================================================

Any help is appreciated. Thanks

The ROOT version you are using seems to not be installed properly as the library libASImage.so is missing . Have you installed it yourself ? is $ROOTSYS defined ? on which machine are you running ? with which ROOT version ?

Yes, I have installed it myself. The way I did it was to try and follow the installation instructions in the file INSTALL found in the README folder. Due to the fact that I am a novice in Linux, I do not know how to define $ROOTSYS. The machine that I am running on is a LENOVO Y700-15ISK. If it makes a difference, it is also a dual boot, the second OS being Windows 10. The version of ROOT is 6.08.06.

Look at “Building” at the bottom of this page:

I have followed the instructions provided on the webpage you suggested and this time it worked. Thank you!

Ok, so after doing that it worked for a while. But now I switched off my pc and went home. When I opened the terminal and typed root and tried the same process at home, the same error occured. I typed the command:

source bin/thisroot.sh

and now there are no more errors. Is there some way to avoid having to write the command everytime I reboot my pc?

You need to put this command in your ~/.profile or ~/login file depending which steel you are using. Also the file ~/kshrc or ~/.cshrc etc … depending also on the shell you are using.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.