Hello,
I’ve recently updated my Mac Laptop from El Capitan to Mojave and am
now getting some build errors in my previously working PyOpenCL project. The
project can be found on this GitHub repo
<https://github.com/zhampel/cr-geomag-prop>.
When I try `python run.py` located in the repo/crprop directory, the
error I’m getting is related to pow, tan, and sqrt. I get errors like
error: call to '__cl_pow' is ambiguous
Has anyone else experienced these build errors? I am including the
kernel and supplementary cl files on line 487 via
program.build(options=[‘-I %s’%cl_src_path], cache_dir=None)
Thanks,
Zig
Traceback (most recent call last):
File "run.py", line 486, in <module>
program.build(options="-I %s"%cl_src_path, cache_dir=None)
File
"/Users/zhampela/py-venv/gpu-python2_7/lib/python2.7/site-packages/pyopencl-2016.2.1-py2.7-macosx-10.14-x86_64.egg/pyopencl/__init__.py",
line 438, in build
options_bytes=options_bytes, source=self._source)
File
"/Users/zhampela/py-venv/gpu-python2_7/lib/python2.7/site-packages/pyopencl-2016.2.1-py2.7-macosx-10.14-x86_64.egg/pyopencl/__init__.py",
line 473, in _build_and_catch_errors
raise err
pyopencl.cffi_cl.RuntimeError: clBuildProgram failed: BUILD_PROGRAM_FAILURE -
Build on <pyopencl.Device 'Iris' on 'Apple' at 0x1024500>:
In file included from <program source>:6:
In file included from
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/particle_props.cl:7:
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/bfield.cl:197:24:
error: call to '__cl_pow' is ambiguous
rpow = pow(1./r,n+2);
^~~~~~~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4662:27:
note: expanded from macro 'pow'
#define pow(__x, __y) __cl_pow(__x, __y)
^~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1009:48:
note: expanded from macro '__CLFN_FD_2FD'
#define __CLFN_FD_2FD(name) float __OVERLOAD__ name(float x, float y); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1010:21:
note: expanded from macro '__CLFN_FD_2FD'
float2 __OVERLOAD__ name(float2 x, float2 y); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1011:21:
note: expanded from macro '__CLFN_FD_2FD'
float3 __OVERLOAD__ name(float3 x, float3 y); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1012:21:
note: expanded from macro '__CLFN_FD_2FD'
float4 __OVERLOAD__ name(float4 x, float4 y); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1013:21:
note: expanded from macro '__CLFN_FD_2FD'
float8 __OVERLOAD__ name(float8 x, float8 y); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4659:15:
note: candidate function
__CLFN_FD_2FD(__cl_pow);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:1014:22:
note: expanded from macro '__CLFN_FD_2FD'
float16 __OVERLOAD__ name(float16 x, float16 y);
^
In file included from <program source>:6:
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/particle_props.cl:68:11:
warning: unused variable 'Z'
float Z = particle->ZMEL.x;
^
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/particle_props.cl:69:11:
warning: unused variable 'mass'
float mass = particle->ZMEL.y;
^
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/particle_props.cl:70:11:
warning: unused variable 'inv_gamman'
float inv_gamman = 1./particle->ZMEL.w;
^
/Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src/particle_props.cl:185:30:
error: call to '__fast_relax_tan' is ambiguous
float dt_theta = 2.*mass*tan(0.5*THETA_MIN)/(Z*Bmag*inv_gamman);
^~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4725:22:
note: expanded from macro 'tan'
#define tan(__x) __fast_relax_tan(__x)
^~~~~~~~~~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:416:27:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float __OVERLOAD__ _name(float x) { return _default_name(x); } \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:417:28:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float2 __OVERLOAD__ _name(float2 x) { return _default_name(x); } \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:418:28:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float3 __OVERLOAD__ _name(float3 x) { return _default_name(x); } \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:419:28:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float4 __OVERLOAD__ _name(float4 x) { return _default_name(x); } \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:420:28:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float8 __OVERLOAD__ _name(float8 x) { return _default_name(x); } \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4723:30:
note: candidate function
__CLFN_FD_1FD_FAST_RELAX(__fast_relax_tan, native_tan, __cl_tan);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:421:29:
note: expanded from macro '__CLFN_FD_1FD_FAST_RELAX'
inline float16 __OVERLOAD__ _name(float16 x){ return _default_name(x); }
^
<program source>:25:15: warning: unused variable 'speed'
float speed = vec_three_Mag(particle->vel);
^
<program source>:69:19: error: call to '__cl_sqrt' is ambiguous
float speed = sqrt(1.-1./(gamma*gamma))*speed_of_light;
^~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4741:23:
note: expanded from macro 'sqrt'
#define sqrt(__x) __cl_sqrt(__x)
^~~~~~~~~
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:366:48:
note: expanded from macro '__CLFN_FD_1FD'
#define __CLFN_FD_1FD(name) float __OVERLOAD__ name(float x); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:367:21:
note: expanded from macro '__CLFN_FD_1FD'
float2 __OVERLOAD__ name(float2 x); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:368:21:
note: expanded from macro '__CLFN_FD_1FD'
float3 __OVERLOAD__ name(float3 x); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:369:21:
note: expanded from macro '__CLFN_FD_1FD'
float4 __OVERLOAD__ name(float4 x); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:370:21:
note: expanded from macro '__CLFN_FD_1FD'
float8 __OVERLOAD__ name(float8 x); \
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:4738:15:
note: candidate function
__CLFN_FD_1FD(__cl_sqrt);
^
/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/include/cl_kernel.h:371:22:
note: expanded from macro '__CLFN_FD_1FD'
float16 __OVERLOAD__ name(float16 x);
^
(options: -I /Users/zhampela/Documents/GitHub/cr-geomag-prop/crprop/cl_src -I
/Users/zhampela/py-venv/gpu-python2_7/lib/python2.7/site-packages/pyopencl-2016.2.1-py2.7-macosx-10.14-x86_64.egg/pyopencl/cl)
(source saved as /var/folders/w6/8kxg7kh53b798gsvst7zkgn000018b/T/tmp9oiAv2.cl)
==========================
Zigfried Hampel-Arias
Physics PhD
BAEF Postdoctoral Fellow IIHE
[email protected] <mailto:[email protected]>
_______________________________________________
PyOpenCL mailing list
[email protected]
https://lists.tiker.net/listinfo/pyopencl