Compiling pysparse from the sandbox
Hi, I tried compiling pysparse from the sandbox in a recent svn SciPy, but I get the following compiler error: In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec_transp’: Lib/sandbox/pysparse/src/ll_mat.c:760: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec’: Lib/sandbox/pysparse/src/ll_mat.c:797: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec_transp’: Lib/sandbox/pysparse/src/csr_mat.c:119: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec’: Lib/sandbox/pysparse/src/csr_mat.c:146: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function ‘SSSMat_matvec’: Lib/sandbox/pysparse/src/sss_mat.c:83: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec_transp’: Lib/sandbox/pysparse/src/ll_mat.c:760: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec’: Lib/sandbox/pysparse/src/ll_mat.c:797: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec_transp’: Lib/sandbox/pysparse/src/csr_mat.c:119: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec’: Lib/sandbox/pysparse/src/csr_mat.c:146: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function ‘SSSMat_matvec’: Lib/sandbox/pysparse/src/sss_mat.c:83: error: ‘CONTIGUOUS’ undeclared (first use in this function) error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -fPIC -ILib/sandbox/pysparse/include/ -I/usr/lib/python2.4/site-packages/numpy/core/include -I/usr/include/python2.4 -c Lib/sandbox/pysparse/src/spmatrixmodule.c -o build/temp.linux-x86_64-2.4/Lib/sandbox/pysparse/src/spmatrixmodule.o" failed with exit status 1 Is this a known problem, or have I forgotten to install some development library? I'm running Ubuntu Edgy AMD64. Thanks Neilen -- you know its kind of tragic we live in the new world but we've lost the magic -- Battery 9 (www.battery9.co.za)
Neilen Marais wrote:
Hi,
I tried compiling pysparse from the sandbox in a recent svn SciPy, but I get the following compiler error:
In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec_transp’: Lib/sandbox/pysparse/src/ll_mat.c:760: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec’: Lib/sandbox/pysparse/src/ll_mat.c:797: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec_transp’: Lib/sandbox/pysparse/src/csr_mat.c:119: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec’: Lib/sandbox/pysparse/src/csr_mat.c:146: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function ‘SSSMat_matvec’: Lib/sandbox/pysparse/src/sss_mat.c:83: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec_transp’: Lib/sandbox/pysparse/src/ll_mat.c:760: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function ‘LLMat_matvec’: Lib/sandbox/pysparse/src/ll_mat.c:797: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec_transp’: Lib/sandbox/pysparse/src/csr_mat.c:119: error: ‘CONTIGUOUS’ undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function ‘CSRMat_matvec’: Lib/sandbox/pysparse/src/csr_mat.c:146: error: ‘CONTIGUOUS’ undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function ‘SSSMat_matvec’: Lib/sandbox/pysparse/src/sss_mat.c:83: error: ‘CONTIGUOUS’ undeclared (first use in this function) error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -fPIC -ILib/sandbox/pysparse/include/ -I/usr/lib/python2.4/site-packages/numpy/core/include -I/usr/include/python2.4 -c Lib/sandbox/pysparse/src/spmatrixmodule.c -o build/temp.linux-x86_64-2.4/Lib/sandbox/pysparse/src/spmatrixmodule.o" failed with exit status 1
Is this a known problem, or have I forgotten to install some development library? I'm running Ubuntu Edgy AMD64.
Thanks Neilen
Hi Neilen, I just tried to install pysparse from the sandox. I can only confirm the failure. Nils
I think the name changed from CONTIGUOUS to NPY_CONTIGUOUS (or NPY_C_CONTIGUOUS if you want to be a little more explicit). Or try including numpy/noprefix.h instead of whatever it is including. That's apparently a compatibility header. So is this pysparse in the sandbox the same pysparse as here? http://sourceforge.net/project/showfiles.php?group_id=101403 Has it been further developed/fixed in the sandbox? --bb On 4/18/07, Nils Wagner <nwagner@iam.uni-stuttgart.de> wrote:
Neilen Marais wrote:
Hi,
I tried compiling pysparse from the sandbox in a recent svn SciPy, but I get the following compiler error:
In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function 'LLMat_matvec_transp': Lib/sandbox/pysparse/src/ll_mat.c:760: error: 'CONTIGUOUS' undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function 'LLMat_matvec': Lib/sandbox/pysparse/src/ll_mat.c:797: error: 'CONTIGUOUS' undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function 'CSRMat_matvec_transp': Lib/sandbox/pysparse/src/csr_mat.c:119: error: 'CONTIGUOUS' undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function 'CSRMat_matvec': Lib/sandbox/pysparse/src/csr_mat.c:146: error: 'CONTIGUOUS' undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function 'SSSMat_matvec': Lib/sandbox/pysparse/src/sss_mat.c:83: error: 'CONTIGUOUS' undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:17: Lib/sandbox/pysparse/src/ll_mat.c: In function 'LLMat_matvec_transp': Lib/sandbox/pysparse/src/ll_mat.c:760: error: 'CONTIGUOUS' undeclared (first use in this function) Lib/sandbox/pysparse/src/ll_mat.c:760: error: (Each undeclared identifier is reported only once Lib/sandbox/pysparse/src/ll_mat.c:760: error: for each function it appears in.) Lib/sandbox/pysparse/src/ll_mat.c: In function 'LLMat_matvec': Lib/sandbox/pysparse/src/ll_mat.c:797: error: 'CONTIGUOUS' undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:18: Lib/sandbox/pysparse/src/csr_mat.c: In function 'CSRMat_matvec_transp': Lib/sandbox/pysparse/src/csr_mat.c:119: error: 'CONTIGUOUS' undeclared (first use in this function) Lib/sandbox/pysparse/src/csr_mat.c: In function 'CSRMat_matvec': Lib/sandbox/pysparse/src/csr_mat.c:146: error: 'CONTIGUOUS' undeclared (first use in this function) In file included from Lib/sandbox/pysparse/src/spmatrixmodule.c:19: Lib/sandbox/pysparse/src/sss_mat.c: In function 'SSSMat_matvec': Lib/sandbox/pysparse/src/sss_mat.c:83: error: 'CONTIGUOUS' undeclared (first use in this function) error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -fPIC -ILib/sandbox/pysparse/include/ -I/usr/lib/python2.4/site-packages/numpy/core/include -I/usr/include/python2.4 -c Lib/sandbox/pysparse/src/spmatrixmodule.c -o build/temp.linux-x86_64-2.4/Lib/sandbox/pysparse/src/spmatrixmodule.o" failed with exit status 1
Is this a known problem, or have I forgotten to install some development library? I'm running Ubuntu Edgy AMD64.
Thanks Neilen
Hi Neilen,
I just tried to install pysparse from the sandox. I can only confirm the failure.
Nils
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
On Apr 18, 2007, at 6:53 PM, Bill Baxter wrote:
I think the name changed from CONTIGUOUS to NPY_CONTIGUOUS (or NPY_C_CONTIGUOUS if you want to be a little more explicit). Or try including numpy/noprefix.h instead of whatever it is including. That's apparently a compatibility header.
So is this pysparse in the sandbox the same pysparse as here?
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
http://sourceforge.net/project/showfiles.php?group_id=101403
Has it been further developed/fixed in the sandbox?
--bb
-- Daniel Wheeler
On 4/18/07, Daniel Wheeler <daniel.wheeler@nist.gov> wrote:
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
Just out of curiosity, is there important functionality that PySparse offers that's not currently available in SciPy? From what I can tell, PySparse has a few preconditioners and an eigensolver, in addition to what SciPy also has. Is there an interest in including these or any other sparse features in SciPy? I have some Algebraic Multigrid code (AMG) that I've been working on for a while. I've implemented the so-called "classical" AMG of Ruge & Stuben and also Smoothed Aggregation as described in by Vanek et. al. Would others be interested in using AMG in SciPy? For those not familiar with AMG, or multigrid in general - multigrid can solve linear systems that arise in certain elliptic PDEs (e.g. Poisson equations, heat diffusion, linear elasticity, etc) in optimal time. Furthermore, the AMG methods mentioned above are "black box" in the sense that only the matrix needs to be provided to the solver - so no knowledge of the mesh geometry is necessary. Also, are the iterative methods (pcg,gmres,etc.) reentrant? I recall having problems using cg with a preconditioner that also called cg (for a coarse level solve). -- Nathan Bell wnbell@gmail.com
On 4/19/07, Nathan Bell <wnbell@gmail.com> wrote:
On 4/18/07, Daniel Wheeler <daniel.wheeler@nist.gov> wrote:
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
Just out of curiosity, is there important functionality that PySparse offers that's not currently available in SciPy? From what I can tell, PySparse has a few preconditioners and an eigensolver, in addition to what SciPy also has.
SciPy's sparse matrices also lack any way to operate based on a sparse index, which is a fundamental operation in FEM codes. Basically you need to be able to do something like idx = [1,8,13,15] K[ix_[idx,idx]] += node_contribution pysparse has an update_add_masked function which can do that efficiently (although it would obviously be better if regular numpy indexing just worked.)
Is there an interest in including these or any other sparse features in SciPy?
I have some Algebraic Multigrid code (AMG) that I've been working on for a while. I've implemented the so-called "classical" AMG of Ruge & Stuben and also Smoothed Aggregation as described in by Vanek et. al.
Would others be interested in using AMG in SciPy? For those not familiar with AMG, or multigrid in general - multigrid can solve linear systems that arise in certain elliptic PDEs (e.g. Poisson equations, heat diffusion, linear elasticity, etc) in optimal time. Furthermore, the AMG methods mentioned above are "black box" in the sense that only the matrix needs to be provided to the solver - so no knowledge of the mesh geometry is necessary.
Sounds great to me. I've toyed with MG, but never got very far. Non-power-of-two grids and boundary conditions were too tricksy for me. But the O(N) solve time is great if someone else does all the hard work for me. :-)
Also, are the iterative methods (pcg,gmres,etc.) reentrant? I recall having problems using cg with a preconditioner that also called cg (for a coarse level solve).
--bb
On Apr 18, 2007, at 11:54 PM, Bill Baxter wrote:
SciPy's sparse matrices also lack any way to operate based on a sparse index, which is a fundamental operation in FEM codes. Basically you need to be able to do something like idx = [1,8,13,15] K[ix_[idx,idx]] += node_contribution
pysparse has an update_add_masked function which can do that efficiently (although it would obviously be better if regular numpy indexing just worked.)
This is one important advantage, although update_add_mask() was not suitable for our needs (we wanted to build sparse matrices from dense vectors, rather than building sparse matrices from small dense matrices). We added (and Roman accepted) an update_add_at() function that did what we wanted. Either is blindingly faster than what could be done if SciPy the last time I looked. SciPy's syntax is more Pythonic, but PySparse can build matrices *much* more efficiently. More broadly, the advantages of PySparse over SciPy all boil down to speed. About a year and a half ago, I posted some benchmarking info to the SciPy wiki, but it went away with the move to the new wiki. I have no idea where it's gone, and I don't seem to have a copy of it. It used to be at <http://www.scipy.org/wikis/featurerequests/ SparseSolvers>.
Sounds great to me. I've toyed with MG, but never got very far. Non-power-of-two grids and boundary conditions were too tricksy for me. But the O(N) solve time is great if someone else does all the hard work for me. :-)
Likewise. We're very interested in multigrid for FiPy, and even more interested if it doesn't require us to think very hard.
Nathan Bell wrote:
On 4/18/07, Daniel Wheeler <daniel.wheeler@nist.gov> wrote:
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
Just out of curiosity, is there important functionality that PySparse offers that's not currently available in SciPy? From what I can tell, PySparse has a few preconditioners and an eigensolver, in addition to what SciPy also has.
Is there an interest in including these or any other sparse features in SciPy?
I have some Algebraic Multigrid code (AMG) that I've been working on for a while. I've implemented the so-called "classical" AMG of Ruge & Stuben and also Smoothed Aggregation as described in by Vanek et. al.
Would others be interested in using AMG in SciPy? For those not familiar with AMG, or multigrid in general - multigrid can solve linear systems that arise in certain elliptic PDEs (e.g. Poisson equations, heat diffusion, linear elasticity, etc) in optimal time. Furthermore, the AMG methods mentioned above are "black box" in the sense that only the matrix needs to be provided to the solver - so no knowledge of the mesh geometry is necessary.
I'm interested.
Also, are the iterative methods (pcg,gmres,etc.) reentrant? I recall having problems using cg with a preconditioner that also called cg (for a coarse level solve).
Yes, because f2py should be re-entrant. -Travis
Nathan Bell wrote:
Just out of curiosity, is there important functionality that PySparse offers that's not currently available in SciPy? From what I can tell, PySparse has a few preconditioners and an eigensolver, in addition to what SciPy also has.
Is there an interest in including these or any other sparse features in SciPy?
I have some Algebraic Multigrid code (AMG) that I've been working on for a while. I've implemented the so-called "classical" AMG of Ruge & Stuben and also Smoothed Aggregation as described in by Vanek et. al.
Would others be interested in using AMG in SciPy? For those not familiar with AMG, or multigrid in general - multigrid can solve linear systems that arise in certain elliptic PDEs (e.g. Poisson equations, heat diffusion, linear elasticity, etc) in optimal time. Furthermore, the AMG methods mentioned above are "black box" in the sense that only the matrix needs to be provided to the solver - so no knowledge of the mesh geometry is necessary.
I'd love to see an AMG implementation in SciPy! r.
Robert Cimrman wrote:
Nathan Bell wrote:
Just out of curiosity, is there important functionality that PySparse offers that's not currently available in SciPy? From what I can tell, PySparse has a few preconditioners and an eigensolver, in addition to what SciPy also has.
Is there an interest in including these or any other sparse features in SciPy?
I have some Algebraic Multigrid code (AMG) that I've been working on for a while. I've implemented the so-called "classical" AMG of Ruge & Stuben and also Smoothed Aggregation as described in by Vanek et. al.
Would others be interested in using AMG in SciPy? For those not familiar with AMG, or multigrid in general - multigrid can solve linear systems that arise in certain elliptic PDEs (e.g. Poisson equations, heat diffusion, linear elasticity, etc) in optimal time. Furthermore, the AMG methods mentioned above are "black box" in the sense that only the matrix needs to be provided to the solver - so no knowledge of the mesh geometry is necessary.
I'd love to see an AMG implementation in SciPy!
r.
+1 Nils
_______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
On 4/18/07, Daniel Wheeler <daniel.wheeler@nist.gov> wrote:
On Apr 18, 2007, at 6:53 PM, Bill Baxter wrote:
I think the name changed from CONTIGUOUS to NPY_CONTIGUOUS (or NPY_C_CONTIGUOUS if you want to be a little more explicit). Or try including numpy/noprefix.h instead of whatever it is including. That's apparently a compatibility header.
So is this pysparse in the sandbox the same pysparse as here?
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
That's interesting to hear; I haven't been following PySparse development for a while. Around the time of the Numeric -> SciPy core transition, I took a snapshot of PySparse, patched it to compile with NumPy and added it to the sandbox, with the idea of using it as a basis for improvements to (or even a re-write of) the scipy.sparse module. But we decided to keep the existing scipy.sparse matrix types, and when I came to add the new list-based lil_matrix type, it turned out to be easier to design it from scratch rather than port PySparse's ll_mat.c code to Python. So I see no reason to keep the pysparse snapshot in the sandbox any longer. I've actually been meaning for a while to propose that we delete it from the tree... -- Ed
On Thu, 19 Apr 2007 16:46:37 +0100 "Ed Schofield" <edschofield@gmail.com> wrote:
On 4/18/07, Daniel Wheeler <daniel.wheeler@nist.gov> wrote:
On Apr 18, 2007, at 6:53 PM, Bill Baxter wrote:
I think the name changed from CONTIGUOUS to NPY_CONTIGUOUS (or NPY_C_CONTIGUOUS if you want to be a little more explicit). Or try including numpy/noprefix.h instead of whatever it is including. That's apparently a compatibility header.
So is this pysparse in the sandbox the same pysparse as here?
Probably not. Pysparse at sourceforge is being maintained and is at release 1.0. It's been updated to use numpy with the numpy/noprefix.h method mentioned above. Use cvs rather than 1.0 as 1.0 doesn't see the numpy header files.
That's interesting to hear; I haven't been following PySparse development for a while. Around the time of the Numeric -> SciPy core transition, I took a snapshot of PySparse, patched it to compile with NumPy and added it to the sandbox, with the idea of using it as a basis for improvements to (or even a re-write of) the scipy.sparse module. But we decided to keep the existing scipy.sparse matrix types, and when I came to add the new list-based lil_matrix type, it turned out to be easier to design it from scratch rather than port PySparse's ll_mat.c code to Python.
So I see no reason to keep the pysparse snapshot in the sandbox any longer. I've actually been meaning for a while to propose that we delete it from the tree...
-- Ed _______________________________________________ Scipy-dev mailing list Scipy-dev@scipy.org http://projects.scipy.org/mailman/listinfo/scipy-dev
Hi Ed, Just now I have installed the latest pysparse via cvs, but I need some advice to improve my local setup.py. I have already installed BLAS/LAPACK,ATLAS and UMFPACK from source. So, who can send me a customized setup.py for pysparse ? Nils
participants (9)
-
Bill Baxter -
Daniel Wheeler -
Ed Schofield -
Jonathan Guyer -
Nathan Bell -
Neilen Marais -
Nils Wagner -
Robert Cimrman -
Travis Oliphant