title: Compilation errors with M1 MacBook Pro and cmake
body: <p>I have just got my new M1 MacBook Pro and am trying to compile a code base required for my university work. Here are the steps I have taken:</p>
  <ol>
  <li>I set Terminal to always open using Rosetta.</li>
  <li>Installed homebrew <code>using /bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot; </code></li>
  <li>Installed cmake using <code>brew install cmake</code></li>
  <li>Run <code>cmake &lt;path to source&gt;</code> (this works fine)</li>
  <li>Run <code>make</code> (this fails)</li>
  </ol>
  <p>Here is the error I get:</p>
  <pre><code>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:97:15: fatal error: 
        'stdlib.h' file not found
  #include_next &lt;stdlib.h&gt;
  </code></pre>
  <p>I have tried uninstalling and re-installing Xcode and CommandLineTools to no avail.</p>
  <p>When using the cmake gui app, I get a different error. I have it set to use CommandLineTools/SDKs/MacOsX11.0.sdk.</p>
  <p>When running <code>make</code> after generating and configuring the build files using this cmake gui setup, I get this error:</p>
  <pre><code>    -- The C compiler identification is AppleClang 12.0.0.12000032
  -- The CXX compiler identification is AppleClang 12.0.0.12000032
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
  -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
  CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
    The C compiler
  
      &quot;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc&quot;
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: /Users/freyamurphy/nori/build/ext_build/src/tbb_p-build/CMakeFiles/CMakeTmp
  </code></pre>
  <p>If I run the command <code>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc test.c</code> (Simple hello world program) I get this error:</p>
  <pre><code>test.c:1:10: fatal error: 'stdio.h' file not found
  #include &quot;stdio.h&quot;
  </code></pre>
  <p>But using <code>cc test.c</code> everything works fine. (This runs usr/bin/cc).</p>
  <p>Seems to me there is perhaps an issue with Xcode. Has anyone had any similar issues or could give me some advice? It would be much appreciated.</p>