driazati commented on code in PR #11140:
URL: https://github.com/apache/tvm/pull/11140#discussion_r860120569


##########
docker/install/ubuntu_install_dnnl.sh:
##########
@@ -20,10 +20,38 @@ set -e
 set -u
 set -o pipefail
 
-cd /usr/local/
-wget -q 
https://github.com/oneapi-src/oneDNN/releases/download/v2.2/dnnl_lnx_2.2.0_cpu_gomp.tgz
-tar -xzf dnnl_lnx_2.2.0_cpu_gomp.tgz
-mv dnnl_lnx_2.2.0_cpu_gomp/include/* /usr/local/include/
-mv dnnl_lnx_2.2.0_cpu_gomp/lib/libdnnl* /usr/local/lib/
-rm -rf dnnl_lnx_2.2.0_cpu_gomp.tgz dnnl_lnx_2.2.0_cpu_gomp
-cd -
+pre_dir=`pwd`
+
+build_dir="/usr/local/"
+install_dir="/usr/local/"
+
+cd ${build_dir}
+rls_tag=$(curl -s https://github.com/oneapi-src/oneDNN/releases/latest \
+    | cut -d '"' -f 2 \
+    | grep -o '[^\/]*$')
+dnnl_ver=`echo ${rls_tag} | sed 's/v//g'`
+echo "The latest oneDNN release is version ${dnnl_ver} with tag '${rls_tag}'"
+
+tar_file="${rls_tag}.tar.gz"
+src_dir="${build_dir}/oneDNN-${dnnl_ver}"
+
+if [ -d ${src_dir} ]; then
+    echo "source files exist."
+else
+    if [ -f ${tar_file} ]; then
+        echo "${tar_file} exists, skip downloading."
+    else 
+        echo "downloading ${tar_file}."
+        
tar_url="https://github.com/oneapi-src/oneDNN/archive/refs/tags/${tar_file}";
+        wget ${tar_url}
+    fi
+    tar -xzvf ${tar_file}
+fi
+
+cd ${src_dir}
+cmake . -DCMAKE_INSTALL_PREFIX=${install_dir} && make -j16 && make install

Review Comment:
   nit: use all available CPUs
   ```suggestion
   NPROC=$(nproc)
   cmake . -GNinja -DCMAKE_INSTALL_PREFIX=${install_dir}
   make -j"$NPROC"
   make install
   ```



-- 
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]

Reply via email to