title: CLion - can't run a program on apple m1
body: <p>I ran clion a month ago and it worked perfectly. Now when I run a program I get:</p>
  <pre><code>/bin/sh: /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion-ARM/ch-0/203.7717.62/CLion.app/Contents/bin/cmake/mac/bin/cmake: No such file or directory
  make: *** [cmake_check_build_system] Error 127
  </code></pre>
  <p>Also, on clion startup, the cmake tool window shows me an error:</p>
  <pre><code>CMake Warning at /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/Platform/Darwin-Initialize.cmake:303 (message):
    Ignoring CMAKE_OSX_SYSROOT value:
  
     /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
  
    because the directory does not exist.
  Call Stack (most recent call first):
    /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake:21 (include)
    CMakeLists.txt:2 (project)
  
  
  -- The C compiler identification is AppleClang 12.0.5.12050022
  -- The CXX compiler identification is AppleClang 12.0.5.12050022
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
  -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - broken
  CMake Error at /Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/share/cmake-3.19/Modules/CMakeTestCCompiler.cmake:66 (message):
    The C compiler
  
      &quot;/Library/Developer/CommandLineTools/usr/bin/cc&quot;
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: /Users/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/usr/bin/make cmTC_e3f61/fast &amp;&amp; /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_e3f61.dir/build.make CMakeFiles/cmTC_e3f61.dir/build
      Building C object CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o
      /Library/Developer/CommandLineTools/usr/bin/cc   -arch arm64 -o CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -c /Users/a/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
      Linking C executable cmTC_e3f61
      &quot;/Users/a/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-1/211.7142.21/CLion.app/Contents/bin/cmake/mac/bin/cmake&quot; -E cmake_link_script CMakeFiles/cmTC_e3f61.dir/link.txt --verbose=1
      /Library/Developer/CommandLineTools/usr/bin/cc  -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_e3f61.dir/testCCompiler.c.o -o cmTC_e3f61 
      ld: library not found for -lSystem
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      make[1]: *** [cmTC_e3f61] Error 1
      make: *** [cmTC_e3f61/fast] Error 2
  </code></pre>
  <p>I have xcode command line tools installed. What should I do?</p>