Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile code which uses clFFT? #224

Open
kevin9105 opened this issue Sep 27, 2018 · 0 comments
Open

How to compile code which uses clFFT? #224

kevin9105 opened this issue Sep 27, 2018 · 0 comments

Comments

@kevin9105
Copy link

Hi, I'm trying to compile my test code using clFFT, with visual studio, but I have a problem which says:
unresolved external symbol __imp_clfftTeardown referenced in function main
unresolved external symbol __imp_clfftSetup referenced in function main
unresolved external symbol __imp_clfftSetResultLocation referenced in function main
and so on (Total 9 unresolved external symbol __imp_clfft~~ referenced in function main).

I installed MinGW-w64 to my laptop (Windows 10 64 bit) where visual studio 2015 is installed, installed CMake 3.12.2, and built boost_1_54_0 by following clFFT wiki.
However, visual studio cannot find boost even though I followed the clFFT wiki, so I deleted and built boost_1_54_0 again with the help of MinGW-w64 wiki.
After that, I searched google how to install clFFT, and found it:
I entered the command, cmake ../src -G "MSYS Makefiles", and now boost_1_54_0 is recognized, and I installed clFFT.

I installed clFFT to D:/clfft64. clAmdFft.h, clAmdFft.version.h, clFFT.h, clFFT.version are in D:/clfft64/package/include, libclFFT.dll.a and libStatTimer.dll.a are in D:/clfft64/package/lib64/import, and libclFFT.dll in D:/clfft64/package/bin.

After installing clFFT, I wrote my test code using visual studio. I added "D:\clfft64\package\include" to the Additional Include Directories, and added "D:/clfft64/package/lib64" and "D:\clfft64\package\bin" to the Additional Library Directories (Of course, since I'm using OpenCL with Intel SDK, I added $(INTELOCLSDKROOT)\include to the Additional Include Directories, $(INTELOCLSDKROOT)\lib\x64 to the Additional Library Directories, and OpenCL.lib to the Additional Dependencies).

Did I miss something? If you know, please let me know. I'm a complete newbie about compiling, so I'm confused... Thank you for your help in advance.
If you know how to write CMakeLists.txt for the following case, it would be a great help to me:
I made a simple test code with mytestcode.c. "mytestcode.h" (cl.h is included in there) and "clFFT.h" should be added to mytestcode.c.

For example, mytestcode.c begins with

#define _CRT_SECURE_NO_WARNINGS
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
#include "mytestcode.h"
#include <clFFT.h>

int main(int argc, char **argv)
{
blahblahblah
}

and mytestcode.h begins with

#define MAX(a, b) (a > b) ? a : b
#define MIN(a, b) (a < b) ? a : b

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <Windows.h>

#ifdef APPLE
#include <OpenCL/opencl.h>
#include <unistd.h>
#else
#include <CL/cl.h>
#endif

blahblahblah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant