Loading on start up


_ROOT Version:6.28
_Platform:Windows 11
_Compiler:Cling, Visual c++, gnu g++

I’m trying to load my libraries at root start up with ‘root -l name.cpp+’ as sugested somewhere here for Linux. It does recognize ‘-L’ – maybe its a Windows thing.

I don’t really care how it’s done – all I want to do is not enter ‘.L name.cpp+’ many times. A scripte would do it but that doesn’t seem to work for ‘…’ commands

1 Like

Try

root -e '.L name.cpp+' -e '.L other.cpp+' ....

Thanks. I’ll try that. I tried something like ‘root -L name.cpp+’ whice some body suggest. It doesn’t work on Windows may on Linux. ‘-e’ makes sense!

I found I could only load one ‘.cpp’ file that way, but I have come up with a solution.
I make a file I call ‘load.cpp’ and it is series of includes like so
#include “rFlat.cpp”
#include “boostTo.cpp”
#include “ProbDStarLNu.cpp”
#include “PickAngles.cpp”

‘.L load.cpp++’ creates a single library file (‘.ddl’) with all my stuff in it and available from the command line.

I found I could only load one ‘.cpp’ file that way

That should not be the case. What is the exact command line that you tried?

It was based on this:

alias roott=’root -l -L /path/to/lib/library.so -L ~/path/to/file.cpp+

I removed the library as I don’'t have one on windows and changed the pat to the cpp file (which was local to the directory I run root in).

It does not even recognize ‘-L’

PS C:\Users\snyde\BFROOT> cd .\ROOT\
PS C:\Users\snyde\BFROOT\ROOT> C:\root_v6.28.06\bin\root.exe -L .\bDecay.cpp+
root: unrecognized option '-L'

However with -e that works.

Ah! Trying more variations, I find the repeating the ‘-e’ command for each ‘.L’ works

C:\root_v6.28.06\bin\root.exe -e ".L .\load.cpp++" -e ".L .\bDecay.cpp++"

==>load.cpp is my files with the ‘includes’ which puts all the functions specified in a single library…and ‘bDecay.cpp’ is what I’m working on that depends on them.

It should not :slight_smile:

Ah! Trying more variations, I find the repeating the ‘-e’ command for each ‘.L’ works

Exactly :slight_smile:

-L is not a command line argument of root.exe
-e is a command line argument of root.exe which says to please execute the next parameter as if it was written on the ROOT command line.

Yes. I finally figured that out for myself after trying many other possibilities.

Thanks!!!

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