Thread: [Lapackpp-devel] Help me: syntax errors from "COMPLEX" in Lapack++
Status: Beta
Brought to you by:
cstim
From: mohamad c. <moh...@in...> - 2004-12-14 14:30:37
|
HI all, I'm new to C++. I've just installed Lapackpp-2.0.3. The installation seems to be fine but when i tried to do a test (i've tried the command "gcc tEigSolve.cc" under the directory lapackpp-2.0.3/testing) i have got many syntax errors!!, these errors come from files: vc.h, gmc.h, lavc.h, blas1pp.h, blaspp.h and blas++.h. Most of these errors claim about the struct "COMPLEX", when declaring a pointer or a reference to "COMPLEX" saying that this is a syntax error! Please give me some feedback, Thanks in advances! |
From: Christian S. <sti...@tu...> - 2004-12-14 14:50:38
|
Dear Mohamad, when using Lapack++ and using the complex-valued matrices, you need to define the constant LA_COMPLEX_SUPPORT because otherwise lapack++ would have the complex numbers disabled. Either you insert #define LA_COMPLEX_SUPPORT into your personal source code before including the headers, or you call gcc with -DLA_COMPLEX_SUPPORT. If you want to run the example files, you can have this done automatically by the command "make check". Christian mohamad chaitou schrieb: > HI all, > I'm new to C++. I've just installed Lapackpp-2.0.3. The installation > seems to be fine but when i tried to do a test (i've tried the command > "gcc tEigSolve.cc" under the directory lapackpp-2.0.3/testing) i have > got many syntax errors!!, these errors come from files: vc.h, gmc.h, > lavc.h, blas1pp.h, blaspp.h and blas++.h. Most of these errors claim > about the struct "COMPLEX", when declaring a pointer or a reference to > "COMPLEX" saying that this is a syntax error! > Please give me some feedback, > Thanks in advances! > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > lapackpp-devel mailing list > lap...@li... > https://lists.sourceforge.net/lists/listinfo/lapackpp-devel > |
From: Christian S. <sti...@tu...> - 2004-12-15 09:19:26
|
Questions about the program *always* to the mailinglist, *never* to=20 individual developers. Thanks. mohamad chaitou schrieb: > Hi Christian, > Thank you for your invaluable help. The tests are passed very well, but= =20 > when i had tried to compile a simple program i got many errors of kinds= =20 > "undefined references". for example when compiling the file=20 > "$HOME/lapackpp-2.0.3/testing/tEigSolve.cc" errors like the following=20 > appears: > (tEigSolve.o(.text+0x284): In function `eig_residual(LaSymmMatDouble=20 > const&, double, LaVectorDouble const&)': > : undefined reference to =AB Mach_eps_double() =BB). what could be t= he=20 > problem? > I hope some suggestions from you, > Thank you a lot, Please send your full compile command line so that we can see how you=20 compiled your test program. Christian >=20 >=20 >=20 > Christian Stimming a =E9crit : >=20 >> Dear Mohamad, >> >> when using Lapack++ and using the complex-valued matrices, you need to= =20 >> define the constant LA_COMPLEX_SUPPORT because otherwise lapack++=20 >> would have the complex numbers disabled. Either you insert >> #define LA_COMPLEX_SUPPORT >> into your personal source code before including the headers, or you=20 >> call gcc with -DLA_COMPLEX_SUPPORT. If you want to run the example=20 >> files, you can have this done automatically by the command "make check= ". >> >> Christian >> >> mohamad chaitou schrieb: >> >>> HI all, >>> I'm new to C++. I've just installed Lapackpp-2.0.3. The installation=20 >>> seems to be fine but when i tried to do a test (i've tried the=20 >>> command "gcc tEigSolve.cc" under the directory=20 >>> lapackpp-2.0.3/testing) i have got many syntax errors!!, these errors= =20 >>> come from files: vc.h, gmc.h, lavc.h, blas1pp.h, blaspp.h and=20 >>> blas++.h. Most of these errors claim about the struct "COMPLEX", when= =20 >>> declaring a pointer or a reference to "COMPLEX" saying that this is a= =20 >>> syntax error! >>> Please give me some feedback, >>> Thanks in advances! >>> >>> >>> >>> ------------------------------------------------------- >>> SF email is sponsored by - The IT Product Guide >>> Read honest & candid reviews on hundreds of IT Products from real use= rs. >>> Discover which products truly live up to the hype. Start reading now.= =20 >>> http://productguide.itmanagersjournal.com/ >>> _______________________________________________ >>> lapackpp-devel mailing list >>> lap...@li... >>> https://lists.sourceforge.net/lists/listinfo/lapackpp-devel >>> >> >> >=20 >=20 >=20 |
From: mohamad c. <moh...@in...> - 2004-12-15 09:33:33
|
The compile command i have used is very simple (maybe stupid) because i=20 don't know how to deal with dependencies between these files! here its: g++ -Wall -c tEigSolve.cc g++ tEigSolve.o Thank you in adavnce for any kind of help! Christian Stimming a =E9crit : > Questions about the program *always* to the mailinglist, *never* to=20 > individual developers. Thanks. > > mohamad chaitou schrieb: > >> Hi Christian, >> Thank you for your invaluable help. The tests are passed very well,=20 >> but when i had tried to compile a simple program i got many errors of=20 >> kinds "undefined references". for example when compiling the file=20 >> "$HOME/lapackpp-2.0.3/testing/tEigSolve.cc" errors like the following=20 >> appears: >> (tEigSolve.o(.text+0x284): In function `eig_residual(LaSymmMatDouble=20 >> const&, double, LaVectorDouble const&)': >> : undefined reference to =AB Mach_eps_double() =BB). what could be = the=20 >> problem? >> I hope some suggestions from you, >> Thank you a lot, > > > Please send your full compile command line so that we can see how you=20 > compiled your test program. > > Christian > >> >> >> >> Christian Stimming a =E9crit : >> >>> Dear Mohamad, >>> >>> when using Lapack++ and using the complex-valued matrices, you need=20 >>> to define the constant LA_COMPLEX_SUPPORT because otherwise lapack++=20 >>> would have the complex numbers disabled. Either you insert >>> #define LA_COMPLEX_SUPPORT >>> into your personal source code before including the headers, or you=20 >>> call gcc with -DLA_COMPLEX_SUPPORT. If you want to run the example=20 >>> files, you can have this done automatically by the command "make=20 >>> check". >>> >>> Christian >>> >>> mohamad chaitou schrieb: >>> >>>> HI all, >>>> I'm new to C++. I've just installed Lapackpp-2.0.3. The=20 >>>> installation seems to be fine but when i tried to do a test (i've=20 >>>> tried the command "gcc tEigSolve.cc" under the directory=20 >>>> lapackpp-2.0.3/testing) i have got many syntax errors!!, these=20 >>>> errors come from files: vc.h, gmc.h, lavc.h, blas1pp.h, blaspp.h=20 >>>> and blas++.h. Most of these errors claim about the struct=20 >>>> "COMPLEX", when declaring a pointer or a reference to "COMPLEX"=20 >>>> saying that this is a syntax error! >>>> Please give me some feedback, >>>> Thanks in advances! >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> SF email is sponsored by - The IT Product Guide >>>> Read honest & candid reviews on hundreds of IT Products from real=20 >>>> users. >>>> Discover which products truly live up to the hype. Start reading=20 >>>> now. http://productguide.itmanagersjournal.com/ >>>> _______________________________________________ >>>> lapackpp-devel mailing list >>>> lap...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lapackpp-devel >>>> >>> >>> >> >> >> > > |
From: Christian S. <sti...@tu...> - 2004-12-15 10:02:45
|
mohamad chaitou schrieb: > The compile command i have used is very simple (maybe stupid) because i > don't know how to deal with dependencies between these files! > here its: C++ doesn't work this way, or in other words not that simple. You need to get a textbook about how to use a C++ compiler, especially how to 1. specify the directories to find the header files, 2. specify the libraries to link against, and 3. specify the directories where to find the libraries to link against. This is not a lapack++ problem but a general problem of how to write a C++ program that uses other libraries. > g++ -Wall -c tEigSolve.cc In this case you are missing the specification of where to find lapackpp's header files, which would usually look like this g++ -I/usr/include/lapackpp -c tEigSolve.cc Apart from this problem, this step obviously worked. This step is called "compiling" and if you report a bug, it is important to note the the "compiling" went ok. > g++ tEigSolve.o This other step obviously gave you errors. This step is called "linking", so you got "linker errors". The point is that your c++ program uses extra libraries (lapack++'s libraries in this case), and you must tell the linker which libraries to use and where to find it. For example g++ -L/usr/lib -llamatrix++ -llapack++ -lblas++ -llapack -lblas tEigSolve.o However, usually you don't call the compiler by hand. Instead, you use some Makefile which contains the compiler commands (see "info make" on your system). And even further, you don't even write the Makefile by hand, but you have them generated by automake and autoconf (see "info automake" and "info autoconf"). In that case, autoconf is configured by a top-level file called "configure.in" or "configure.ac", and configuration for Lapack++ use can be done through the macro ACX_LAPACKPP which is included in the filename acx_lapackpp.m4. That's how we are using this in our package simthetic-mimolib http://cvs.sourceforge.net/viewcvs.py/simthetic/mimolib/ Christian |
From: mohamad c. <moh...@in...> - 2004-12-15 16:19:00
|
Thank you Christian, I follow your advices and i began reading some tutorials about "automake=20 and autoconf". It will be very helpful for me if you can send me an=20 example of a configure.ac file and a Makefale.am which use the lapack++=20 library. Thank you again and again... Christian Stimming a =E9crit : > mohamad chaitou schrieb: > >> The compile command i have used is very simple (maybe stupid) because=20 >> i don't know how to deal with dependencies between these files! >> here its: > > > C++ doesn't work this way, or in other words not that simple. You need=20 > to get a textbook about how to use a C++ compiler, especially how to > 1. specify the directories to find the header files, > 2. specify the libraries to link against, and > 3. specify the directories where to find the libraries to link against. > > This is not a lapack++ problem but a general problem of how to write a=20 > C++ program that uses other libraries. > >> g++ -Wall -c tEigSolve.cc > > > In this case you are missing the specification of where to find=20 > lapackpp's header files, which would usually look like this > > g++ -I/usr/include/lapackpp -c tEigSolve.cc > > Apart from this problem, this step obviously worked. This step is=20 > called "compiling" and if you report a bug, it is important to note=20 > the the "compiling" went ok. > >> g++ tEigSolve.o > > > This other step obviously gave you errors. This step is called=20 > "linking", so you got "linker errors". The point is that your c++=20 > program uses extra libraries (lapack++'s libraries in this case), and=20 > you must tell the linker which libraries to use and where to find it.=20 > For example > > g++ -L/usr/lib -llamatrix++ -llapack++ -lblas++ -llapack -lblas=20 > tEigSolve.o > > However, usually you don't call the compiler by hand. Instead, you use=20 > some Makefile which contains the compiler commands (see "info make" on=20 > your system). And even further, you don't even write the Makefile by=20 > hand, but you have them generated by automake and autoconf (see "info=20 > automake" and "info autoconf"). In that case, autoconf is configured=20 > by a top-level file called "configure.in" or "configure.ac", and=20 > configuration for Lapack++ use can be done through the macro=20 > ACX_LAPACKPP which is included in the filename acx_lapackpp.m4. That's=20 > how we are using this in our package simthetic-mimolib=20 > http://cvs.sourceforge.net/viewcvs.py/simthetic/mimolib/ > > Christian > > > |
From: Christian S. <sti...@tu...> - 2004-12-15 18:02:40
|
Dear Mohamad, I am confident that you fill find plenty of documentation for these c++=20 tools. As for an example, I would mostly direct you to our package=20 package simthetic-mimolib, where you can download the configure.in and=20 Makefile.am files directly from CVS=20 http://cvs.sourceforge.net/viewcvs.py/simthetic/mimolib/ or rather=20 download a full package on=20 http://sourceforge.net/project/showfiles.php?group_id=3D89810&package_id=3D= 109380 Christian mohamad chaitou schrieb: > Thank you Christian, > I follow your advices and i began reading some tutorials about "automak= e=20 > and autoconf". It will be very helpful for me if you can send me an=20 > example of a configure.ac file and a Makefale.am which use the lapack++= =20 > library. > Thank you again and again... >=20 > Christian Stimming a =E9crit : >=20 >> mohamad chaitou schrieb: >> >>> The compile command i have used is very simple (maybe stupid) because= =20 >>> i don't know how to deal with dependencies between these files! >>> here its: >> >> >> >> C++ doesn't work this way, or in other words not that simple. You need= =20 >> to get a textbook about how to use a C++ compiler, especially how to >> 1. specify the directories to find the header files, >> 2. specify the libraries to link against, and >> 3. specify the directories where to find the libraries to link against. >> >> This is not a lapack++ problem but a general problem of how to write a= =20 >> C++ program that uses other libraries. >> >>> g++ -Wall -c tEigSolve.cc >> >> >> >> In this case you are missing the specification of where to find=20 >> lapackpp's header files, which would usually look like this >> >> g++ -I/usr/include/lapackpp -c tEigSolve.cc >> >> Apart from this problem, this step obviously worked. This step is=20 >> called "compiling" and if you report a bug, it is important to note=20 >> the the "compiling" went ok. >> >>> g++ tEigSolve.o >> >> >> >> This other step obviously gave you errors. This step is called=20 >> "linking", so you got "linker errors". The point is that your c++=20 >> program uses extra libraries (lapack++'s libraries in this case), and=20 >> you must tell the linker which libraries to use and where to find it.=20 >> For example >> >> g++ -L/usr/lib -llamatrix++ -llapack++ -lblas++ -llapack -lblas=20 >> tEigSolve.o >> >> However, usually you don't call the compiler by hand. Instead, you use= =20 >> some Makefile which contains the compiler commands (see "info make" on= =20 >> your system). And even further, you don't even write the Makefile by=20 >> hand, but you have them generated by automake and autoconf (see "info=20 >> automake" and "info autoconf"). In that case, autoconf is configured=20 >> by a top-level file called "configure.in" or "configure.ac", and=20 >> configuration for Lapack++ use can be done through the macro=20 >> ACX_LAPACKPP which is included in the filename acx_lapackpp.m4. That's= =20 >> how we are using this in our package simthetic-mimolib=20 >> http://cvs.sourceforge.net/viewcvs.py/simthetic/mimolib/ >> >> Christian >> >> >> >=20 >=20 >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now.=20 > http://productguide.itmanagersjournal.com/ > _______________________________________________ > lapackpp-devel mailing list > lap...@li... > https://lists.sourceforge.net/lists/listinfo/lapackpp-devel >=20 |