Skip to content

Build fails: a conflict with system headers due to math.h? #103

@barracuda156

Description

@barracuda156

Something does not work with cmath correctly:

--->  Extracting tsmp-0.4.15.tar.gz
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tsmp/R-tsmp/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/R-tsmp/tsmp-0.4.15.tar.gz' | /usr/bin/gnutar --no-same-owner -xf - 
--->  Configuring R-tsmp
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tsmp/R-tsmp/work/tsmp-0.4.15" && /opt/local/bin/R CMD build . --no-manual --no-build-vignettes --keep-empty-dirs 
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘tsmp’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘tsmp_0.4.15.tar.gz’

--->  Building R-tsmp
xinstall: mkdir /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tsmp/R-tsmp/work/build
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tsmp/R-tsmp/work/tsmp-0.4.15" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-tsmp/R-tsmp/work/build --install-tests 
* installing *source* package ‘tsmp’ ...
** using staged installation
** libs
using C++ compiler: ‘g++-mp-13 (MacPorts gcc13 13.2.0_4+stdlib_flag) 13.2.0’
using C++11
Warning in system2("xcrun", "--show-sdk-path", TRUE, TRUE) :
  running command ''xcrun' --show-sdk-path 2>&1' had status 64
using SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
/opt/local/bin/g++-mp-13 -std=gnu++11 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/RcppParallel/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc   -c RcppExports.cpp -o RcppExports.o
/opt/local/bin/g++-mp-13 -std=gnu++11 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include' -I'/opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/RcppParallel/include' -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc   -c math.cpp -o math.o
In file included from /opt/local/include/LegacySupport/cmath:54,
                 from /opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:100,
                 from /opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include/Rcpp/r/headers.h:62,
                 from /opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include/RcppCommon.h:30,
                 from /opt/local/Library/Frameworks/R.framework/Versions/4.4/Resources/library/Rcpp/include/Rcpp.h:27,
                 from math.h:4,
                 from math.cpp:1:
/opt/local/include/gcc13/c++/cmath:85:11: error: 'acos' has not been declared in '::'
   85 |   using ::acos;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:104:11: error: 'asin' has not been declared in '::'
  104 |   using ::asin;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:123:11: error: 'atan' has not been declared in '::'
  123 |   using ::atan;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:142:11: error: 'atan2' has not been declared in '::'
  142 |   using ::atan2;
      |           ^~~~~
/opt/local/include/gcc13/c++/cmath:154:11: error: 'ceil' has not been declared in '::'
  154 |   using ::ceil;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:173:11: error: 'cos' has not been declared in '::'
  173 |   using ::cos;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:192:11: error: 'cosh' has not been declared in '::'
  192 |   using ::cosh;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:211:11: error: 'exp' has not been declared in '::'
  211 |   using ::exp;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:230:11: error: 'fabs' has not been declared in '::'
  230 |   using ::fabs;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:249:11: error: 'floor' has not been declared in '::'
  249 |   using ::floor;
      |           ^~~~~
/opt/local/include/gcc13/c++/cmath:268:11: error: 'fmod' has not been declared in '::'
  268 |   using ::fmod;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:280:11: error: 'frexp' has not been declared in '::'
  280 |   using ::frexp;
      |           ^~~~~
/opt/local/include/gcc13/c++/cmath:299:11: error: 'ldexp' has not been declared in '::'
  299 |   using ::ldexp;
      |           ^~~~~
/opt/local/include/gcc13/c++/cmath:318:11: error: 'log' has not been declared in '::'
  318 |   using ::log;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:337:11: error: 'log10' has not been declared in '::'
  337 |   using ::log10;
      |           ^~~~~
/opt/local/include/gcc13/c++/cmath:356:11: error: 'modf' has not been declared in '::'
  356 |   using ::modf;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:368:11: error: 'pow' has not been declared in '::'
  368 |   using ::pow;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:396:11: error: 'sin' has not been declared in '::'
  396 |   using ::sin;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:415:11: error: 'sinh' has not been declared in '::'
  415 |   using ::sinh;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:434:11: error: 'sqrt' has not been declared in '::'
  434 |   using ::sqrt;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath:453:11: error: 'tan' has not been declared in '::'
  453 |   using ::tan;
      |           ^~~
/opt/local/include/gcc13/c++/cmath:472:11: error: 'tanh' has not been declared in '::'
  472 |   using ::tanh;
      |           ^~~~
/opt/local/include/gcc13/c++/cmath: In function 'constexpr int std::fpclassify(float)':
/opt/local/include/gcc13/c++/cmath:1098:33: error: 'FP_NAN' was not declared in this scope; did you mean 'ML_NAN'?
 1098 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                 ^~~~~~
      |                                 ML_NAN
