Message: tpia_decayChannel.cc: error: 'M_PI' was not declared in this scope Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning tpia_decayChannel.cc: error: 'M_PI' was not declared in this scope 

Forum: Installation and Configuration
Date: 27 Jun, 2013
From: Mojca Miklavec <Mojca Miklavec>

Building Geant4.9.5.p02 on Windows with MinGW breaks (among others) with

  [ 63%] Building CXX object source/processes/CMakeFiles/_G4processes-archive.dir/hadronic/models/lend/src/tpia_decayChannel.cc.obj
  C:\Programs\geant4\geant4.9.5.p02-src\source\processes\hadronic\models\lend\src\tpia_decayChannel.cc: In function 'int GIDI::tpia_decayChannel_sampleProd
  uctsAtE(GIDI::statusMessageReporting*, GIDI::tpia_decayChannel*, GIDI::tpia_decaySamplingInfo*, int, GIDI::tpia_productOutgoingData*)':
  C:\Programs\geant4\geant4.9.5.p02-src\source\processes\hadronic\models\lend\src\tpia_decayChannel.cc:100:36: error: 'M_PI' was not declared in this scope

  C:\Programs\geant4\geant4.9.5.p02-src\source\processes\hadronic\models\lend\src\tpia_decayChannel.cc:128:32: error: 'M_PI' was not declared in this scope

  source\processes\CMakeFiles\_G4processes-archive.dir\build.make:24993: recipe for target 'source/processes/CMakeFiles/_G4processes-archive.dir/hadronic/models/lend/src/tpia_decayChannel.cc.obj' failed
  mingw32-make[2]: *** [source/processes/CMakeFiles/_G4processes-archive.dir/hadronic/models/lend/src/tpia_decayChannel.cc.obj] Error 1
  CMakeFiles\Makefile2:2612: recipe for target 'source/processes/CMakeFiles/_G4processes-archive.dir/all' failed
  mingw32-make[1]: *** [source/processes/CMakeFiles/_G4processes-archive.dir/all]
  Error 2
  Makefile:135: recipe for target 'all' failed
  mingw32-make: *** [all] Error 2

With a bit of searching I stumbled upon this: http://ubuntuforums.org/showthread.php?t=583094 where one of the users is suggesting defining M_PI as it has been taken out of the standard. I see that Geant4 does just that in many other files:

  hadronic/models/chiral_inv_phase_space/body/src/G4QBesIKJY.cc:  static const G4double PI  = 3.14159265358979324;
  hadronic/models/radioactive_decay/src/G4BetaFermiFunction.cc:const G4double G4BetaFermiFunction::PI=3.14159;
  visualization/OpenInventor/include/HEPVis/SbMath.h:#define M_PI       3.1415926535897931160E0

What about doing something similar in that particular file as well?

I just wanted to add: I see that the beginning of file starts with

  #ifdef WIN32
     #define _USE_MATH_DEFINES
  #endif
  #include <cmath>

which, according to many posts, should help, but apparently it does so only for MSVC. For MinGW it doesn't make any difference.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Warning: Re: tpia_decayChannel.cc: error: 'M_PI' was not declared in this scope   (Gabriele Cosmo - 28 Jun, 2013)
 Add Message Add Message
to: "tpia_decayChannel.cc: error: 'M_PI' was not declared in this scope"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]