code: def _compile(self, compile_request):
      
  
      try:
        argv = self._make_compile_argv(compile_request)
      except self._HeaderOnlyLibrary:
        self.context.log.debug('{} is a header-only library'.format(compile_request))
        return
  
      compiler = compile_request.compiler
      output_dir = compile_request.output_dir
      env = compiler.invocation_environment_dict
  
      with self.context.new_workunit(
          name=self.workunit_label, labels=[WorkUnitLabel.COMPILER]) as workunit:
        try:
          process = subprocess.Popen(
            argv,
            cwd=output_dir,
            stdout=workunit.output('stdout'),
            stderr=workunit.output('stderr'),
            env=env)
        except OSError as e:
          workunit.set_outcome(WorkUnit.FAILURE)
          raise self.NativeCompileError(
            "Error invoking '{exe}' with command {cmd} and environment {env} for request {req}: {err}"
            .format(exe=compiler.exe_filename, cmd=argv, env=env, req=compile_request, err=e))
  
        rc = process.wait()
        if rc != 0:
          workunit.set_outcome(WorkUnit.FAILURE)
          raise self.NativeCompileError(
            "Error in '{section_name}' with command {cmd} and environment {env} for request {req}. "
            "Exit code was: {rc}."
            .format(section_name=self.workunit_label, cmd=argv, env=env, req=compile_request, rc=rc))
docs: Perform the process of compilation, writing object files to the request's 'output_dir'.
  
      NB: This method must arrange the output files so that `collect_cached_objects()` can collect all
      of the results (or vice versa)!