Ticket #11024: trac-11024-dokchitser-2.patch

File trac-11024-dokchitser-2.patch, 1.7 KB (added by Martin Raum, 12 years ago)

Something went wrong with diff, this patch is better.

  • sage/lfunctions/dokchitser.py

    diff -r b2608b625964 sage/lfunctions/dokchitser.py
    a b  
    1212
    1313- Martin Raum (2011-03): Refactor the wrapper and adapt to C file
    1414
     15- Henri Cohen (2011-03): Convert GP script to C file
     16
     17- Martin Raum (2011-03): Refactor the wrapper and adapt to C file
     18
    1519TODO:
    1620
    1721- add more examples from data/extcode/pari/dokchitser that illustrate
     
    490494                                      logfile=None)
    491495            self.__gp = g
    492496
    493             libraries = ["computel5.gp." + suffix for suffix in ["so", "dll", "dylib", "dylib64"]]
    494             while True :
    495                 library = libraries.pop()
    496                 try :
    497                     g('GP;install("init_computel5","v","init_computel5","./%s");' % library)
    498                 except :
    499                     continue
    500                 break
    501            
    502             map(g, ['GP;install("initglobs","","initglobs","./%s");' % library,
     497            script_directory = os.environ["SAGE_ROOT"] + "/data/extcode/pari/dokchitser"
     498            suffix = filter(lambda s: "computel5.gp." + s in os.listdir(script_directory),
     499                            ["so", "libdyn", "libdyn64", "dll"])[0]
     500            library = "computel5.gp." + suffix
     501
     502            map(g, ['GP;install("init_computel5","v","init_computel5","./%s");' % library,
     503                    'GP;install("initglobs","","initglobs","./%s");' % library,
    503504                    'GP;install("getconductor","","getconductor","./%s");' % library,
    504505                    'GP;install("getgammaV","","getgammaV","./%s");' % library,
    505506                    'GP;install("getweight","","getweight","./%s");' % library,