marcoabreu commented on a change in pull request #11520: [WIP] Improve Ccache
URL: https://github.com/apache/incubator-mxnet/pull/11520#discussion_r237220644
 
 

 ##########
 File path: ci/docker/runtime_functions.sh
 ##########
 @@ -33,35 +33,23 @@ clean_repo() {
     git submodule update --init --recursive
 }
 
-build_ccache_wrappers() {
-    set -ex
-
-    rm -f cc
-    rm -f cxx
-
-    touch cc
-    touch cxx
-
-    if [ -z ${CC+x} ]; then
-        echo "No \$CC set, defaulting to gcc";
-        export CC=gcc
-    fi
-
-    if [ -z ${CXX+x} ]; then
-       echo "No \$CXX set, defaulting to g++";
-       export CXX=g++
-    fi
-
-    # this function is nessesary for cuda enabled make based builds, since 
nvcc needs just an executable for -ccbin
 
-    echo -e "#!/bin/sh\n/usr/local/bin/ccache ${CC} \"\$@\"\n" >> cc
-    echo -e "#!/bin/sh\n/usr/local/bin/ccache ${CXX} \"\$@\"\n" >> cxx
+install_ccache_wrappers() {
+    set -ex
 
-    chmod +x cc
-    chmod +x cxx
+    # Add to the beginning of path to ensure this redirection is picked up 
instead
+    # of the original ones. Especially CUDA/NVCC appends itself to the 
beginning of the
+    # path and thus this redirect is ignored. This change fixes this problem
+    export PATH=/usr/local/bin:$PATH
+    ln -s ccache /usr/local/bin/gcc
 
 Review comment:
   In that case, the softlink (or whatever was there previously) would just get 
replaced. But since this script is executed at the install time of the 
container, it's highly unlikely that the link already exists

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to