Skip to content

ensure CXX is used to link the final shared object - #104

Merged
wch merged 2 commits into
rstudio:mainfrom
paleolimbot:linking
Mar 31, 2022
Merged

wch merged 2 commits into
rstudio:mainfrom
paleolimbot:linking

Conversation

@paleolimbot

@paleolimbot paleolimbot commented Mar 30, 2022 •

Copy link
Copy Markdown
Contributor

This PR fixes #94, which is a similar problem to one we see in 'arrow' when compiling with slightly different C++ flags (in our case, -stdlib=libc++ to replicate the custom clang build that exists on fedora-clang-devel; see apache/arrow#12734). The final .so is getting linked with CC instead of CXX because there are no .cpp files (I think). This PR just renames init.c to init.cpp and includes the relevant changes to make sure that compile.c/compile.h work as they did before.

With reprex:

# docker pull rhub/fedora-clang-devel
/opt/R-devel/bin/R -e 'install.packages(c("withr", "remotes"), repos = "https://cloud.r-project.org/")'
/opt/R-devel/bin/R -e 'withr::with_makevars(list(CXX = "-stdlib=libc++"), remotes::install_github("rstudio/sass"), assignment = "+=")'
# ...
# ** testing if installed package can be loaded from temporary location
# Error: package or namespace load failed for ‘sass’ in dyn.load(file, DLLpath = DLLpath, ...):
#  unable to load shared object '/opt/R-devel/lib64/R/library/00LOCK-sass/00new/sass/libs/sass.so':
#   /opt/R-devel/lib64/R/library/00LOCK-sass/00new/sass/libs/sass.so: undefined symbol: _ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE
/opt/R-devel/bin/R -e 'withr::with_makevars(list(CXX = "-stdlib=libc++"), remotes::install_github("rstudio/sass#104"), assignment = "+=")'
# ...works!

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@paleolimbot

Copy link
Copy Markdown
Contributor Author

(I can't seem to sign the CLA, I just get a window with a select box that won't let me choose anything)

@wch

wch commented Mar 31, 2022

Copy link
Copy Markdown
Collaborator

Thanks!

paleolimbot added a commit to apache/arrow that referenced this pull request Aug 24, 2022
#12824)

In ARROW-15857 (#12734) we fixed the nightly failures on rhub/fedora-clang-devel by a kludge modifying the default makefile, but also upstreamed the fixes (rstudio/sass#104 and r-hub/rhub-linux-builders#60). These upstreams are now both released, so we can remove the kludge from modification of the docker image.

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Signed-off-by: Dewey Dunnington <[email protected]>
zagto pushed a commit to zagto/arrow that referenced this pull request Oct 7, 2022
apache#12824)

In ARROW-15857 (apache#12734) we fixed the nightly failures on rhub/fedora-clang-devel by a kludge modifying the default makefile, but also upstreamed the fixes (rstudio/sass#104 and r-hub/rhub-linux-builders#60). These upstreams are now both released, so we can remove the kludge from modification of the docker image.

Lead-authored-by: Dewey Dunnington <[email protected]>
Co-authored-by: Dewey Dunnington <[email protected]>
Signed-off-by: Dewey Dunnington <[email protected]>
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.

undefined symbol: _ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE

3 participants