mfakto icon indicating copy to clipboard operation
mfakto copied to clipboard

2nd compilation error on Debian

Open valeriob01 opened this issue 6 years ago • 4 comments

This errors after fixing the AMDAPPSDK path:

Downloads/mfakto-master/src$ make gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c read_config.c -o read_config.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c mfaktc.c -o mfaktc.o mfaktc.c: In function ‘tf’: mfaktc.c:748:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if(time_run > 60000ULL) printf("%2" PRIu64 "m ", (time_run / 60000ULL) % 60ULL); ^~ mfaktc.c:749:31: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ printf("%2" PRIu64 ".%03" PRIu64 "s", (time_run / 1000ULL) % 60ULL, time_run % 1000ULL); ^~~~~~ mfaktc.c:756:7: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if(time_est > 60000ULL) printf("%2" PRIu64 "m ", (time_est / 60000ULL) % 60ULL); ^~ mfaktc.c:757:33: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ printf("%2" PRIu64 ".%03" PRIu64 "s", (time_est / 1000ULL) % 60ULL, time_est % 1000ULL); ^~~~~~ gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c checkpoint.c -o checkpoint.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c signal_handler.c -o signal_handler.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c filelocking.c -o filelocking.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c output.c -o output.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c mfakto.cpp -o mfakto.o mfakto.cpp:855:20: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] std::cerr << "\nKernel file ""KERNEL_FILE"" not found, it needs to be in the same directory as the executable.\n"; ^ mfakto.cpp: In function ‘int init_CL(int, cl_int*)’: mfakto.cpp:553:18: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp:553:83: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] mandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp:557:20: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp:557:85: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] mandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp:571:21: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueuePrf = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp:571:86: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] dQueuePrf = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context / context /, ^~~~~~~~~~~~~~~~~~~~ mfakto.cpp: In function ‘int run_mod_kernel(cl_ulong, cl_ulong, cl_ulong, cl_float, cl_ulong, cl_ulong*)’: mfakto.cpp:1645:12: warning: ‘cl_int clEnqueueTask(cl_command_queue, cl_kernel, cl_uint, _cl_event* const*, _cl_event**)’ is deprecated [-Wdeprecated-declarations] status = clEnqueueTask(QUEUE, ^~~~~~~~~~~~~ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1373:1: note: declared here clEnqueueTask(cl_command_queue /* command_queue /, ^~~~~~~~~~~~~ mfakto.cpp:1649:26: warning: ‘cl_int clEnqueueTask(cl_command_queue, cl_kernel, cl_uint, _cl_event const*, _cl_event**)’ is deprecated [-Wdeprecated-declarations] &mod_evt); ^ In file included from my_types.h:22:0, from mfakto.h:23, from mfakto.cpp:25: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1373:1: note: declared here clEnqueueTask(cl_command_queue /* command_queue /, ^~~~~~~~~~~~~ mfakto.cpp: In function ‘int run_kernel15(cl_kernel, cl_uint, int75, int, cl_uint8, cl_mem, cl_int, cl_int)’: mfakto.cpp:1717:5: note: The ABI for passing parameters with 32-byte alignment has changed in GCC 4.6 int run_kernel15(cl_kernel l_kernel, cl_uint exp, int75 k_base, int stream, cl_uint8 b_in, cl_mem res, cl_int shiftcount, cl_int bin_max) ^~~~~~~~~~~~ gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c gpusieve.cpp -o gpusieve.o gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c perftest.cpp -o perftest.o perftest.cpp:1737:18: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix] std::cerr << "\nKernel file ""KERNEL_FILE"" not found, it needs to be in the same directory as the executable.\n"; ^ perftest.cpp: In function ‘GPUKernels test_cpu_tf_kernels(cl_uint)’: perftest.cpp:1018:88: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘cl_ulong {aka long unsigned int}’ [-Wformat=] f.exponent, num_fcs >> 20, ((cl_ulong)num_loopsmystuff.threads_per_grid)>>20); ^ perftest.cpp:1018:88: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘cl_ulong {aka long unsigned int}’ [-Wformat=] perftest.cpp:1021:86: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘cl_ulong {aka long unsigned int}’ [-Wformat=] %f GHz-days (assignment), %f GHz-days (per test): ", k, ghzd, ghzdt); fflush(stdout); ^ perftest.cpp: In function ‘GPUKernels test_gpu_tf_kernels(cl_uint)’: perftest.cpp:1153:72: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘cl_ulong {aka long unsigned int}’ [-Wformat=] printf("exponent=%u, %lldM FCs each, ", mystuff.exponent, num_fcs>>20); ^ perftest.cpp:1156:86: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘cl_ulong {aka long unsigned int}’ [-Wformat=] %f GHz-days (assignment), %f GHz-days (per test): ", k, ghzd, ghzdt); fflush(stdout); ^ perftest.cpp: In function ‘void CL_test(cl_int)’: perftest.cpp:1692:18: warning: ‘_cl_command_queue* clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context /, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1692:82: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] mmandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context /, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1696:20: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context /, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1696:84: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] mmandQueue = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context /, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1707:21: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] commandQueuePrf = clCreateCommandQueue(context, devices[devnumber], props, &status); ^~~~~~~~~~~~~~~~~~~~ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context /, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1707:85: warning: ‘_cl_command_queue clCreateCommandQueue(cl_context, cl_device_id, cl_command_queue_properties, cl_int*)’ is deprecated [-Wdeprecated-declarations] ndQueuePrf = clCreateCommandQueue(context, devices[devnumber], props, &status); ^ In file included from perftest.cpp:25:0: /home/sel/AMDAPPSDK-3.0/include/CL/cl.h:1359:1: note: declared here clCreateCommandQueue(cl_context /* context */, ^~~~~~~~~~~~~~~~~~~~ perftest.cpp:1767:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (mystuff.CompileOptions[0]) // if mfakto.ini defined compile options, override the default with them ^~ perftest.cpp:1770:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ printf("Compiling kernels (build options: "%s").", program_options); ^~~~~~ gcc -m64 -Wall -O3 -funroll-loops -ffast-math -finline-functions -frerun-loop-opt -fgcse-sm -fgcse-las -flto -I/home/sel/AMDAPPSDK-3.0/include -DBUILD_OPENCL -c menu.cpp -o menu.o In file included from /usr/include/c++/6/bits/char_traits.h:39:0, from /usr/include/c++/6/ios:40, from /usr/include/c++/6/ostream:38, from /usr/include/c++/6/iostream:39, from menu.cpp:36: /usr/include/c++/6/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2 min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/6/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2 max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ In file included from menu.cpp:32:0: /usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected unqualified-id before ‘const’ min(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected initializer before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected unqualified-id before ‘const’ max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’ /usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected initializer before ‘const’ In file included from /usr/include/c++/6/bits/char_traits.h:39:0, from /usr/include/c++/6/ios:40, from /usr/include/c++/6/ostream:38, from /usr/include/c++/6/iostream:39, from menu.cpp:36: /usr/include/c++/6/bits/stl_algobase.h:243:5: error: ‘std::min’ declared as an ‘inline’ variable min(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected primary-expression before ‘if’ if (__comp(__b, __a)) ^~ /usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected ‘}’ before ‘if’ /usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected ‘;’ before ‘if’ /usr/include/c++/6/bits/stl_algobase.h:248:7: error: expected unqualified-id before ‘return’ return __a; ^~~~~~ /usr/include/c++/6/bits/stl_algobase.h:265:5: error: ‘max’ declared as an ‘inline’ variable max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^~~ /usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected primary-expression before ‘if’ if (__comp(__a, __b)) ^~ /usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected ‘}’ before ‘if’ /usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected ‘;’ before ‘if’ /usr/include/c++/6/bits/stl_algobase.h:270:7: error: expected unqualified-id before ‘return’ return __a; ^~~~~~ /usr/include/c++/6/bits/stl_algobase.h:271:5: error: expected declaration before ‘}’ token } ^ Makefile:95: recipe for target 'menu.o' failed make: *** [menu.o] Error 1

valeriob01 avatar Jul 25 '18 05:07 valeriob01

These look like the code was written for a different version of the CUDA libraries and a different version of the C/C++ compiler. My copy of the code is modified from the version on github and compiles but fails at the start of the self tests with: Error -5 (Out of resources): clEnqueueReadBuffer RES failed. ... I think because my MSWindows desktop is using the same GPU for the video display; I haven't had time to verify that or try to work around it.

wedgingt avatar Jul 25 '18 07:07 wedgingt

That does not sound ok as I am trying to compile for OpenCL .

valeriob01 avatar Jul 25 '18 08:07 valeriob01

Preda's changes look sensible to me and should resolve a lot of the compiler complaints, which are likely due, at least in part, to a different compiler version and/or OpenCL library version. I'm also looking at the mfaktc code, mostly to improve the command line support, so I mentioned the CUDA libraries before when I should have mentioned the OpenCL libraries.

wedgingt avatar Jul 27 '18 16:07 wedgingt