Skip to content

Commit

Permalink
fix: PYTHON_USE
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes14 committed Mar 29, 2020
1 parent 4c91232 commit 02a9dad
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
16 changes: 9 additions & 7 deletions Singular/dyn_modules/machinelearning/Makefile.am
Expand Up @@ -19,9 +19,13 @@ AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/kernel \
-I${top_builddir}/kernel -I${top_srcdir}/libpolys \
-I${top_builddir}/libpolys $(FACTORY_INCLUDES) $(GMP_CPPFLAGS) \
-DDATA_PATH=\"$(datadir)\" \
-DBIN_PATH=\"$(bindir)\" -I/usr/include/python2.7
-DBIN_PATH=\"$(bindir)\" ${PYTHON_CSPEC}

if PYTHON_USE
machinelearning_la_SOURCES = machinelearning.cc mlpredict.c mlpredict.h
else
machinelearning_la_SOURCES =
endif

### if HAVE_PYTHON???
machinelearning_la_CXXFLAGS = $(PYTHON_CSPEC)
Expand All @@ -38,15 +42,13 @@ endif
TESTS = test_bufsize test_init_ml
check_PROGRAMS = test_bufsize test_init_ml

#test_bufsize_LDFLAGS = -lpython3.6m
test_bufsize_LDFLAGS = -lpython2.7
test_bufsize_LDFLAGS = ${PYTHON_LSPEC}
test_bufsize_SOURCES = tests/test_bufsize.c mlpredict.c
test_bufsize_CFLAGS = -Wall -Wextra -I/usr/include/python2.7
test_bufsize_CFLAGS = -Wall -Wextra ${PYTHON_CSPEC}

#test_init_ml_LDFLAGS = -lpython3.6m
test_init_ml_LDFLAGS = -lpython2.7
test_init_ml_LDFLAGS = ${PYTHON_LSPEC}
test_init_ml_SOURCES = tests/test_init_ml.c mlpredict.c
test_init_ml_CFLAGS = -Wall -Wextra -I/usr/include/python2.7
test_init_ml_CFLAGS = -Wall -Wextra ${PYTHON_CSPEC}


nobase_dist_data_DATA = \
Expand Down
7 changes: 6 additions & 1 deletion Singular/dyn_modules/pyobject/Makefile.am
@@ -1,5 +1,6 @@
ACLOCAL_AMFLAGS = -I ../../m4

if PYTHON_USE
if SI_BUILTIN_PYOBJECT
noinst_LTLIBRARIES = pyobject.la
## moduledir = $(libdir)/singular
Expand All @@ -13,11 +14,15 @@ else !SI_BUILTIN_PYOBJECT
P_PROCS_MODULE_LDFLAGS = -module -export-dynamic -avoid-version -flat_namespace -weak_reference_mismatches weak -undefined dynamic_lookup
### -export-dynamic -shared -module -avoid-version (add to all DMs?)
endif !SI_BUILTIN_PYOBJECT
pyobject_la_SOURCES = pyobject.cc
else
pyobject_la_SOURCES =
endif


##########################################################################
AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(FACTORY_INCLUDES) $(GMP_CPPFLAGS) $(NTL_CPPFLAGS) $(FLINT_CFLAGS)

pyobject_la_SOURCES = pyobject.cc

### if HAVE_PYTHON???
pyobject_la_CXXFLAGS = $(PYTHON_CSPEC)
Expand Down
8 changes: 6 additions & 2 deletions Singular/dyn_modules/python/Makefile.am
Expand Up @@ -2,12 +2,16 @@ ACLOCAL_AMFLAGS = -I ../../m4

PYTHON_VERSION=2.7

if PYTHON_USE
SOURCES = python_module.cc poly_wrap.cc vector_wrap.cc CF_wrap.cc\
number_wrap.cc ring_wrap.cc ideal_wrap.cc intvec_wrap.cc \
interpreter_support.cc \
CF_wrap.h Number.h ideal_wrap.h number_wrap.h ring_wrap.h \
IIntvec.h Poly.h interpreter_support.h vector_wrap.h \
Ideal.h PowerSeries.h intvec_wrap.h poly_wrap.h wrapper.h
else
SOURCES=
endif

AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} \
-I${top_srcdir}/libpolys -I${top_builddir}/libpolys \
Expand All @@ -28,7 +32,7 @@ endif

python_module_la_SOURCES = $(SOURCES)

python_module_la_CPPFLAGS = -I/usr/include/python${PYTHON_VERSION} ${AM_CPPFLAGS} ${P_PROCS_CPPFLAGS_COMMON}
python_module_la_CPPFLAGS = ${PYTHON_CSPEC} ${AM_CPPFLAGS} ${P_PROCS_CPPFLAGS_COMMON}
python_module_la_LDFLAGS = ${P_PROCS_MODULE_LDFLAGS} $(SINGULAR_LDFLAGS)

# forcefully enable exceptions for python
Expand All @@ -42,7 +46,7 @@ endif
endif

if HAVE_PYTHON_MODULE
python_module_la_LIBADD += -lboost_python-${PYTHON_VERSION} -lpython${PYTHON_VERSION}
python_module_la_LIBADD += -lboost_python-${PYTHON_VERSION} ${PYTHON_LSPEC}
endif

python_module_la_CXXFLAGS = ${AM_CXXFLAGS}
Expand Down
3 changes: 1 addition & 2 deletions configure.ac
Expand Up @@ -126,8 +126,7 @@ AC_CONFIG_GOOGLE_PERFTOOLS()
LB_CHECK_CCLUSTER()

AX_PYTHON_DEFAULT()
AX_PYTHON_WITH_VERSION([2.4])
AX_PYTHON_DEVEL()
AX_PYTHON_WITH()

LB_CHECK_MATHICGB

Expand Down

0 comments on commit 02a9dad

Please sign in to comment.