Building on os x 10.11.3 el capitan
When try to build as:
mkdir build && cd build
cmake ..
cmake gives the following error:
FindEigen3.cmake
CMake Error at CMakeLists.txt:47 (find_package):
By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen3", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen3" with any
of the following names:
Eigen3Config.cmake
eigen3-config.cmake
Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set
"Eigen3_DIR" to a directory containing one of the above files. If "Eigen3"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/Users/inanc/dev/deepdetect/build/CMakeFiles/CMakeOutput.log".
_CMAKE_MODULE_PATH set to:_
export CMAKE_MODULE_PATH=/usr/local/share/cmake/Modules
# the content of this directory contains cmake for eigen:
$ ls $CMAKE_MODULE_PATH | grep -i eigen
FindEigen3.cmake
It completely does not respect the path being set as described in the message. Such as: While CMAKE_MODULE_PATH is set to homebrew`s eigen cmake file directory, it does not respect that.
Can I send a bug fix for this?
hi @deeperx OSX is not a supported platform, only Ubuntu 14.04LTS is at the moment. However, any patch and fixes that you can submit and that do not break the reference platform builds are highly welcome and are to be brought into the codebase, yes.
Also, have you tried cmake -DCMAKE_MODULE_PATH=/path/to/where ?
Hey @beniz Yes, I've did triy that but still had no chance. I can send a patch but I can't validate whether it would work on ubuntu or no.
Great please do open a PR with description and usage example or send a patch if you cannot do otherwise, I can do the checking against the reference platform.
Not sure where you are at with this one @deeperx but a workaround to move a step further on OSX could be edit deepdetect/CMakeLists.txt, comment out find_package(Eigen3 REQUIRED) and replace include_directories("${EIGEN3_INCLUDE_DIR}") with include_directories("/path/to/eigen3"). If this works, then something else will probably fail, but this could pave the way to an OSX (unsupported) build.
Also please look at http://stackoverflow.com/questions/5922016/cmake-cant-find-eigen3
Not sure where you are at with this one @deeperx but a workaround to move a step further on OSX could be edit deepdetect/CMakeLists.txt, comment out find_package(Eigen3 REQUIRED) and replace include_directories("${EIGEN3_INCLUDE_DIR}") with include_directories("/path/to/eigen3").
Doing this leads me to -
-- Boost version: 1.60.0
-- Found the following Boost libraries:
-- filesystem
-- thread
-- system
-- chrono
-- date_time
-- atomic
-- CUDA detected: 7.5
-- Added CUDA NVCC flags for: sm_30
CMake Error at cmake/Cuda.cmake:264 (deepdetect_detect_darwin_version):
Unknown CMake command "deepdetect_detect_darwin_version".
Call Stack (most recent call first):
CMakeLists.txt:59 (include)
-- Configuring incomplete, errors occurred!
I couldn't find deepdetect_detect_darwin_version() in the repository, does this come from some other repo?
I see a similar function in build/caffe_dd/src/caffe_dd/cmake/Utils.cmake. Not sure where Utils.cmake does come from, but you could try to modify it and put it into the deepdetect/cmake repository.
I took deepdetect_detect_darwin_version() & deepdetect_option() from /caffe/cmake/Utils.cmake and put them in deepdetect/cmake/Cuda.cmake. This gives me a successful execution of
cmake ..
This is the output of cmake - http://pastebin.com/hvFSmwrV
make gives the following errors - http://pastebin.com/FJpPZuAP
All the errors seem to be of the type -
In file included from ./include/caffe/common.hpp:7: ./include/caffe/llogging.h:153:63: error: dynamic_cast from rvalue to reference type 'std::ostringstream &' (aka 'basic_ostringstream<char> &') throw CaffeErrorException(std::string(__FILE__) + ":" + SSTR(__LINE__) + " / Fatal Caffe error"); // XXX: cannot report the exact location of the trigger... ^~~~~~~~~~~~~~ ./include/caffe/llogging.h:70:19: note: expanded from macro 'SSTR' #define SSTR( x ) dynamic_cast< std::ostringstream & >( \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any suggestion about what I could try?
Thanks for pushing this further.
I'll be honest, this looks bad. It comes from our custom https://github.com/beniz/caffe/blob/master/include/caffe/llogging.h
Can you try replacing dynamic_cast with static_cast ?
EDIT: beware that Caffe is downloaded when calling cmake on a new build repository. To try the trick above you need to edit build/caffe_dd/src/caffe_dd/include/caffe/llogging.h.
Thanks for replying.
Looks like the same bunch of errors with static_cast - http://pastebin.com/rzUmh4Cp
Could it be related to not having some library not being installed or configured properly or related to eigen in some way?
So the difficulty appears to be with compiling our custom version of Caffe, available here: https://github.com/beniz/caffe/tree/master_dd_integ
FYI, this version replaces the fatal errors from original Caffe with C++ exception that can be safely caught by dd. If you would like to dig this further, you can try to directly compile the github repository above.
I will try to replicate your issue by building it up with clang and let you know.
So, I cannot reproduce your error with clang, though there are other unrelated issues. If you know how to install gcc on OSX and select it for compiling Caffe, it should work, from gcc 4.8 to gcc 5.x.
I've started using an ec2 instance but I'll try this later. Thanks
@neo01124 I had a similar issue on Ubuntu, which was related to Eigen being header only (and as such a cmake file not being needed). I overcame the issue by changing the CMakeLists.txt to:
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
PATHS
${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen
)
Hope this helps! @beniz has anyone else had this issue? If you don't see a reason this would break builds on other platforms, I'm happy to PR it?
Hi, this is strange that you would have an issue with Eigen on Ubuntu, unless you are using your own local version, or that there's a conflict due to Tensorflow build. I'll check on that particular case later on today though AFAIK all our daily builds are fine.
Is your patch for OSX ? I'm not sure I understand the KDE4 include ? I'm all in favor of a community supported OSX build. If your changes help with OSX you may be interested to build upon #153 and re-PR as needed with building instructions. If you are building on another platform, let me know which one.
Same problem on :
Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty
see whether #75 applies
I am sure I can easily fix the problem by adding the FindEIGEN3 file which is missing in /usr/share... path. I want to find a clean install solution and also find a root cause.
AFAIK root cause is cmake3 not including FindEigen whereas cmake2 did.
Looks like cmake 3.x changed the syntax for modules and FindEIGEN3 was dropped in favor of pkg_config. I fixed the problem on Ubuntu 14.04.5 LTS - here is the PR.
Using compile time casting rather than runtime casting avoids the problem noted earlier -
--- a/include/caffe/llogging.h +++ b/include/caffe/llogging.h @@ -67,8 +67,7 @@ class DateLogger {
#ifdef CAFFE_THROW_ON_ERROR #include
-#define SSTR( x ) dynamic_cast< std::ostringstream & >(( std::ostringstream() << std::dec << x )).str() +#define SSTR( x ) #x class CaffeErrorException : public std::exception { public:
Deepdetect on darwin works using our caffe which is the latest caffe release. Updating deepdetect's caffe is a bit more involved. Let me know if there is still interest in supporting deepdetect on OS X.
Hi, thanks. There will not be professional support for OSX. However, if they are small enough, non impacting changes, that would simplify the building on OSX, we would of course integrated them into master. Regarding Caffe, I'd be surprised you can use the official Caffe release with DD without a lot of issues...
@beniz thanks for the feedback. What are the issues with the latest caffe on DD?
We don't need support nor are we looking to run on OS X but if others are interested in it, we can update our fork.
OS X support will be good actually, however someone can run it through a container as well.
No troll intended, but from our experience, OSX support would be hell :) More seriously, see my comment above for inclusion of non impacting changes. Also, if some of you are successfully running the docker builds from OSX, please let us know so that we can point to a short documentation.