summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-02-20 19:57:49 -0800
committerTimo Rothenpieler <timo@rothenpieler.org>2019-02-27 18:03:17 +0100
commit5f47bfd50ac46fb18b23a212a53bea0feacc1bb0 (patch)
tree7179d5fc1bd4fa550e119d54d04d6c9187164547 /configure
parentb38dd2d219c99996ca64259ce9d9deff00ad6afe (diff)
downloadffmpeg-streaming-5f47bfd50ac46fb18b23a212a53bea0feacc1bb0.zip
ffmpeg-streaming-5f47bfd50ac46fb18b23a212a53bea0feacc1bb0.tar.gz
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: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure b/configure
index bf40c1d..cf1b960 100755
--- a/configure
+++ b/configure
@@ -321,6 +321,7 @@ External library support:
The following libraries provide various hardware acceleration features:
--disable-amf disable AMF video encoding 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]
--disable-cuvid disable Nvidia CUVID support [autodetect]
--disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
@@ -1001,6 +1002,10 @@ hostcc_o(){
eval printf '%s\\n' $HOSTCC_O
}
+nvcc_o(){
+ eval printf '%s\\n' $NVCC_O
+}
+
test_cc(){
log test_cc "$@"
cat > $TMPC
@@ -1022,6 +1027,22 @@ test_objcc(){
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(){
log test_cpp "$@"
cat > $TMPC
@@ -1806,6 +1827,7 @@ EXTRALIBS_LIST="
"
HWACCEL_LIBRARY_NONFREE_LIST="
+ cuda_nvcc
cuda_sdk
libnpp
"
@@ -4238,6 +4260,7 @@ tmpfile TMPCPP .cpp
tmpfile TMPE $EXESUF
tmpfile TMPH .h
tmpfile TMPM .m
+tmpfile TMPCU .cu
tmpfile TMPO .o
tmpfile TMPS .S
tmpfile TMPSH .sh
@@ -6087,6 +6110,7 @@ for func in $COMPLEX_FUNCS; do
done
# 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 chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
enabled decklink && { require_headers DeckLinkAPI.h &&
OpenPOWER on IntegriCloud