caffe-builder icon indicating copy to clipboard operation
caffe-builder copied to clipboard

Build script chooses gcc over VC if on path.

Open asbe opened this issue 8 years ago • 4 comments

Hi, I accidentially had gcc installed (http://tdm-gcc.tdragon.net) - and this breaks the build script. [Output not pasted - ninja fails a subcommand on the variable "toolset"]

I assume it is a bug and not a feature that gcc is chosen as compiler if available, when running the build_v1*0_x64.cmd scripts?

Asbjørn

asbe avatar Nov 08 '16 10:11 asbe

@asbe Can you echo the PATH after vcvarsall.bat has been called?

Some people have had success by specifying the compiler path like so: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe

willyd avatar Nov 08 '16 13:11 willyd

Hi. I worked around it by removing the gcc compiler suite - but I assume this also could be fixed by checking what compiler is reported used? Literally the first output of your script is "The C compiler identification is MSVC 18.0.21005.1", and when the id was Gnu 5.1 I realized that gcc was used - the Ninja errors were slightly confusing.

I'll try to get around to reinstalling gcc and have a poke around - if it helps.

asbe avatar Nov 08 '16 14:11 asbe

same problem ! vs2013 && tdm installed, tdm is chosen as compiler.

AvenSun avatar Nov 20 '16 13:11 AvenSun

CMake found gcc.exe on your path. You need to it tell it to use cl.exe either by executing:

set CC=cl
set CXX=cl

in a command prompt before you execute CMake or by adding -DCMAKE_C_COMPILER=cl and -DCMAKE_CXX_COMPILER=cl on the cmake command.

Make sure to delete the build folder and start over.

willyd avatar Nov 24 '16 13:11 willyd