code: def has_c_library(library, extension=".c"):
      """Check whether a C/C++ library is available on the system to the compiler.
  
      Parameters
      ----------
      library: str
          The library we want to check for e.g. if we are interested in FFTW3, we
          want to check for `fftw3.h`, so this parameter will be `fftw3`.
      extension: str
          If we want to check for a C library, the extension is `.c`, for C++
          `.cc`, `.cpp` or `.cxx` are accepted.
  
      Returns
      -------
      bool
          Whether or not the library is available.
  
      """
      with tempfile.TemporaryDirectory(dir=".") as directory:
          name = join(directory, "%s%s" % (library, extension))
          with open(name, "w") as f:
              f.write("#include <%s.h>\n" % library)
              f.write("int main() {}\n")
  
          # Get a compiler instance
          compiler = ccompiler.new_compiler()
          # Configure compiler to do all the platform specific things
          customize_compiler(compiler)
          # Add conda include dirs
          for inc_dir in get_include_dirs():
              compiler.add_include_dir(inc_dir)
          assert isinstance(compiler, ccompiler.CCompiler)
  
          try:
              # Try to compile the file using the C compiler
              compiler.link_executable(compiler.compile([name]), name)
              return True
          except (CompileError, LinkError):
              return False
  
imports: import distutils
  import os
  import platform
  import sys
  import tempfile
  import warnings
  from distutils import ccompiler
  from distutils.errors import CompileError, LinkError
  from distutils.sysconfig import customize_compiler
  from os.path import join
  import setuptools
  from Cython.Distutils.build_ext import new_build_ext
  from setuptools import setup, Extension
label_desc: Use image node_id 4 for calling a global function with example usage: has_c_library(library, extension) and returns: True, False