#########################################################1### Library order2#########################################################34# This list defines the *order* of linking libraries. A library should5# be put *before* any library it links to. Cython allows6# defining libraries using "# distutils: libraries = LIB". However, if7# there are multiple libraries, the order is undefined so we need to8# manually reorder the libraries according to this list. Any libraries which are not9# listed here will be added at the end of the list (without changing10# their relative order).11from sage.env import cython_aliases, default_required_modules, default_optional_modules1213modules = default_required_modules + default_optional_modules1415aliases = cython_aliases(required_modules=(), optional_modules=modules)1617library_order_list = aliases.get("SINGULAR_LIBRARIES", []) + [18"intl", "curl",19"ec", "ecm"20] + aliases.get("LINBOX_LIBRARIES", []) + aliases.get("FFLASFFPACK_LIBRARIES", []) + aliases.get("GSL_LIBRARIES", []) + [21"pari", "flint", "ecl", "glpk", "ppl",22] + [23"mpfi", "mpfr", "mpc", "ntl", "gmp", "gmpxx",24"brial",25"brial_groebner",26"m4rie",27] + aliases.get("M4RI_LIBRARIES", []) + [28"gap",29] + aliases.get("GDLIB_LIBRARIES", []) + aliases.get("LIBPNG_LIBRARIES", []) + [30"m", "readline", "Lfunction",31] + aliases.get("CBLAS_LIBRARIES", []) + aliases.get("ZLIB_LIBRARIES", [])3233# Make a dict with library:order pairs, where the order are negative34# integers sorted according to library_order_list. When sorting,35# unlisted libraries have order 0, so they appear after the libraries36# in library_order_list.37n = len(library_order_list)38library_order = {}39for i in range(n):40lib = library_order_list[i]41library_order[lib] = i-n424344