Skip to content

Commit

Permalink
add ffi and install.libs.R (#290)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Hoffman <[email protected]>
  • Loading branch information
GabrielHoffman and GEHoffman authored Jan 21, 2025
1 parent 6c88788 commit 953408c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 2.0/pgenlibr/src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ LIBDEFLATE = $(LIBDEFLATE_SOURCES:.c=.o)
LIBPLINK2_SOURCES = $(INCL)/include/plink2_base.cc $(INCL)/include/plink2_bits.cc $(INCL)/include/pgenlib_ffi_support.cc $(INCL)/include/pgenlib_misc.cc $(INCL)/include/pgenlib_read.cc $(INCL)/include/plink2_bgzf.cc $(INCL)/include/plink2_htable.cc $(INCL)/include/plink2_memory.cc $(INCL)/include/plink2_string.cc $(INCL)/include/plink2_text.cc $(INCL)/include/plink2_thread.cc $(INCL)/include/plink2_zstfile.cc $(INCL)/include/pvar_ffi_support.cc
LIBPLINK2 = $(LIBPLINK2_SOURCES:.cc=.o)


LIBPFFI_SOURCES = $(INCL)/include/pvar_ffi_support.cpp $(INCL)/include/pgenlib_ffi_support.cpp
LIBFFI = $(LIBPFFI_SOURCES:.cpp=.o)

$(SHLIB): @ZSTD_SHLIB@ @LIBDEFLATE_SHLIB@ libPLINK2.a

libPGZSTD.a: $(LIBZSTD)
Expand All @@ -20,10 +24,10 @@ libPGZSTD.a: $(LIBZSTD)
libPGDEFLATE.a: $(LIBDEFLATE)
$(AR) rcs libPGDEFLATE.a $(LIBDEFLATE)

libPLINK2.a: $(LIBPLINK2)
libPLINK2.a: $(LIBPLINK2) $(LIBFFI)
$(AR) rcs libPLINK2.a $(LIBPLINK2)

clean:
rm -f $(SHLIB) $(OBJECTS) @ZSTD_CLEAN@ @LIBDEFLATE_CLEAN@ $(LIBPLINK2)
rm -f $(SHLIB) $(OBJECTS) @ZSTD_CLEAN@ @LIBDEFLATE_CLEAN@ $(LIBPLINK2) $(LIBFFI)

OBJECTS = pvar.o pgenlibr.o RcppExports.o
5 changes: 5 additions & 0 deletions 2.0/pgenlibr/src/install.libs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
files <- Sys.glob(paste0("*", SHLIB_EXT))
files <- c(files, dir(pattern="a$"))
dest <- file.path(R_PACKAGE_DIR, paste0('libs', R_ARCH))
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
file.copy(files, dest, overwrite = TRUE)

0 comments on commit 953408c

Please sign in to comment.