source: sasmodels/gen_so.py @ 381b1f0

Last change on this file since 381b1f0 was 381b1f0, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 8 years ago

Ticket #539: Precompile model dlls and reuse them.

  • Property mode set to 100644
File size: 762 bytes
Line 
1# Script to compile all C/C++ models
2# Part of the build process, referenced from setup.py
3import sys, os
4
5def main():
6    sasmodels = os.path.dirname(os.path.realpath(__file__))
7    sys.path.insert(0, sasmodels)
8    from sasmodels import generate, core
9
10    # Convert ../sasmodels/models/name.py to name
11    model_loc = os.path.join(sasmodels, "sasmodels", "models") 
12    for i in os.listdir(model_loc):
13        # Choose only relevant python files
14        if i.endswith(".py") and not i.startswith("_"):
15            model_name = os.path.basename(i)[:-3]
16            model_info = core.load_model_info(model_name)
17            # Run the conversion but don't delete the .so
18            model = core.build_model(model_info)
19
20if __name__ == "__main__":
21    main()
22
23
24
Note: See TracBrowser for help on using the repository browser.