提交 860a4e2b 编写于 作者: S Shanqing Cai 提交者: TensorFlower Gardener

Relax assumption about CUDA library path

On mac 64-bit, the library paths is actually at /usr/local/cuda/lib by default. The assumption that it is always at /usr/local/cuda/lib64 has led to build failures, e.g.,
http://ci.tensorflow.org/view/Nightly/job/nightly-matrix-mac-gpu/100/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=gpu-mac/console
Change: 136653210
上级 c2c59fc1
...@@ -184,11 +184,23 @@ else ...@@ -184,11 +184,23 @@ else
-I "${TF_INC}" -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC || \ -I "${TF_INC}" -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC || \
die "nvcc compilation of ${OP_KERNEL_CC} FAILED" die "nvcc compilation of ${OP_KERNEL_CC} FAILED"
CUDA_LIB_DIR="/usr/local/cuda/lib64"
if [[ ! -d "${CUDA_LIB_DIR}" ]]; then
CUDA_LIB_DIR="/usr/local/cuda/lib"
fi
if [[ ! -d "${CUDA_LIB_DIR}" ]]; then
die "ERROR: Failed to find CUDA library directory at either of "
"/usr/local/cuda/lib and /usr/local/cuda/lib64"
fi
echo "Found CUDA library diretory at: ${CUDA_LIB_DIR}"
echo ""
# USER_OP_SO=$(basename $(echo "${OP_KERNEL_CC}" | sed -e 's/\.cc/\.so/')) # USER_OP_SO=$(basename $(echo "${OP_KERNEL_CC}" | sed -e 's/\.cc/\.so/'))
USER_OP_SO="add_one.so" USER_OP_SO="add_one.so"
"${GPP_BIN}" -std=c++11 ${EXTRA_GPP_FLAGS} \ "${GPP_BIN}" -std=c++11 ${EXTRA_GPP_FLAGS} \
-shared -o "${USER_OP_SO}" "${OP_KERNEL_CC}" \ -shared -o "${USER_OP_SO}" "${OP_KERNEL_CC}" \
"${OP_KERNEL_O}" -I "${TF_INC}" -L "/usr/local/cuda/lib64" \ "${OP_KERNEL_O}" -I "${TF_INC}" -L "${CUDA_LIB_DIR}" \
-fPIC -lcudart || \ -fPIC -lcudart || \
die "g++ compilation of ${OP_KERNEL_CC}" FAILED die "g++ compilation of ${OP_KERNEL_CC}" FAILED
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册