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

Caffe_DIR in CMakeLists.txt #13

Closed
aeitel opened this issue Aug 24, 2017 · 13 comments
Closed

Caffe_DIR in CMakeLists.txt #13

aeitel opened this issue Aug 24, 2017 · 13 comments

Comments

@aeitel
Copy link

aeitel commented Aug 24, 2017

Hi,
nice work with the package.
I needed to change CAFFE_DIR to Caffe_DIR in the CMakeLists.txt in order to be able to link with Caffe.
Otherwise I get:
fatal error: caffe/layers/memory_data_layer.hpp: No such file or directory

I am using 14.04, not sure why the original does not work.

@BoboTheFFClown
Copy link

@aeitel , I encountered a similar error. While running catkin_make, I got the following

image

I have already changed the CAFFE_DIR on line 28 of the CMakeList to my custom path /home/<my_username>/caffe/buid like mentioned in issue #7. @YuehChuan closed that issue, and I assumed changing the CAFFE_DIR path was the solution. However, it didn't work for me. Could anyone help us out?

@YuehChuan
Copy link

@aeitel
Hi! it'spath problem
Check where you put caffe/build folder!
Mine is
gpd
make sure custom path is correct!
https://github.com/atenpas/gpd/blob/master/CMakeLists.txt#L29

change SET(CAFFE_DIR "/home/andreas/software/caffe/build")
to
SET(CAFFE_DIR "$YOUR_PATH/caffe/build")

@BoboTheFFClown
sometimes it's Cmake cache issue
try to
$rm -r devel build
under your catkin_ws, then catkin_make again!

@BoboTheFFClown
Copy link

@YuehChuan
Hi, I removed the devel and build folder and tried to catkin_make again. However, it's outputting the same CMake error. I wonder if this has to do with the fact that my gcc version is 4.8.4, issue #14 mentioned that packaged may not compile with gcc 4.8, but my error is not the same as that mentioned in issue #14. So did you manage to compile this package with gcc 4.8 or 4.9?

@aeitel
Did you get the package to compile after changing the Caffe path? if so, did you compile it with gcc 4.8 or 4.9? You can check your gcc version with $gcc --version.

@YuehChuan
Copy link

@BoboTheFFClown
mine is 4.8.4
gcc-version

@BoboTheFFClown
Copy link

@YuehChuan

Thanks for the quick response. We have the same exact gcc version. I'm really confused to why it's not compiling on my end. @atenpas could you help us out with this issue. Much thanks.

@aeitel
Copy link
Author

aeitel commented Sep 18, 2017

@BoboTheFFClown
My gcc version is 4.8.4
After renaming CAFFE_DIR to Caffe_DIR in the CMakeLists it worked for me.
That's how I linked to my own caffe build directory
SET(Caffe_DIR "/home/eitel/ros_workspaces/grasp_ws/libs/caffe/build")

@BoboTheFFClown
Copy link

Okay so that's exactly what I changed in the CMakeLists but somehow it still fails to compile. The output CMake error is exactly the same as before. @aeitel I assumed you made a typo "Caffe_DIR" should be all uper-case right "CAFFE_DIR"?

@aeitel and @YuehChuan can you all post code snippets from line 27 to line 30 of your CMakeLists?

@atenpas
Copy link
Owner

atenpas commented Sep 18, 2017

@BoboTheFFClown Can you access Caffe in other cmake projects?

@BoboTheFFClown
Copy link

@atenpas yes, agile_grasp 2 complied successfully and I looked into its CMakeLists, it's pretty much the same thing as gpd's CMakeLists.

@BoboTheFFClown
Copy link

@atenpas, this is what my CMakeLists looks like for linking caffe

image

and the CMake error is still the same.

@atenpas
Copy link
Owner

atenpas commented Sep 18, 2017

AFAIK, if you follow BVLC/caffe#1667, your system should be able to find Caffe using find_package(Caffe). You could check this by creating a minimal cmake project that depends on Caffe and includes caffe/caffe.hpp.

@BoboTheFFClown
Copy link

@atenpas, thanks for sharing this information, I'll try this out. Would it be okay to privately email you if I have further questions? for now I guess you can close this issue. Thanks everyone @aeitel , @YuehChuan

@atenpas
Copy link
Owner

atenpas commented Sep 18, 2017

Sure, just send me an email!

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

4 participants