Skip to content

Configure libatomic when needed#4

Open
jefferis wants to merge 1 commit into
masterfrom
fix/libatomic
Open

Configure libatomic when needed#4
jefferis wants to merge 1 commit into
masterfrom
fix/libatomic

Conversation

@jefferis

Copy link
Copy Markdown
Collaborator

Summary

  • add a Unix configure probe for C++ atomic compare/exchange link support
  • generate src/Makevars from src/Makevars.in
  • append -latomic to PKG_LIBS only when the probe needs it

Motivation

CRAN's r-devel-linux-x86_64-debian-clang check currently fails while loading natcpp.so:

undefined symbol: __atomic_compare_exchange

The package compiles and links, but Debian clang 22 leaves this atomic runtime helper unresolved unless libatomic is explicitly linked. RcppThread's thread pool uses atomic compare/exchange internally, so this can surface at dyn.load() time on that platform.

Verification

  • R CMD build --no-build-vignettes /Users/jefferis/dev/R/natcpp
  • R CMD check --no-manual --no-build-vignettes /private/tmp/natcpp_0.3.0.tar.gz

The local check still exits later because this R session has locale/metadata startup warnings, but checking whether package 'natcpp' can be installed ... OK and 00install.out shows the package installs and loads successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant