Menu

#80 Adding the possiblity to compile a law using python module

3.0.2
closed
nobody
None
2017-07-11
2017-07-07
No

Instead of doing a os.command avec "mfront --obuild --interface=" etc.

Discussion

  • Helfer Thomas

    Helfer Thomas - 2017-07-07
    • status: open --> accepted
     
  • Helfer Thomas

    Helfer Thomas - 2017-07-11

    Hi Lucie,

    MFront relies on external tools, called generators, for this step
    (this semantic is the same than the one used by cmake).

    The only available generator is currently the Makefile generator,
    handled by the MakefileGenerator class. This generator can be used
    as follows:

    import mfront
    dsl = mfront.getDSL("Chaboche.mfront")
    
    dsl.setInterfaces(['castem'])
    dsl.analyseFile("Chaboche.mfront")
    dsl.generateOutputFiles()
    
    m = mfront.MakefileGenerator()
    m.exe(dsl.getTargetsDescription())
    

    The exe methods provides several overloads and may accept an additional argument of type GeneratorOptions which let the user specifiy the optimisation level to be used.

    Regards,
    Thomas

     
  • Helfer Thomas

    Helfer Thomas - 2017-07-11
    • status: accepted --> closed
     

Log in to post a comment.