Skip to content

Commit

Permalink
Merge eccf514 into 8f6fd4c
Browse files Browse the repository at this point in the history
  • Loading branch information
vitenti committed Mar 30, 2023
2 parents 8f6fd4c + eccf514 commit a059001
Show file tree
Hide file tree
Showing 43 changed files with 4,110 additions and 2,329 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install prereq
run: sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev gtk-doc-tools texlive texlive-bibtex-extra texlive-science texlive-publishers tex4ht perl libxml-libxml-perl
run: |
sudo apt-get update
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev gtk-doc-tools texlive texlive-bibtex-extra texlive-science texlive-publishers tex4ht perl libxml-libxml-perl
pip install pytest pytest-tap
- name: Ensure clear Jupyter Notebooks
uses: ResearchSoftwareActions/EnsureCleanNotebooksAction@1.1
- name: Autogen
Expand All @@ -26,7 +29,15 @@ jobs:
run: ./configure --enable-gtk-doc --enable-man --prefix=/usr --libdir=/usr/lib
- name: make
run: make -j8
- name: Test example compilation
- name: Test example compilation using non-installed library
run: |
source numcosmo_export.sh
cd examples
gcc -D_GNU_SOURCE -Wall example_simple.c -o example_simple -lnumcosmo -lgsl -lm $(pkg-config glib-2.0 gobject-2.0 --libs --cflags)
gcc -D_GNU_SOURCE -Wall example_ca.c -o example_ca -lnumcosmo -lgsl -lm $(pkg-config glib-2.0 gobject-2.0 --libs --cflags)
./example_simple
./example_ca
- name: Test example compilation using installed library
run: |
sudo make install
cd examples
Expand All @@ -51,7 +62,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install prereq
run: sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran lcov pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev python3-setuptools gtk-doc-tools
run: |
sudo apt-get update
sudo apt-get install gobject-introspection gir1.2-glib-2.0 libgirepository1.0-dev gcc gfortran lcov pkg-config libglib2.0-dev libgmp3-dev libmpfr-dev libgsl0-dev libfftw3-dev libopenblas-dev libflint-arb-dev libcfitsio-dev libnlopt-dev libhdf5-dev python3-setuptools gtk-doc-tools
pip install pytest pytest-tap
- name: Autogen
run: NOCONFIGURE=yes ./autogen.sh
- name: configure
Expand Down Expand Up @@ -85,7 +99,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install prereq
run: |
brew install autoconf automake libtool gobject-introspection gsl gmp mpfr fftw cfitsio nlopt gfortran gtk-doc glib-utils glib
brew install autoconf automake libtool gobject-introspection gsl gmp mpfr fftw cfitsio nlopt gfortran gtk-doc glib-utils glib pygobject3
brew ls glib
brew ls glib-utils
- name: Ensure clear Jupyter Notebooks
Expand Down
12 changes: 7 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ numcosmodoc_DATA = \
ChangeLog \
NEWS

#DISTCLEANFILES = intltool-extract intltool-merge intltool-update
if HAVE_PYTHON
include numcosmo_py.mk
endif # HAVE_PYTHON

EXTRA_DIST = \
INSTALL \
$(numcosmodoc_DATA) \
numcosmo.pc.in \
tap-driver.sh \
INSTALL \
$(numcosmodoc_DATA) \
numcosmo-valgrind.supp \
tap-driver.sh \
tap-test

AM_CFLAGS =
Expand Down
51 changes: 34 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ AC_C_CONST()
AC_C_RESTRICT()
AC_C_VOLATILE()

dnl ***************************************************************************
dnl C Sizes
dnl ***************************************************************************
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(unsigned long)

dnl ***************************************************************************
dnl Makefile.decl variable dependency (here glib_native_win32 is null)
dnl ***************************************************************************
Expand Down Expand Up @@ -360,8 +368,10 @@ dnl ***************************************************************************
AM_PATH_PYTHON([3.8], [
AX_PYTHON_MODULE([gi])
AX_PYTHON_MODULE([pytest])
AX_PYTHON_MODULE([pytest_tap])
],[:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"])
AM_CONDITIONAL([HAVE_PYTEST_TAP], [test "x$HAVE_PYMOD_PYTEST_TAP" = xyes])

dnl ***************************************************************************
dnl check for gtk-doc
Expand All @@ -372,23 +382,6 @@ GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
AM_CONDITIONAL([ENABLE_GTK_DOC], false)
])

AC_ARG_ENABLE(man,
[AS_HELP_STRING([--enable-man],[regenerate man pages from Docbook [default=no]])],enable_man=yes,
enable_man=no)

if test "${enable_man}" != no; then

dnl ***************************************************************************
dnl Check for xsltproc
dnl ***************************************************************************
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
enable_man=no
fi
fi

AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)

dnl ***************************************************************************
dnl Set PACKAGE_DATA_DIR in config.h.
dnl ***************************************************************************
Expand Down Expand Up @@ -1052,6 +1045,20 @@ fi

AC_SUBST(PLC_DEFINES)

dnl ***************************************************************************
dnl libfyaml
dnl ***************************************************************************

PKG_CHECK_MODULES(LIBFYAML, [ libfyaml ], HAVE_LIBFYAML=1, HAVE_LIBFYAML=0)

AC_SUBST(HAVE_LIBFYAML)
AC_SUBST(LIBFYAML_CFLAGS)
AC_SUBST(LIBFYAML_LIBS)
if test "x$HAVE_LIBFYAML" = "x1"; then
AC_DEFINE([HAVE_LIBFYAML], [], [Define if you have libfyaml available])
fi
AM_CONDITIONAL([HAVE_LIBFYAML], [ test x$HAVE_LIBFYAML = x1 ])

dnl ***************************************************************************
dnl Appending libs and setting up TEST_SHARED
dnl ***************************************************************************
Expand Down Expand Up @@ -1147,6 +1154,11 @@ if [ test "x$HAVE_ARB" = xyes ]; then
else
echo "Building with ARB support: .......................................NO"
fi
if [ test "x$HAVE_LIBFYAML" = x1 ]; then
echo "Building with libfyaml support: .................................YES"
else
echo "Building with libfyaml support: ..................................NO"
fi
if [ test "x$PYTHON_VERSION" != x ]; then
echo "Building with Python support: ...................................$PYTHON"
echo "Building with Python version: ...................................$PYTHON_VERSION"
Expand All @@ -1160,6 +1172,11 @@ if [ test "x$PYTHON_VERSION" != x ]; then
else
echo "Building with Python pytest support ..............................NO"
fi
if [test "x$HAVE_PYMOD_PYTEST_TAP" = xyes]; then
echo "Building with Python pytest-tap support .........................YES"
else
echo "Building with Python pytest-tap support ..........................NO"
fi
else
echo "Building with Python support: ....................................NO"
fi
Expand Down
32 changes: 5 additions & 27 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Local xml files
XML_FILES= \
introduction.xml \
darkenergy.xml \
refs.xml

# Generated xml files
Expand Down Expand Up @@ -135,6 +134,8 @@ IGNORE_HFILES= \
libqp_splx.c \
kdtree.h \
kdtree.c \
rb_knn_list.h \
rb_knn_list.c \
clencurt.h \
converged.h \
vwrapper.h \
Expand Down Expand Up @@ -195,32 +196,9 @@ endif

########################################################################

man_MANS := darkenergy.1
MAINTAINERCLEANFILES = $(BUILT_SOURCES)

EXTRA_DIST += $(man_MANS)

if ENABLE_MAN

%.1: %.xml
@@XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

dist-local-check-mans-enabled:
if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi
else

$(man_MANS):
@echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it.
@echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@

dist-local-check-mans-enabled:
@echo "*** --enable-man must be used in order to make dist"
false

endif

MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES)

BUILT_EXTRA_DIST = $(man_MANS)
BUILT_EXTRA_DIST =

CLEANFILES += \
addmathjax.stamp \
Expand All @@ -238,7 +216,7 @@ CLEANFILES += \
$(addsuffix .xref, $(basename $(XML_GEN_FILES))) \
$(addprefix $(top_srcdir)/docs/, $(XML_GEN_FILES))

dist-hook-local: dist-local-check-mans-enabled all-local
dist-hook-local: all-local

numcosmo-docs-clean: clean
cd $(srcdir) && rm -rf xml html
Expand Down
51 changes: 0 additions & 51 deletions docs/darkenergy.xml

This file was deleted.

1 change: 1 addition & 0 deletions docs/numcosmo-docs.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
<xi:include href="xml/nc_galaxy_wl_dist.xml"/>
<xi:include href="xml/nc_galaxy_wl_ellipticity_gauss.xml"/>
<xi:include href="xml/nc_galaxy_wl_ellipticity_kde.xml"/>
<xi:include href="xml/nc_galaxy_wl_ellipticity_binned.xml"/>
<xi:include href="xml/nc_galaxy_wl_proj.xml"/>
</section>
<section>
Expand Down
46 changes: 46 additions & 0 deletions generate_py_makefile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@


import os
import os.path

# Set the directory where the notebooks are located
NOTEBOOK_DIR = 'numcosmo_py'

# Get a list of all subdirectories in the notebook directory
subdirs = []
for root, dirs, files in os.walk(NOTEBOOK_DIR):
if "__pycache__" not in root:
normalized_path = os.path.normpath(root)
if normalized_path.startswith("./"):
normalized_path = normalized_path[2:]
subdirs.append(normalized_path)

subdirs.sort()

# Generate the Makefile.am contents
makefile_contents = "## Generated automatically with generate_py_makefile.py\n\n\n"
python_files = []

for subdir in subdirs:
# Get a list of all notebook files in the subdirectory
for root, dirs, files in os.walk(subdir):
if subdir == root:
for file in files:
if file.endswith('.py'):
file = os.path.join(root, file)
python_files.append(file)


max_length = max(len(extra_dist_file) for extra_dist_file in python_files)
python_files = [extra_dist_file.ljust(max_length) for extra_dist_file in python_files]

# Generate the EXTRA_DIST variable
makefile_contents += "nobase_python_PYTHON = \\\n"
for file in python_files[:-1]:
makefile_contents += f"\t{file} \\\n"
makefile_contents += f"\t{python_files[-1]}\n"

# Write the Makefile.am file
with open('numcosmo_py.mk', 'w') as f:
f.write(makefile_contents)

0 comments on commit a059001

Please sign in to comment.