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

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

Portrait de 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:\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

5 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de om-sachan (Intel)
Quoting - dchoicalgary.oilfield.slb.com 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.

Portrait de dchoi
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

Portrait de om-sachan (Intel)
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

Portrait de dchoi

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

Fichiers joints: 

Connectez-vous pour laisser un commentaire.