Fixes for compiler warnings, more support for amdgpu-pro #19

Open
wants to merge 5 commits into
from

Projects

None yet

4 participants

@magick777

Fixed some of the more obvious compiler warnings, i.e. incompatible pointers and suchlike. Commented out the define GIT_VERSION, let the declared version win. Compiles fairly cleanly on GCC5.4.0 with Ubuntu 16.04.1 if you don't go asking for extra warnings.

Adds a couple of tests to configure.ac to check whether we have the amdgpu-pro driver installed in addition to the AMDAPPSDK. If so, uses libOpenCL.so from amdgpu-pro with headers from the SDK; if we have the SDK but not amdgpu-pro, use the libraries from the SDK. Less to specify at build time, after git and autoreconf I can simply build and install it with:

CFLAGS="-Os -march=native" ./configure && make clean && make -j5 install

NB. These three commits squash a few easy compile warnings, but there's plenty left. Static analysis (with scan-build from clang-4.0 throws up another 80 bugs from dead assignments to logic errors to possible memory leaks, most of which I haven't begun to understand).

@@ -1,5 +1,7 @@
#ifndef MINER_H
#define MINER_H
+#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
+#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
@tpruvot
tpruvot Jan 2, 2017

seems enough to put that here.. only

@magick777
magick777 Jan 3, 2017

Ah. You are, of course, correct. I'll update accordingly. Thanks for the heads up (and the work on however many miners, too.)

I recall how this happened, worth mention in passing though could well have been user error. The default with 5.5.4 of using OpenCL from /usr/local/lib (AMDAPPSDK-3.0 here) didn't seem to pick up the defs as I expected and I started throwing them around before changing the default to amdgpu-pro, which was known to work for me.

@NaN-git NaN-git was assigned by OhGodAGirl Jan 2, 2017
@OhGodAGirl OhGodAGirl requested a review from NaN-git Jan 2, 2017
@@ -70,7 +70,7 @@ typedef struct {
sph_whirlpool_context whirlpool1;
} Xhash_context_holder;
-static Xhash_context_holder base_contexts;
+extern Xhash_context_holder base_contexts;
@tpruvot
tpruvot Jan 3, 2017

its not the correct way to fix that... because this local type is used in different algos.

Will push a sample commit to fix these warnings

@magick777
magick777 Jan 3, 2017

Thank you again for your help and patience. As you will have gathered, I'm pretty new at this.

@wolf9466
wolf9466 commented Jan 6, 2017

This oddly caused HW errors for me on XMR - I compiled only with --disable-git-version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment