Enable CERES_HAS_POSIX_BESSEL_FUNCTIONS on Apple platforms

Commit 8b88a9ab49 guarded CERES_HAS_POSIX_BESSEL_FUNCTIONS in port.h with the glibc feature-test macros _SVID_SOURCE, _BSD_SOURCE, and _XOPEN_SOURCE. Because Apple libc++ does not implement C++17 special math functions and Darwin's <math.h> exposes j0, j1, and jn under __DARWIN_C_LEVEL >= 199506L rather than glibc feature-test macros, BesselJ0, BesselJ1, BesselJn, and TEST(Jet, Bessel) were silently disabled on macOS and iOS.

Add __DARWIN_C_LEVEL >= 199506L and _DEFAULT_SOURCE (which replaced _BSD_SOURCE and _SVID_SOURCE in glibc 2.19) to the preprocessor check for CERES_HAS_POSIX_BESSEL_FUNCTIONS.

Change-Id: I17a56983ae0b549346eaf3b5b3a993a6fcc4a3c3
1 file changed
tree: b03062070c60f44ad74882c210f0f22581d239e4
  1. .github/
  2. bazel/
  3. cmake/
  4. config/
  5. data/
  6. docs/
  7. examples/
  8. include/
  9. internal/
  10. LICENSES/
  11. scripts/
  12. third_party/
  13. .bazelignore
  14. .clang-format
  15. .gitignore
  16. .gitmodules
  17. .readthedocs.yaml
  18. BUILD
  19. CITATION.cff
  20. CMakeLists.txt
  21. CONTRIBUTING.md
  22. LICENSE
  23. MODULE.bazel
  24. package.xml
  25. README.md
  26. REUSE.toml
  27. WORKSPACE
README.md

Android Linux macOS Windows

Ceres Solver

Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.

  1. Non-linear Least Squares problems with bounds constraints.
  2. General unconstrained optimization problems.

Please see ceres-solver.org for more information.