create new tag
view all tags

1. missing variables and functions declaration(Numbers of this type: 32)

  • Reasons: With the upgrade of GCC to 64bit and 4.3, stricter rules in declarations of variables and functions are required, which leads to many failure of "not declared" errors in compiling phases. such as:
    • 1. missing declaration of system include files such as "cmath"
    • 2. missing declaration of functions used
    • 3. missing name space declaration such as "CLHEP::"
    • 4. not regular writing such as extra ";", same name for function parameters
  • Numbers of this type: 32
  • Typical Examples:
    • Errors:
                  Subscribers/src/TirregBoxSubscriber.cpp:121: error: ?fabs? was not declared in this scope
      To Solve it:
      #include <cmath>
    • Errors:
       error: there are no arguments to #nspecific# that depend on a template parameter, so a declaration of #nspecific# must be available.
      To Solve it:
      The C++ standard prescribes that all names that are not dependent on template parameters are bound to their present definitions when parsing a template function or class. Only names that are dependent are looked up at the point of instantiation. Therefore, you need to state explicitly where are these parameters or functions from. eg. this->nspecific(), or format::Header<TPointer>::nspecific().
    • Errors:
       /afs/.ihep.ac.cn/bes3/offline/Boss/6.5.5-x86_64/InstallArea/include/CalibData/CalibData/Dedx/DedxSimData.h:41: error: expected ?.?.or ?...?.before ?.?.token
      To Solve it:
       using namespace std 
    • Errors:
              In file included from ../src/Pi0EtaToGGRecAlg.cxx:11:
              error: multiple parameters named ?.1_P4?
      To Solve it:
       change P1_p4 to P2_p4

2. wrong location of include files(Numbers of this type: 14)

* Reasons: With the upgrade of External libraries to higher versions, some include files slightly changed its location, which leads to many failure of "no such file or directory" errors in compiling phases.

  • Numbers of this type: 14
  • Typical Examples:
    • Errors:
       /In file included from ../src/DatabaseSvc.cxx:7:
                                error: mysql/mysql.h: No such file or directory
      To Solve it:
      use # include <mysql.h>

3. fortran compiling problems(Numbers of this type: 10)

  • Reasons: With the upgrade of the fortran compiler from g77 to gfortran, some changes are needed in original fotran code. include:
    • 1. gfortran libraries have to be added
    • 2. change the way of declaration of function type
    • 3. some functions are changed, such as "Open"
    • 4. more stricter rules in compiling, which also caused much warning
  • Numbers of this type: 10
  • Typical Examples:
    • Errors:
             execute.F:(.text+0x5d): undefined reference to `_gfortran_*'
      To Solve it:
       in BesFortranPolicy, you need to add:
              macro_append BesFortranPolicy_linkopts " -lgfortran "
    • Errors:
                 Error: Expected formal argument list in function definition at (1)
      To Solve it:
                 REAL*4 FUNCTION GENRX(STATUS)          
    • Errors:
                 Error: Non-numeric character in statement label at (1)
      To Solve it:
                  C AI=INT {FUNCT(X)*^MDFUN(X)Y}
                 just simply remove this line of statement temporarily          
    • Errors:
        ffftemp_shlib/filcom.o:(.bss+0x0): multiple definition of `cmodel_'
        ffftemp_shlib/fff.o:(.data+0x20): first defined here         
      To Solve it:
         comment out "equivalence (kkmode, mparam(8))" in fff.F  or better solution?         
    • Errors:
            Error: Syntax error in OPEN statement at (1)
      To Solve it:
       type -> status  
    • Errors:
              IF (LUNOUT .NE. 0)
            Error: The STATUS specified in OPEN statement at (1) is 'NEW' and no FILE specifier is present
      To Solve it:
         stil don't know why the specified files are not stated  

4. fPIC errors(Numbers of this type: 5)

  • Reasons: Shared libraries need to be compiled as PIC (Position Independent Code) code using the –fPIC flag when compiling in x86-64, which is not required in x86.
  • Numbers of this type: 5
  • Examples:
    • Errors:
       usr/bin/ld: ROOTGeoLibtemp_shlib/EmcROOTGeo.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      ROOTGeoLibtemp_shlib/EmcROOTGeo.o: could not read symbols: Bad value
      To Solve it:
              macro_remove cppflags '-fPIC'        

