pcn icon indicating copy to clipboard operation
pcn copied to clipboard

Advises on makefile

Open Hannes9 opened this issue 1 year ago • 0 comments

Hi.

I got the following error message when executing the makefile on Colab:

...In file included from /usr/local/lib/python3.10/dist-packages/tensorflow/include/google/protobuf/generated_message_reflection.h:45,
                 from /usr/local/lib/python3.10/dist-packages/tensorflow/include/tensorflow/core/framework/full_type.pb.h:28,
                 from /usr/local/lib/python3.10/dist-packages/tensorflow/include/tensorflow/core/framework/op.h:26,
                 from tf_nndistance.cpp:1:
/usr/local/lib/python3.10/dist-packages/tensorflow/include/google/protobuf/descriptor.h:116:7: note: forward declaration of ‘class google::protobuf::MethodOptions’
  116 | class MethodOptions;
      |       ^~~~~~~~~~~~~
make: *** [makefile:13: tf_nndistance_so.so] Error 1

My makefile looks like this and the pathes should be correct.

cuda_inc = /usr/local/cuda-12.0/include/
cuda_lib = /usr/local/cuda-12.0/lib64/
nvcc = /usr/local/cuda-12.0/bin/nvcc
tf_inc = /usr/local/lib/python3.10/dist-packages/tensorflow/include
tf_lib = /usr/local/lib/python3.10/dist-packages/tensorflow

all: tf_nndistance_so.so tf_approxmatch_so.so

tf_nndistance.cu.o: tf_nndistance.cu
	$(nvcc) tf_nndistance.cu -o tf_nndistance.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC

tf_nndistance_so.so: tf_nndistance.cpp tf_nndistance.cu.o
	g++ tf_nndistance.cpp tf_nndistance.cu.o -o tf_nndistance_so.so \
	-I $(cuda_inc) -I $(tf_inc) -L $(cuda_lib) -lcudart -L $(tf_lib) -ltensorflow_framework \
    -shared -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -fPIC -O2

tf_approxmatch.cu.o: tf_approxmatch.cu
	$(nvcc) tf_approxmatch.cu -o tf_approxmatch.cu.o -c -O2 -DGOOGLE_CUDA=1 -x cu -Xcompiler -fPIC

tf_approxmatch_so.so: tf_approxmatch.cpp tf_approxmatch.cu.o
	g++ -shared $(CPPFLAGS) tf_approxmatch.cpp tf_approxmatch.cu.o -o tf_approxmatch_so.so \
	-I $(cuda_inc) -I $(tf_inc) -L $(cuda_lib) -lcudart -L $(tf_lib) -ltensorflow_framework \
    -shared -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 -fPIC -O2

clean:
	rm -rf *.o *.so

I would appreciate it a lot, thanks !

Hannes9 avatar Dec 10 '23 18:12 Hannes9