/opt/local/include/gcc13/c++/cmath:1098:41: error: 'FP_INFINITE' was not declared in this scope; did you mean 'R_FINITE'?
 1098 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                         ^~~~~~~~~~~
      |                                         R_FINITE
/opt/local/include/gcc13/c++/cmath:1098:54: error: 'FP_NORMAL' was not declared in this scope; did you mean 'IOPOL_NORMAL'?
 1098 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                                      ^~~~~~~~~
      |                                                      IOPOL_NORMAL
/opt/local/include/gcc13/c++/cmath:1099:33: error: 'FP_SUBNORMAL' was not declared in this scope
 1099 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                 ^~~~~~~~~~~~
/opt/local/include/gcc13/c++/cmath:1099:47: error: 'FP_ZERO' was not declared in this scope; did you mean 'NZERO'?
 1099 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                               ^~~~~~~
      |                                               NZERO
/opt/local/include/gcc13/c++/cmath:1099:62: error: body of 'constexpr' function 'constexpr int std::fpclassify(float)' not a return-statement
 1099 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                                              ^
/opt/local/include/gcc13/c++/cmath: In function 'constexpr int std::fpclassify(double)':
/opt/local/include/gcc13/c++/cmath:1103:33: error: 'FP_NAN' was not declared in this scope; did you mean 'ML_NAN'?
 1103 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                 ^~~~~~
      |                                 ML_NAN
/opt/local/include/gcc13/c++/cmath:1103:41: error: 'FP_INFINITE' was not declared in this scope; did you mean 'R_FINITE'?
 1103 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                         ^~~~~~~~~~~
      |                                         R_FINITE
/opt/local/include/gcc13/c++/cmath:1103:54: error: 'FP_NORMAL' was not declared in this scope; did you mean 'IOPOL_NORMAL'?
 1103 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                                      ^~~~~~~~~
      |                                                      IOPOL_NORMAL
/opt/local/include/gcc13/c++/cmath:1104:33: error: 'FP_SUBNORMAL' was not declared in this scope
 1104 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                 ^~~~~~~~~~~~
/opt/local/include/gcc13/c++/cmath:1104:47: error: 'FP_ZERO' was not declared in this scope; did you mean 'NZERO'?
 1104 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                               ^~~~~~~
      |                                               NZERO
/opt/local/include/gcc13/c++/cmath:1104:62: error: body of 'constexpr' function 'constexpr int std::fpclassify(double)' not a return-statement
 1104 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                                              ^
/opt/local/include/gcc13/c++/cmath: In function 'constexpr int std::fpclassify(long double)':
/opt/local/include/gcc13/c++/cmath:1108:33: error: 'FP_NAN' was not declared in this scope; did you mean 'ML_NAN'?
 1108 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                 ^~~~~~
      |                                 ML_NAN
/opt/local/include/gcc13/c++/cmath:1108:41: error: 'FP_INFINITE' was not declared in this scope; did you mean 'R_FINITE'?
 1108 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                         ^~~~~~~~~~~
      |                                         R_FINITE
/opt/local/include/gcc13/c++/cmath:1108:54: error: 'FP_NORMAL' was not declared in this scope; did you mean 'IOPOL_NORMAL'?
 1108 |   { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
      |                                                      ^~~~~~~~~
      |                                                      IOPOL_NORMAL
/opt/local/include/gcc13/c++/cmath:1109:33: error: 'FP_SUBNORMAL' was not declared in this scope
 1109 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                 ^~~~~~~~~~~~
/opt/local/include/gcc13/c++/cmath:1109:47: error: 'FP_ZERO' was not declared in this scope; did you mean 'NZERO'?
 1109 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                               ^~~~~~~
      |                                               NZERO
/opt/local/include/gcc13/c++/cmath:1109:62: error: body of 'constexpr' function 'constexpr int std::fpclassify(long double)' not a return-statement
 1109 |                                 FP_SUBNORMAL, FP_ZERO, __x); }
      |                                                              ^
/opt/local/include/gcc13/c++/cmath: In function 'constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, int>::__type std::fpclassify(_Tp)':
/opt/local/include/gcc13/c++/cmath:1117:25: error: 'FP_NORMAL' was not declared in this scope; did you mean 'IOPOL_NORMAL'?
 1117 |     { return __x != 0 ? FP_NORMAL : FP_ZERO; }
      |                         ^~~~~~~~~
      |                         IOPOL_NORMAL
/opt/local/include/gcc13/c++/cmath:1117:37: error: 'FP_ZERO' was not declared in this scope; did you mean 'NZERO'?
 1117 |     { return __x != 0 ? FP_NORMAL : FP_ZERO; }
      |                                     ^~~~~~~
      |                                     NZERO
. . .

Perhaps a conflict in headers? The package has a header math.h, which is also a name for a standard system header.

Metadata

Metadata

Assignees

Labels

Technical WorkTask belonging to the "Technical Work" team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions