OpenSourceRisk / Engine

Open Source Risk Engine
http://www.opensourcerisk.org
Other
494 stars 222 forks source link

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

Open pasparis opened 5 months ago

pasparis commented 5 months ago

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;
}
pcaspers commented 5 months ago

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

pasparis commented 5 months ago

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