LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-01-06 14:14:34


So yes, this looks like a problem with icpc. However, I'd be surprised
if it's actually something wrong in their std library -- double check
that you have the Intel compiler installed correctly and that it's
finding all the libraries that it expects to find (i.e., not libraries
that can satisfy linker requirements, but be either from a different
vendor or from a different version).

I'm pretty sure that other users have successfully built and used LAM
with the Intel v8.1 compilers.

On Jan 6, 2005, at 1:50 PM, Konstantin Skaburskas wrote:

> #include <iostream.h>
> #include <string.h>
> #include <vector.h>
>
> using namespace std;
>
> bool lam_wrap_split(const string&,char c, vector<string>&);
>
> int main() {
>
> string str = "string";
> vector<string> sv;
>
> cout<<str.c_str()<<endl;
> int i = str.size();
> cout<<"i="<<i<<endl;
> sv.push_back(str.substr(0, i-1));
> cout<<"i="<<i<<endl;
>
> lam_wrap_split(str,' ',sv);
>
> return 0;
> }
>
> bool
> lam_wrap_split(const string& str, char c, vector<string>& out)
> {
> int start, i(0), size(str.size());
> out.clear();
>
> // Strip off the first bunch of c's
>
> while (i < size && str[i] == c)
> ++i;
>
> if (i >= size)
> return false;
>
> // Now start making a vector of the strings
>
> while (i < size) {
> start = i;
> while (i < size && str[i] != c)
> ++i;
> cout <<"lam_wrap_split: i="<< i <<endl;
> cout.flush();
> out.push_back(str.substr(start, i - start));
> cout <<"lam_wrap_split: i="<< i <<endl;
> cout <<"str.size()="<<str.size()<<endl;
> cout <<"c="<<c<<endl;
> cout.flush();
>
> while (i < size && str[i] == c)
> ++i;
> }
>
> return true;
> }
>

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/