Bitcoin Forum
May 21, 2019, 10:08:56 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Midstate - Python3.2 from source  (Read 2518 times)
sippsnapp
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


View Profile
September 29, 2012, 09:17:18 AM
 #1

Python 3.2 is installed like this:
Code:
./configure --prefix=/opt/python3
make
make install

How do i have to edit the makefile to work with the python installation?

Problem:
Midstate "make" does print an error:
Code:
root@j064:/opt/midstate# make
gcc -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/opt/python3/  midstatemodule.c -o test -Wl,-O1 -Wl,--as-needed -lpython3
midstatemodule.c:5:20: error: Python.h: Datei oder Verzeichnis nicht gefunden
midstatemodule.c:96: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
midstatemodule.c:138: error: array type has incomplete element type
midstatemodule.c:139: error: âmidstate_helperâ undeclared here (not in a function)
midstatemodule.c:139: error: âMETH_Oâ undeclared here (not in a function)
midstatemodule.c:144: error: variable âmidstatemoduleâ has initializer but incomplete type
midstatemodule.c:145: error: âPyModuleDef_HEAD_INITâ undeclared here (not in a function)
midstatemodule.c:145: warning: excess elements in struct initializer
midstatemodule.c:145: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:146: warning: excess elements in struct initializer
midstatemodule.c:146: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:147: warning: excess elements in struct initializer
midstatemodule.c:147: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:148: warning: excess elements in struct initializer
midstatemodule.c:148: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:149: warning: excess elements in struct initializer
midstatemodule.c:149: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:150: warning: excess elements in struct initializer
midstatemodule.c:150: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:151: warning: excess elements in struct initializer
midstatemodule.c:151: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:152: warning: excess elements in struct initializer
midstatemodule.c:152: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:154: warning: excess elements in struct initializer
midstatemodule.c:154: warning: (near initialization for âmidstatemoduleâ)
midstatemodule.c:157: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âPyInit_midstateâ
make: *** [test] Fehler 1

https://gitorious.org/midstate/midstate/blobs/master/Makefile

Code:
CC = gcc

CFLAGS = -march=native -Wall -funroll-all-loops -O3 -fstrict-aliasing -Wall -std=c99 -I/usr/include/python3.2

LDFLAGS = -Wl,-O1 -Wl,--as-needed -lpython3.2

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

Πάντα ῥεῖ
Bitcoin + Altcoin node pool setup - pm
New Generation Antminer S17 Mining Plan Available Now! Highly Reduced Electricity Fee $0.067/T/DAY! Register To Experience
Free Mining Plan!
GET STARTED!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
September 29, 2012, 09:40:41 AM
 #2

midstatemodule.c:5:20: error: Python.h: Datei oder Verzeichnis nicht gefunden

^ means you fucked up, try installing the python headers.

(please, another time post in english)

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
sippsnapp
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


View Profile
September 29, 2012, 06:30:32 PM
 #3

I have no idea how to fix this

Πάντα ῥεῖ
Bitcoin + Altcoin node pool setup - pm
Inaba
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000



View Profile WWW
September 29, 2012, 07:56:22 PM
 #4

As I recall, you need this file: /usr/include/python3.2mu/Python.h

I forget what package has that, though.

If you're searching these lines for a point, you've probably missed it.  There was never anything there in the first place.
sippsnapp
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


View Profile
September 29, 2012, 08:00:11 PM
 #5

I pressed the killswitch minutes ago - actually installing ubuntu 12.

Πάντα ῥεῖ
Bitcoin + Altcoin node pool setup - pm
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
September 30, 2012, 09:00:15 AM
 #6

on ubuntu in the terminal try:
Code:
sudo apt-get install python3.2-dev

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
sippsnapp
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


View Profile
September 30, 2012, 06:12:27 PM
 #7

on ubuntu in the terminal try:
Code:
sudo apt-get install python3.2-dev
I found this: http://stackoverflow.com/questions/11740218/python-3-2-installation-on-ubuntu-12-04

Which one is correct and why?

Πάντα ῥεῖ
Bitcoin + Altcoin node pool setup - pm
kokjo
Legendary
*
Offline Offline

Activity: 1050
Merit: 1000

You are WRONG!


View Profile
September 30, 2012, 06:52:04 PM
 #8

on ubuntu in the terminal try:
Code:
sudo apt-get install python3.2-dev
I found this: http://stackoverflow.com/questions/11740218/python-3-2-installation-on-ubuntu-12-04

Which one is correct and why?
dunno! try one, if you fail, try the other one.

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
sippsnapp
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250


View Profile
September 30, 2012, 11:36:26 PM
 #9

In this case
Code:
sudo apt-get install python3.2-dev
was what installed python 3.2 successfully.

The command sudo
Code:
apt-get install python3
installs python 3.2 in the
Code:
usr/include/Python3.2mu
directory, the above package installs correctly to
Code:
usr/include/Python3.2
.

For me it made a difference, may it helps others...




Πάντα ῥεῖ
Bitcoin + Altcoin node pool setup - pm
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!