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

Remove compiled files from version control and add to .gitignore #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BerriJ
Copy link

@BerriJ BerriJ commented Apr 9, 2024

This PR removes some .o, .so, and ,dll files from git version control and adds them to the .gitignore file.

Almost certainly, these need to be compiled locally during package install or other functions that start compilation of the respective C code.

At the moment:

  1. Cloning the repository
  2. Executing devtools::load_all()

Leads to an error message due to the presence of these files (devtools assumes that it does not need to compile again):

[R] devtools::load_all()
ℹ Loading gamlss
Loading required package: splines
Loading required package: gamlss.data

Attaching package:gamlss.dataThe following object is masked frompackage:datasets:

    sleep

Loading required package: gamlss.dist
Loading required package: nlme
Loading required package: parallel
Error in dyn.load(dll_copy_file) : 
  unable to load shared object '/tmp/RtmpyAVSHy/pkgloadef057eaaa2/gamlss.so':
  /tmp/RtmpyAVSHy/pkgloadef057eaaa2/gamlss.so: invalid ELF header

Merging this PR solves this. A call to devtools::load_all() will trigger compilation as it should:

[R] devtools::load_all()
ℹ Loading gamlssRe-compiling gamlss (debug build)
── R CMD INSTALL ──────────────────────────────────────────────────────────────────
─  installing *source* packagegamlss...
   ** using staged installation
   ** libs
   using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0ccache gcc -I"/usr/share/R/include" -DNDEBUG       -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H0vbME/r-base-4.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c gamlss_init.c -o gamlss_init.o
   ccache gcc -I"/usr/share/R/include" -DNDEBUG       -fpic  -g -O2 -ffile-prefix-map=/build/r-base-H0vbME/r-base-4.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c genD.c -o genD.o
   ccache gcc -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o gamlss.so gamlss_init.o genD.o -L/usr/lib/R/lib -lR
   installing to /tmp/RtmpyAVSHy/devtools_install_ef07715f8e/00LOCK-gamlss/00new/gamlss/libs
   ** checking absolute paths in shared objects and dynamic libraries
─  DONE (gamlss)
 **********   GAMLSS Version 5.4-22  ********** 
For more on GAMLSS look at https://www.gamlss.com/
Type gamlssNews() to see new features/changes/bug fixes

Best Regards,
BerriJ

@zeileis
Copy link
Member

zeileis commented Apr 9, 2024

Thanks for the PR. I agree that the targets should not be in the git repository and adding them to the .gitignore is a good idea. Mikis @mstasinopoulos, is there a particular reason for adding these files?

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.

2 participants