Re: Problems with CLAPACK SVD routines on OS X
- From: "H.S." <hs.saDELETEMEmix@xxxxxxxxx>
- Date: Wed, 08 Aug 2007 15:03:07 -0400
Robert V. wrote:
Hello,
I apologize if these questions have been addressed before, but I am
new to both C++ and LAPACK.
I am trying to write a program to calculate the SVD of a term-document
matrix. Since I have no experience with Fortran, I thought it best to
do this in C/C++. I am doing my development on an Intel Mac running OS
X 10.4.10.
I am able to get results using Lapack's dgesvd routine, but only when
Great! So your libraries and routine calls are working properly.
The following program is based on the sample above, but it differs in
that I have to allocate my arrays dynamically. Unfortunately, I can't
seem to get it to run without seg faulting during the call to dgesvd:
####
#include <vecLib/vecLib.h>
I am not familiar with this header file. What does it do and why do you
need it?
I wanted to run this code of yours (I have lapack libraries installed on
my Linux system) but I do not have a data file that you are trying to
read. But I couldn't get the program compiled ....
g++ svd_test.cpp -I/usr/local/include -framework vecLib -o svd
.... If I try to compile your program, I get (after excluding fstream and
sstream headers):
$> g++ testsvn.cc ~/lib/lapack_LINUX.a -I~/include/ -o testsvd
testsvn.cc:1:27: error: vecLib/vecLib.h: No such file or directory
testsvn.cc: In function ‘int main(int, char**)’:
testsvn.cc:27: error: variable ‘std::ifstream infile’ has initializer
but incomplete type
testsvn.cc:46: error: variable ‘std::istringstream s’ has initializer
but incomplete type
testsvn.cc:85: error: variable ‘std::istringstream s’ has initializer
but incomplete type
testsvn.cc:91: error: statement cannot resolve address of overloaded
function
testsvn.cc:122: error: ‘dgesvd_’ was not declared in this scope
So, doesn't your g++ compiler not give any warnings or errors at all?
Try with the "-Wall" switch.
Next, can you send us an example date file you are trying out? You don't
need a huge matrix, try with a much smaller one (would help in debugging).
So let us what warnings you get from your compiler and send an example
data file as well and then I will try again.
regards,
->HS
./svd small.matrix.
Opening small.matrix
Initializing a 5 x 15513 matrix
Finished initializing...
Initializing LWORK...
Calculating SVD...
Segmentation fault
I suspect that my problem stems from my confusion about row-major vs
column-major matrices, but this is a shot in the dark. Any insight
would be greatly appreciated.
Thanks!
Robert
- Follow-Ups:
- Re: Problems with CLAPACK SVD routines on OS X
- From: mecej4
- Re: Problems with CLAPACK SVD routines on OS X
- References:
- Problems with CLAPACK SVD routines on OS X
- From: Robert V.
- Problems with CLAPACK SVD routines on OS X
- Prev by Date: Re: Problems with CLAPACK SVD routines on OS X
- Next by Date: Re: Problems with CLAPACK SVD routines on OS X
- Previous by thread: Re: Problems with CLAPACK SVD routines on OS X
- Next by thread: Re: Problems with CLAPACK SVD routines on OS X
- Index(es):
Relevant Pages
|