Skip to content

Commit

Permalink
all compiles now
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfrantz committed Oct 24, 2024
1 parent 7dc0706 commit 2211919
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ MAIN_HIGHER_EXE = $(patsubst $(SRCDIR)/main/higher-level/%.c, $(BINDIR)/%, $(MAI
TEST_EXE = $(patsubst $(SRCDIR)/tests/%.c, $(BINDIR)/force-test/%, $(TEST_SRC))

# Dependencies
DEP = $(CROSS_OBJ:.o=.d) $(LOWER_OBJ:.o=.d) $(HIGHER_OBJ:.o=.d) $(AUX_OBJ:.o=.d)
DEPENDENCIES = $(CROSS_OBJ:.o=.d) $(LOWER_OBJ:.o=.d) $(HIGHER_OBJ:.o=.d) $(AUX_OBJ:.o=.d)

# Targets
all: exe tests
Expand All @@ -119,7 +119,7 @@ dev: $(BINDIR)/force-stratified-sample # specific target for development
#.PHONY: temp all install install_ bash python rstats misc external clean build check

# Include dependencies
-include $(DEP)
-include $(DEPENDENCIES)


print-vars:
Expand Down Expand Up @@ -224,8 +224,7 @@ $(BINDIR)/%: $(SRCDIR)/main/lower-level/%.c $(CROSS_OBJ) $(LOWER_OBJ)
@echo "Compiling $<..."
$(CXX) $(CFLAGS) $(INCLUDES) $(FLAGS) -o $@ $^ $(LIBS)

#$(BINDIR)/%: $(SRCDIR)/main/higher-level/%.c $(CROSS_OBJ) $(HIGHER_OBJ)
$(BINDIR)/%: $(MAIN_HIGHER_EXE) $(CROSS_OBJ) $(HIGHER_OBJ)
$(BINDIR)/%: $(SRCDIR)/main/higher-level/%.c $(CROSS_OBJ) $(HIGHER_OBJ)
@echo "Compiling $<..."
$(CXX) $(CFLAGS) $(INCLUDES) $(FLAGS) -o $@ $^ $(LIBS)

Expand Down
2 changes: 1 addition & 1 deletion misc/force-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.7.12-dev:::2024-10-24_07:32:25
3.7.12-dev:::2024-10-24_13:09:57
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions src/modules/higher-level/py-udf-hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ par_udf_t *udf;
} else if (phl->udf.pyp.out){
udf = &phl->udf.pyp;
} else {
return;
exit(FAILURE);
}


Py_Initialize();

import_array();
if (_import_array() < 0) {
PyErr_Print();
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
exit(FAILURE);
}

PyRun_SimpleString("from multiprocessing.pool import Pool");
PyRun_SimpleString("import numpy as np");
Expand Down Expand Up @@ -548,7 +552,7 @@ short* return_ = NULL;
py_nproc,
NULL);

if (py_return == Py_None){
if ((PyObject*)py_return == Py_None){
printf("None returned from python. Check the python UDF code!\n");
exit(FAILURE);}

Expand Down

0 comments on commit 2211919

Please sign in to comment.