CLN compile errors on GCC4.2
Hi, I've been using CLN 1.3.1 successfully with the GCC4.3 compiler. Now I am running my code using the GCC4.2 on another machine (in which I dont have the option of updating to the newer GCC): <SNIP> In file included from /users/varma/cln-1.3.1/include/cln/string.h:7, from /usr/include/c++/4.2/cstring:52, from /usr/include/c++/4.2/i486-linux-gnu/bits/c++locale.h:47, from /usr/include/c++/4.2/iosfwd:45, from /usr/include/c++/4.2/ios:43, from /usr/include/c++/4.2/ostream:45, from /usr/include/c++/4.2/iostream:45, from graph.cpp:12: /usr/include/cln/io.h:22: error: expected initializer before & token /usr/include/cln/io.h:23: error: expected initializer before & token /usr/include/cln/io.h:24: error: expected initializer before * token ........ ........ ........ //and many more errors// <SNIP> Lines 22-24 of cln/io.h contain the following: <SNIP> typedef std::istream& cl_istream; typedef std::ostream& cl_ostream; extern std::ostream* cl_debugout_stream; #define cl_debugout (*cl_debugout_stream) <SNIP> My guess is that the streams are not recognised due to circular referencing (but which are the two, or more, files that are responsibile for this, I am not sure), which is somehow taken care of in the newer GCC. Any advice on this will be appreciated. Vipin
Hello, On Fri, May 21, 2010 at 03:10:21PM +0200, Vipin Varma wrote:
I've been using CLN 1.3.1 successfully with the GCC4.3 compiler. Now I am running my code using the GCC4.2 on another machine (in which I dont have the option of updating to the newer GCC):
<SNIP> In file included from /users/varma/cln-1.3.1/include/cln/string.h:7, from /usr/include/c++/4.2/cstring:52,
Oops... For some reason GCC decided to include cln/string.h instead of /usr/include/string.h That's a bit strage (I've been using GCC 4.2.{1,2,4} to compile CLN and GiNaC, and didn't hit any similar errors). Could you please post a) the OS you use and its version b) the exact version of GCC you use (the output of gcc -v) c) the graph.cpp file (or at least #include part) Best regards, Alexei
Vipin, Alexei Sheplyakov wrote:
In file included from /users/varma/cln-1.3.1/include/cln/string.h:7, from /usr/include/c++/4.2/cstring:52,
Oops... For some reason GCC decided to include cln/string.h instead of /usr/include/string.h
Indeed. Your compiler options should include -I/users/varma/cln-1.3.1/include and should *not* include -I/users/varma/cln-1.3.1/include/cln Bruno
Hi Thanks for the replies. @Alexei: This is the OS and gcc that I use:
>>>>>>>>>>>>>>>>>>>
Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
>>>>>>>>>>>>>>>>>>>>
And the include portion of the graph.cpp: <SNIP> #include <cmath> #include <iostream> #include <iomanip> #include <sstream> #include <map> <SNIP> @Bruno: When I give the compiler-option of just -I/users/varma/cln-1.3.1/include and not -I/users/varma/cln-1.3.1/include/cln, the compiler is unable to find the header files which are in include/cln: rational.h: No such file or directory ES_lattice_temp.cpp:13:25: error: rational_io.h: No such file or directory ES_lattice_temp.cpp:156: error: integer constant is too large for âlongâ type ES_lattice_temp.cpp:156: error: integer constant is too large for âlongâ type ES_lattice_temp.cpp:28: error: cln is not a namespace-name ES_lattice_temp.cpp:28: error: expected namespace-name before ; token In file included from BHH_Nsite_final.cpp:12, from ES_lattice_temp.cpp:34: CoulombEnergy.cpp:1: error: cl_RA was not declared in this scope CoulombEnergy.cpp:1: error: template argument 1 is invalid CoulombEnergy.cpp:1: error: template argument 2 is invalid ......and more errors ...... I am wondering how to make the compiler just pick up the relevant header files from include/cln ... Regards, Vipin On Tue, 25 May 2010, Alexei Sheplyakov wrote:
Hello,
On Fri, May 21, 2010 at 03:10:21PM +0200, Vipin Varma wrote:
I've been using CLN 1.3.1 successfully with the GCC4.3 compiler. Now I am running my code using the GCC4.2 on another machine (in which I dont have the option of updating to the newer GCC):
<SNIP> In file included from /users/varma/cln-1.3.1/include/cln/string.h:7, from /usr/include/c++/4.2/cstring:52,
Oops... For some reason GCC decided to include cln/string.h instead of /usr/include/string.h
That's a bit strage (I've been using GCC 4.2.{1,2,4} to compile CLN and GiNaC, and didn't hit any similar errors). Could you please post a) the OS you use and its version b) the exact version of GCC you use (the output of gcc -v) c) the graph.cpp file (or at least #include part)
Best regards, Alexei
_______________________________________________ CLN-list mailing list CLN-list@ginac.de https://www.cebix.net/mailman/listinfo/cln-list
Hi Vipin,
When I give the compiler-option of just -I/users/varma/cln-1.3.1/include and not -I/users/varma/cln-1.3.1/include/cln, the compiler is unable to find the header files which are in include/cln:
rational.h: No such file or directory ES_lattice_temp.cpp:13:25: error: rational_io.h: No such file or directory
The answer is already contained in CLN's documentation, section "Using the library" <http://www.ginac.de/CLN/cln_11.html> Bruno
Bruno, Sorry, I should have been more explicit. These are my compile options now, following your initial suggestion: g++ -I/users/varma/Desktop/Applications_Libraries/cln-1.3.1/include -I/users/varma/include -L/users/varma/lib -L/users/varma/include -L/users/varma/Desktop/Applications_Libraries/cln-1.3.1/src/.libs/libcln.a -lcln file.cpp -o file.run I guess the problem is that the string.h from the cln directory is being picked up rather than the one in the system directory. I dont know why GCC4.3 does not show this problem. Vipin On Wed, 26 May 2010, Bruno Haible wrote:
Hi Vipin,
When I give the compiler-option of just -I/users/varma/cln-1.3.1/include and not -I/users/varma/cln-1.3.1/include/cln, the compiler is unable to find the header files which are in include/cln:
rational.h: No such file or directory ES_lattice_temp.cpp:13:25: error: rational_io.h: No such file or directory
The answer is already contained in CLN's documentation, section "Using the library" <http://www.ginac.de/CLN/cln_11.html>
Bruno
Hello, On Wed, May 26, 2010 at 12:21:39PM +0200, Vipin Varma wrote:
@Alexei: This is the OS and gcc that I use:
>>>>>>>>>>>>>>>>>>>>
Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release--build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
That's almost the same as I use (modulo 64bit vs 32bit and Debian vs Ubuntu).
>>>>>>>>>>>>>>>>>>>>>
And the include portion of the graph.cpp:
<SNIP> #include <cmath> #include <iostream> #include <iomanip> #include <sstream> #include <map> <SNIP>
What about CLN headers?
When I give the compiler-option of just -I/users/varma/cln-1.3.1/include and not -I/users/varma/cln-1.3.1/include/cln, the compiler is unable to find the header files which are in include/cln:
rational.h: No such file or directory ES_lattice_temp.cpp:13:25: error: rational_io.h: No such file or directory
I guess you #include "rational_io.h" // INCORRECT instead of #include "cln/rational_io.h" // CORRECT
I am wondering how to make the compiler just pick up the relevant header files from include/cln ...
#include "cln/integer.h" #include "cln/rational.h" Best regards, Alexei
participants (3)
-
Alexei Sheplyakov
-
Bruno Haible
-
Vipin Varma