5. Data type conversion errors(Numbers of this type: 5)

  • Reasons: part of these errors are caused by the change from LP32 to LP64. In LP64, long and pointer are 64 bit. another part of these errors are caused by stricter rules of 64bit and 43 versions and some not good conversion are not allowed in compiling
  • Numbers of this type: 5
  • Examples:
    • Errors:
       ../src/KalFitSuper_Mdc.cxx: In member function ?void
      ../src/KalFitSuper_Mdc.cxx:44: error: cast from ?KalFitWire**? to ?int?
      loses precision
      ../src/KalFitSuper_Mdc.cxx:44: error: cast from ?KalFitWire**? to ?int?
      loses precision
      To Solve it:
              Pointer type is not 32 bit as int type now, so convert "KalFitWire**" to long type.     

6. CMT policy warning and errors(Numbers of this type: 4)

  • Reasons:some patterns can't use as before, which causes errors. Fortunately they are useless now. these patterns are: "relative_fincludes" "package_Cshlibflags" "package_use_linkopts"
  • cmt/project.cmt are needed to add here to avoid warning, and also make projects more complete.

  • Numbers of this type: 4

7. mixing in 32-bit libraries errors(Numbers of this type: 3)

  • Reasons: some libraries accidentaly used "m32" flage to compile to be 32 libraries, which of course cause "incompatible libraries" errors
  • Numbers of this type: 3

8. functions change in new versions(Numbers of this type: 24)

  • Reasons: with the upgrade of some system and external libraries to new versions, some functions are slightly changed.
  • Numbers of this type: 4
  • Examples:
    • Errors:
      ../src/CalibMySQLCnvSvc.cxx:541: error: ?.ID_IDataProviderSvc?.was not declared in this scope
      To Solve it:
            StatusCode sc = serviceLocator()->getService("CalibDataSvc",  IID_IDataProviderSvc, (IInterface*&)pCDS);
                                     StatusCode sc = serviceLocator()->getService("CalibDataSvc",  IDataProviderSvc::interfaceID(), (IInterface*&)pCDS); 
      * Errors:
      ../src/DedxCurSvc.cxx:145: error: cannot allocate an object of abstract type #TBuffer#
      note: because the following virtual functions are pure within #TBuffer#:
      To Solve it:
         use concrete class of TBuffer: TBufferFile   
         #include "TBufferFile.h"
        TBuffer *buf1 = new TBuffer(TBuffer::kRead); -> TBuffer *buf1 = new TBufferFile(TBuffer::kRead);

9. GCC options need to be changed with new machine type(Numbers of this type: 3)

  • Reasons: since machine type changed from x86 to x86_64, so mtune, march and mcpu, etc need to be changed to x86_64 . Also some options are not supported in 64-bit, such as fno-emulate-complex, etc
  • Numbers of this type: 3

10. incomplete links in ROOT libraries(Numbers of this type: 1)

  • Reasons: ROOT libraries
  • Numbers of this type: 1 * Errors:
    BeamParamsAlgtemp_shlib/BeamParams.o: In function
    BeamParams.cxx:(.text+0x9184): undefined reference to `TMath::Prob(double, int)'
    BeamParams.cxx:(.text+0x9b20): undefined reference to `TMath::Prob(double, int)'
    BeamParams.cxx:(.text+0x9b76): undefined reference to `TMath::Prob(double, int)'
    BeamParams.cxx:(.text+0x9f29): undefined reference to `TMath::Prob(double, int)'
    ldd /afs/.ihep.ac.cn/bes3/offline/ExternalLib/lcg/app/releases/ROOT/5.24.00b/x86_64-slc5-gcc43-opt/root/lib/libRooFit.so
            libRooFitCore.so => not found
            libTree.so => not found
            libRIO.so => not found
            libMatrix.so => not found
            libMathCore.so => not found
            libCore.so => not found
            libCint.so => not found
            libstdc++.so.6 =>
            libm.so.6 => /lib64/libm.so.6 (0x00002b52788ef000)
            libgcc_s.so.1 =>
            libc.so.6 => /lib64/libc.so.6 (0x00002b5278d88000)
            /lib64/ld-linux-x86-64.so.2 (0x00000037c3e00000)
    To Solve it:
       explicitly tell compilers all the necessary libraries to link:
    macro_append BeamParamsAlg_linkopts "
    -lRooFit -lRooFitCore -lTree -lRIO -lMatrix -lMathCore -lCore -lCint"
-- ZhangXiaomei - 2010-12-13
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2011-02-22 - ZhangXiaomei
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback