Returns the symbol for the specified *fortran* module and subroutine/function
    that has been compiled into a shared library.

    :arg lib: the full path to the shared library *.so file.

def static_symbol(module, method, lib, bindc=False):
    """Returns the symbol for the specified *fortran* module and subroutine/function
    that has been compiled into a shared library.

    :arg lib: the full path to the shared library *.so file.
    """
    from os import path
    from numpy.ctypeslib import load_library
    libpath = path.abspath(lib)
    libkey = libpath.lower()

    if libkey not in compilers:
        compilers[libkey] = detect_compiler(libpath)
        if compilers[libkey] == False:
            raise ValueError("Couldn't auto-detect the compiler for {}".format(libpath))
    compiler = compilers[libkey]

    if libkey not in libs:
        libs[libkey] = load_library(libpath, "")
        if not libs[libkey]:
            raise ValueError("Couldn't auto-load the shared library with ctypes.")
    slib = libs[libkey]
    
    identifier = "{}.{}".format(module, method)
    if bindc:
        symbol = method
    elif compiler == "gfortran":
        symbol = "__" + identifier.lower().replace(".", "_MOD_")
    else:
        #We assume the only other option is ifort.
        symbol = identifier.lower().replace(".", "_mp_") + "_"

    if hasattr(slib, symbol):
        return getattr(slib, symbol)
    else:
        return None