Skip to content

Linux compile issues #41

@eliasen

Description

@eliasen

The instructions in FastGCM/README.md have some bugs in Linux (Fedora 30, NVIDIA). They probably should read:

gcc FastDCM.c -O3 -lOpenCL -lm -o FastDCM

Note that the optimization parameter is a capital O in gcc and you need to link with the math library -lm. If you don't link with -lm, you get the error:

/usr/bin/ld: /tmp/ccvnWeLr.o: in function `timeCheck':
FastDCM.c:(.text+0x73fc): undefined reference to `exp'
collect2: error: ld returned 1 exit status

Here are the error messages I get when compiling (note that I'm not experienced with compiling OpenCL) but I do get an executable:

In file included from /usr/include/CL/cl.h:32,
                 from /usr/include/CL/opencl.h:38,
                 from FastDCM.c:58:
/usr/include/CL/cl_version.h:34:9: note: #pragma message: cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)
   34 | #pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 220 (OpenCL 2.2)")
      |         ^~~~~~~
FastDCM.c: In function ‘initOpenCL’:
FastDCM.c:1106:1: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]
 1106 | commands = clCreateCommandQueue(context, gpu_device, 0, &clErr);
      | ^~~~~~~~
In file included from /usr/include/CL/opencl.h:38,
                 from FastDCM.c:58:
/usr/include/CL/cl.h:1777:1: note: declared here
 1777 | clCreateCommandQueue(cl_context                     context,
      | ^~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions