0

I want to do hadd of two .root files. hadd is a function of the ROOT software library, which produces .root files. When I do hadd I get the error:

$ hadd -f FinalFileName.root IndividualFileNames*.root

sh: sysctl: command not found
hadd Target file: FinalFileName.root
hadd compression setting for all output: 1

 *** Break *** floating point exception
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[/usr/lib/system/libsystem_malloc.dylib] small_malloc_from_free_list (no debug info)
[/usr/lib/dyld] start (no debug info)

I'm posting this here because the error message makes me think that it's not a ROOT problem, but a MacOS problem.

I did grep -r sysctl / which matched in various places including /usr/bin/man:SYSCTL=/sbin/sysctl so I checked /usr/sbin/sysctl and it exists.

Using macOS Ventura 13.0.1

My research online says that the problem is caused by sysctl being in /sbin/ not /usr/sbin/ but that's not my case.

Can someone please tell me what the problem is here? I don't find any reference to hadd not being available on MacOS.

2
  • Anyway, sysctl should be found automatically. What does echo $PATH show?
    – nohillside
    Dec 5, 2022 at 18:41
  • @nohillside $ echo $PATH /Users/bethlong/.pyenv/shims:/usr/local/Cellar/root/6.26.06_1/bin:/Users/bethlong/opt/anaconda3/bin:/bin:/usr/bin:/usr/local/bin:/condabin
    – Beth Long
    Dec 5, 2022 at 18:43

1 Answer 1

1

Your PATH variable doesn't contain /usr/sbin so hadd/root-config can't find it.

As a quick fix, run

export PATH=$PATH:/usr/sbin:/sbin

and then execute hadd again.

For a longterm fix please make sure

  • These two directories (/usr/sbin and /sbin) are included in /etc/paths
  • Your shell doesn't mangle PATH somehow in the profile it loads at start
1
  • 1
    Added these to my PATH in my .bash_profile and now it works perfectly, thank you
    – Beth Long
    Dec 5, 2022 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .