Author

Topic: Midstate - Python3.2 from source (Read 2660 times)

sr. member
Activity: 322
Merit: 250
September 30, 2012, 06: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...



legendary
Activity: 1050
Merit: 1000
You are WRONG!
September 30, 2012, 01: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.
sr. member
Activity: 322
Merit: 250
September 30, 2012, 01: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?
legendary
Activity: 1050
Merit: 1000
You are WRONG!
September 30, 2012, 04:00:15 AM
#6
on ubuntu in the terminal try:
Code:
sudo apt-get install python3.2-dev
sr. member
Activity: 322
Merit: 250
September 29, 2012, 03:00:11 PM
#5
I pressed the killswitch minutes ago - actually installing ubuntu 12.
legendary
Activity: 1260
Merit: 1000
September 29, 2012, 02:56:22 PM
#4
As I recall, you need this file: /usr/include/python3.2mu/Python.h

I forget what package has that, though.
sr. member
Activity: 322
Merit: 250
September 29, 2012, 01:30:32 PM
#3
I have no idea how to fix this
legendary
Activity: 1050
Merit: 1000
You are WRONG!
September 29, 2012, 04: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)
sr. member
Activity: 322
Merit: 250
September 29, 2012, 04: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
Jump to: