In C++ you can partition your application/program in several source files. This is advantageous from the point of view that the code is more modular and easier to maintain.
I have a header file “read_inputs.h” with several function prototypes and a “read_inputs.cxx” file with the detailed functions. In standard C++, using g++ all I have to do is compile my main.cxx and read_inputs.cxx at the same time (provided I have the line #include “read_inputs.h” in both my cxx files) and everything works.
How do I do something similar using ACLiC?
I’ve simply tried .L main.C++, but it throws out errors saying i have undefined references to my functions (declared in the read_input files)
[With ACLiC you want to avoid any routine called ‘main’, and thus in the following I assume that your main.cxx contains a routine called start].
You can accomplish what you need by either creating a wrapper file[code]// wrapper.C #include “read_inputs.cxx” #include “main.cxx”
#ifdefMAKECINT #pragma link C++ function start; #endif[/code]and the load (.L wrapper.C+) this wrapper script. Alternative (and better if you want to generate the dictionary for the content of the file) you can simply load them both in succession:.L read_inputs.cxx+
lvis_mol_lens is basically a big function (with the same name) that takes several parameters as input.
I did it this way in order to run script using a bash script that changes the parameters sequentially. However, since I need to load the other file (read_inputs), this presents a problem for my bash script…
I suppose the way to work this out is using your wrapper script approach, but I’m afraid I don’t know what should be done. I guess the wrapper should accept inputs as well that I can then supply to the function? how can I accomplish this?