diff --git a/Makefile b/Makefile index f2d4b1d7..8c7212bf 100755 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: @@ -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) diff --git a/misc/force-version.txt b/misc/force-version.txt index 303423b8..6f7023b1 100644 --- a/misc/force-version.txt +++ b/misc/force-version.txt @@ -1 +1 @@ -3.7.12-dev:::2024-10-24_07:32:25 +3.7.12-dev:::2024-10-24_13:09:57 diff --git a/src/main/aux-level/force-qai-inflate.c b/src/main/higher-level/force-qai-inflate.c similarity index 100% rename from src/main/aux-level/force-qai-inflate.c rename to src/main/higher-level/force-qai-inflate.c diff --git a/src/main/aux-level/force-cube-init.c b/src/main/lower-level/force-cube-init.c similarity index 100% rename from src/main/aux-level/force-cube-init.c rename to src/main/lower-level/force-cube-init.c diff --git a/src/modules/aux-level/train-aux.cpp b/src/modules/aux-level/train-aux.c similarity index 100% rename from src/modules/aux-level/train-aux.cpp rename to src/modules/aux-level/train-aux.c diff --git a/src/modules/higher-level/pheno-hl.cpp b/src/modules/higher-level/pheno-hl.c similarity index 100% rename from src/modules/higher-level/pheno-hl.cpp rename to src/modules/higher-level/pheno-hl.c diff --git a/src/modules/higher-level/py-udf-hl.c b/src/modules/higher-level/py-udf-hl.c index 1ccaee3a..153ee672 100755 --- a/src/modules/higher-level/py-udf-hl.c +++ b/src/modules/higher-level/py-udf-hl.c @@ -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"); @@ -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);}