IBM InfoSphere Streams primitive operator compilation errors on IBM Power Systems

Technote (troubleshooting)


Problem(Abstract)

After migration to InfoSphere Streams Version 3.0, or later on IBM Power Systems, primitive operators no longer successfully compile.

Symptom

On IBM Power Systems, primitive operators that successfully compiled on earlier versions of InfoSphere Streams, no longer compile after migration to InfoSphere Streams version 3.0, or later.

The new compilation errors fall into two categories:

1. Errors involving conversion between types __gnu_cxx::__versa_string and std::string

For this category, there is often error message text in either of the following formats:


    error: conversion from __gnu_cxx::__versa_string<char> to non-scalar type std::string {aka std::basic_string<char>} requested

    error: no matching function for call to functionxyz note: no known conversion for argument from 'SPL::rstring' to 'std::string'


2. Previously unreported C++ syntax errors that mention the "-fpermissive" option as a workaround.

For this category, there is often error message text in the following format:


    error: <syntax-error> [-fpermissive]

The message indicates that the "-fpermissive" option can be used to flag these problems as warnings instead of errors.

Cause

Two InfoSphere Streams changes might result in compilation errors on IBM Power Systems that do not occur on other InfoSphere Streams versions or platforms:


1. On IBM Power Systems, InfoSphere Streams Version 3.0, or later changes the C++ base class for the SPL::rstring type to __gnu_cxx::__versa_string from std::string. This change affects SPL Toolkit developers. Mixing std::string and SPL::rstring types are flagged as an error on IBM Power Systems. For example:

SPL::int16 get_bts(SPL::rstring bts_sector)
{
 int16_t rv = 0;
 int intlen = bts_sector.length();
 switch(intlen)
 {
   case 6: // 2-byte int
   {
   
// wrong - inconsistent types - assign SPL::rstring to std::string
   
std::string part = bts_sector.substr(2, 3); // wrong

    // correct - consistent types - assign SPL::rstring to SPL::rstring
   
SPL::rstring part = bts_sector.substr(2, 3); // correct

   rv = (int16_t)strtol(part.c_str(), NULL, 16);
   break;
   }
...

In the following example, a call is made to an external function that takes std::string as an argument. You need to explicitly cast between the SPL::rstring and std::string types:

{
SPL::rstring myString;
 externalFunction(
(const std::string &)myString); // now need the cast
... }

Consistent usage of the SPL::rstring type or doing explicit casting between the types will compile successfully on both IBM Power Systems and x86.

2. On IBM Power Systems, the gcc compiler version that is used with InfoSphere Streams Version 3.0, or later is newer than the gcc compiler version on x86.

The gcc compiler version that is used on IBM Power Systems is Version 4.6.4. On x86 systems, Version 4.4.5 is used. The newer compiler version on IBM Power Systems introduces more complete enforcement of the C++ architecture and therefore might detect additional syntax errors not reported by older gcc compiler versions. The compiler message indicates that the warning can be suppressed by using the -fpermissive option.


Environment

IBM InfoSphere Streams Version 3.0, or later on IBM Power Systems.

Resolving the problem

The errors about attempting to intermix SPL::rstring and std::string types are resolved by consistently using the SPL::rstring type declaration or explicitly casting between types.

The preferred method for resolving "fpermissive" errors is to correct the particular syntax issue described by the gcc compiler. A less optimal workaround is to specify the -fpermissive compiler option using the sc --cxx-flags option, for example: --cxx-flags="-fpermissive"

Rate this page:

(0 users)Average rating

Document information


More support for:

InfoSphere Streams
Programming Model and Language

Software version:

3.0, 3.1, 3.2, 3.2.1

Operating system(s):

Linux

Reference #:

1609684

Modified date:

2014-10-15

Translate my page

Machine Translation

Content navigation