tkonolige commented on pull request #7917:
URL: https://github.com/apache/tvm/pull/7917#issuecomment-828562180


   @mherkazandjian I'm sorry it took me so long to remember this, but I don't 
think this PR will work on macOS. Here is what I had in my version of this:
   
   ```
   # On MacOS, the default C compiler (/usr/bin/cc) is actually a small script 
that dispatches to a
   # compiler the default SDK (usually 
/Library/Developer/CommandLineTools/usr/bin/ or
   # 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/).
 CMake
   # automatically detects what is being dispatched and uses it instead along 
with all the flags it
   # needs. CMake makes this second compiler avaliable through the 
CMAKE_C_COMPILER variable, but it
   # does not make the necessary flags available. This leads to configuration 
errors in libbacktrace
   # because it can't find system libraries. Our solution is to detect if 
CMAKE_C_COMPILER lives in
   # /Library or /Applications and switch to the default compiler instead.
   if(CMAKE_SYSTEM_NAME MATCHES "Darwin" AND (CMAKE_C_COMPILER MATCHES 
"^/Library"
     OR CMAKE_C_COMPILER MATCHES "^/Applications"))
     set(c_compiler "/usr/bin/cc")
   else()
     set(c_compiler "${CMAKE_C_COMPILER}")
   endif()
   ```
   
   Note that this solution is not quite correct. You probably want to set the 
sdk path to whatever the user set it to.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to