Install caffe on Mac OS X (Catalina) - gpu

I am following the official instructions from http://caffe.berkeleyvision.org/install_osx.html
A couple of things are unclear. Instructions say
"CUDA: Install via the NVIDIA package that includes both CUDA and the bundled driver."
I do not have an Nvidia GPU (am on MacBook Pro 2016 which has amd gpu instead) and plan to use caffe with CPU only.
a) do I have to install CUDA in order to install caffe?
b) inside Makefile.config it have uncommented code that asks to set CUDA directory, saying the following:
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
Seems to suggest that I should have CUDA. It was my impression that I can't have CUDA without Nvidia gpu. (My ultimate goal is to install and work with OpenPose from Spyder.)
Why do I need CUDA uncommented when I am specifying that it will be CPU only
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
So far I have left CUDA commands uncommented as they were and proceeded with make all caffe compilation from terminal. I am encountering the following error and not sure how to solve it. Anyone managed please?
LD -o .build_release/lib/libcaffe.so.1.0.0
ld: framework not found vecLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
I have tried uninstalling and re-installing Xcode command line tools but that did not help. Now I am trying to find the file from which a call to search for vecLib.framework is made, so that I can edit that file and set the vecLib path correctly. I have found it under Library/Developer section. Does anyone know which file is being used to search for vecLib path?
Next problem:
LD -o .build_release/lib/libcaffe.so.1.0.0
ld: library not found for -lboost_python3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
I uncommented this line in Makefile.config as per instructions I was following
PYTHON_LIBRARIES := boost_python3 python3.7m
Not sure how to resolve the missing -lboost_python3.
I found and can see the directory of boost_python3 but don't know how/where I shall use it?

Related

CMake -- CUDA compiler is not able to compile a simple test program

