Hello - I think these kinds of questions are supposed to go here; pardon me if I have been misdirected.
I am brand new to Linux and Ubuntu and pretty much installed it just for the purposes of running Caffe. I have Ubuntu 16.04, and a GTX 1080 ti. After many failures and Ubuntu breakages I have successfully managed to install Ubuntu, cuda 8.0, cudnn (for cuda 8), and after a few snafus, everything seems to be detected and matched and tests were passed with flying colors. So I installed Anaconda with Python 3.6.3 (please don't make me learn Python 2...), and, after confirming it worked, moved onto installing Caffe.
I've done my best to follow whatever walkthroughs/solutions I can find, but finally I am at a standstill. When I go into caffe-rc5 (put it in /usr/local) and "make all", I get the following error:
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/
caffe.pb.ccCXX src/caffe/util/hdf5.cpp
In file included from ./include/caffe/blob.hpp:8:0,
from ./include/caffe/util/hdf5.hpp:9,
from src/caffe/util/hdf5.cpp:1:
./include/caffe/common.hpp:5:27: fatal error: gflags/gflags.h: No such file or directory
compilation terminated.
Makefile:582: recipe for target '.build_release/src/caffe/util/hdf5.o' failed
make: *** [.build_release/src/caffe/util/hdf5.o] Error 1
I understand this means I am missing some dependencies; I tried to follow this guide
http://olivernina.blogspot.com/2014/09/includecaffecommonhpp527-fatal-error.htmlwhich says to write
wget https://github.com/schuhschuh/gflags/archive/master.zip
unzip master.zip
cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make
sudo make install
but when I get to the export line I get this error message:
___________
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:184 (file):
file failed to open for writing (No such file or directory):
/usr/local/gflags-master/build/CMakeFiles/CMakeOutput.log
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
CMake Error: Could not open file for write in copy operation /usr/local/gflags-master/build/CMakeFiles/3.5.1/CMakeSystem.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake:196 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:141 (file):
file problem creating directory:
/usr/local/gflags-master/build/CMakeFiles/3.5.1/CompilerIdCXX
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:40 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.5/Modules/CMakeDetermineCXXCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:93 (project)
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:141 (file):
file problem creating directory:
/usr/local/gflags-master/build/CMakeFiles/3.5.1/CompilerIdCXX
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:40 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
/usr/share/cmake-3.5/Modules/CMakeDetermineCXXCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:93 (project)
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:647 (file):
file failed to open for writing (No such file or directory):
/usr/local/gflags-master/build/CMakeFiles/CMakeError.log
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake:55 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)
/usr/share/cmake-3.5/Modules/CMakeDetermineCXXCompiler.cmake:113 (CMAKE_DETERMINE_COMPILER_ID)
CMakeLists.txt:93 (project)
-- The CXX compiler identification is unknown
CMake Error: Could not open file for write in copy operation /usr/local/gflags-master/build/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake.tmp
CMake Error: : System Error: No such file or directory
CMake Error at /usr/share/cmake-3.5/Modules/CMakeDetermineCXXCompiler.cmake:179 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
CMake Error: Could not find cmake module file: /usr/local/gflags-master/build/CMakeFiles/3.5.1/CMakeCXXCompiler.cmake
-- Check for working CXX compiler: /usr/bin/c++
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:35 (file):
file failed to open for writing (No such file or directory):
/usr/local/gflags-master/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:40 (try_compile):
Unknown extension ".cxx" for file
/usr/local/gflags-master/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
try_compile() works only for enabled languages. Currently these are:
CXX
See project() command to enable other languages.
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
-- Check for working CXX compiler: /usr/bin/c++ -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:51 (file):
file failed to open for writing (No such file or directory):
/usr/local/gflags-master/build/CMakeFiles/CMakeError.log
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/c++" is not able to compile a simple test
program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
-- Configuring incomplete, errors occurred!
CMake Error: Cannot open file for write: /usr/local/gflags-master/build/CMakeCache.txt.tmp
CMake Error: : System Error: Permission denied
CMake Error: Unable to open cache file for save. /usr/local/gflags-master/build/CMakeCache.txt
CMake Error: : System Error: Permission denied
________________________
By now I'm used to sudoing my way over permission obstacles, since I've been trying to put everything in /usr/local per best practices advice, but in this case it doesn't work since we can't sudo export. I tried to follow a few more walkthroughs/explanations about something something environment variables, but I'm too new to all of this and most of it is Greek to me.
If it matters I also built openCV using this
https://github.com/BVLC/caffe/wiki/OpenCV-3.3-Installation-Guide-on-Ubuntu-16.04and am trying to follow this
https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-Installation-GuideBut in both places they talk about "entering the unpacked directory" and I don't know how to do that. When I try to cd to master.zip (my best guess when they refer to caffe-master unpacked directory), it just tells me it's not a directory.
I am also unsure how to configure my makefile.config for my setup. I've done my best and finally just used the makefile.config example file provided with the Cmake instructions in the link(s) above, but I'm still unsure. Finally, in one of the openCV install tutorials, virtual environments were highly recommended, but i was unable to succeed in installing those as well. Pretty sure it's a path problem (tried adding something to bashrc to fix this but getting error message:
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/home/swerve/anaconda3/bin/python and that PATH is
set properly.
Any chance I can get some very noob-friendly help with this problem here? I'm in way over my head here but I'm learning, slowly, and really need to get Caffe up and running ASAP for a project. I'm not sure if that's too much or not enough information, so please let me know what else I can do to help this along.
Thanks in advance for any help you can provide.