Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Tuesday, May 26, 2015

Caffe incompatible with Boost 1.58.0

Boost 1.58.0 was released on April 17th, and it breaks compilation with Caffe on OSX (when the build reaches one of the "NVCC" steps, you get a string of errors starting with complaining about the absence of a semicolon, that look like this: /usr/local/include/boost/smart_ptr/detail/sp_counted_base_clang.hpp(27): error: expected a ";"

Googling landed me on this page which suggested an incompatibility with boost 1.58.0 (https://groups.google.com/forum/#!topic/caffe-users/fY2r6bO3_0w). However, the steps suggested in the solution (as of May 26th; it seems to have been updated since) didn't work for me. So this is what I did, and it's kindof sketchy but oh well...

[July 16th update: Ian Blenke put together a boost-1.57 brew and mentioned how to use it in the comments; it looks a lot easier and less sketchy to install, but if that does not work for you, read on...]

1) cd $(brew --prefix) (for me this cd's to /usr/local/).
2) cd Library/Formula
3) Make a backup of the files boost.rb and boost-python.rb
4) Replace the boost.rb file with the contents of https://raw.githubusercontent.com/Homebrew/homebrew/6fd6a9b6b2f56139a44dd689d30b7168ac13effb/Library/Formula/boost.rb
5) Replace the boost-python.rb file with the contents of https://raw.githubusercontent.com/Homebrew/homebrew/3141234b3473717e87f3958d4916fe0ada0baba9/Library/Formula/boost-python.rb

6) brew uninstall boost (this should uninstall the 1.58.0 version)
7) brew install boost (this should install 1.57.0 since you've replaced the rb files)

(Edit: You *may* have to do "brew link boost" after this - can't recall exactly. Also, Parang Saraf pointed out a "no rule to make target" error in the comments, which they solved with "make clean")

Also, I missed this guide the first time I went through the page, so I'm linking to it in case you did too: http://caffe.berkeleyvision.org/install_osx.html

Monday, April 6, 2015

Error: 'SecTrustEvaluateAsync' undeclared

I got this error when trying to compile cmake on my mac. It apparently concerns curl in some way. It was fixed by commenting out some of the lines form 2003 to 2048 in Utilities/cmcurl/lib/vtls/curl_darwinssl.c - but I'm not sure whether to take the first or the second block (for now I'm taking the first block of the if statement).

Adventures installing gkmersvm

gkmersvm is an svm kernel implementation from the Beer lab: http://www.beerlab.org/gkmsvm/

I ran into a couple of issues when trying to compile it, and I thought I'd describe them here.

When I first typed in make, I got: fatal error: 'tr1/unordered_map' file not found

This was fixed by upgrading my gcc using the instructions on: http://stackoverflow.com/questions/837992/update-gcc-on-osx

Then make resulted in: "'getopt' was not declared in this scope"

This was fixed by adding "#include <getopt.h>" to src/mainSVMclassify.cpp:

When I did this on our linux server, I also got a bunch of errors about "intptr_t" has not been declared. This was fixed by adding #include <stdint.h> to the following files:

src/CountKLmersGeneral.cpp:19
src/MLEstimKLmers.cpp
src/LKTree.cpp
src/LTree.cpp
src/LKTree.h 

After this, "make" produced the necessary binaries gkmsvm_classify, gkmsvm_kernel and gkmsvm_train. Curiously enough, there's no "make install", so I manually copied the binaries to /usr/local/bin.

Finally, when I tried to run the modshogun script, I got the error "Cannot create new instances of type 'Labels'". I think this is because I was using shogun 4.0.0, and the script was written for Shogun version 0.9.2 ~ 1.1.0. Changing every instance of "Labels" to "BinaryLabels" fixed the issue. Note, if you are getting a segfault with the modular interface, or are having trouble installing it, see my post about shogun.

Also...after that gcc upgrade, I ran into the following error with a line containing "dispatch_block_t", which once again requires modifying some source code: http://hamelot.co.uk/programming/osx-gcc-dispatch_block_t-has-not-been-declared-invalid-typedef/


Monday, January 19, 2015

Upgrade to bleeding edge version solved issue with Theano and Anaconda

I recently switched to using the python that comes with Anaconda (sidebar: is an Anaconda a kind of python? I would google it except, for the first time, I have the problem where googling search terms gets me the technical usage instead of the layperson one). Theano started hiccupping quite badly, both on my local Mac and on the linux server (I got different errors depending on the machine). In both cases, switching to the bleeding-edge version of theano (http://deeplearning.net/software/theano/install.html#bleeding-edge-install-instructions) made the problem go away. Googling the error on linux didn't turn up any solutions, so I am copying it here so the search engine fairy will index it:


 'Compilation failed (return status=1): /usr/bin/ld: cannot find -lf77blas. collect2: ld returned 1 exit status. '