Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
17060 Discussions

Compile Fails After Upgrading To Update 2 (It worked prior to the upgrade)

dchoi
Beginner
889 Views
Hi, I upgraded to Intel Parallel Studio Update 2. I have a project that fails to compile after the upgrade. It was building with the Intel C++ compiler successfully before the upgrade. It also builds successfully with the Visual C++ compiler. This class uses templates. Here is an example of the errors I see:


Error 4 error: declaration is incompatible with "void TimeSeries::SetDiscountRate(double, TimeSeries::DiscountMethod)" (declared at line 85) W:\cp107update2\ctc\CapitalPlanning\TimeSeries\TimeSeriesT.h 476


Here's lines 475-477:

template< class T >

void TimeSeries< T >::SetDiscountRate( double dRate, enum DiscountMethod eMethod )

{


Here's part of the class declaration:

template< class T >

class TimeSeries

{

public:



void SetDiscountRate( double dRate, DiscountMethod method );

};



The declaration of SetDiscountRate is line 85.


What has changed in Intel Composer between Parallel Studio update 1 and update 2 that could cause this? Is there a work-around?


Cheers,
Albert
0 Kudos
4 Replies
Om_S_Intel
Employee
889 Views
Hi, I upgraded to Intel Parallel Studio Update 2. I have a project that fails to compile after the upgrade. It was building with the Intel C++ compiler successfully before the upgrade. It also builds successfully with the Visual C++ compiler. This class uses templates. Here is an example of the errors I see:


Error 4 error: declaration is incompatible with "void TimeSeries::SetDiscountRate(double, TimeSeries::DiscountMethod)" (declared at line 85) W:cp107update2ctcCapitalPlanningTimeSeriesTimeSeriesT.h 476


Here's lines 475-477:

template< class T >

void TimeSeries< T >::SetDiscountRate( double dRate, enum DiscountMethod eMethod )

{


Here's part of the class declaration:

template< class T >

class TimeSeries

{

public:



void SetDiscountRate( double dRate, DiscountMethod method );

};



The declaration of SetDiscountRate is line 85.


What has changed in Intel Composer between Parallel Studio update 1 and update 2 that could cause this? Is there a work-around?


Cheers,
Albert

I created the following test case using your description:

//
// f64301.cpp
//
// http://software.intel.com/en-us/forums/showthread.php?t=64301

typedef int DiscountMethod ;

template< class T >

class TimeSeries

{

public:



void SetDiscountRate( double dRate, DiscountMethod method );

};

template< class T >

void TimeSeries< T >::SetDiscountRate( double dRate, DiscountMethod eMethod )

{
;
}

int main()
{
TimeSeries< double > ts;
ts.SetDiscountRate(5.0, 1);
return 0;
}



I have compiled the above code with Parallel composer Beta update3 without any issue.

C:>icl f64301.cpp
Intel C++ Compiler for applications running on IA-32, Version 11.1 Beta Bui
ld 20081208 Package ID: composer_beta_update3.040
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

icl: NOTE: The Beta evaluation period for this product ends on 30-jun-2009 UTC.
f64301.cpp
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:f64301.exe
f64301.obj

C:>icl -V
Intel C++ Compiler for applications running on IA-32, Version 11.1 Beta Bui
ld 20081208 Package ID: composer_beta_update3.040
Copyright (C) 1985-2008 Intel Corporation. All rights reserved.

0 Kudos
dchoi
Beginner
889 Views
Thanks for the reply, Om.

I noticed that you are using build 20081208 of Intel Composer. I am using build 20090227.

Could you try replacing

Typedef int DiscountMethod;

With

enum DiscountMethod { dmBeginningOfYear, dmMidYear, dmEndOfYear, dmMonthly, dmLumpSum, dmAtlantic };

And

void TimeSeries< T >::SetDiscountRate( double dRate, DiscountMethod eMethod )

With

void TimeSeries< T >::SetDiscountRate( double dRate, enum DiscountMethod eMethod )

And try building with build 20090227?

Kind Regards,
Albert
Quoting - dchoi
Hi, I upgraded to Intel Parallel Studio Update 2. I have a project that fails to compile after the upgrade. It was building with the Intel C++ compiler successfully before the upgrade. It also builds successfully with the Visual C++ compiler. This class uses templates. Here is an example of the errors I see:


Error 4 error: declaration is incompatible with "void TimeSeries::SetDiscountRate(double, TimeSeries::DiscountMethod)" (declared at line 85) W:cp107update2ctcCapitalPlanningTimeSeriesTimeSeriesT.h 476


Here's lines 475-477:

template< class T >

void TimeSeries< T >::SetDiscountRate( double dRate, enum DiscountMethod eMethod )

{


Here's part of the class declaration:

template< class T >

class TimeSeries

{

public:



void SetDiscountRate( double dRate, DiscountMethod method );

};



The declaration of SetDiscountRate is line 85.


What has changed in Intel Composer between Parallel Studio update 1 and update 2 that could cause this? Is there a work-around?


Cheers,
Albert

0 Kudos
Om_S_Intel
Employee
889 Views
Quoting - dchoi


I have modified the testcase as suggested by you. It is given below:

//
// f64301.cpp
//
// http://software.intel.com/en-us/forums/showthread.php?t=64301


enum DiscountMethod { dmBeginningOfYear, dmMidYear, dmEndOfYear, dmMonthly, dmLumpSum, dmAtlantic };

template< class T >

class TimeSeries

{

public:



void SetDiscountRate( double dRate, enum DiscountMethod method );

};

template< class T >
void TimeSeries< T >::SetDiscountRate( double dRate, enum DiscountMethod eMethod )

{
;
}

int main()
{
TimeSeries< double > ts;
ts.SetDiscountRate(5.0, dmMidYear);
return 0;
}


I have installed the same Intel Parallel Studio version as yours.

C: >icl -V

Intel C++ Compiler for applications running on IA-32, Version 11.1 Beta Build 20090227 Package ID: composer_beta_update4.049

Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

I could compile the above testcase without any issue:

C: >icl f64301_1.cpp
Intel C++ Compiler for applications running on IA-32, Version 11.1 Beta Build 20090227 Package ID: composer_beta_update4.049
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

f64301_1.cpp
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

-out:f64301_1.exe
f64301_1.obj


0 Kudos
dchoi
Beginner
889 Views
Thanks for running that test, Om.

I am still experiencing this problem. Attached are the build logs from compiling with Visual C++ and Intel Composer. I am building using the Rebuild option in the Visual Studio 2008 IDE.

Can you, please, take a look at the logs to look for clues as to why the compile fails with Intel Composer?

Looking at the build output I noticed that Intel Composer generates TimeSeries.pchi whereas Visual C++ generates TimeSeries.pch. I did not closely examine the build output from pre-Intel Parallel Studio Update 2 so I am not sure if a .pchi file was created then, as well.

If you have any ideas on further trouble shooting I can do on my end, please, let me know.

Kind Regards,
Albert
0 Kudos
Reply