[FFmpeg-devel] configure needs to check for OpenCL version 1.2 and look elsewhere as well

Wei Gao highgod0401 at gmail.com
Sat Apr 20 04:52:22 CEST 2013


Hi, sorry for replying late, and also I am not familiar with configure
things, I do some works and test as your patch, some comments as follows:


2013/4/13 Hanspeter Niederstrasser <niederstrasser at gmail.com>

> The OpenCL test just checks for CL/cl.h which doesn't exist on OS X
> (it's at OpenCL/cl.h).  In trying to fix that, I also noticed that
> ffmpeg needs OpenCL >= 1.2, so I tried to add a version check to
> configure as well.  Here's my current patch, but it is not setting
> HAVE_OPENCL_CL_H, even though config.log says that the header and
> library were found.
>
> diff --git a/configure b/configure
> index fe976fd..83bb71f 100755
> --- a/configure
> +++ b/configure
> @@ -1471,6 +1471,7 @@ HAVE_LIST="
>      mprotect
>      msvcrt
>      nanosleep
> +    opencl_cl_h
>      openjpeg_1_5_openjpeg_h
>      PeekNamedPipe
>      perl
>
it should add a check header line:check_header opencl/cl.h to set the
opencl_cl_h

> @@ -4034,7 +4035,12 @@ enabled openal     && { { for al_libs in
> "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32
>                          die "ERROR: openal not found"; } &&
>                        { check_cpp_condition "AL/al.h"
> "defined(AL_VERSION_1_1)" ||
>                          die "ERROR: openal must be installed and
> version must be 1.1 or compatible"; }
> -enabled opencl     && require2 opencl CL/cl.h clEnqueueNDRangeKernel
> -lOpenCL
> +enabled opencl     && { check_lib OpenCL/cl.h clEnqueueNDRangeKernel
> -Wl,-framework,OpenCL ||
> +                        check_lib CL/cl.h clEnqueueNDRangeKernel -lOpenCL
> ||
> +                        die "ERROR: opencl not found"; } &&
> +                      { check_cpp_condition "OpenCL/cl.h"
> "defined(CL_VERSION_1_2)" ||
> +                        check_cpp_condition "CL/cl.h"
> "defined(CL_VERSION_1_2)"  ||
> +                        die "ERROR: opencl must be installed and
> version must be 1.2 or compatible"; }
>
I tried this on my computer, it does not pass the configure, I think it
should be written like this:
enabled opencl     && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel
-Wl,-framework,OpenCL ||
                        check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL
||
                        die "ERROR: opencl not found"; } &&
                      { check_cpp_condition "OpenCL/cl.h"
"defined(CL_VERSION_1_2)" ||
                        check_cpp_condition "CL/cl.h"
"defined(CL_VERSION_1_2)" ||
                        die "ERROR: opencl must be installed and version
must be 1.2 or compatible"; }
use check_lib2 to check, and this can pass on my computer. And I want to
ask a question: -Wl,-framework,OpenCL, what does these mean? Isn't
 -lOpenCL OK?

 enabled openssl    && { check_lib openssl/ssl.h SSL_library_init
> -lssl -lcrypto ||
>                          check_lib openssl/ssl.h SSL_library_init
> -lssl32 -leay32 ||
>                          check_lib openssl/ssl.h SSL_library_init
> -lssl -lcrypto -lws2_32 -lgdi32 ||
> diff --git a/libavutil/opencl.h b/libavutil/opencl.h
> index acafe36..5450537 100644
> --- a/libavutil/opencl.h
> +++ b/libavutil/opencl.h
> @@ -31,7 +31,11 @@
>  #ifndef LIBAVUTIL_OPENCL_H
>  #define LIBAVUTIL_OPENCL_H
>
> +#if HAVE_OPENCL_CL_H
> +#include <OpenCL/cl.h>
> +#else
>  #include <CL/cl.h>
> +#endif
>  #include "config.h"
>  #include "dict.h"
>
I think the  #include "config.h" should above the #if HAVE_OPENCL_CL_H
line. It should be written as follows:

 #include "config.h"
+#if HAVE_OPENCL_CL_H
+#include <OpenCL/cl.h>
+#else
 #include <CL/cl.h>
+#endif
 #include "dict.h"

>
>
> Hanspeter
>
> --
> Disclaimer:
> By sending an email to ANY of my addresses you are agreeing that:
> 1. I am by definition, "the intended recipient"
> 2. All information in the email is mine to do with as I see fit and
> make such financial profit, political mileage, or good joke as it
> lends itself to.
> 3. I may take the contents as representing the views of your company.
> 4. This overrides any disclaimer or statement of confidentiality that
> may be included with your message.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list