From 2be73a9e29d51170775de0b8fe6bae0135ce8e34 Mon Sep 17 00:00:00 2001 From: Benjamin James Date: Sat, 3 Feb 2024 19:25:26 -0500 Subject: [PATCH] Deleted unnecessary files, added auto-update RcppExports --- .github/workflows/autoreconf.yml | 7 +++- Makefile.am | 40 ------------------ VERSION | 1 - configure.ac | 4 +- setup.py | 72 -------------------------------- 5 files changed, 8 insertions(+), 116 deletions(-) delete mode 100644 Makefile.am delete mode 100644 VERSION delete mode 100644 setup.py diff --git a/.github/workflows/autoreconf.yml b/.github/workflows/autoreconf.yml index 21407a6..e287895 100644 --- a/.github/workflows/autoreconf.yml +++ b/.github/workflows/autoreconf.yml @@ -15,17 +15,22 @@ jobs: ref: 'dev' - name: Set up Autotools - run: sudo apt-get update && sudo apt-get install -y autoconf automake libtool sed r-base r-cran-rcppeigen g++ libeigen3-dev python3-pybind11 libgsl-dev + run: sudo apt-get update && sudo apt-get install -y autoconf r-base r-cran-rcppeigen r-cran-rcppprogress g++ libeigen3-dev python3-pybind11 libgsl-dev - name: Run autoreconf run: | autoreconf -fiv ./configure + - name: Rcpp compileAttributes + run: | + Rscript -e "Rcpp::compileAttributes()" - name: Push to Main Branch run: | git config --global user.name 'GitHub Action' git config --global user.email 'action@github.com' git add configure DESCRIPTION VERSION docs/sphinx/conf.py + git add src/RcppExports.cpp R/RcppExports.R + git rm -f DESCRIPTION.in git commit -m "Auto-update Autotools files" || echo "No changes to commit" git push origin HEAD:main -f \ No newline at end of file diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3569760..0000000 --- a/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -# Makefile.am - -src/RcppExports.cpp: - Rscript -e "Rcpp::compileAttributes()" -R/RcppExports.R: - Rscript -e "Rcpp::compileAttributes()" - -document: src/RcppExports.cpp R/RcppExports.R - Rscript -e "devtools::document(roclets = c('rd', 'collate', 'namespace'))" - -buildbin: src/RcppExports.cpp R/RcppExports.R - Rscript -e "devtools::build(binary = TRUE, args = c('--preclean'))" - -buildsrc: src/RcppExports.cpp R/RcppExports.R - Rscript -e "devtools::build(args=c('--no-build-vignettes'))" - -install: src/RcppExports.cpp R/RcppExports.R - Rscript -e "devtools::install_local(force=TRUE, upgrade=FALSE)" - -test: - Rscript -e "devtools::test()" - -site: - Rscript -e "pkgdown::build_site(preview=FALSE)" - -AM_CXXFLAGS = @EIGEN_CXXFLAGS@ @OPENMP_CXXFLAGS@ @HDF5_CXXFLAGS@ @GSL_CXXFLAGS@ - -bin_PROGRAMS = -if ENABLE_CXX_TEST - bin_PROGRAMS += bin/scdemon - bin_scdemon_SOURCES = bin/scdemon.cpp - bin_scdemon_LDADD = @EIGEN_LIBS@ @OPENMP_LIBS@ @HDF5_LIBS@ @GSL_LIBS@ -endif - -all-local: document buildsrc buildbin install test site - -clean-local: - rm -f src/*.o src/*.so - rm -f src/RcppExports.cpp R/RcppExports.R - rm -f bin/scdemon bin/scdemon.o diff --git a/VERSION b/VERSION deleted file mode 100644 index 8acdd82..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 diff --git a/configure.ac b/configure.ac index 35a00c0..af53042 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_INIT([scdemon], [0.0.3]) -AC_MSG_NOTICE([Creating VERSION file]) -echo m4_defn([AC_PACKAGE_VERSION]) > VERSION +dnl AC_MSG_NOTICE([Creating VERSION file]) +dnl echo m4_defn([AC_PACKAGE_VERSION]) > VERSION : ${R_HOME=$(R RHOME)} if test -z "${R_HOME}"; then diff --git a/setup.py b/setup.py deleted file mode 100644 index de7822d..0000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -from setuptools import setup, find_packages -from pybind11.setup_helpers import Pybind11Extension, build_ext -import glob -import os - -with open("VERSION", "r") as version_file: - __version__ = version_file.read().strip() - -build_flags = {"OPENMP_CXXFLAGS": "-fopenmp", - "OPENMP_LIBS": "-fopenmp", - "EIGEN_CXXFLAGS": "", - "EIGEN_LIBS": "", - "GSL_CXXFLAGS": "", - "GSL_LIBS": "-lgsl -lgslcblas -lcblas -lm".split()} -try: - with open("src/Makevars", "r") as makevars: - for line in makevars: - parts = line.strip().split("=") - if len(parts) == 2: - build_flags[parts[0]] = parts[1] -except: - pass - -if os.getenv("CONDA_PREFIX"): - ### conda - build_flags["EIGEN_CXXFLAGS"] = "-I%s" % os.path.join(os.getenv("CONDA_PREFIX"), "include", "eigen3") - -extra_compile_args = [] -extra_link_args = [] - -def flag_compile(name): - global extra_compile_args - x = build_flags.get(name, "") - if isinstance(x, list): - extra_compile_args += [y for y in x if y] - elif x: - extra_compile_args += [x] - -def flag_link(name): - global extra_link_args - x = build_flags.get(name, "") - if isinstance(x, list): - extra_link_args += [y for y in x if y] - elif x: - extra_link_args += [x] - -flag_compile("OPENMP_CXXFLAGS") -flag_link("OPENMP_LIBS") -flag_compile("EIGEN_CXXFLAGS") -flag_link("EIGEN_LIBS") -flag_compile("GSL_CXXFLAGS") -flag_link("GSL_LIBS") - -ext_modules = [ - Pybind11Extension( - "scdemon_ext", - sources=sorted(glob.glob("scdemon/py*.cpp")), - include_dirs=["src"], - cxx_std=17, - define_macros=[("VERSION_INFO", __version__)], - extra_compile_args=extra_compile_args, - extra_link_args=extra_link_args - ), -] - -setup( - name="scdemon", - version=__version__, - packages=find_packages(), - ext_modules=ext_modules, - cmdclass={"build_ext": build_ext} -)