vernamlab / cuFHE

CUDA-accelerated Fully Homomorphic Encryption Library
MIT License
211 stars 60 forks source link

make cpu fails if nvcc is not installed #21

Open craig-dillabaugh opened 2 years ago

craig-dillabaugh commented 2 years ago

I am testing some cuFHE code on a VM (so no GPU access) and just want to build the CPU version, so I ran:

make cpu

But failed with an error as Make could not find nvcc.

I was able to get compilation working by updating the Makefile, but didn't want push a fix as I am not sure if this is correct in all build configurations.

diff --git a/cufhe/Makefile b/cufhe/Makefile
index 7396594..52e64c5 100644
--- a/cufhe/Makefile
+++ b/cufhe/Makefile
@@ -70,7 +70,7 @@ $(DIR_OBJ)/test/test_api_gpu.o: test/test_api_gpu.cu

 $(DIR_BIN)/libcufhe_cpu.so: $(CC_OBJ)
    $(dir_guard)
-   $(CU) $(FLAGS) $(CU_FLAGS) -shared -o $@ $(CC_OBJ)
+   $(CC) $(FLAGS) -shared -o $@ $(CC_OBJ)

 $(DIR_BIN)/libcufhe_gpu.so: $(CU_OBJ) $(DIR_OBJ)/cufhe.o $(DIR_OBJ)/cufhe_io.o
    $(dir_guard)