Problem compiling pymat - invalid conversion

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
Yves Roy
Posts: 2
Joined: Mon Mar 29, 2004 7:17 pm
Location: Montreal, Quebec, CANADA
Contact:

Problem compiling pymat - invalid conversion

Post by Yves Roy »

Bonjour:

J' essaie de compiler pymat en utilisant le makefile offert sur le sire de BrainVISA et j' obtiens l' erreur suivante a plusieurs endroits:

invalid conversion from `const maybelong*' to `int*' (voir ci-bas)

Une idee du probleme ?
Merci bien
Yves

make install
g++ -c pymat.cpp -o pymat.o -I/usr/local/matlab6p5/extern/include -I/usr/include/python2.2/numarray -I/usr/include/python2.2
pymat.cpp: In function `mxArray* makeMxFromNumeric(const PyArrayObject*)':
pymat.cpp:216: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:216: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = char]'
pymat.cpp:219: duplicate case value
pymat.cpp:215: previously used here
pymat.cpp:220: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:220: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = unsigned char]'
pymat.cpp:224: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:224: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = signed char]'
pymat.cpp:228: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:228: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = short int]'
pymat.cpp:232: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:232: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = int]'
pymat.cpp:235: duplicate case value
pymat.cpp:231: previously used here
pymat.cpp:236: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:236: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = long int]'
pymat.cpp:240: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:240: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = float]'
pymat.cpp:244: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:244: initializing argument 5 of `void copyNumeric2Mx(T*, int, int,
double*, int*) [with T = double]'
pymat.cpp:248: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:248: initializing argument 6 of `void copyCplxNumeric2Mx(T*, int,
int, double*, double*, int*) [with T = float]'
pymat.cpp:252: invalid conversion from `const maybelong*' to `int*'
pymat.cpp:252: initializing argument 6 of `void copyCplxNumeric2Mx(T*, int,
int, double*, double*, int*) [with T = double]'
pymat.cpp: In function `mxArray* numeric2mx(const PyObject*)':
pymat.cpp:294: invalid conversion from `const PyObject*' to `PyObject*'
make: *** [pymat.o] Error 1

Compilation exited abnormally with code 2 at Thu Jun 10 13:19:26
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hello,

My guess would be that the Numeric module installed in your python is not the same as the one we used. I don't remember exactly where ours comes from (it's Yann who managed python installation and setup), it's named Numeric-23.1 and its headers are not in <python_inc_dir>/numarray but in <python_inc_dir>/Numeric.
We'll try to make this clear next week...

Denis
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Post by Yann Cointepas »

Numeric is an obsolete package that is beign replaced by Numarray (see http://www.pfdubois.com/numpy). I did not installed Numarray to avoid compatibility problems with existing processes. I will have either to switch form Numeric to Numarray or to install both (the web site says it is possible).
Post Reply