google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
11.22k stars 2.13k forks source link

Installation error windows VS 2019 #1371

Closed bernalde closed 5 years ago

bernalde commented 5 years ago

Hi guys, after trying to compile from source the OR-Tools (I have a local installation of CPLEX, Gurobi and SCIP which I would like to use eventually to solve the model I'm writing) I found the following error that I could not solve C:\Users\debernal\GitHub\or-tools>tools\make.exe python makefiles/Makefile.port.mk:138: "Unrecognized visual studio version" copy dependencies\\install\\bin\\protoc.exe dependencies\\sources\\protobuf-3.7.1\\src The system cannot find the file specified. tools\make.exe: *** [dependencies/sources/protobuf-3.7.1/python/google/protobuf/descriptor_pb2.py] Error 1 I followed all the installation steps including git + cmake + VS installation and compilation from the x64 terminal from VS but couldn't get past this error. I hope you can give me a hand with this since I haven't been able to figure it out.

lperron commented 5 years ago

I have pushed the support on the master branch.

Can you test it ?

Thanks Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le ven. 21 juin 2019 à 10:34, David Bernal notifications@github.com a écrit :

Hi guys, after trying to compile from source the OR-Tools (I have a local installation of CPLEX, Gurobi and SCIP which I would like to use eventually to solve the model I'm writing) I found the following error that I could not solve C:\Users\debernal\GitHub\or-tools>tools\make.exe python makefiles/ Makefile.port.mk:138: "Unrecognized visual studio version" copy dependencies\install\bin\protoc.exe dependencies\sources\protobuf-3.7.1\src The system cannot find the file specified. tools\make.exe: *** [dependencies/sources/protobuf-3.7.1/python/google/protobuf/descriptor_pb2.py] Error 1 I followed all the installation steps including git + cmake + VS installation and compilation from the x64 terminal from VS but couldn't get past this error. I hope you can give me a hand with this since I haven't been able to figure it out.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3K4GRVMVXO6GRWQJLDP3SHADA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2474BA, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUPL3NOLGIXNEBTSDT7QZ3P3SHADANCNFSM4H2OYFNQ .

bernalde commented 5 years ago

Unfortunately now the error appears after the third_party command as follows:

...
 Eclipse CDT4 - MinGW Makefiles
                               = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

tools\make.exe: *** [dependencies\sources\protobuf-3.8.0\cmake\build\protobuf.sln] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python
makefiles/Makefile.port.mk:138: "Unrecognized visual studio version"
copy dependencies\\install\\bin\\protoc.exe dependencies\\sources\\protobuf-3.8.0\\src
The system cannot find the file specified.
tools\make.exe: *** [dependencies/sources/protobuf-3.8.0/python/google/protobuf/descriptor_pb2.py] Error 1

C:\Users\debernal\GitHub\or-tools>
lperron commented 5 years ago

It should be the same with make third_party and make python.

are you on the master branch ? (which is not the default) Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le ven. 21 juin 2019 à 11:04, David Bernal notifications@github.com a écrit :

Unfortunately now the error appears after the third_party command as follows:

... Eclipse CDT4 - MinGW Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

tools\make.exe: *** [dependencies\sources\protobuf-3.8.0\cmake\build\protobuf.sln] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python makefiles/Makefile.port.mk:138: "Unrecognized visual studio version" copy dependencies\install\bin\protoc.exe dependencies\sources\protobuf-3.8.0\src The system cannot find the file specified. tools\make.exe: *** [dependencies/sources/protobuf-3.8.0/python/google/protobuf/descriptor_pb2.py] Error 1

C:\Users\debernal\GitHub\or-tools>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3MOOGRGXKZJ55PG7ITP3SKQTA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYH4ZAQ#issuecomment-504351874, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUPL3NS746BUVEZYB5MXR3P3SKQTANCNFSM4H2OYFNQ .

bernalde commented 5 years ago

I am, yes. I don't know what else could it be. I removed all the files twice and still got the same error.

On Fri, Jun 21, 2019, 2:23 AM Laurent Perron notifications@github.com wrote:

It should be the same with make third_party and make python.

are you on the master branch ? (which is not the default) Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le ven. 21 juin 2019 à 11:04, David Bernal notifications@github.com a écrit :

Unfortunately now the error appears after the third_party command as follows:

... Eclipse CDT4 - MinGW Makefiles = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Ninja = Generates Eclipse CDT 4.0 project files. Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.

tools\make.exe: *** [dependencies\sources\protobuf-3.8.0\cmake\build\protobuf.sln] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python makefiles/Makefile.port.mk:138: "Unrecognized visual studio version" copy dependencies\install\bin\protoc.exe dependencies\sources\protobuf-3.8.0\src The system cannot find the file specified. tools\make.exe: *** [dependencies/sources/protobuf-3.8.0/python/google/protobuf/descriptor_pb2.py] Error 1

C:\Users\debernal\GitHub\or-tools>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3MOOGRGXKZJ55PG7ITP3SKQTA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYH4ZAQ#issuecomment-504351874 , or mute the thread < https://github.com/notifications/unsubscribe-auth/ACUPL3NS746BUVEZYB5MXR3P3SKQTANCNFSM4H2OYFNQ

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACB7FILLBZ7IOKE5GZMZTLLP3SMZBA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYH6HLQ#issuecomment-504357806, or mute the thread https://github.com/notifications/unsubscribe-auth/ACB7FIKYRQWPAJTVJ4T7BE3P3SMZBANCNFSM4H2OYFNQ .

lperron commented 5 years ago

Can you debug the Makefile.port.mk part

Are you running the visual studio 2019 x64 command line ?

bernalde commented 5 years ago

Can you debug the Makefile.port.mk part


# Util variables
SPACE := $(empty) $(empty)
BACKSLASH_SPACE := $(empty)\ $(empty)

Let's discover something about where we run

ifeq ($(OS),Windows_NT) OS = Windows endif ifeq ($(OS),Windows) SYSTEM = win else SYSTEM = unix endif

Unix specific part.

ifeq ($(SYSTEM),unix) OR_TOOLS_TOP ?= $(shell pwd) OS = $(shell uname -s) ifeq ($(UNIX_PYTHON_VER),) ifeq ($(shell which python3),) DETECTED_PYTHON_VERSION := $(shell python -c "from sys import version_info as v; print (str(v[0]) + '.' + str(v[1]))") else DETECTED_PYTHON_VERSION := $(shell python3 -c "from sys import version_info as v; print (str(v[0]) + '.' + str(v[1]))") endif else DETECTED_PYTHON_VERSION := $(UNIX_PYTHON_VER) endif

ifeq ($(OS),Linux) PLATFORM = LINUX CODEPORT = OpSys-Linux LBITS = $(shell getconf LONG_BIT) DISTRIBUTION_ID = $(shell lsb_release -i -s) DISTRIBUTION_NUMBER = $(shell lsb_release -r -s) DISTRIBUTION = $(DISTRIBUTION_ID)-$(DISTRIBUTION_NUMBER) ifeq ($(LBITS),64) NETPLATFORM = anycpu PORT = $(DISTRIBUTION)-64bit PTRLENGTH = 64 GUROBI_PLATFORM=linux64 CANDIDATE_JDK_ROOTS = \ /usr/lib/jvm/default-java \ /usr/lib/jvm/java-11-openjdk-amd64 \ /usr/lib/jvm/java-1.11.0-openjdk-amd64 \ /usr/lib/jvm/java-9-openjdk-amd64 \ /usr/lib/jvm/java-8-openjdk-amd64 \ /usr/lib/jvm/java-1.8.0-openjdk-amd64 \ /usr/lib/jvm/java-1.8.0-openjdk \ /usr/lib/jvm/java-7-openjdk-amd64 \ /usr/lib/jvm/java-1.7.0-openjdk.x86_64 \ /usr/lib/jvm/java-1.7.0-openjdk \ /usr/lib/jvm/java-6-openjdk-amd64 \ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64 \ /usr/lib64/jvm/java-6-sun-1.6.0.26 \ /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0 \ /usr/local/buildtools/java/jdk else NETPLATFORM = x86 PORT = $(DISTRIBUTION)-32bit PTRLENGTH = 32 GUROBI_PLATFORM=linux32 CANDIDATE_JDK_ROOTS = \ /usr/local/buildtools/java/jdk-32 \ /usr/lib/jvm/java-1.11.0-openjdk-i386 \ /usr/lib/jvm/java-1.9.0-openjdk-i386 \ /usr/lib/jvm/java-1.8.0-openjdk-i386 \ /usr/lib/jvm/java-1.7.0-openjdk-i386 \ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0 \ /usr/lib/jvm/java-6-sun-1.6.0.26 \ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86 \ /usr/lib/jvm/java-6-openjdk-i386 \ /usr/lib/jvm/java-7-openjdk-i386

endif
JAVA_HOME ?= $(firstword $(wildcard $(CANDIDATE_JDK_ROOTS)))

endif # ($(OS),Linux) ifeq ($(OS),Darwin) # Assume Mac OS X PLATFORM = MACOSX OS_VERSION = $(shell sw_vers -productVersion) PORT = MacOsX-$(OS_VERSION) CODEPORT = OpSys-OSX NETPLATFORM = x64 PTRLENGTH = 64 GUROBI_PLATFORM=mac64 ifeq ($(wildcard /usr/libexec/java_home),) JAVA_HOME = \# /usr/libexec/java_home could not be found on your system. Set this variable to the path to jdk to build the java files. else JAVA_HOME ?= $(shell /usr/libexec/java_home) endif MAC_MIN_VERSION = 10.9 endif # ($(OS),Darwin) endif # ($(SYSTEM),unix)

Windows specific part.

ifeq ($(SYSTEM),win)

Detect 32/64bit

ifeq ("$(Platform)","X64") # Visual Studio 2015/2017 64 bit PLATFORM = WIN64 PTRLENGTH = 64 CMAKE_SUFFIX = Win64 CBC_PLATFORM_PREFIX = x64 GLPK_PLATFORM = w64 NETPLATFORM = x64 else ifeq ("$(Platform)","x64") # Visual studio 2013 64 bit PLATFORM = WIN64 PTRLENGTH = 64 CMAKE_SUFFIX = Win64 CBC_PLATFORM_PREFIX = x64 GLPK_PLATFORM = w64 NETPLATFORM = x64 else # Visual Studio 32 bit (soon obsolete) PLATFORM = Win32 PTRLENGTH = 32 CMAKE_SUFFIX = CBC_PLATFORM_PREFIX = Win32 GLPK_PLATFORM = w32 NETPLATFORM = x86 endif endif

Detect visual studio version

ifeq ("$(VisualStudioVersion)","12.0") VISUAL_STUDIO_YEAR = 2013 VISUAL_STUDIO_MAJOR = 12 VS_RELEASE = v120 else ifeq ("$(VisualStudioVersion)","14.0") VISUAL_STUDIO_YEAR = 2015 VISUAL_STUDIO_MAJOR = 14 VS_RELEASE = v140 else ifeq ("$(VisualStudioVersion)","15.0") VISUAL_STUDIO_YEAR = 2017 VISUAL_STUDIO_MAJOR = 15 VS_RELEASE = v141 else $(warning "Unrecognized visual studio version") endif endif endif

OS Specific

OS = Windows OR_TOOLS_TOP_AUX = $(shell cd) OR_TOOLS_TOP = $(shell echo $(OR_TOOLS_TOP_AUX) | tools\win\sed.exe -e "s/\/\\/g" | tools\win\sed.exe -e "s/ //g") CODEPORT = OpSys-Windows

Compiler specific

PORT = VisualStudio$(VISUAL_STUDIO_YEAR)-$(PTRLENGTH)bit VS_COMTOOLS = $(VISUAL_STUDIO_MAJOR)0

ifeq ("$(CMAKE_SUFFIX)","") CMAKE_PLATFORM = "Visual Studio $(VISUAL_STUDIO_MAJOR) $(VISUAL_STUDIO_YEAR)" else CMAKE_PLATFORM = "Visual Studio $(VISUAL_STUDIO_MAJOR) $(VISUAL_STUDIO_YEAR) $(CMAKE_SUFFIX)" endif

Third party specific

CBC_PLATFORM = $(CBC_PLATFORM_PREFIX)-$(VS_RELEASE)-Release

Java specific

ifeq ($(JAVA_HOME),) SELECTED_PATH_TO_JDK = JAVA_HOME = # JAVA_HOME is not set on your system. Set it to the path to jdk to build the java files. else SELECTED_PATH_TO_JDK = JAVA_HOME = $(JAVA_HOME) endif

Detect Python

ifeq ($(WINDOWS_PATH_TO_PYTHON),) DETECTED_PATH_TO_PYTHON = $(shell python -c "from sys import executable; from os.path import sep; print(sep.join(executable.split(sep)[:-1]).rstrip())") CANONIC_DETECTED_PATH_TO_PYTHON = $(subst $(SPACE),$(BACKSLASH_SPACE),$(subst \,/,$(subst \,/,$(DETECTED_PATH_TO_PYTHON)))) ifeq ($(wildcard $(CANONIC_DETECTED_PATH_TO_PYTHON)),) SELECTED_PATH_TO_PYTHON = WINDOWS_PATH_TO_PYTHON =# python was not found. Set this variable to the path to python to build the python files. Don\'t include the name of the executable in the path! (ex: WINDOWS_PATH_TO_PYTHON = c:\python27-64) else SELECTED_PATH_TO_PYTHON = WINDOWS_PATH_TO_PYTHON = $(DETECTED_PATH_TO_PYTHON) WINDOWS_PATH_TO_PYTHON = $(DETECTED_PATH_TO_PYTHON) endif else SELECTED_PATH_TO_PYTHON = WINDOWS_PATH_TO_PYTHON = $(WINDOWS_PATH_TO_PYTHON) endif ifneq ($(WINDOWS_PATH_TO_PYTHON),) WINDOWS_PYTHON_VERSION = $(shell "$(WINDOWS_PATH_TO_PYTHON)\python" -c "from sys import version_info as v; print (str(v[0]) + str(v[1]))") endif endif # ($(SYSTEM),win)

Get github revision level

ifneq ($(wildcard .git),) ifneq ($(wildcard .git/shallow),) $(warning you are using a shallow copy) GIT_REVISION:= 9999 else GIT_REVISION:= $(shell git rev-list --count HEAD) endif GIT_HASH:= $(shell git rev-parse --short HEAD) else GIT_REVISION:= 9999 GIT_HASH:= "not_on_git" endif

OR_TOOLS_VERSION := $(OR_TOOLS_MAJOR).$(OR_TOOLS_MINOR).$(GIT_REVISION) OR_TOOLS_SHORT_VERSION := $(OR_TOOLS_MAJOR).$(OR_TOOLS_MINOR) ifdef PRE_RELEASE OR_TOOLS_VERSION := $(OR_TOOLS_VERSION)-beta OR_TOOLS_SHORT_VERSION := $(OR_TOOLS_SHORT_VERSION)-beta endif INSTALLDIR = or-tools$(PORT)_v$(OR_TOOLS_VERSION) FZ_INSTALL_DIR = or-toolsflatzinc$(PORT)_v$(OR_TOOLS_VERSION) DATA_INSTALL_DIR = or-tools_data_v$(OR_TOOLS_VERSION)

.PHONY: detect_port # Show variables used to build OR-Tools. detect_port: @echo Relevant info on the system: @echo SYSTEM = $(SYSTEM) @echo OS = $(OS) @echo PLATFORM = $(PLATFORM) @echo PTRLENGTH = $(PTRLENGTH) @echo PORT = $(PORT) @echo SHELL = $(SHELL) @echo OR_TOOLS_TOP = $(OR_TOOLS_TOP) @echo OR_TOOLS_VERSION = $(OR_TOOLS_VERSION) @echo OR_TOOLS_SHORT_VERSION = $(OR_TOOLS_SHORT_VERSION) @echo GIT_REVISION = $(GIT_REVISION) @echo GIT_HASH = $(GIT_HASH) @echo CMAKE = $(CMAKE) ifeq ($(SYSTEM),win) @echo CMAKE_PLATFORM = $(CMAKE_PLATFORM) endif @echo SWIG_BINARY = $(SWIG_BINARY) @echo SWIG_INC = $(SWIG_INC) ifeq ($(SYSTEM),win) @echo off & echo( else @echo endif



> Are you running the visual studio 2019 x64 command line ?
Yes I am
bernalde commented 5 years ago

After pulling the latest master version the command tools\make.exe third_party went through the compilation but now the error apparently is elsewhere:

  C:\Users\debernal\GitHub\or-tools\dependencies\sources\Cbc-2.10.3\Clp\src\OsiClp\OsiClpSolverInterface.hpp(400,65): w
arning C4309:  'static_cast': truncation of constant value [C:\Users\debernal\GitHub\or-tools\dependencies\sources\Cbc-
2.10.3\Cbc\MSVisualStudio\v10\cbc\cbc.vcxproj]

    487 Warning(s)
    0 Error(s)

Time Elapsed 00:06:55.68
copy dependencies\sources\Cbc-2.10.3\Cbc\MSVisualStudio\v10\-v142-Release\*.lib dependencies\install\lib\coin
The system cannot find the path specified.
tools\make.exe: *** [dependencies\install\bin\cbc.exe] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python
lperron commented 5 years ago

Please have a look at the copy part in Makefile.third_party.win.mk and compare it with the content of sources/Cbc-2.10.3/Cbc/MSVisualStudio/... Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le ven. 21 juin 2019 à 19:41, David Bernal notifications@github.com a écrit :

After pulling the latest master version the command tools\make.exe third_party went through the compilation but now the error apparently is elsewhere:

C:\Users\debernal\GitHub\or-tools\dependencies\sources\Cbc-2.10.3\Clp\src\OsiClp\OsiClpSolverInterface.hpp(400,65): w arning C4309: 'static_cast': truncation of constant value [C:\Users\debernal\GitHub\or-tools\dependencies\sources\Cbc- 2.10.3\Cbc\MSVisualStudio\v10\cbc\cbc.vcxproj]

487 Warning(s)
0 Error(s)

Time Elapsed 00:06:55.68 copy dependencies\sources\Cbc-2.10.3\Cbc\MSVisualStudio\v10-v142-Release*.lib dependencies\install\lib\coin The system cannot find the path specified. tools\make.exe: *** [dependencies\install\bin\cbc.exe] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3ITHICF7IXR3UVWL6LP3UHEJA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJDSWA#issuecomment-504510808, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUPL3N4QHCN2OKL3EUQ44TP3UHEJANCNFSM4H2OYFNQ .

bernalde commented 5 years ago

I copied the cbc.exe file from \or-tools\dependencies\sources\Cbc-2.10.3\Cbc\MSVisualStudio\v10\x64-v142-Release (as suggested by the Makefile.third_party.win.mk file) directly into dependencies\install\bin and after running tools\make.exe python I encountered another error

md ortools\\gen\\ortools\\algorithms
"dependencies\\install\\swigwin-3.0.12\\swig.exe" -I"dependencies/install/include" -I"dependencies/install/include" -DGFLAGS_DLL_DECL= -DGFLAGS_DLL_DECLARE_FLAG= -DGFLAGS_DLL_DEFINE_FLAG= -I"dependencies/install/include" -DGOOGLE_GLOG_DLL_DECL= -I"dependencies/install/include" -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CLP -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CBC -DUSE_GLOP -DUSE_BOP -DABSL_MUST_USE_RESULT  -I""C:\Program Files\SCIPOptSuite 6.0.1"/include" -DUSE_SCIP -I""C:\gurobi811\win64"/win32/include" -DUSE_GUROBI -I""C:\Program Files\IBM\ILOG\CPLEX_Studio128\cplex"/include" -DUSE_CPLEX -I. -c++ -python -py3 -DPY3 \
 -o ortools\\gen\\ortools\\algorithms\\knapsack_solver_python_wrap.cc \
 -module pywrapknapsack_solver \
 ortools\\algorithms\\python\\knapsack_solver.i
swig error : Unrecognized option Files\SCIPOptSuite
swig error : Unrecognized option 6.0.1/include
swig error : Unrecognized option Files\IBM\ILOG\CPLEX_Studio128\cplex/include
Use 'swig -help' for available options.
tools\make.exe: *** [ortools/gen/ortools/algorithms/pywrapknapsack_solver.py] Error 1

It seems like it does not like to have blank spaces in the location of CPLEX and SCIP (although by default in a Windows Machine both software get intalled in the Program Files folder).

lperron commented 5 years ago

OK. This is the reason. I know the makefile does protect some of the paths by "". You can try giving the dos name (progra~1) instead. Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le ven. 21 juin 2019 à 23:48, David Bernal notifications@github.com a écrit :

I copied the cbc.exe file directly into dependencies/install/bin and after running tools\make.exe python I encountered another error

md ortools\gen\ortools\algorithms "dependencies\install\swigwin-3.0.12\swig.exe" -I"dependencies/install/include" -I"dependencies/install/include" -DGFLAGS_DLL_DECL= -DGFLAGS_DLL_DECLARE_FLAG= -DGFLAGS_DLL_DEFINE_FLAG= -I"dependencies/install/include" -DGOOGLE_GLOG_DLL_DECL= -I"dependencies/install/include" -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CLP -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CBC -DUSE_GLOP -DUSE_BOP -DABSL_MUST_USE_RESULT -I""C:\Program Files\SCIPOptSuite 6.0.1"/include" -DUSE_SCIP -I""C:\gurobi811\win64"/win32/include" -DUSE_GUROBI -I""C:\Program Files\IBM\ILOG\CPLEX_Studio128\cplex"/include" -DUSE_CPLEX -I. -c++ -python -py3 -DPY3 \ -o ortools\gen\ortools\algorithms\knapsack_solver_python_wrap.cc \ -module pywrapknapsack_solver \ ortools\algorithms\python\knapsack_solver.i swig error : Unrecognized option Files\SCIPOptSuite swig error : Unrecognized option 6.0.1/include swig error : Unrecognized option Files\IBM\ILOG\CPLEX_Studio128\cplex/include Use 'swig -help' for available options. tools\make.exe: *** [ortools/gen/ortools/algorithms/pywrapknapsack_solver.py] Error 1

It seems like it does not like to have blank spaces in the location of CPLEX and SCIP (although by default in a Windows Machine both software get intalled in the Program Files folder).

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3LQXPTBZZ3M43PHOLTP3VECDA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYJVJVY#issuecomment-504583383, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUPL3LKOHCKZEQTXC3QKJLP3VECDANCNFSM4H2OYFNQ .

bernalde commented 5 years ago

Ok I think I have found the source of error. The warning Only visual studio 2017 and up 64 bit is supported is being issued regardless of me executing everything from the x64 native tools for VS 2019. Then CBC_PLATFORM_PREFIX is never set and the files of CBC are never pasted. I couldn't track down the part where the variable PLATFORM is defined, where I wanted to edit it. Any suggestions?

lperron commented 5 years ago

can you print the result of 'make detect_port'

bernalde commented 5 years ago

C:\Users\debernal\GitHub\or-tools>tools\make.exe detect_port
makefiles/Makefile.port.mk:105: "Only visual studio 2017 and up 64 bit is supported"
Relevant info on the system:
SYSTEM = win
OS = Windows
PLATFORM =
PTRLENGTH =
PORT = VisualStudio2019-bit
SHELL = sh.exe
OR_TOOLS_TOP = C:\\Users\\debernal\\GitHub\\or-tools
OR_TOOLS_VERSION = 7.1.6897
OR_TOOLS_SHORT_VERSION = 7.1
GIT_REVISION = 6897
GIT_HASH = bd6c747ef
CMAKE = C:\Program Files\CMake\bin\cmake.EXE
CMAKE_PLATFORM = "Visual Studio 16 2019"
SWIG_BINARY = "dependencies\\install\\swigwin-3.0.12\\swig.exe"
SWIG_INC = -I"dependencies/install/include" -I"dependencies/install/include" -DGFLAGS_DLL_DECL= -DGFLAGS_DLL_DECLARE_FLAG= -DGFLAGS_DLL_DEFINE_FLAG= -I"dependencies/install/include" -DGOOGLE_GLOG_DLL_DECL= -I"dependencies/install/include" -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CLP -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CBC -DUSE_GLOP -DUSE_BOP -DABSL_MUST_USE_RESULT  -I""C:\PROGRA~1\SCIPOptSuite 6.0.1"/include" -DUSE_SCIP -I""C:\gurobi811\win64"/win32/include" -DUSE_GUROBI -I""C:\PROGRA~1\IBM\ILOG\CPLEX_Studio128\cplex"/include" -DUSE_CPLEX
lperron commented 5 years ago

can you update and retry ?

bernalde commented 5 years ago

I did and now the problem happens while doing make third_party as follows:

tools\win\wget.exe --quiet -P dependencies\archives --no-check-certificate https://github.com/google/protobuf/archive/v3.8.0.zip
tools\win\unzip.exe -q -d dependencies\sources dependencies\archives\v3.8.0.zip
md dependencies\sources\protobuf-3.8.0\cmake\build
tools\win\sed.exe -i -e '/\"\/MD\"/d' dependencies\sources\protobuf-3.8.0\cmake\CMakeLists.txt
cd dependencies\sources\protobuf-3.8.0\cmake\build && "C:\Program Files\CMake\bin\cmake.EXE" -G "Visual Studio 16 2019 Win64" -Dprotobuf_BUILD_TESTS=OFF ..
CMake Error: Could not create named generator Visual Studio 16 2019 Win64

which leads to


tools\make.exe: *** [dependencies\sources\protobuf-3.8.0\cmake\build\protobuf.sln] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe python
tools\win\mkdir.exe -p ortools\\gen
tools\win\mkdir.exe -p ortools\\gen\\ortools
copy ortools\\__init__.py ortools\\gen\\ortools\\__init__.py
        1 file(s) copied.
copy dependencies\\install\\bin\\protoc.exe dependencies\\sources\\protobuf-3.8.0\\src
The system cannot find the file specified.
tools\make.exe: *** [dependencies/sources/protobuf-3.8.0/python/google/protobuf/descriptor_pb2.py] Error 1
lperron commented 5 years ago

You need to upgrade cmake to a recent version:

see https://cmake.org/cmake/help/v3.14/release/3.14.html

I would suggest 3.14.5

bernalde commented 5 years ago

I think I have an ever newer version:

C:\Users\debernal\GitHub\or-tools>cmake --version
cmake version 3.15.0-rc2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Should I downgrade it?

lperron commented 5 years ago

OK. Please update and retry

bernalde commented 5 years ago

Alright, it appears that the problem in the third_party issue were solved. I now encounter this error

md ortools\\gen\\ortools\\algorithms
"dependencies\\install\\swigwin-3.0.12\\swig.exe" -I"dependencies/install/include" -I"dependencies/install/include" -DGFLAGS_DLL_DECL= -DGFLAGS_DLL_DECLARE_FLAG= -DGFLAGS_DLL_DEFINE_FLAG= -I"dependencies/install/include" -DGOOGLE_GLOG_DLL_DECL= -I"dependencies/install/include" -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CLP -I"dependencies/install/include" -I"dependencies/install/include/coin" -DUSE_CBC -DUSE_GLOP -DUSE_BOP -DABSL_MUST_USE_RESULT  -I""C:\PROGRA~1\SCIPOptSuite 6.0.1"/include" -DUSE_SCIP -I""C:\gurobi811\win64"/win64/include" -DUSE_GUROBI -I""C:\PROGRA~1\IBM\ILOG\CPLEX_Studio128\cplex"/include" -DUSE_CPLEX -I. -c++ -python -py3 -DPY3 \
 -o ortools\\gen\\ortools\\algorithms\\knapsack_solver_python_wrap.cc \
 -module pywrapknapsack_solver \
 ortools\\algorithms\\python\\knapsack_solver.i
swig error : Unrecognized option 6.0.1/include
Use 'swig -help' for available options.
tools\make.exe: *** [ortools/gen/ortools/algorithms/pywrapknapsack_solver.py] Error 1

C:\Users\debernal\GitHub\or-tools>tools\make.exe install_python
makefiles/Makefile.third_party.win.mk:63: *** Third party SCIP files was not found! please check the path given to WINDOWS_SCIP_DIR.  Stop.

where it seems like the SCIP directory name (containing a space by default) leads to an error. I also looks like the Gurobi path should not include the win64 folder part. And just in case, if one installs CPLEX through CPLEX Studeio, the headers are one folder under include as in .../cplex/include/ilcplex/*.h

lperron commented 5 years ago

Scip support is broken (again). I have fixed in on linux, maybe mac. I have not yet looked at windows.

lperron commented 5 years ago

OK. I pushed a working version. Please update.

Note, as I touched the makefiles, Makefile.local will be deleted. So keep a copy

I used the installed version of scip opt suite 6.0.1

In makefile.local, I set

WINDOWS_SCIP_DIR=c:\progra\~1\SCIPOP\~1.1 # DOS paths

You need to have c:\Program Files\SCIPOptSuite 6.0.1\bin in your path (to get scip.dll).

After that, it works.

bernalde commented 5 years ago

I think there is still a bug in the SCIP part. I replaced the path as follows: WINDOWS_SCIP_DIR = "C:\PROGRA~1\SCIPOP~1.1" And I still get the message that you introduced in the latest commit makefiles/Makefile.third_party.win.mk:63: *** Third party SCIP files was not found! please check the path given to WINDOWS_SCIP_DIR. Stop. I'm sure that the files exist as the following output shows:

C:\PROGRA~1\SCIPOP~1.1\include\scip>dir scip.h
 Volume in drive C is windows 7
 Volume Serial Number is DA42-4431

 Directory of C:\PROGRA~1\SCIPOP~1.1\include\scip

01/25/2019  07:43 AM             5,858 scip.h
               1 File(s)          5,858 bytes
               0 Dir(s)  109,225,123,840 bytes free

C:\PROGRA~1\SCIPOP~1.1\include\scip>

I thought it might be a permissions issue but still got the same outcome after running the x64 command prompt as an admin.

lperron commented 5 years ago

Try without using the "" Laurent Perron | Operations Research | lperron@google.com | (33) 1 42 68 53 00

Le lun. 24 juin 2019 à 23:58, David Bernal notifications@github.com a écrit :

I think there is still a bug in the SCIP part. I replaced the path as follows: WINDOWS_SCIP_DIR = "C:\PROGRA~1\SCIPOP~1.1" And I still get the message that you introduced in the latest commit makefiles/Makefile.third_party.win.mk:63: *** Third party SCIP files was not found! please check the path given to WINDOWS_SCIP_DIR. Stop. I'm sure that the files exist as the following output shows:

C:\PROGRA~1\SCIPOP~1.1\include\scip>dir scip.h Volume in drive C is windows 7 Volume Serial Number is DA42-4431

Directory of C:\PROGRA~1\SCIPOP~1.1\include\scip

01/25/2019 07:43 AM 5,858 scip.h 1 File(s) 5,858 bytes 0 Dir(s) 109,225,123,840 bytes free

C:\PROGRA~1\SCIPOP~1.1\include\scip>

I thought it might be a permissions issue but still got the same outcome after running the x64 command prompt as an admin.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/1371?email_source=notifications&email_token=ACUPL3KEGFBFH4UB6LB673TP4E7RTA5CNFSM4H2OYFN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYOLIVA#issuecomment-505197652, or mute the thread https://github.com/notifications/unsubscribe-auth/ACUPL3IOU4FNGSLVJMOMNJLP4E7RTANCNFSM4H2OYFNQ .

bernalde commented 5 years ago

Thank you for the help! This worked out. I just wanted to finally let you notice that one has to modify the Makefile.win.mk file to point to the actual CPLEX Library similarly to issue #1181 In my case it was: STATIC_CPLEX_LNK = "$(WINDOWS_CPLEX_DIR)\\lib\\x64_windows_vs2017\\stat_mda\\cplex1280.lib" As suggested in the other issue, specifying a CPLEX_LIB_VERSION variable in Makefile.localsimilar to GUROBI_LIB_VERSION could be useful.