BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.12k stars 18.68k forks source link

Ready made Cmake configuration #5877

Open herleeyandi opened 7 years ago

herleeyandi commented 7 years ago

Hello, I am new in caffe windows using CMake. Now I have 2 anaconda in my PC. First contains python 2.7 and others containspython 3.5. I am using windows 7 64bit, CUDA 8.0, and CUDNNv5. I have visual studio 2013 (or we can say v12) and MSVC version=14. However when I am running CMake I have this error. Is there any ready made configuration, we just change what we need. For example like makefile.config of caffe in linux. We just change what version that we want, and specified the path manually. Because in here I want to use anaconda 3 but the script wants me use anaconda 2. In short I want use my Python 3.5. -Thank you-

C:\caffe3\caffe>scripts\build_win.cmd
The system cannot find the drive specified.
The system cannot find the drive specified.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 14
INFO: WITH_NINJA                 = 1
INFO: CMAKE_GENERATOR            = "Ninja"
INFO: CPU_ONLY                   = 0
INFO: CUDA_ARCH_NAME             = Auto
INFO: CMAKE_CONFIG               = Release
INFO: USE_NCCL                   = 0
INFO: CMAKE_BUILD_SHARED_LIBS    = 0
INFO: PYTHON_VERSION             = 2
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: ============================================================
The system cannot find the path specified.
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/amd64/cl.exe -- broken
CMake Error at C:/Program Files/Anaconda2/Library/share/cmake-3.6/Modules/CMakeT
estCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/amd64/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

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

  Run Build Command:"C:/PROGRA~1/ANACON~1/Library/bin/ninja.exe" "cmTC_6265c"

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

  [2/2] Linking C executable cmTC_6265c.exe

  FAILED: cmTC_6265c.exe

  cmd.exe /C "cd .  && "C:\Program Files\Anaconda2\Library\bin\cmake.exe" -E
  vs_link_exe --intdir=CMakeFiles\cmTC_6265c.dir --manifests --
  C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo
  CMakeFiles\cmTC_6265c.dir\testCCompiler.c.obj /out:cmTC_6265c.exe
  /implib:cmTC_6265c.lib /pdb:cmTC_6265c.pdb /version:0.0 /machine:x64 /debug
  /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib
  winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib
  advapi32.lib && cd ."

  RC Pass 1 failed to run.

  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:/caffe3/caffe/build/CMakeFiles/CMakeOutput.log".
See also "C:/caffe3/caffe/build/CMakeFiles/CMakeError.log".
ERROR: Configure failed
willyd commented 7 years ago

Seems to me you want to use MSVC 14.0

INFO: MSVC_VERSION = 14

but you end up using MSVC 12.0:

-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe

Any idea why this is? Is MSVC 12.0 on your path before MSVC 14.0?

In short I want use my Python 3.5

CMake will just pick python.exe on your PATH. Make sure that the command line you use has Python 3.5.

If Ninja keeps erroring try with VS WITH_NINJA=0.

herleeyandi commented 7 years ago

Yes that's why I want to ask can we just manually edit it so I can use proper setting without messing up with my environment variable?

herleeyandi commented 7 years ago

@willyd Wait I just see in build_win.cmd let me try first.

herleeyandi commented 7 years ago

@willyd Finally I have done until this so far. What must I do next?, how can I test this? -Thank you- image

Franzisdrak commented 6 years ago

Finally I have done until this so far. What must I do next?, how can I test this?

How did you fix it? I am having the same issue.