[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SGI C++ compilers and netcdf
- Subject: Re: SGI C++ compilers and netcdf
- Date: Wed, 23 Feb 2000 11:14:38 -0700
Greg,
We have a slightly newer compiler than you:
$ CC -version
MIPSpro Compilers: Version 7.3.1.1m
We're sorry we can't duplicate the problem, but the netCDF C++
interface works on every other platform we've tried. Maybe when we
announce 3.5 for beta testing, someone else will send in a workaround
for this problem.
It might be useful to know "uname -a" and "uname -R" info from your system.
--
Stuart Wier UCAR Unidata Program Center
address@hidden P.O. Box 3000
(303) 497-8659 Boulder, CO 80307
Unidata Home Page http://www.unidata.ucar.edu/
Gregory Roland Ruetsch wrote:
>
> Stuart,
>
> Thanks for your help in looking into this. It seems that we must be
> running on different version of the SGI compiler. I can also get the
> following to run:
>
> > // really_simple_nstd.cpp succeeds on SGI with command
> > // CC -o test -I/upc/netcdf/include really_simple_nstd.cpp
> > #include <iostream.h>
> > #include <string.h>
> > #include "netcdfcpp.h"
> >
> > int main() {
> > cerr << "This has gotta work; 3, simple cerr." << endl;
> > return 0;
> > }
>
> but ...
>
> > // various forms make compiler errors or warnings: really_simple.cpp
> > // command CC -LANG:std -o test really_simple.cpp
> > #include <string>
> > #include <iostream>
> > using namespace std;
> >
> > int main() {
> > cerr << "This has gotta work, simple cerr." << endl;
> > // string str(" string output: This has gotta work, too.");
> > // cerr << str << endl;
> > return 0;
> > }
> >
> >
> > As shown it compiles, with ("fatal"?) warnings, and runs.
> > With the one line "string str..." uncommented it fails to compile.
>
> ... this isn't what happens to me:
>
> thayer 95% CC -version
> MIPSpro Compilers: Version 7.30
> thayer 96% more rs.cc
> // various forms make compiler errors or warnings: really_simple.cpp
> // command CC -LANG:std -o test really_simple.cpp
> #include <string>
> #include <iostream>
> using namespace std;
>
> int main() {
> cerr << "This has gotta work, simple cerr." << endl;
> string str(" string output: This has gotta work, too.");
> cerr << str << endl;
> return 0;
> }
>
> thayer 97% CC -LANG:std rs.cc
>
> --- C++ prelinker: rs.o ---
> CC -c -DEFAULT:abi=n32:isa=mips4:proc=r10k -LANG:std -n32 rs.cc
>
> --- C++ prelinker: rs.o ---
> CC -DEFAULT:abi=n32:isa=mips4:proc=r10k -c
> -DEFAULT:abi=n32:isa=mips4:proc=r10k -LANG:std -n32 rs.cc
> thayer 98% a.out
> This has gotta work, simple cerr.
> string output: This has gotta work, too.
>
> Now, adding the "netcdfcpp.h" file:
>
> thayer 99% xemacs rs.cc
> thayer 100% more rs.cc
> // various forms make compiler errors or warnings: really_simple.cpp
> // command CC -LANG:std -o test really_simple.cpp
> #include <string>
> #include <iostream>
> using namespace std;
>
> #include "netcdfcpp.h"
>
> int main() {
> cerr << "This has gotta work, simple cerr." << endl;
> string str(" string output: This has gotta work, too.");
> cerr << str << endl;
> return 0;
> }
>
> ...
>
> thayer 103% CC -LANG:std -I/usr/people/ruetsch/include rs.cc |& more
> cc-1239 CC: ERROR File = /usr/include/CC/iostream.h, Line = 91
> "streambuf" is ambiguous.
>
> ios(streambuf*) ;
> ^
>
> cc-1239 CC: ERROR File = /usr/include/CC/iostream.h, Line = 107
> "ostream" is ambiguous.
>
> ostream* tie(ostream* s);
> ^
>
> cc-1239 CC: ERROR File = /usr/include/CC/iostream.h, Line = 107
> "ostream" is ambiguous.
>
> ostream* tie(ostream* s);
> ^
>
> cc-1239 CC: ERROR File = /usr/include/CC/iostream.h, Line = 108
> "ostream" is ambiguous.
>
> ostream* tie() { return x_tie ; }
> ^
>
> cc-1239 CC: ERROR File = /usr/include/CC/iostream.h, Line = 138
>
> ... you get the picture. But you are right, g++ is probably the way
> to go ...
>
> thayer 104% g++ -LANG:std -I/usr/people/ruetsch/include rs.cc
> ld32: WARNING 84 : /usr/lib32/libm.so is not used for resolving any symbol.
> thayer 105% a.out
> This has gotta work, simple cerr.
> string output: This has gotta work, too.
>
> The only difficulty I have is with linking to -lncdf and -lncdf_c++ which
> were compiled using CC. I can recompile netcdf/_c++ using gcc/g++, but sooner
> or later I'm going to have to face the music with -lmpi and the likes.
> Do you have any experience or advice on combining GNU and SGI objects?
>
> Thanks again,
>
> Greg
>
> --
> Greg Ruetsch || address@hidden
> Center for Turbulence Research || http://thayer.stanford.edu/ruetsch
> Stanford University || Voice: (650) 725-1821
> Stanford, CA 94305-3030 || Fax: (650) 723-9617