I am working on a small library that makes use of CUDA, however I cannot seem to make CMake work when I run it from the command line, even though my IDE (CLion) uses CMake to comile the program succesfully.
I have scoured the internet for ages trying to solve this, though with nothing making much of a difference. I have got CUDA 11.1 and CMake 3.17.3, and both are accessable from the command line.
CLion is able to compile the code perfectly, and everything works as expected, however when I run CMake from the command line, it gives the following error:
PS C:\Users\penci\OneDrive\Desktop\Rapid\Temporary\Rapid\build> cmake ..
-- The CUDA compiler identification is NVIDIA 11.1.105
-- Check for working CUDA compiler: /cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe
-- Check for working CUDA compiler: /cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe - broken
CMake Error at /usr/share/cmake-3.17.3/Modules/CMakeTestCUDACompiler.cmake:46 (message):
The CUDA compiler
"/cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make.exe cmTC_2c864/fast && /usr/bin/make -f CMakeFiles/cmTC_2c864.dir/build.make CMakeFiles/cmTC_2c864.dir/build
make[1]: Entering directory '/cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_2c864.dir/main.cu.o
"/cygdrive/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.1/bin/nvcc.exe" -forward-unknown-to-host-compiler -x cu -c /cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_2c864.dir/main.cu.o
c1xx: fatal error C1083: Cannot open source file: 'C:/cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeTmp/main.cu': No such file or directory
main.cu
make[1]: *** [CMakeFiles/cmTC_2c864.dir/build.make:86: CMakeFiles/cmTC_2c864.dir/main.cu.o] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:141: cmTC_2c864/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/penci/OneDrive/Desktop/Rapid/Temporary/Rapid/build/CMakeFiles/CMakeError.log".
Sorry for the wall of text, but I'm not sure why this doesn't work in the command line, when it does in CLion.
This is my CMakeLists.txt file:
cmake_minimum_required(VERSION 3.17)
project(Rapid LANGUAGES CUDA)
set(CMAKE_CUDA_STANDARD 14)
include_directories(${PROJECT_SOURCE_DIR}/include/rapid/graphics/GLFW)
link_directories(${PROJECT_SOURCE_DIR}/include/rapid/graphics/GLFW/lib64)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler /openmp")
SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)
add_executable(Rapid main.cu)
set_target_properties(
Rapid
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(Rapid cublas glfw3 gdi32 opengl32)
Any ideas as to how I can fix this issue would be greatly appreciated, as I have spent days trying to fix this, but nothing online seems to work.
After Googling some things that seemed completely unrelated to the issue, I discovered that my Cygwin64 install of CMake was not setup to use Visual Studio generators.
To fix the issue, I needed to put the Visual Studio install of CMake into the PATH environment variable, but it needed to be above the Cygwin64 bin directory. This meant that running the cmake command from the command line would refer to the Visual Studio install, and not the Cygwin64 install, allowing it to work correctly.
Hopefully this helps someone else in the future too

Version number mismatch: inconsistency between gmp.h and libgmp

I was trying to install NTL library on ubuntu, and after using "make", I get this error :
GMP version check (6.0.0/6.1.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
makefile:346: recipe for target 'setup3' failed
make[1]: *** [setup3] Error 134
make[1]: Leaving directory '/mnt/c/Users/pc-admin/ntl-11.0.0/ntl-11.0.0/src'
makefile:310: recipe for target 'setup-phase' failed
make: *** [setup-phase] Error 2
I saw the posts
https://gmplib.org/list-archives/gmp-discuss/2009-March/003663.html
http://www.mpfr.org/faq.html#undef_ref1
But still that didnt quite help.
Currently my usr/local/lib has
XXX#SECURE2:/usr/local/lib$ ls
libgmp.a libgmp.so libgmp.so.23.0.3 libmpfr.la libmpfr.so.6 libmpir.a libmpir.so libmpir.so.23.0.3 python3.5
libgmp.la libgmp.so.23 libmpfr.a libmpfr.so libmpfr.so.6.0.1 libmpir.la libmpir.so.23 pkgconfig
and /usr/local/include has
XXX#SECURE2:/usr/local/include$ ls
gmp.h mpf2mpfr.h mpfr.h mpir.h
Tried changing environment paths as
C_INCLUDE_PATH=usr/local/include
LIBRARY_PATH=usr/local/lib
LD_LIBRARY_PATH=usr/local/lib
Somehow I don't understand how to solve. Any help would be highly appreciated! Thanks for your patience
I encountered this problem today when I installed GMP after NTL Makefile lets me do so.
The following command seems to help:
sudo ldconfig
I met the same problem.It was because of the library's version.
First I installed gmp-6.1.2(using configure,make,make install command),and then I downloaded ntl-11.3.2,input configure and make commands.And the problem appeared:
GMP version check (6.1.2/6.1.0)
*** version number mismatch: inconsistency between gmp.h and libgmp
Aborted (core dumped)
makefile:353: recipe for target 'setup3' failed
I guessed maybe I need to install gmp 6.1.0.So I first entered gmp-6.1.2 directory,using command sudo make uninstall,then downloaded gmp-6.1.0 and the problem was solved.
Maybe you can have a try uninstalling gmp 6.0.0,installing 6.1.0.
I figured out a solution, start again and let the Wizard figure it out.
First, get rid of everything we did before
make clobber
./configure
Then edit the makefile and enable the wizard (around line 128)
#WIZARD=off
WIZARD=on

Error while building Tensorflow using bazel

I'm currently following the instructions here
to build tensorflow from source using bazel.
After setting up the configuration, and attempting to build it, I get this error:
Cuda Configuration Error: Error reading C:/Program Files/NVIDIA GPU
Computing To olkit/CUDA/v9.0/include/cudnn.h: java.io.IOException:
ERROR: src/main/native/win dows/processes-jni.cc(239):
CreateProcessW("grep" --color=never -A1 -E "#define CUDNN_MAJOR"
"C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.0/include/cu
dnn.h"): Das System kann die angegebene Datei nicht finden.
The last phrase translates to "no such file or directory".
But I'm 100% sure I installed cuDNN 7.1.2 correctly, merging the downloaded bin/include/lib folder's with the preexisting CUDA folders. If I copy/paste the path from the error message, there it is cudnn.h! I also run everything in administator etc..
This problem shows up a few times on google, linking it to a mis-configured theano setup, but I'm not using theano right now.
Why doesn't bazel find the file, when it's definitely there?
EDIT: I would also be very thankful if anyone has a link a pre-built version of tensorflow for CUDA compute capability 3.0!
Thank you in advance!
The error indicated that grep.exe can't be found. I tried grep for Windows and msys2. Both will do.

'brew install cmake' gives 'InsecurePlatformWarning'

on mac OSX 10.9.5 (Mavericks)
$brew install cmake
gives
==> Using the sandbox
==> Downloading https://cmake.org/files/v3.8/cmake-3.8.0.tar.gz
Already downloaded: /Users/me/Library/Caches/Homebrew/cmake-3.8.0.tar.gz
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.8.0 --no-system-libs --parallel=8 --datadir=/share/cmake --docdir=/sh
==> make
Last 15 lines from /Users/me/Library/Logs/Homebrew/cmake/02.make:
[100%] Linking CXX executable ../bin/ctest
[100%] Built target ctest
Scanning dependencies of target documentation
[100%] sphinx-build man: see Utilities/Sphinx/build-man.log
Exception occurred:
File "/usr/local/Cellar/sphinx-doc/1.5.5/libexec/lib/python2.7/site-packages/sphinx/util/requests.py", line 52, in <module>
requests.packages.urllib3.exceptions.InsecurePlatformWarning)
AttributeError: 'module' object has no attribute 'InsecurePlatformWarning'
The full traceback has been saved in /tmp/sphinx-err-FKTGTI.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[2]: *** [Utilities/Sphinx/doc_format_man] Error 1
make[1]: *** [Utilities/Sphinx/CMakeFiles/documentation.dir/all] Error 2
make: *** [all] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
These open issues may also help:
glew 2.0.0: add "--with-cmake" option https://github.com/Homebrew/homebrew-core/pull/12722
qt5: cmake find_package(Qt5Core) doesn't work when linked to /usr/local https://github.com/Homebrew/homebrew-core/issues/8392
Error: You are using macOS 10.9.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
Error: You are using macOS 10.9.
We (and Apple) do not provide support for this old version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
why am i getting this error?
A search for this on SO led me to this page which says 'This happens on Python 2 platforms that have an outdated ssl module. '
I am using Python 2.7.13. I followed this page and issued:
pip install urllib3[secure]
but I still get the same error.
turns out make 3.8 is not compatible w mavericks. i upgraded to el capitan and it installed without a hiccough.

OS X - 10.10.4 ld: symbol(s) not found for architecture x86_64

I am installing NS2 2.35 in my macbook having OS X 10.10.4. The Xcode which i have install is Xcode 6.4. While installing I am getting following error:
ld: symbol (s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [octlsh] Error 1
octl-1.14 make failed! Exiting...
From the following link I have downloaded NS2:
https://drive.google.com/file/d/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view
Following steps I have use to install NS2:
Install Xcode
Unzip or untar ns-2.35 using the command "tar zxvf ns-allinone-2.35-xxx.tar.gz" (without quotes)
The ns-2.35 configuration files contains the path to xlibdir and xincdir, so you need not include the path for those directories.
kindly ensure that the path to xlibdir and xincdir are installed on your Mac OS(Xcode)
execute the command ./install inside the directory (~ns-allinone-2.35-xxx/) (use terminal to install) .
Once installed successfully, the path setting information will be provided to you. copy those informations and put it in a file called .profile or .bash_profile (please note that there is a dot in these files)
finally execute the command "source .profile" (wihtout quotes) and logout and login back.
After step 5 i.e. ./install i got above mentioned error.
Kindly help me to solve this problem.
clang: error: linker command failed with exit code 1
The version you got is my "Oct 2014 update" ns-allinone-2.35_gcc482.tar.gz, for gcc/g++ versions 4.6 .. 5.2 . Not clang, AFAIK.
Path´s : # cd ns-2.35/ && make install ; cd ../nam-1.15/ && make install
P.S. : There's a patch for OS X 10 → http://myns2work.blogspot.dk/2013/08/installing-ns-235-on-mountain-lion-and.html
Ref. Google, ns-allinone-2.35 with OS X 10 https://www.google.com/webhp?hl=all&gws_rd=ssl#hl=en&q=ns-allinone-2.35+with+OS+X+10