Browse Source

Adapt miner code to free ADL structures

Luke Dashjr 13 years ago
parent
commit
ac6128d1e0
10 changed files with 24 additions and 64 deletions
  1. 0 3
      ADL_SDK/.gitignore
  2. 0 3
      ADL_SDK/readme.txt
  3. 1 1
      Makefile.am
  4. 1 8
      README
  5. 5 1
      adl.c
  6. 1 1
      adl_functions.h
  7. 13 20
      configure.ac
  8. 0 1
      make-release
  9. 1 1
      miner.h
  10. 2 25
      windows-build.txt

+ 0 - 3
ADL_SDK/.gitignore

@@ -1,3 +0,0 @@
-adl_defines.h
-adl_sdk.h
-adl_structures.h

+ 0 - 3
ADL_SDK/readme.txt

@@ -1,3 +0,0 @@
-Please insert AMD ADL files adl_defines.h adl_sdk.h adl_structures.h here.
-They can be found here:
-http://developer.amd.com/sdks/ADLSDK/Pages/default.aspx

+ 1 - 1
Makefile.am

@@ -8,7 +8,7 @@ JANSSON_INCLUDES=
 endif
 
 EXTRA_DIST	= example.conf m4/gnulib-cache.m4 linux-usb-bfgminer \
-		  ADL_SDK/readme.txt api-example.php miner.php	\
+		  api-example.php miner.php	\
 		  API.class API.java api-example.c windows-build.txt \
 		  bitstreams/* API-README FPGA-README SCRYPT-README
 

+ 1 - 8
README

@@ -49,9 +49,6 @@ Dependencies:
 	AMD APP SDK		http://developer.amd.com/sdks/AMDAPPSDK
 	(This sdk is mandatory for GPU mining)
 
-	AMD ADL SDK		http://developer.amd.com/sdks/ADLSDK
-	(This sdk is mandatory for ATI GPU monitoring & clocking)
-
 	libudev headers
 	(This is only required for FPGA auto-detection and is linux only)
 
@@ -62,7 +59,7 @@ Dependencies:
 BFGMiner specific configuration options:
 	--enable-cpumining      Build with cpu mining support(default disabled)
 	--disable-opencl        Build without support for OpenCL (default enabled)
-	--disable-adl           Override detection and disable building with adl
+	--disable-adl           Build without ADL monitoring (default enabled)
 	--disable-bitforce      Compile support for BitForce (default enabled)
 	--disable-icarus        Compile support for Icarus (default enabled)
 	--disable-modminer      Compile support for ModMiner (default enabled)
@@ -77,10 +74,6 @@ Basic *nix build instructions:
 	install it so just keep track of where it is if you're not installing
 	the include files and library files into the system directory.
 	(Do NOT install the ati amd sdk if you are on nvidia.)
-	To build with GPU monitoring & clocking support:
-	Extract the AMD ADL SDK, latest version - there is also no official
-	place for these files. Copy all the *.h files in the "include"
-	directory into BFGMiner's ADL_SDK directory.
 
 The easiest way to install the ATI AMD SPP sdk on linux is to actually put it
 into a system location. Then building will be simpler. Download the correct

+ 5 - 1
adl.c

@@ -20,7 +20,7 @@
 #endif
 
 #include "miner.h"
-#include "ADL_SDK/adl_sdk.h"
+#include "ADL/adl_sdk.h"
 #include "compat.h"
 
 #if defined (__linux)
@@ -33,6 +33,10 @@
 #endif
 #include "adl_functions.h"
 
+#ifndef WIN32
+#define __stdcall
+#endif
+
 #ifndef HAVE_CURSES
 #define wlogprint(...)  applog(LOG_WARNING, __VA_ARGS__)
 #endif

+ 1 - 1
adl_functions.h

@@ -38,7 +38,7 @@
  #include <tchar.h>
 #endif
 
-#include "ADL_SDK/adl_sdk.h"
+#include "ADL/adl_sdk.h"
 
 // Definitions of the used function pointers. Add more if you use other ADL APIs
 

+ 13 - 20
configure.ac

@@ -121,6 +121,8 @@ AC_ARG_ENABLE([opencl],
 	)
 if test "x$opencl" = xyes; then
 	AC_DEFINE([HAVE_OPENCL], [1], [Defined to 1 if OpenCL support is wanted])
+else
+	DLOPEN_FLAGS=""
 fi
 AM_CONDITIONAL([HAVE_OPENCL], [test x$opencl = xyes])
 
@@ -130,27 +132,20 @@ PTHREAD_LIBS=-lpthread
 
 AC_CHECK_LIB(jansson, json_loads, request_jansson=false, request_jansson=true)
 
+if test "x$opencl" = xyes; then
+	adl="yes"
+	
 AC_ARG_ENABLE([adl],
-	[AC_HELP_STRING([--disable-adl],[Override detection and disable building with adl])],
+	[AC_HELP_STRING([--disable-adl],[Build without ADL monitoring (default enabled)])],
 	[adl=$enableval]
 	)
 
-if test "x$opencl" = xyes; then
-	if test "x$adl" != xno; then
-		if test -f ADL_SDK/adl_sdk.h; then
-			have_adl=true
-		else
-			have_adl=false
-		fi
-		if test x$have_adl = xtrue
+	if test x$adl = xyes
 		then
 			AC_DEFINE([HAVE_ADL], [1], [Defined if ADL headers were found])
-		else
-			DLOPEN_FLAGS=""
 		fi
-	fi
 else
-	DLOPEN_FLAGS=""
+	adl="no"
 fi
 
 AC_ARG_ENABLE([bitforce],
@@ -420,14 +415,12 @@ else
 	echo "  OpenCL...............: Disabled"
 fi
 
-if test "x$adl" != xno; then
-	if test x$have_adl = xtrue; then
-		echo "    ADL................: SDK found, GPU monitoring support enabled"
-	else
-		echo "    ADL................: SDK NOT found, GPU monitoring support DISABLED"
-	fi
+if test "x$adl" = xyes; then
+	echo "    ADL.monitoring.....: Enabled"
+elif test "x$opencl" = xyes; then
+	echo "    ADL.monitoring.....: Disabled"
 else
-	echo "    ADL................: Detection overrided. GPU monitoring support DISABLED"
+	echo "    ADL.monitoring.....: n/a"
 fi
 
 if test "x$bitforce" = xyes; then

+ 0 - 1
make-release

@@ -36,7 +36,6 @@ for txt in AUTHORS COPYING NEWS README API-README FPGA-README SCRYPT-README; do
 	cp -v "$txt" "$OUTDIR/${txt}.txt"
 done
 cp -av "bitstreams" "$OUTDIR/"
-cp -av "$IDIR/"ADL_SDK/adl_{defines,sdk,structures}.h "ADL_SDK/"
 ./autogen.sh
 ./configure \
 	--prefix='C:\\Program Files\\BFGMiner\' \

+ 1 - 1
miner.h

@@ -81,7 +81,7 @@ void *alloca (size_t);
 
 
 #ifdef HAVE_ADL
- #include "ADL_SDK/adl_sdk.h"
+ #include "ADL/adl_sdk.h"
 #endif
 
 #ifdef HAVE_LIBUSB

+ 2 - 25
windows-build.txt

@@ -101,16 +101,6 @@ Note: If you are on a 32 bit version of windows "Program Files (x86)" will be
 "Program Files".
 Note2: If you update your APP SDK later you might want to recopy the above files 
 
-**************************************************************************************
-* Install AMD ADL SDK, latest version (only if you want GPU monitoring)              *
-**************************************************************************************
-Note: You do not need to install the AMD ADL SDK if you are only using Nvidia GPU's	
-Go to this url ==> http://developer.amd.com/sdks/ADLSDK/Pages/default.aspx
-Download and unzip the file you downloaded.
-Pull adl_defines.h, adl_sdk.h, and adl_structures.h out of the include folder 
-Put those files into the ADL_SDK folder in your source tree as shown below.
-\MinGW\msys\1.0\home\(folder with your user name)\bfgminer-x.x.x\ADL_SDK
-
 **************************************************************************************
 * Install GTK-WIN, required for Pkg-config in the next step                          *
 **************************************************************************************
@@ -196,24 +186,11 @@ If you simply just want to update the source after you have already cloned, type
 
 Now you can get the latest source directly from github.
 
-**************************************************************************************
-* Optional - Make a .sh file to automate copying over ADL files                      *
-**************************************************************************************
-Make a folder/directory in your home folder and name it ADL_SDK.
- (ref:  \MinGW\msys\1.0\home\(folder with your user name)\ADL_SDK)
-Copy the ADL .h files into that folder/directory.
-Open your favorite text editor and type the following into it.
- cp -av ../ADL_SDK/*.h ADL_SDK
-Save the file as "adl.sh" and then place the file into "\MinGW\msys\1.0\bin".
-From now on when your current working directory is the bfgminer source directory
-You can simply type "adl.sh" and it will place the ADL header files into place
-For you. Make sure you never remove the ADL_SDK folder from your home folder.
-
 **************************************************************************************
 * Some ./configure options                                                           *
 **************************************************************************************
---disable-opencl        Override detection and disable building with opencl
---disable-adl           Override detection and disable building with adl
+--disable-opencl        Build without support for OpenCL (default enabled)
+--disable-adl           Build without ADL monitoring (default enabled)
 --enable-bitforce       Compile support for BitForce FPGAs(default disabled)
 --enable-icarus         Compile support for Icarus Board(default disabled)