clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
843 stars 237 forks source link

error: ‘FloatComplex {aka union <anonymous>}’ has no member named ‘x’ #307

Closed vedranmiletic closed 7 years ago

vedranmiletic commented 7 years ago

I'm building clBLAS on Fedora 25 with GCC 6.3.1, Mesa 17.1 git and ocl-icd 2.2.11. I have turned on every BUILD_* except BUILD_CLIENT, and I get:

[ 60%] Linking C executable example_ssymm
[ 60%] Linking CXX executable example_zhemv
[ 60%] Linking C executable example_snrm2
[ 60%] Linking C executable example_sswap
[ 60%] Linking C executable example_ssyr2k
[ 60%] Linking C executable example_isamax
[ 60%] Linking C executable example_ssyr2
[ 60%] Linking C executable example_sasum
[ 60%] Built target example_sswap
[ 60%] Built target example_snrm2
[ 60%] Building C object samples/CMakeFiles/example_ctrsm.dir/example_ctrsm.c.o
[ 60%] Built target example_isamax
[ 60%] Built target example_ssymm
[ 60%] Built target example_zhemv
[ 60%] Linking C executable example_ssyr
[ 60%] Built target example_ssyr2
/users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c: In function ‘printResult’:
/users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c:74:48: error: ‘FloatComplex {aka union <anonymous>}’ has no member named ‘x’
             printf("%.5f ", result[i * ldb + j].x);
                                                ^
/users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c: In function ‘main’:
/users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c:94:48: warning: passing argument 2 of ‘clGetPlatformIDs’ from incompatible pointer type [-Wincompatible-pointer-types]
     err = clGetPlatformIDs(sizeof( platform ), &platform, NULL);
                                                ^
In file included from /users/miletivn/workspace/clBLAS/src/clBLAS.h:35:0,
                 from /users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c:25:
/usr/include/CL/cl.h:661:1: note: expected ‘struct _cl_platform_id **’ but argument is of type ‘struct _cl_platform_id * (*)[2]’
 clGetPlatformIDs(cl_uint          /* num_entries */,
 ^~~~~~~~~~~~~~~~
/users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c:113:5: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]
     queue = clCreateCommandQueue(ctx, device, 0, &err);
     ^~~~~
In file included from /users/miletivn/workspace/clBLAS/src/clBLAS.h:35:0,
                 from /users/miletivn/workspace/clBLAS/src/samples/example_ctrsm.c:25:
/usr/include/CL/cl.h:1427:1: note: declared here
 clCreateCommandQueue(cl_context                     /* context */,
 ^~~~~~~~~~~~~~~~~~~~
samples/CMakeFiles/example_ctrsm.dir/build.make:62: recipe for target 'samples/CMakeFiles/example_ctrsm.dir/example_ctrsm.c.o' failed
make[2]: *** [samples/CMakeFiles/example_ctrsm.dir/example_ctrsm.c.o] Error 1
CMakeFiles/Makefile2:798: recipe for target 'samples/CMakeFiles/example_ctrsm.dir/all' failed
make[1]: *** [samples/CMakeFiles/example_ctrsm.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 60%] Linking C executable example_strmv
[ 60%] Built target example_ssyr2k
[ 60%] Linking C executable example_strsm
[ 60%] Built target example_sasum
[ 60%] Linking C executable example_strsv
[ 60%] Linking CXX executable example_chemm
[ 60%] Built target example_strsm
[ 60%] Built target example_ssyr
[ 60%] Built target example_strmv
[ 60%] Built target example_strsv
[ 61%] Built target example_chemm
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
tingxingdong commented 7 years ago

I do not think you need ctrsm example. so remove everything related to ctrsm from the cmakefile: https://github.com/clMathLibraries/clBLAS/blob/master/src/samples/CMakeLists.txt#L64

vedranmiletic commented 7 years ago

Possibly, but it would be nice if it did not fail compilation.

cirosantilli commented 7 years ago

Reproduce on Ubuntu 16.10 with -DBUILD_SAMPLE.

FloatComplex is typedefed to cl_float2.

Recommend adding that build config to your test server.

tingxingdong commented 7 years ago

Can you make a pull request to fix it? Thank you.

vedranmiletic commented 7 years ago

Eventually yes, but not right now. There is more things I like to clean up in clBLAS and I will send those patches as well, but first I would like to get clBLAS working with Clover (tracking meta-bug) since it is a prerequisite for (at least) Octopus and Theano.

TimmyLiu commented 7 years ago

I wonder if the error error: ‘FloatComplex {aka union <anonymous>}’ has no member named ‘x’ is related to this ? I wonder if you can compile the example if you change result[i * ldb + j].x to result[i * ldb + j].s[0] and so forth.

cirosantilli commented 7 years ago

@TimmyLiu I think you are spot on... fix proposed at: https://github.com/clMathLibraries/clBLAS/pull/309