-
Notifications
You must be signed in to change notification settings - Fork 549
download and build the opencl dependencies with cmake #454
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
Conversation
|
Please do not merge yet: it depends on clMathLibraries/clBLAS#67 for the static build, and clMathLibraries/clFFT#68 and clMathLibraries/clBLAS#68 to find an installed version of these libs. |
|
@glehmann We need to be a bit mindful about how it affects Windows builds. Do you have a windows machine handy that you can test this on ? |
|
@pavanky I only have a VM with windows 7, and no opencl installed on it. Is it possible to install opencl in a VM? |
|
@glehmann It is fine. We'll test it out once the Pull requests for clMath go through. |
ba75697 to
cdf437b
Compare
so arrayfire can be used in a cmake project with the usual find_package command
find_package(arrayfire REQUIRED)
include_directories(${ARRAYFIRE_INCLUDE_DIRS})
tarkget_link_libraries(mytarget ${ARRAYFIRE_LIBRARIES})
|
👍 good learning for me about CMake. thanks @glehmann |
|
I merged the PR's mentioned above by @glehmann. gtg. |
|
@glehmann We are doing a beta (binary) release today. We'll be merging this after the release is done. |
cdf437b to
1969fc3
Compare
|
@glehmann I am getting the following error when trying to build a fresh clone of your branch |
|
The problem is with USE_SYSTEM_* being set to ON by default. Can you set it to off ? Also when set to ON, it would be better if user had to specify the root paths manually rather than CMake trying to find "FindclBLAS.cmake" |
|
I'll set it to OFF by default. Having it to ON by default helps to identify the dependencies for the packagers, but I understand that this is much more convenient for the users and the developers when set to OFF by default. The message is automatically generated by And the user indeed has to set clFFT_DIR and clBLAS_DIR by hand when the USE_SYSTEM_* are set to ON and clBLAS and clFFT can't be found automatically. |
1969fc3 to
8c05ce0
Compare
|
I've updated the pull request. Please try it on windows before merging — I didn't have a chance to test it on this platform. |
|
@glehmann The examples for clFFT were added recently and they don't seem to compile with the static libraries on windows and linux. I reported the issue here: clMathLibraries/clFFT#74 I may have a quick solution for Linux but the windows one will take some time to figure out. |
CMakeModules/build_clBLAS.cmake
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this GIT_TAG necessary or can we simply use HEAD always? We would prefer having HEAD.
Also, can you change the repository URL to point to https://github.com/arrayfire/clBLAS.git
Same changes for clFFT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the tag is necessary, but it is a good idea to keep it in my opinion: it ensures that the version used is the expected one at the time the code was written, a bit like having clBLAS and clFFT directly in the repository or in a submodule.
clBLAS, clFFT and boost compute were used to be configure and built manually. They are now built using cmake's external projects, and linked statically. The system installed packages can also be used by setting the corresponding USE_SYSTEM_<package> option to ON. This also fix a possible conflict with clBLAS and clFFT when installing these project shared libraries from arrayfire see arrayfire#453
8c05ce0 to
6be994e
Compare
|
I've updated the PR to use arrayfire's repositories for clFFT and clBLAS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glehmann can you add ADD_DEFINITIONS( -DCLFFT_BUILD_STATIC ) here (also any check required around it). This is needed to disable the dll exports on Windows. Otherwise when clfft.h is included in ArrayFire source, the dll definitions will be there and thats what is causing issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-(
We really shouldn't have to do this - I'll think a bit more about clMathLibraries/clFFT#75 to see if it can be done directly there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clBLAS is not using the __dlexport and __dlimport routines. I am not entirely sure if clFFT needs them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this quickly in clFFT (by removing the macro conditions and just keeping #define CLFFTAPI (to keep the compiler happy) and it worked fine. all the examples ran ok.
I can go ahead and push this is all parties agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah well, may have spoken too soon. Shared libs aren't playing too well with that. I guess for now we can just add the definitions in ArrayFire until we figure out a solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. after a little bit of research it looks like clBLAS does export it, except not in the standard way.
It uses a .def file (https://github.com/arrayfire/clBLAS/blob/develop/src/clBLAS.def) to export the symbols in case of shared libs. Because such a file does not exist for clFFT, the declspecs are required.
And according to this http://www.cmake.org/cmake/help/v3.0/command/add_library.html, if add_library does not specify SHARED or STATIC, then the value of BUILD_SHARED_LIBS is used to determine shared. And this is exactly the case in clBLAS.
|
Merged in #550 |
clBLAS, clFFT and boost compute were used to be configure and built manually.
They are now built using cmake's external projects, and linked statically.
The system installed packages can also be used by setting the corresponding
USE_SYSTEM_ option to ON.
This also fix a possible conflict with clBLAS and clFFT when installing these
project shared libraries from arrayfire
see #453