Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[r] Resolve interaction between ccache and package build #1807

Open
johnkerl opened this issue Oct 19, 2023 · 5 comments
Open

[r] Resolve interaction between ccache and package build #1807

johnkerl opened this issue Oct 19, 2023 · 5 comments
Labels
blocked bug Something isn't working r-api

Comments

@johnkerl
Copy link
Member

Follow-on from chanzuckerberg/cellxgene-census#809.

Repro:

docker run --rm -ti eddelbuettel/r2u:jammy
apt-get update
apt-get install -y cmake git ccache

Rscript -e 'install.packages("tiledbsoma", repos = c("https://tiledb-inc.r-universe.dev", "https://cloud.r-project.org"))'
Rscript -e 'update.packages(ask=FALSE)'
Rscript -e 'remotes::install_github(repo="TileDB-Inc/TileDB-R@0.20.3")'
Rscript -e 'tiledbsoma::show_package_versions()'

If ~/.R/Makevars does not exist, or lacks ccache lines, this works as intended. However, in the following scenario

$ cat ~/.R/Makevars
#VER=-13
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER) #-std=c++11
CXX14=$(CCACHE) g++$(VER) #-std=c++14
CXX17=$(CCACHE) g++$(VER) #-std=c++17

then

Rscript -e 'install.packages("tiledbsoma", repos = c("https://tiledb-inc.r-universe.dev", "https://cloud.r-project.org"))'

results in a compile error at the spdlog step which includes

  The C compiler

    "/usr/bin/ccache"

  is not able to compile a simple test program.
@johnkerl johnkerl added bug Something isn't working r-api labels Oct 19, 2023
@eddelbuettel
Copy link
Contributor

eddelbuettel commented Oct 19, 2023

Should we first demonstrate that the issue persists on current versions? I don't think it is under tiledb dev.

@johnkerl
Copy link
Member Author

@eddelbuettel I'll remind myself to test this out with 1.5.0 when we release it.

@eddelbuettel
Copy link
Contributor

As you know I live on dev and it completely changed how this is done (and I gave in being different, so even when I have Ubuntu builds this now takes over but caches) so I now build 'everything' too (under vcpkg cache) and I have had no issues.

So all hail TileDB 2.18 where this is sorted out. I'd close this one.

@johnkerl
Copy link
Member Author

@eddelbuettel I will test this out with 2.18 and then close. Thank you!

@eddelbuettel
Copy link
Contributor

In case it matters, my current ~/.R/Makevars minus its copious commented-out lines

edd@rob:~$ grep -v "^#" .R/Makevars

PEDANTIC=-pedantic

XTRAFLAGS=-fdiagnostics-color=always
DEBUG_OPTIM=-g -O3


CFLAGS=               $(DEBUG_OPTIM) -Wall -pipe            $(XTRAFLAGS)

CXXFLAGS=               $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX1XFLAGS=             $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX11FLAGS=             $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX14FLAGS=             $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX17FLAGS=             $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)
CXX20FLAGS=             $(DEBUG_OPTIM) -Wall -pipe $(PEDANTIC) $(XTRAFLAGS) $(LTO)

FLAGS=-Wall -O3 -g -pipe $(PEDANTIC) $(XTRAFLAGS)


FFLAGS=-O3 -g0 -Wall -pipe
FCFLAGS=-O3 -g0 -Wall -pipe

VER=-12
CCACHE=ccache
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER) #-std=c++11
CXX14=$(CCACHE) g++$(VER) #-std=c++14
CXX17=$(CCACHE) g++$(VER) #-std=c++17
CXX20=$(CCACHE) g++$(VER) #-std=c++20

SHLIB_CXXLD=$(CCACHE) g++$(VER)

STRIP=-Wl,-S
SHLIB_CXXLDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_CXX11LDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_CXX14LDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_CXX17LDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_CXX20LDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_FCLDFLAGS = $(STRIP) -shared $(LTO_LD)
SHLIB_LDFLAGS = $(STRIP) -shared $(LTO_LD)

FC=$(CCACHE) gfortran
F77=$(CCACHE) gfortran
F95=$(CCACHE) gfortran


edd@rob:~$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working r-api
Projects
None yet
Development

No branches or pull requests

2 participants