def lib_name(base_name, version = None, static = False):
    """Constructs the name of a library on Linux.

      Args:
        base_name: The name of the library, such as "cudart"
        version: The version of the library.
        static: True the library is static or False if it is a shared object.

      Returns:
        The name of the library on linux
      """
    if static:
        return "lib{}.a".format(base_name)
    else:
        version = "." + version if version else ""
        return "lib{}.so{}".format(base_name, version)