0

Here's the tutorial I was using, just to get a bit of bearing on the issue.

https://bitcointalk.org/index.php?topic=158105.0

It instructed me to use the following repository for the midstate module/library.

http://gitorious.org/midstate/midstate

After setting everything up, and downloading everything, all seemed to work fairly well. The only issue was the midstate module - I just couldn't get it compiled.

Here's the Makefile:

CC = gcc
CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/local/include/python3.3m
LDFLAGS = -Wl,-O1 -Wl,--as-needed -lpython3.3m

all: test midstate.so

test: midstatemodule.c
    $(CC) $(CFLAGS)  midstatemodule.c -o test $(LDFLAGS)

midstate.so: midstatemodule.c
    $(CC) $(CFLAGS) -fPIC -shared midstatemodule.c -o midstate.so $(LDFLAGS)

.PHONY: clean

clean:
    rm -f midstate.so test

And here's the compilation error:

gcc -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/local/include/python3.3m  midstatemodule.c -o test -Wl,-O1 -Wl,--as-needed -lpython3.3m
/usr/local/lib/libpython3.3m.a(longobject.o): In function `PyLong_FromString':
/home/jon/Downloads/Python-3.3.2/Objects/longobject.c:2157: undefined reference to `log'
/usr/local/lib/libpython3.3m.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
/home/jon/Downloads/Python-3.3.2/./Python/dynload_shlib.c:97: undefined reference to `dlsym'
/home/jon/Downloads/Python-3.3.2/./Python/dynload_shlib.c:129: undefined reference to `dlopen'
/home/jon/Downloads/Python-3.3.2/./Python/dynload_shlib.c:149: undefined reference to `dlsym'
/home/jon/Downloads/Python-3.3.2/./Python/dynload_shlib.c:135: undefined reference to `dlerror'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_start_new_thread':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:218: undefined reference to `pthread_create'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:234: undefined reference to `pthread_detach'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:208: undefined reference to `pthread_attr_setstacksize'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_allocate_lock':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:287: undefined reference to `sem_init'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_free_lock':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:312: undefined reference to `sem_destroy'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_acquire_lock_timed':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:347: undefined reference to `sem_timedwait'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:351: undefined reference to `sem_wait'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:351: undefined reference to `sem_wait'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:349: undefined reference to `sem_trywait'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:349: undefined reference to `sem_trywait'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_release_lock':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:393: undefined reference to `sem_post'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_acquire_lock_timed':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:349: undefined reference to `sem_trywait'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:351: undefined reference to `sem_wait'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_create_key':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:607: undefined reference to `pthread_key_create'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_set_key_value':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:627: undefined reference to `pthread_getspecific'
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:630: undefined reference to `pthread_setspecific'
/usr/local/lib/libpython3.3m.a(thread.o): In function `_pythread_pthread_set_stacksize':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:585: undefined reference to `pthread_attr_setstacksize'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_delete_key':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:614: undefined reference to `pthread_key_delete'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_delete_key_value':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:620: undefined reference to `pthread_setspecific'
/usr/local/lib/libpython3.3m.a(thread.o): In function `PyThread_get_key_value':
/home/jon/Downloads/Python-3.3.2/Python/thread_pthread.h:637: undefined reference to `pthread_getspecific'
/usr/local/lib/libpython3.3m.a(signalmodule.o): In function `timeval_from_double':
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:126: undefined reference to `floor'
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:126: undefined reference to `floor'
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:127: undefined reference to `fmod'
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:127: undefined reference to `fmod'
/usr/local/lib/libpython3.3m.a(signalmodule.o): In function `signal_pthread_kill':
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:848: undefined reference to `pthread_kill'
/usr/local/lib/libpython3.3m.a(signalmodule.o): In function `signal_pthread_sigmask':
/home/jon/Downloads/Python-3.3.2/./Modules/signalmodule.c:632: undefined reference to `pthread_sigmask'
/usr/local/lib/libpython3.3m.a(posixmodule.o): In function `posix_openpty':
/home/jon/Downloads/Python-3.3.2/./Modules/posixmodule.c:6088: undefined reference to `openpty'
/usr/local/lib/libpython3.3m.a(posixmodule.o): In function `posix_forkpty':
/home/jon/Downloads/Python-3.3.2/./Modules/posixmodule.c:6148: undefined reference to `forkpty'
/usr/local/lib/libpython3.3m.a(faulthandler.o): In function `faulthandler_thread':
/home/jon/Downloads/Python-3.3.2/./Modules/faulthandler.c:435: undefined reference to `pthread_sigmask'
/usr/local/lib/libpython3.3m.a(complexobject.o): In function `_Py_c_pow':
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:121: undefined reference to `hypot'
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:122: undefined reference to `pow'
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:123: undefined reference to `atan2'
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:127: undefined reference to `sincos'
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:126: undefined reference to `exp'
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:127: undefined reference to `log'
/usr/local/lib/libpython3.3m.a(complexobject.o): In function `_Py_c_abs':
/home/jon/Downloads/Python-3.3.2/Objects/complexobject.c:192: undefined reference to `hypot'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_is_integer':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:794: undefined reference to `floor'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_as_integer_ratio':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:1464: undefined reference to `floor'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_divmod':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:609: undefined reference to `floor'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:586: undefined reference to `fmod'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_rem':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:557: undefined reference to `fmod'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_round':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:988: undefined reference to `round'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:991: undefined reference to `round'
/usr/local/lib/libpython3.3m.a(floatobject.o): In function `float_pow':
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:710: undefined reference to `floor'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:745: undefined reference to `pow'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:695: undefined reference to `fmod'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:721: undefined reference to `fmod'
/home/jon/Downloads/Python-3.3.2/Objects/floatobject.c:685: undefined reference to `fmod'
collect2: ld returned 1 exit status
make: *** [test] Error 1

I'm just not sure what to make of it. There isn't really much information about the midstate module. Haven't been able to find any threads about others having the same issue.

I even tried ignoring it and starting the eloipool server - it promptly gave me the following error, but seemed to run in the background.

2013-09-17 18:17:31,083 jsonrpc_getwork WARNING Error importing 'midstate' module; work will not provide midstates

I tried using cgminer to test if it was working, but it wasn't able to establish a connection.

Any help would be greatly appreciated! And sorry for being a noob at this.

  • I used this command python3.3-config --ldflags that returned the flags to add to the Makefile LDFLAGS =, compiled after that but I get this now: 2013-12-12 23:56:51,435 jsonrpc_getwork WARNING Error importing 'midstate' module; work will not provide midstates >>> Traceback (most recent call last): File "eloipool.py", line 905, in <module> BitcoinLink(bcnode, dest=config.UpstreamBitcoindNode) File "/home/john/Miner/eloipool/bitcoin/node.py", line 50, in init sock.connect(dest) ConnectionRefusedError: [Errno 111] Connection refused – user10732 Dec 13 '13 at 4:59
  • You should not be posting questions as "answers". If you have a genuine question post it as a new question. – DeathAndTaxes Dec 22 '13 at 2:53
  • This is a question, not an answer. And I still haven't gotten a solution to this. Did you even read the whole thing? – xil3 Dec 26 '13 at 22:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.