code: def main():
      if len(sys.argv) != 3:
          print(__doc__)
          return
      # Make sure that patch and f2c are found on path
      ensure_executable("f2c")
      ensure_executable("patch")
  
      wrapped_routines_file = sys.argv[1]
      lapack_src_dir = sys.argv[2]
      output_dir = os.path.join(os.path.dirname(__file__), "build")
  
      shutil.rmtree(output_dir, ignore_errors=True)
      os.makedirs(output_dir)
  
      wrapped_routines, ignores = getWrappedRoutineNames(
          wrapped_routines_file
      )
      library = getLapackRoutines(
          wrapped_routines, ignores, lapack_src_dir
      )
  
      dumpRoutineNames(library, output_dir)
  
      for typename in types:
          fortran_file = os.path.join(output_dir, "f2c_%s.f" % typename)
          c_file = fortran_file[:-2] + ".c"
          print("creating %s ..." % c_file)
          routines = library.allRoutinesByType(typename)
          concatenateRoutines(routines, fortran_file)
  
          # apply the patchpatch
          patch_file = os.path.basename(fortran_file) + ".patch"
          if os.path.exists(patch_file):
              subprocess.check_call(
                  ["patch", "-u", fortran_file, patch_file]
              )
              print("Patched {}".format(fortran_file))
          try:
              runF2C(fortran_file, output_dir)
          except F2CError:
              print("f2c failed on %s" % fortran_file)
              break
          scrubF2CSource(c_file)
  
          # patch any changes needed to the C file
          c_patch_file = c_file + ".patch"
          if os.path.exists(c_patch_file):
              subprocess.check_call(
                  ["patch", "-u", c_file, c_patch_file]
              )
  
          print()
  
      create_name_header(output_dir)
  
      for fname in os.listdir(output_dir):
          if fname.endswith(".c") or fname == "lapack_lite_names.h":
              print("Copying " + fname)
              shutil.copy(
                  os.path.join(output_dir, fname),
                  os.path.abspath(os.path.dirname(__file__)),
              )
  
imports: import sys
  import os
  import re
  import subprocess
  import shutil
  import fortran
  import clapack_scrub
label_desc: Use image node_id 10 for calling a global function with example usage: main() without return types