adstraw commented on code in PR #11189:
URL: https://github.com/apache/tvm/pull/11189#discussion_r864338884
##########
CMakeLists.txt:
##########
@@ -509,6 +510,103 @@ set(LIBINFO_FILE
${CMAKE_CURRENT_LIST_DIR}/src/support/libinfo.cc)
add_lib_info(${LIBINFO_FILE})
list(REMOVE_ITEM COMPILER_SRCS ${LIBINFO_FILE})
+# Caches the build.
+# Note that ccache-3.x doesn't support nvcc well, so CUDA kernels may never
hit the cache and still
+# need to be re-compiled every time. Using ccache 4.0+ can resolve this issue.
+#
+# NOTE: CMAKE_C[XX]_COMPILER_LAUNCHER only affects build targets that we add
*later*.
+# So we want this logic to appear towards the top of thet this CMakeLists.txt
file.
+if(USE_CCACHE) # True for AUTO, ON, /path/to/ccache
+
+
#-------------------------------------------------------------------------------------------------
+ # Determine which requested policy.
+ # If ccache is required but can't be found, fail with an error message.
+
#-------------------------------------------------------------------------------------------------
+ if("${USE_CCACHE}" STREQUAL "AUTO") # Auto mode
+ set(CCACHE_PROGRAM_CANDIDATE ccache)
+ set(CCACHE_REQUIRED FALSE)
+ elseif("${USE_CCACHE}" MATCHES ${IS_TRUE_PATTERN})
+ set(CCACHE_PROGRAM_CANDIDATE ccache)
+ set(CCACHE_REQUIRED TRUE)
+ else() # /path/to/ccache
+ set(CCACHE_PROGRAM_CANDIDATE "${USE_CCACHE}")
+ set(CCACHE_REQUIRED TRUE)
+ endif()
+
+ find_program(CCACHE_PROGRAM "${CCACHE_PROGRAM_CANDIDATE}")
+ if (CCACHE_PROGRAM)
+ message(STATUS "Found ccache program: '${CCACHE_PROGRAM}'")
+ else()
+ # Note: Once we require cmake >= 3.18, we can simplify this logic using
+ # `find_program(... REQUIRED)`.
+ if (CCACHE_REQUIRED)
+ message(FATAL_ERROR "Unable to find ccache program:
'${CCACHE_PROGRAM_CANDIDATE}'")
+ else()
+ message(STATUS "Unable to find ccache program:
'${CCACHE_PROGRAM_CANDIDATE}'")
Review Comment:
Wondering if this should be a warning? At this point the user has expressed
some desire to use ccache and we couldn't find it. Feels like `STATUS` is
burying the lede.
##########
docs/install/from_source.rst:
##########
@@ -315,7 +332,7 @@ configuration. A workaround for this is to do the following
commands:
brew install openblas gfortran
- pip install pybind11 cython pythran
+ pip install pybind11 cython pythran
Review Comment:
Space error.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]