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
[Caffe2] How to link Caffe2 in cmake file for C++ compilation? #15004
Comments
try: |
I found Caffe2Config.cmake . The problem is there are many locations where its located and I tried setting Caffe2_DIR with all possible location but the real problem is all the header files relative paths are set properly. I mean if I got to Caffe2/core/init.h there are include files whose relative path is not accurate. How to tackle this ? |
@beichen2012 The Caffe2_DIR = ~/pytorch/build/Caffe2Config.cmake does not relative path correct as there is no folder named “public” in the current directory Also if I set Caffe2_DIR= ~/pytorch/torch/share/cmake/Caffe2Config.cmake then also cmake does not include and files. I had to manually include it. Finally I am getting linking errors. Which are the libraries I should link and in which order. Please guide I am working hard just to run a simple code using Caffe2 C++ more than a week. |
cd your pytorch source code dir, then mkdir build, cd build , cmake -DCMAKE_INSTALL_PREFIX=/opt/Caffe2 .. , then: make && sudo make install. please refer to : "https://github.com/beichen2012/testMultiThreadCaffe2" |
I tried-->find_package(Caffe2 REQUIRED)
Here is the error
By not providing "FindCaffe2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Caffe2", but
CMake did not find one.
Could not find a package configuration file provided by "Caffe2" with any
of the following names:
Add the installation prefix of "Caffe2" to CMAKE_PREFIX_PATH or set
"Caffe2_DIR" to a directory containing one of the above files. If "Caffe2"
provides a separate development package or SDK, be sure it has been
installed.
The text was updated successfully, but these errors were encountered: