Caffe Windows Build failed when CMAKE_BUILD_SHARED_LIBS=1

605 views
Skip to first unread message

Paul Delamusica

unread,
Jan 10, 2017, 2:41:43 AM1/10/17
to Caffe Users
I am building caffe on Windows 7 using VC 2013 according to the instructions in https://github.com/BVLC/caffe/blob/windows/README.md

If I set CMAKE_BUILD_SHARED_LIBS=1, I got the following message and the build aborts. 

.....

"c:\projects\caffe\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\projects\caffe\build\tools\upgrade_solver_proto_text.vcxproj" (default targ
et) (21) ->
  LINK : fatal error LNK1181: cannot open input file '..\lib\Release\caffe.lib'
 [C:\projects\caffe\build\tools\upgrade_solver_proto_text.vcxproj]

    556 Warning(s)
    17 Error(s)

Time Elapsed 00:07:21.87
ERROR: Build failed

c:\projects\caffe>

Guillaume Dumont

unread,
Jan 10, 2017, 7:01:44 AM1/10/17
to Caffe Users
Use the ninja generator. The vs generator is known mot to work for this configuration.

Paul Delamusica

unread,
Jan 10, 2017, 12:25:55 PM1/10/17
to Caffe Users
Thanks!

I downloaded ninja, put the *.exe into the search path, and re-run the build script. It seems the C compiler isn't correctly identified. Is MSVC 18 somewhere hard wired?

Here is the full error message:


c:\projects\caffe>scripts\build_win.cmd
The system cannot find the drive specified.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 12
INFO: WITH_NINJA                 = 1
INFO: CMAKE_GENERATOR            = "Ninja"
INFO: CPU_ONLY                   = 1
INFO: CMAKE_CONFIG               = Release
INFO: CMAKE_BUILD_SHARED_LIBS    = 1
INFO: BUILD_PYTHON               = 1
INFO: BUILD_PYTHON_LAYER         = 1
INFO: BUILD_MATLAB               = 0
INFO: PYTHON_EXE                 = "python"
INFO: RUN_TESTS                  = 0
INFO: RUN_LINT                   = 0
INFO: RUN_INSTALL                = 0
INFO: ============================================================
INFO: Downloading dependencies
Downloading dependencies (libraries_v120_x64_py27_1.0.1.tar.bz2). Please wait...

...100%, 142 MB, 381 KB/s, 381 seconds passed
Done.
Extracting dependencies. Please wait...
Done.
loading initial cache file c:\projects\caffe\build\libraries\caffe-builder-confi
g.cmake
-- The C compiler identification is unknown
-- The CXX compiler identification is MSVC 18.0.40629.0
cc: file '/etc/compiler.ccg': The system cannot find the path specified.
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.3/Modules/CMakeTestCCo
mpiler.cmake:61 (message):
  The C compiler "C:/mks_bin/CC.EXE" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/projects/caffe/build/CMakeFiles/CMakeTmp



  Run Build Command:"C:/mks_bin/ninja.exe" "cmTC_7f87e"

  [1/2] Building C object CMakeFiles\cmTC_7f87e.dir\testCCompiler.c.obj

  FAILED: CMakeFiles/cmTC_7f87e.dir/testCCompiler.c.obj

  C:\mks_bin\CC.EXE -o CMakeFiles\cmTC_7f87e.dir\testCCompiler.c.obj -c
  testCCompiler.c

  cc: file '/etc/compiler.ccg': The system cannot find the path specified.


  ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:18 (project)


-- Configuring incomplete, errors occurred!
See also "C:/projects/caffe/build/CMakeFiles/CMakeOutput.log".
See also "C:/projects/caffe/build/CMakeFiles/CMakeError.log".
ERROR: Configure failed

c:\projects\caffe>

DI

unread,
Mar 12, 2017, 1:57:23 AM3/12/17
to Caffe Users
Hi,

Where do we find this search path. I downloaded ninja but not able to figure out how to use it for caffe installation on windows10 with cuda8.0
Please help me out

Thanks
DI

Sandareka Wickramanayake

unread,
Jul 26, 2017, 12:09:01 AM7/26/17
to Caffe Users
Hi Paul, 

Were you able to solve this problem? I'm also getting the same error when I try to build Caffe in Windows 10. If you found the solution please be kind enough to post here. 

Thanks!
Reply all
Reply to author
Forward
0 new messages