Messed up PATH settings!

Hi Everyone,

I probably have a messed up path settings, can anyone help me fix this:

Currently I have the following in my /etc/environment:

PATH="/usr/local/texlive/2016/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/home/me/softwares/root:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/texbin:/opt/texbin"

and the relevant part of my .bashrc looks like this:

export PATH="/usr/local/texlive/2016/bin/x86_64-linux:$PATH"

export ROOTSYS=/home/me/softwares/root
export PATH=$PATH:$ROOTSYS/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib

and .profile goes here:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
	. "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

export PATH="/usr/local/texlive/2016/bin/x86_64-linux:$PATH"

My root installation directory is “/home/me/softwares/root”.

“$PATH” returns the following:

me@asus:~$ $PATH
bash: /usr/local/texlive/2016/bin/x86_64-linux:/usr/local/texlive/2016/bin/x86_64-linux:/home/me/bin:/home/me/.local/bin:/usr/local/texlive/2016/bin/x86_64-linux:/usr/local/sbin:/usr/local/bin:/home/me/softwares/root:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/texbin:/opt/texbin:/snap/bin:/home/me/softwares/root/bin: No such file or directory

$ROOTSYS returns:

me@asus:~$ $ROOTSYS
bash: /home/me/softwares/root: Is a directory

$LD returns:

me@asus:~$ $LD_LIBRARY_PATH
bash: :/home/me/softwares/root/lib: No such file or directory

which is absolutely not true !! I definitely have that directory there… the “ls” proves it:

me@asus:~$ ls /home/me/softwares/root/
bin       cint            config         configure  documentation  geom    gui   icons    lib      main      math        net     roofit  test  tutorials
bindings  cmake           config.log     core       etc            graf2d  hist  include  LICENSE  Makefile  misc        proof   rootx   tmva
build     CMakeLists.txt  config.status  doc        fonts          graf3d  html  io       macros   man       montecarlo  README  sql     tree

And inside “…/root/lib” I have all the libraries ! How can I sort this ?

When I compile a code using the following command:

g++ code.cpp `root-config --glibs --cflags` -o code

it compiles smoothly and produces the executable, but when I run it, I get these errors:

Warning in <TClass::TClass>: no dictionary for class TTree is available
Warning in <TClass::TClass>: no dictionary for class TBranch is available
Warning in <TClass::TClass>: no dictionary for class TLeafI is available
Warning in <TClass::TClass>: no dictionary for class TLeaf is available
Warning in <TClass::TClass>: no dictionary for class TVirtualIndex is available
Warning in <TClass::TClass>: no dictionary for class TBranchRef is available
Error in <TBufferFile::ReadClassBuffer>: class: TNamed, attempting to access a wrong version: 18, object skipped at offset 62
Error in <TBufferFile::CheckByteCount>: object of class TNamed read too few bytes: 2 instead of 262755
Error in <TFile::WriteTObject>: Directory myfile.root is not writable
Error in <TFile::Read>: Key not found
Error in <TFile::Read>: Key not found
Error in <TFile::Read>: Key not found

 *** Break *** segmentation violation

I suspect there’s something wrong with my root path settings etc although I can run root from anywhere and work on root shell just fine. Also using g++ it compiles perfectly.

When I type “root” it returns:

me@asus:~$ root
Couldn't find font "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1",
trying "fixed". Please fix your system so helvetica can be found, 
this font typically is in the rpm (or pkg equivalent) package 
XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi.
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/36      5 April 2016   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/36 (v5-34-36@v5-34-36, dic 07 2016, 23:31:51 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] 

System Info:
ROOT version 5.34/36
Ubuntu 16.04.1 LTS, 64-bit.

Thanks very much