Skip to content

Commit

Permalink
Start
Browse files Browse the repository at this point in the history
  • Loading branch information
SlimcoinMiner committed Jan 2, 2015
0 parents commit f8d466c
Show file tree
Hide file tree
Showing 36 changed files with 9,397 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
OPENCL_INCLUDES= -I"$(AMDAPPSDKROOT)//include"

if WANT_JANSSON
JANSSON_INCLUDES= -I$(top_srcdir)/compat/jansson
else
JANSSON_INCLUDES=
endif

EXTRA_DIST = dcrypt.cl example-cfg.json

SUBDIRS = compat

INCLUDES = $(PTHREAD_FLAGS) -fno-strict-aliasing $(JANSSON_INCLUDES) $(OPENCL_INCLUDES)

bin_PROGRAMS = minerd

minerd_SOURCES = elist.h \
miner.h \
compat.h \
gpu.h \
dcrypt.h \
dcrypt_sha256.h \
gpu.c \
cpu-miner.c \
util.c \
dcrypt.c \
dcrypt_sha256.c \
sha2.c

minerd_LDFLAGS = $(PTHREAD_FLAGS)
minerd_LDADD = @LIBCURL@ @JANSSON_LIBS@ @PTHREAD_LIBS@ @WS2_LIBS@ @OPENSSL_LIBS@ @MATH_LIBS@ -lOpenCL
minerd_CPPFLAGS = @LIBCURL_CPPFLAGS@
minerd_CFLAGS = -std=gnu11 -O3
#-march=native
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
SlimcoinMiner-OpenCL
==============

This is a multi-threaded slimcoin solo OpenCL/CPU miner,
fork of [pooler](//github.com/pooler)'s cpuminer.

#### Table of contents

* [Algorithms](#algorithms)
* [Dependencies](#dependencies)
* [Download](#download)
* [Build](#build)
* [Usage instructions](#usage-instructions)
* [License](#license)

Algorithms
==========
*__dcrypt__ (Slimcoin [SLM])

Dependencies
============
* libcurl http://curl.haxx.se/libcurl/
* jansson http://www.digip.org/jansson/ (jansson is included in-tree)
* openssl https://www.openssl.org/
* opencl

Build
=====

Important: edit 1st line of Makefile.am if you have OpenCL headers in different directory.

#### Basic *nix build instructions:
Install OpenCL SDK (AMD or NVidia)

```sh
./autogen.sh # only needed if building from git repo
./nomacro.pl # only needed if building on Mac OS X or with Clang
./configure CFLAGS="-march=native"
# Use -march=native if building for a single machine
make
```

#### Notes for AIX users:
* To build a 64-bit binary, `export OBJECT_MODE=64`
* GNU-style long options are not supported, but are accessible via configuration file

#### Basic Windows build instructions, using MinGW:
* Install MinGW and the MSYS Developer Tool Kit (http://www.mingw.org/)
* Make sure you have mstcpip.h in MinGW\include
* If using MinGW-w64, install pthreads-w64
* Install libcurl devel (http://curl.haxx.se/download.html)
* Make sure you have libcurl.m4 in MinGW\share\aclocal
* Make sure you have curl-config in MinGW\bin
* Install openssl devel (https://www.openssl.org/related/binaries.html)
* In the MSYS shell, run:
```sh
./autogen.sh # only needed if building from git repo
LIBCURL="-lcurldll" ./configure CFLAGS="-march=native"
# Use -march=native if building for a single machine
make
```

#### Basic cross-compile instructions, compiling for win64 on Linux Fedora:
```sh
yum install mingw\*
./autogen.sh # only needed if building from git repo
./configure CC=x86_64-w64-mingw32-gcc RANLIB=x86_64-w64-mingw32-ranlib --target x86_64-w64-mingw32
make
```

Usage instructions
==================

Copy dcrypt.cl kernel file to executable's directory.

To mine on all available GPUs:
```
minerd.exe -G -o http://localhost:41683 -u x -p x
```

Run "minerd --help" to see all options.

License
=======
GPLv2. See COPYING for details.
12 changes: 12 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# You need autoconf 2.5x, preferably 2.57 or later
# You need automake 1.7 or later. 1.6 might work.

set -e

aclocal
autoheader
automake --gnu --add-missing --copy
autoconf

21 changes: 21 additions & 0 deletions compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef __COMPAT_H__
#define __COMPAT_H__

#ifdef WIN32

#include <windows.h>

#define sleep(secs) Sleep((secs) * 1000)

enum {
PRIO_PROCESS = 0,
};

static inline int setpriority(int which, int who, int prio)
{
return -!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
}

#endif /* WIN32 */

#endif /* __COMPAT_H__ */
7 changes: 7 additions & 0 deletions compat/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

if WANT_JANSSON
SUBDIRS = jansson
else
SUBDIRS =
endif

3 changes: 3 additions & 0 deletions compat/jansson/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

libjansson.a

19 changes: 19 additions & 0 deletions compat/jansson/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2009, 2010 Petri Lehtinen <petri@digip.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
18 changes: 18 additions & 0 deletions compat/jansson/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

noinst_LIBRARIES = libjansson.a

libjansson_a_SOURCES = \
config.h \
dump.c \
hashtable.c \
hashtable.h \
jansson.h \
jansson_private.h \
load.c \
strbuffer.c \
strbuffer.h \
utf.c \
utf.h \
util.h \
value.c

73 changes: 73 additions & 0 deletions compat/jansson/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "jansson"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "petri@digip.org"

/* Define to the full name of this package. */
#define PACKAGE_NAME "jansson"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "jansson 1.3"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "jansson"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.3"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1.3"

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif

/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef int32_t */
Loading

0 comments on commit f8d466c

Please sign in to comment.