Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Pb Run ORE examples on Linux Machine with ore.xml file (needs additional xml files)

Open pasparis opened this issue 9 months ago • 2 comments

Hello

I try to run both in python and C++ ORE examples on a linux Mint machine

I get for example 3 the same error message in python and c++ RuntimeError: Failed to open file Input/../../Input/conventions.xml (Python) an error occurred: Failed to open file Input/../../Input/conventions.xml(C++) for example 1: an error occurred: Failed to open file Input/../../Input/calendaradjustment.xml

in the parameter loading only ore.xml is targeted, I don't understand this error Thanks in advance for your help Pascal

below the Python and c++ code

Execution in Python

from ORE import * params = Parameters() params.fromFile("******/Input_3/ore.xml") ore = OREApp(params, True) ore.run()

RuntimeError: Failed to open file Input/../../Input/conventions.xml

Execution in C++

ore::data::initBuilders();
// "usage: ORE path/to/ore.xml"
string inputFile("***********/Input_1/ore.xml");

try {
    auto params = boost::make_shared<Parameters>();
    params->fromFile(inputFile);
    OREApp ore(params, true);
    ore.run();
    return 0;
} catch (const exception& e) {
    cout << endl << "an error occurred: " << e.what() << endl;
    return -1;
}

pasparis avatar May 15 '24 16:05 pasparis

Can you check the parameter setup / InputPath. This path has to point to the locations of the other config files like conventions.xml etc. It can either be an absolute path or a path relative to the current working directory

pcaspers avatar May 19 '24 11:05 pcaspers

Hi Peter, Thank you for the reply, I am going to see the parameter setup. I have just managed to make it run by putting this location

string inputFile("****/pOre1/cmake-build-debug/Input/ore.xml"); //pOre1/cmake-build-debug/Input netting.xml ore.xml portfolio.xml simulation.xml

/*******/pOre1/Input calendaradjustment.xml conventions.xml currencies.xml curveconfig.xml pricingengine.xml todaysmarket.xml

pasparis avatar May 23 '24 15:05 pasparis