code: def getLapackRoutines(wrapped_routines, ignores, lapack_dir):
      blas_src_dir = os.path.join(lapack_dir, "BLAS", "SRC")
      if not os.path.exists(blas_src_dir):
          blas_src_dir = os.path.join(lapack_dir, "blas", "src")
      lapack_src_dir = os.path.join(lapack_dir, "SRC")
      if not os.path.exists(lapack_src_dir):
          lapack_src_dir = os.path.join(lapack_dir, "src")
      install_src_dir = os.path.join(lapack_dir, "INSTALL")
      if not os.path.exists(install_src_dir):
          install_src_dir = os.path.join(lapack_dir, "install")
  
      library = LapackLibrary(
          [install_src_dir, blas_src_dir, lapack_src_dir]
      )
  
      for r in ignores:
          library.addIgnorableRoutine(r)
  
      for w in wrapped_routines:
          library.addRoutine(w)
  
      library.resolveAllDependencies()
  
      return library
  
imports: import sys
  import os
  import re
  import subprocess
  import shutil
  import fortran
  import clapack_scrub
label_desc: Use image node_id 2 for calling a global function with example usage: getLapackRoutines(wrapped_routines, ignores, lapack_dir) and returns: library