Closed afritz1 closed 8 years ago
I had posted about this in the FindOpenCL pull request, but it was getting a little off-topic so I'm moving it here.
I've gotten close to having a working Travis-CI build. https://travis-ci.org/Allofich/OpenTESArena/builds/155897946
I downloaded cl2.hpp from https://github.com/KhronosGroup/OpenCL-CLHPP/releases
There are problems at the linking stage at the end. It may be related to this http://stackoverflow.com/questions/15855759/opencl-1-2-c-wrapper-undefined-reference-to-clreleasedevice
I've only been able to get this far by using the FindOpenCL.cmake from https://github.com/afritz1/OpenTESArena/pull/45.
Also you can see that WildMIDI is not found yet in the travis builds I've tried.
Edit: Same result when building with Clang. https://travis-ci.org/Allofich/OpenTESArena/builds/155905235
Thanks for taking a look at that.
I'm not sure why WildMIDI isn't being found, though.
And with the OpenCL linker error, it might be from Nvidia not supporting past OpenCL 1.2. I added defines in this issue to solve those problems but Travis still seems to have trouble. Maybe something isn't being undefined in the header that should be.
Not making much progress. I tried adding DCL_USE_DEPRECATED_OPENCL_1_1_APIS to the CXX_FLAGS and C_FLAGS in CMakeLists.txt as suggested here http://yorik.uncreated.net/guestblog.php?2012=141, but no luck.
I noticed that even with the new FindOpenCL from the pull request, the Travis log still says
Looking for CL_VERSION_1_2 -- Looking for CL_VERSION_1_2 - not found -- Looking for CL_VERSION_1_1 -- Looking for CL_VERSION_1_1 - not found -- Looking for CL_VERSION_1_0 -- Looking for CL_VERSION_1_0 - not found
I borrowed part of https://github.com/ethereum/ethash/blob/master/cmake/modules/FindOpenCL.cmake from the beginning (from function(_FIND_OPENCL_VERSION) to _FIND_OPENCL_VERSION()) and using that instead of the current _FIND_OPENCL_VERSION, it will then report that it found CL_VERSION_1_2, but the same linker problems with clReleaseDevice and clRetainDevice still happen.
As a last resort, I suppose I could revert to the C headers (i.e., <CL/cl.h>
) instead of the C++ wrapper, but I'd like to avoid doing that.
@Ragora, any ideas why Travis wouldn't find OpenCL 1.2?
I got a successful build! I switched from the nvidia package to a non-nvidia one. http://packages.ubuntu.com/en/trusty/ocl-icd-libopencl1
Here's the successful build. https://travis-ci.org/Allofich/OpenTESArena/builds/155987037
Would you like me to open a pull request so you can see all the changes I made?
Edit: Oh, and don't worry, I'm not going to include all those dozens of test commits in a pull request. I'll make a clean one.
Great! It'd be best if your pull request just has one commit instead of all those guess-and-check commits. There might be a couple small changes in the future to make FindOpenCL.cmake more robust, but for now it's probably okay.
It's not a big deal if Travis can't find WildMIDI, since it's still able to compile without music, but that should be investigated at some point.
The versions printed by the find script are irrelevant as nothing actually makes use of the variable declarations it sets as a result.
With my modified cmake, I probably just forgot to add a path or suffix, but I can check after work today. Post the cmake invocation of the broken situation and I can look in a few hours.
For what it's worth, changing the value under NAMES in the FindOpenCL.cmake file from just cl.h to CL/cl.h OpenCL/cl.h seems to be what let Travis report finding the correct version.
Sounds like it's just a path issue I accidently introduced then, should be easy enough to fix when I can get to it.
As for this particular issue, it's reporting that it found OpenCL 1.2 now after the PR I sent was merged.
Btw, Travis-CI seems to build fine even if the cl2.hpp stuff is taken out of FindOpenCL.cmake, as long as cl2.hpp is downloaded by .travis.yml and put in the /usr/include/CL/ directory. I don't know a lot about all this, maybe it's good to have the cl2.hpp finding in there anyway, but I just thought I'd bring it to your attention.
That find portion isn't strictly necessary but it doesn't hurt to be there either. I added it to make sure that there is a usable cl2.hpp somewhere, and if not, bring it to attention a little more nicely than a million complier errors because it isn't guaranteed to be present on all compilation environments (particularly where it's just a person trying to build on their local machine).
OK, good to know.
The Travis CI build works now, so all that's left is to get it to find WildMIDI. It might just be something simple like adding a small fix in FindWildMidi.cmake. Once that's figured out, I'll close this issue.
WildMIDI is found by Travis CI now thanks to the changes in #48.
I've linked my project with Travis CI, and all I need now is the
.travis.yml
file, but the examples I've seen so far have more scripts and extra things in them than I currently need, and it's a bit confusing.Could someone give an example below? I'm looking for something along the lines of:
or
I'm not sure what all is needed, though.