Added support for building with Visual Studio - #2538
Conversation
Conflicts: cmake/Dependencies.cmake
|
C.I. issues with this look easy to fix; one of the configs passes tests. |
|
@eelstork |
|
That's cool idea to generate reference header automatically! ;-) |
|
In my opinion, it's good idea to make user explicitly enable external projects, i.e. make it off by default and use have to manually set to on in order to run automatic download compilation of glog/gflags. Otherwise it might be a surprise for many users who integrate caffe into own large projects. (yes I know someone has contributed this before) |
There was a problem hiding this comment.
I think this should be done only if user explicitly set special option for this.
There was a problem hiding this comment.
Agreed. Some settings of my dependencies made it over in the Caffe CMake files. I will submit again with these settings set through a cache file instead.
|
Good approach! So finally there will even be more than one build system work on Windows! If you stay within CMake already, did you have a look at biicode? It should do the dependency management automatically, and already offer quite some of the dependencies either as blocks or precompiled (including boost) in a well-structured way. |
|
@ChrisLS I stumbled upon biicode some time ago but they were missing binary blocks at that time. Maybe it is worth to reconsider using this now that they support it (although it seems a bit like a hack: http://blog.biicode.com/upload-to-biicode-precompiled-binaries-sfml/). |
…when building with VS only Fixed debug and release builds of pycaffe
Conflicts: include/caffe/common.hpp include/caffe/layer_factory.hpp tools/caffe.cpp
Conflicts: cmake/GenerateForceLinkSymbolsHeader.cmake src/caffe/CMakeLists.txt
|
Closing this one in favor of my second attempt (PR #2816). |
This is a first attempt to add support for Visual Studio via the CMake build.
Only static libraries are supported now, but it should not be too hard to add support for shared libraries. Since Visual Studio has no direct equivalent of the --whole-archive option I have included a post build script to generate a header that forces symbol inclusion in caffe.bin and other executable targets.
Dependencies can be hard to build under Windows. To make the dependency compilation easier I provide a super-build project where almost all Caffe dependencies can be built with Visual Studio and a CMake cache file is produced so that Caffe configuration is lot less tedious on Windows (see caffe-windows-dependencies).
I only tested theses changes with Visual Studio 2013 64 bit and CMake 3.2.