I have the following snippet in my makefile
(the first line was added by me after finding it as a candidate solution online - unfortunately, it doesn't work):
$(shell set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} /usr/local/lib/python3.5/dist-packages/numpy/core/include))
all: obj $(EXEC) link
$(EXEC): $(OBJS)
$(CC) $(COMMON) -I./src/factor $(CFLAGS) $^ -o $@ $(LDFLAGS)
$(CC) -shared $(COMMON) -I./src/factor $(CFLAGS) $^ -o $(SHAREDLIB) $(LDFLAGS)
$(OBJDIR)%.o: %.c $(DEPS)
$(CC) $(COMMON) -I./src/factor $(CFLAGS) -c $< -o $@
I verified that numpy/arrayobject.h
is in /usr/local/lib/python3.5/dist-packages/numpy/core/include
on my system. After executing make
I get:
gcc -I ./include -I/usr/include/python3.5 -DGPU -I/usr/local/cuda-10.0/include/ -DCUDNN -I./src/factor -Wall -Wfatal-errors -fPIC -Ofast -DGPU -DCUDNN -c ./src/ComputationPy.c -o obj/ComputationPy.o
./src/ComputationPy.c:12:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
Makefile:51: recipe for target 'obj/ComputationPy.o' failed
make: *** [obj/ComputationPy.o] Error 1
Line 51 corresponds to the last line of the snippet.