Commit 5f47bfd5 authored by Philip Langdale's avatar Philip Langdale Committed by Timo Rothenpieler

configure: Add an explicit check and option for nvcc

The use of nvcc to compile cuda kernels is distinct from the use of
cuda sdk libraries and linking against those libraries. We have
previously not bothered to distinguish these two cases because all
the filters that used cuda kernels also used the sdk. In the following
changes, I'm going to remove the sdk dependency from those filters,
but we need a way to ensure that nvcc is present and functioning, and
also a way to explicitly disable its use so that the filters are not
built.
Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
parent b38dd2d2
...@@ -321,6 +321,7 @@ External library support: ...@@ -321,6 +321,7 @@ External library support:
The following libraries provide various hardware acceleration features: The following libraries provide various hardware acceleration features:
--disable-amf disable AMF video encoding code [autodetect] --disable-amf disable AMF video encoding code [autodetect]
--disable-audiotoolbox disable Apple AudioToolbox code [autodetect] --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
--enable-cuda-nvcc enable Nvidia CUDA compiler [no]
--enable-cuda-sdk enable CUDA features that require the CUDA SDK [no] --enable-cuda-sdk enable CUDA features that require the CUDA SDK [no]
--disable-cuvid disable Nvidia CUVID support [autodetect] --disable-cuvid disable Nvidia CUVID support [autodetect]
--disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect] --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
...@@ -1001,6 +1002,10 @@ hostcc_o(){ ...@@ -1001,6 +1002,10 @@ hostcc_o(){
eval printf '%s\\n' $HOSTCC_O eval printf '%s\\n' $HOSTCC_O
} }
nvcc_o(){
eval printf '%s\\n' $NVCC_O
}
test_cc(){ test_cc(){
log test_cc "$@" log test_cc "$@"
cat > $TMPC cat > $TMPC
...@@ -1022,6 +1027,22 @@ test_objcc(){ ...@@ -1022,6 +1027,22 @@ test_objcc(){
test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
} }
test_nvcc(){
log test_nvcc "$@"
cat > $TMPCU
log_file $TMPCU
test_cmd $nvcc -ptx $NVCCFLAGS "$@" $NVCC_C $(nvcc_o $TMPO) $TMPCU
}
check_nvcc() {
log check_nvcc "$@"
test_nvcc <<EOF
extern "C" {
__global__ void hello(unsigned char *data) {}
}
EOF
}
test_cpp(){ test_cpp(){
log test_cpp "$@" log test_cpp "$@"
cat > $TMPC cat > $TMPC
...@@ -1806,6 +1827,7 @@ EXTRALIBS_LIST=" ...@@ -1806,6 +1827,7 @@ EXTRALIBS_LIST="
" "
HWACCEL_LIBRARY_NONFREE_LIST=" HWACCEL_LIBRARY_NONFREE_LIST="
cuda_nvcc
cuda_sdk cuda_sdk
libnpp libnpp
" "
...@@ -4238,6 +4260,7 @@ tmpfile TMPCPP .cpp ...@@ -4238,6 +4260,7 @@ tmpfile TMPCPP .cpp
tmpfile TMPE $EXESUF tmpfile TMPE $EXESUF
tmpfile TMPH .h tmpfile TMPH .h
tmpfile TMPM .m tmpfile TMPM .m
tmpfile TMPCU .cu
tmpfile TMPO .o tmpfile TMPO .o
tmpfile TMPS .S tmpfile TMPS .S
tmpfile TMPSH .sh tmpfile TMPSH .sh
...@@ -6087,6 +6110,7 @@ for func in $COMPLEX_FUNCS; do ...@@ -6087,6 +6110,7 @@ for func in $COMPLEX_FUNCS; do
done done
# these are off by default, so fail if requested and not available # these are off by default, so fail if requested and not available
enabled cuda_nvcc && { check_nvcc || die "ERROR: failed checking for nvcc."; }
enabled cuda_sdk && require cuda_sdk cuda.h cuCtxCreate -lcuda enabled cuda_sdk && require cuda_sdk cuda.h cuCtxCreate -lcuda
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
enabled decklink && { require_headers DeckLinkAPI.h && enabled decklink && { require_headers DeckLinkAPI.h &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment