-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamped build system to minimal autoconf + scikit-build
- Loading branch information
1 parent
1485f04
commit ac57bcb
Showing
12 changed files
with
101 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,17 +21,11 @@ jobs: | |
run: | | ||
autoreconf -fiv | ||
./configure | ||
make dist | ||
- name: Extract dist files | ||
run: | | ||
tar -zxvf scdemon-*.tar.gz | ||
cp -r scdemon-*/* . | ||
- name: Push to Main Branch | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git add config.guess config.sub configure configure.ac Makefile.in Makefile.am install-sh aclocal.m4 missing DESCRIPTION VERSION | ||
git add configure DESCRIPTION VERSION docs/sphinx/conf.py | ||
git commit -m "Auto-update Autotools files" || echo "No changes to commit" | ||
git push origin HEAD:main -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
## makevars | ||
src/Makevars | ||
|
||
## autoconf | ||
autom4te.cache/ | ||
config.status | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.15...3.27) | ||
project( | ||
${SKBUILD_PROJECT_NAME} | ||
VERSION ${SKBUILD_PROJECT_VERSION} | ||
LANGUAGES CXX) | ||
|
||
# Set C++ standard | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) | ||
find_package(pybind11 CONFIG REQUIRED) | ||
|
||
# Find OpenMP | ||
find_package(OpenMP REQUIRED) | ||
if(OpenMP_CXX_FOUND) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
endif() | ||
|
||
# Include Eigen | ||
find_package(Eigen3 3.3 REQUIRED NO_MODULE) | ||
|
||
python_add_library(_core MODULE scdemon/py_se.cpp WITH_SOABI) | ||
target_link_libraries(_core PRIVATE pybind11::headers) | ||
target_link_libraries(_core PRIVATE Eigen3::Eigen) | ||
|
||
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION}) | ||
|
||
# Include the C++ headers | ||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env sh | ||
rm -f src/Makevars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,25 @@ | ||
AC_INIT([scdemon], [0.0.2]) | ||
AC_INIT([scdemon], [0.0.3]) | ||
|
||
AC_MSG_NOTICE([Creating VERSION file]) | ||
echo m4_defn([AC_PACKAGE_VERSION]) > VERSION | ||
|
||
AC_CANONICAL_BUILD | ||
AC_CANONICAL_HOST | ||
AC_CANONICAL_TARGET | ||
: ${R_HOME=$(R RHOME)} | ||
if test -z "${R_HOME}"; then | ||
AC_MSG_ERROR([Could not determine R_HOME.]) | ||
fi | ||
|
||
CXX=`"${R_HOME}/bin/R" CMD config CXX` | ||
if test -z "${CXX}"; then | ||
AC_MSG_ERROR([No C++ compiler available]) | ||
fi | ||
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS` | ||
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS` | ||
AC_LANG([C++]) | ||
AC_REQUIRE_CPP | ||
AC_PROG_CXX | ||
|
||
PKG_PROG_PKG_CONFIG | ||
PKG_CHECK_MODULES([EIGEN], [eigen3 >= 3.3.9], [], [AC_MSG_WARN([Eigen flags may not be set for python])]) | ||
PKG_CHECK_MODULES([HDF5], [hdf5], [], [AC_MSG_WARN([HDF5 may not be set for testing])]) | ||
PKG_CHECK_MODULES([GSL], [gsl], [], [AC_MSG_ERROR([GSL is required, please install])]) | ||
AC_OPENMP | ||
|
||
AC_CHECK_PROG([R_FOUND], [R], [yes], [no]) | ||
if test "x$R_FOUND" = xno; then | ||
AC_MSG_WARN([R is not installed.]) | ||
fi | ||
AC_PROG_MAKE_SET | ||
|
||
AM_INIT_AUTOMAKE([foreign subdir-objects]) | ||
AM_MAINTAINER_MODE | ||
|
||
|
||
AC_ARG_ENABLE([cxxtest], | ||
[AS_HELP_STRING([--enable-cxxtest], [Enable the compilation of c++ binary])], | ||
[cxxtest=$enableval], | ||
[cxxtest=no]) | ||
|
||
AM_CONDITIONAL([ENABLE_CXX_TEST], [test "x$cxxtest" = "xyes"]) | ||
|
||
AC_SUBST([PKG_CXXFLAGS], ["$CXXFLAGS $OPENMP_CXXFLAGS $GSL_CFLAGS"]) | ||
AC_SUBST([PKG_LIBS], ["$LDFLAGS $OPENMP_CXXFLAGS $GSL_LIBS"]) | ||
AC_SUBST([EIGEN_CXXFLAGS], ["$EIGEN_CFLAGS"]) | ||
AC_SUBST([EIGEN_LIBS], ["$EIGEN_LIBS"]) | ||
AC_SUBST([OPENMP_CXXFLAGS], ["$OPENMP_CXXFLAGS"]) | ||
AC_SUBST([OPENMP_LIBS], ["$OPENMP_CXXFLAGS"]) | ||
AC_SUBST([HDF5_CXXFLAGS], ["$HDF5_CXXFLAGS"]) | ||
AC_SUBST([HDF5_LIBS], ["$HDF5_LIBS"]) | ||
AC_SUBST([GSL_CXXFLAGS], ["$GSL_CFLAGS"]) | ||
AC_SUBST([GSL_LIBS], ["$GSL_LIBS"]) | ||
AC_CONFIG_FILES([src/Makevars Makefile DESCRIPTION docs/sphinx/conf.py]) | ||
AC_SUBST([PKG_CXXFLAGS], ["$CXXFLAGS $OPENMP_CXXFLAGS"]) | ||
AC_SUBST([PKG_LIBS], ["$LDFLAGS $OPENMP_CXXFLAGS"]) | ||
AC_CONFIG_FILES([src/Makevars DESCRIPTION]) | ||
AC_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[build-system] | ||
requires = ["scikit-build-core>=0.3.3", "pybind11"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "scdemon" | ||
version = "0.0.3" | ||
description = "Single cell decomposition into networks" | ||
authors = [{name = "Benjamin James", email = "[email protected]"}, | ||
{name = "Carles Boix", email = "[email protected]"}] | ||
license = {file = "LICENSE"} | ||
requires-python = ">=3.7" | ||
dependencies = ["numpy", "pandas", "scipy", "tqdm"] | ||
|
||
[project.optional-dependencies] | ||
test = ["pytest"] | ||
|
||
[tool.scikit-build] | ||
wheel.expand-macos-universal-tags = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
PKG_CXXFLAGS = @PKG_CXXFLAGS@ | ||
PKG_LIBS = @PKG_LIBS@ | ||
OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ | ||
OPENMP_LIBS = @OPENMP_LIBS@ | ||
EIGEN_CXXFLAGS = @EIGEN_CXXFLAGS@ | ||
EIGEN_LIBS = @EIGEN_LIBS@ | ||
GSL_CXXFLAGS = @GSL_CXXFLAGS@ | ||
GSL_LIBS = @GSL_LIBS@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) | ||
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) |