Skip to content
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

modified for mac os x #75

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,32 @@ After dependencies have been prepared, open a Visual Studio command
prompt window, and run:

nmake /fMakefile.Win32 vanitygen.exe oclvanitygen.exe


Mac OS X:

Prerequisites:
OpenSSL (0.9.8 is okay, but consider to use 1.0.1 or higher for better performance.)
pcre/pcre++

It's easy to use "homebrew" tool chains for install OpenSSL and pcre/pcre++.
If not installed, take the following steps.

1) Install homebeww
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"

2) Install pcre and openssl
brew install pcre pcre++ openssl
brew link --force openssl

3) Edit ~/.bash_profile to add PATH environment at the end of the file.
export PATH=/usr/local/bin:$PATH

4) Fetch the source.
git clone https://github.com/7m4gmh/vanitygen.git

5) Build.
cd vanitygen
make -f Makefile all


7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
LIBS=-lpcre -lcrypto -lm -lpthread
CFLAGS=-ggdb -O3 -Wall
LIBS= -lpcre -lcrypto -lm -lpthread
OBJS=vanitygen.o oclvanitygen.o oclvanityminer.o oclengine.o keyconv.o pattern.o util.o
PROGS=vanitygen keyconv oclvanitygen oclvanityminer

PLATFORM=$(shell uname -s)
ifeq ($(PLATFORM),Darwin)
OPENCL_LIBS=-framework OpenCL
INCPATHS=-I$(shell brew --prefix)/include -I$(shell brew --prefix openssl)/include
LIBPATHS=-L$(shell brew --prefix)/lib -L$(shell brew --prefix openssl)/lib
CFLAGS=-ggdb -O3 -Wall -Qunused-arguments $(INCPATHS) $(LIBPATHS)
else
OPENCL_LIBS=-lOpenCL
CFLAGS=-ggdb -O3 -Wall
endif


Expand Down
15 changes: 13 additions & 2 deletions vanitygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <string.h>
#include <math.h>
#include <assert.h>

#include <sys/sysctl.h>
#include <pthread.h>

#include <openssl/sha.h>
Expand Down Expand Up @@ -240,7 +240,18 @@ vg_thread_loop(void *arg)
}


#if !defined(_WIN32)
#ifdef __APPLE__
int count_processors(void)
{
int mib[2], count;
size_t len;
mib[0] = CTL_HW;
mib[1] = HW_NCPU;
len = sizeof(count);
sysctl(mib, 2, &count, &len, NULL, 0);
return count;
}
#elif !defined(_WIN32)
int
count_processors(void)
{
Expand Down