I’m struggling with building pytorch, with additional c++ source code. Because it is about code instrumentation, I’m not considering c++ extensions.
So I tried to locate my .h and .cpp files in torch/csrc/utils/
, but it seems like additional treatment is needed to build properly with additional source files. If it is true, where is the place that I should add the information about my additional sources?
Current state:
torch/csrc/utils/instrument.h:
int foo();
torch/csrc/utils/instrument.cpp:
#include <torch/csrc/utils/instrument.h>
int foo() {
return 42;
}
When foo()
is invoked by other (existing) source code, pytorch is built without error, but fails to be imported in python with undefined symbol error.