Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advises on makefile #73

Open
Hannes9 opened this issue Dec 10, 2023 · 0 comments
Open

Advises on makefile #73

Hannes9 opened this issue Dec 10, 2023 · 0 comments

Comments

@Hannes9
Copy link

Hannes9 commented Dec 10, 2023

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant