Third party SCIP files was not found when I build the source code of OR-Tools in compile OR-Tools using tools\make cc - c++

I have made new file 'Makefile.local' and add "WINDOWS_SCIP_DIR=c:/Program Files/SCIPOptSuite" to the file.
SCIP is also compiled and the file path is correct.

We have recently updated the installation instructions here:
https://developers.google.com/optimization/install/cpp/source_windows
Can you check them against what you did?
Thanks

You must use a path without space since Makefile can't support it everywhere on a windows prompt (e.g. wildcard function in Makefile inside a if command).
if you have installed SCIP using the SCIPOptSuite 6.0.2 64bits Windows installer it should be located in %ProgramFiles%\SCIPOptSuite 6.0.2 first you need to find the short name version for each directories
dir "%ProgramFiles%*" /x
...
Directory of C:\
01/06/2020 10:35 AM <DIR> PROGRA~1 Program Files
dir "%ProgramFiles%\SCIP*" /x
...
01/06/2020 10:35 AM <DIR> SCIPOP~1.2 SCIPOptSuite 6.0.2
so in my case I can use:
set WINDOWS_SCIP_DIR=C:\PROGRA~1\SCIPOP~1.2
then you can check using:
cd <path_to_your_ortools_source_install>
set PATH=%PATH%;tools;tools\win
make check_third_party
to test you can run the sample examples/integer_programming.cc using:
make rcc_integer_programming

Related

could not find "vswhere"

I'm trying to install boost to run PyGMO properly. However, after I unpack it in a directory (did not use git).
After running bootstrap vc142 (I'm using VScode V1.63.2 and I'm on windows). I'm getting this error:
Building Boost.Build engine
LOCALAPPDATA=C:\Users\wojci\AppData\Local
could not find "vswhere"
Call_If_Exists "..\bin\VCVARS32.BAT"
###
### Using 'msvc' toolset.
###
Followed by:
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>dir *.exe
Volume in drive C has no label.
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>copy /b .\b2.exe .\bjam.exe
The system cannot find the file specified.
Failed to build Boost.Build engine.
Does anyone know how to fix/work around this?
Thank you in advance
I found the solution here (git)
Prerequisites:
First download and install MinGW installer mingw-w64-install.exe (I fot it from Sourceforge) and make sure you use x86_64 architecture.
Then download the boost file (boost_1_78_0.zip source)
Open and run cmd as admin
Enter the following command to link the MinFW folder in C:\
mklink /J C:\MinGW "C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64"
add MinGW to the system PATH:
set PATH=%PATH%;C:\MinGW\bin
setx /M PATH "%PATH%"
Check if you have at least g++ version of 8.1.0
g++ --version
Methodology to install boost:
Navigate to the install folder created and unzip and extract the boost_1_78_0.zip file into this folder
In the CMD navigated to the boost folder
cd C:\install\boost_1_78_0
Type the following to make directories for building and installing boost
mkdir C:\boost-build
mkdir C:\install\boost_1_78_0\boost-build
mkdir C:\boost
Setup boost.build (second line prepers b2, the third line builds boost.build with b2, and the fourth line adds C:\boost-build\bin to your session PATH variable)
cd C:\install\boost_1_78_0\tools\build
bootstrap.bat gcc
b2 --prefix="C:\boost-build" install
set PATH=%PATH%;C:\boost-build\bin
building boost (first line navigateds to boost directory, second line builds boost with b2 this can take a while)
cd C:\install\boost_1_78_0
b2 --build-dir="C:\install\boost_1_78_0\build" --build-type=complete --prefix="C:\boost" toolset=gcc install
Extra notes:
This should work for boost 1.68.0 too and might work for other version just replace 1_78_0 with 1_68_0.
At the end you should have three lines that look something like this:
...failed updating 72 targets...
...skipped 292 targets...
...updated 22164 targets...
It's totally fine if you have some failed and skipped files.
Type "native tools " in the start search.
Run "Native tools for visual studio" as an administrator. A command prompt opens.
change directory to boost .
run command "bootstrap".
Follow up by ".\b2".
Wait for a while.
Worked for me. Hope it helps.

Cannot build Soundpipe DSP library on Windows

I've found the lightweight DSP c library - Soundpipe.
I want to use some filters from it. I do not really need binary files, but the problem is that the repository doesn't have its main header file - soundpipe.h. As I understand, this is because the library uses specific modules ported from Csound and FAUST languages. Also the repository's readme doesn't have installation guide for Windows. It says:
By default, Soundpipe needs libsndfile, and a standard build
environment. Other modules that use other external libraries will need
to be explicitly compiled by modifying config.mk (note: but the Makefile's folder doesn't contain config.mk, there is only config.def.mk)
To compile:
make
sudo make install
Ok, I've downloaded and installed libsndfile.
Then I have tried to use MSVC's nmake - it doesn't work:
makefile(7) : fatal error U1036: syntax error : too many names to left of '='
Stop.
Here is the beginning of the makefile:
> .PHONY: all clean install docs bootstrap
>
> default: all
>
> VERSION = 1.5.0
>
> INTERMEDIATES_PREFIX ?= . PREFIX ?= /usr/local
> ...
After that I've downloaded MinGW, mingw32-make result:
config.mk: No such file or directory
mingw32-make: *** No rule to make target 'config.def.mk', needed by 'config.mk'. Stop.
Ok, when I try to run the configure command, it doesn't work on my Win7 x 64 (sh: ./configure: No such file or directory, etc...)
I have the paths in mt system path variable:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin
Links that I've read:
How Do I Run ./configure with MinGW?
Getting mingw-get to install correctly - mingw/msys path missing plus more!
MinGW's configure doesn't work after reinstalling Git for Windows and GCC_TDM too (No idea how to run configure).
Any ideas how to build the library or at least find missing source files (or make through CSound, Faust, ...) ?
The Soundpipe build system is designed to be used with POSIX environments, of which there are a few to choose from on Windows.
I've been able to build Soundpipe using both MSYS2 and Windows Bash on Windows 10.

Build folder and makefile

The question comes from my puzzlement when compiling a makefile for Deep Learning framework Caffe on Ubuntu, but it relates, I believe, to a more general phenomenon of the nature of compiling a C++ makefile.
After "make all", the resulting files from the compilation were put in a hidden folder: .build_release, not in the respective folders where the cpp files are.
Then when I tried to run the following lines:
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh
I was getting an error that the system does not find the file:
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
But the file actually existed in the .build_release folder.
What happened and how to fix this problem?
The issue is not with make, you simply need to follow the instructions carefully. The BUILD_DIR is specified by Makefile.config. By default this folder is named build. Once you followed the compilation instructions:
cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python)
make all
make test
make runtest
Navigate to build:
cd build
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh

Can't run bjam to compile boost python tutorial

I am trying to follow this tutorial on wrapping C++ code for python for Windows.I installed python.Downloaded the latest version of boost(1_55).First I ran bootstrap.bat to build bjam.exe.Next, I configured boost_1_55_0\tools\build\v2\user-config.jam to use msvc10 compiler and added the path to python installation.
Now,based on the tutorial :
Now we are ready... Be sure to cd to libs/python/example/tutorial
where the tutorial "hello.cpp" and the "Jamroot" is situated.
Finally:
bjam
Trying to run bjam in that directory gives me : "bjam is not recognized as internal or external command" error.What have I missed here? Should user-config.jam reside in another location?Or bjam added to system path?
UPDATE:
Ok.Thanks to #john I had to add bjam to system path.But now,running it,hello_ext.lib is created in \boost_1_55_0\libs\python\example\tutorial\bin\msvc-11.0\debug but not DLL.Based on the tutorial I should get DLL file for the extension.Now, I am not sure how python links with extension.But if I assume it does like C++ then it should have linked with hello_ext.lib.But if run :
python hello.py
which contains imported method from the extension ,the python runtime crashes.Isn't there a comprehensive tutorial on this workflow?Boost doc sucks completely on this.
This worked for me:
1.) unzip boost_1_55_0.zip
2.) Prepare to use the Boost Library Binaries
Go to the boost_1_55_0 root directory and open a command prompt and type following commands:
Bootstrap
3.) Find user-config.jam:
Type following in the command prompt:
ECHO %HOMEDRIVE%%HOMEPATH%
4.) If the user-config.jam is in your homedrive directory please change it there as followed:
ATTENTION:
The .jam language rates a “whitespace” as a separation of arguments!
# -------------------
# MSVC configuration.
# -------------------
# Configure msvc (default version, searched for in standard locations and PATH).
# using msvc ;
# Configure specific msvc version (searched for in standard locations and PATH).
using msvc : 10.0 : C:\\app\\tools\\MSVisualStudio2010\\VC\\bin\\cl.exe ;
….
# ---------------------
# Python configuration.
# ---------------------
# Configure specific Python version.
# using python : 3.1 : /usr/bin/python3 : /usr/include/python3.1 : /usr/lib ;
using python
: 2.5 # Version
: C:\\app\\tools\\Python25\\python.exe # Python Path
: C:\\app\\tools\\Python25\\include # include path
: C:\\app\\tools\\Python25\\libs # lib path(s)
: <define>BOOST_ALL_NO_LIB=1
;
5.) Build the Libraries AFTER configuration!!
Go to the boost_1_55_0 root directory and open a command prompt and type following commands:
.\b2
6.) Copy the user-config.jam to \boost_1_55_0\libs\python\example\tutorial
7.) Go further to \boost_1_55_0\stage\lib\
Rename libboost_python-vc100-mt-gd-1_55.lib to boost_python-vc100-mt-gd-1_55.lib and copy it to
\boost_1_55_0\libs\python\example\tutorial
8.) Now you should have all of these files in the \boost_1_55_0\libs\python\example\tutorial directory
hello.cpp
hello.py
user-config.jam
Jamroot
boost_python-vc100-mt-gd-1_55.lib
bjam.exe
9.) Open a command prompt in \boost_1_55_0\libs\python\example\tutorial
And type following command:
bjam
10.) After successful building..
You should have this file in the directory:
hello_ext.dll
rename this file to:
hello_ext.pyd

Building Boost 1.52 with non-standard location of MinGW

I tried to build Boost from source for 64bit using MinGW (x64) but failed when creating the bjam.exe. Any pointer to help is appreciated. Thanks.
Package: Boost 1.52.0 (download from sourceforge, C:\BoostSrc)
Package: MinGW-w64 (4.7.2-x64 rubenvb, C:\MinGW\rubenvb-4.7.2-64)
I created the following batch file to ensure repeatable building, but things got wrong. I cannot build the bjam.exe with supplied batch file. I'm not using the supplied "bootstrap.bat" as the non-standard installation path of MinGW (I have multiple mingw sets), and I have no MSVC installed in my machine
SET BOOST_VER=boost_1_52_0
SET PATH_MINGW=C:\MinGW\rubenvb-4.7.2-64
SET PATH_BJAM=%~dp0\%BOOST_VER%\tools\build\v2\engine
SET PATH="%PATH_MINGW%\bin"
PUSHD "%PATH_BJAM%"
REM check path
mingw32-make -version
REM error below
build.bat mingw --toolset-root=%PATH_MINGW% --show-locate-target
SET PATH=%OPATH%
POPD
REM ... some more ...
Error message
gcc: error: CreateProcess: No such file or directory
When I type the command directly from command prompt (set the path, go to location and invoke build.bat), it goes smoothly (with warnings which i think can be ignored)
This may solve your issue, but even if it doesn't it's a good idea to change it anyways.
Use a different variable name other than PATH as this is a built in and important windows environment variable, which MINGW may be relying on.
After digging into build.bat located at BOOST_ROOT\tools\build\v2\engine, when supplying "mingw" as the toolset, the script by-passed the "guessing toolset" step and failed to define the variable "BOOST_JAM_TOOLSET_ROOT", leaving calls to gcc-related executables failed.
Now I changed the batch as follow
PUSHD "%PATH_BJAM%"
SET "PATH=%PATH_MINGW%\bin"
REM add the line below
SET "BOOST_JAM_TOOLSET_ROOT=%PATH_MINGW%\"
build.bat mingw --show-locate-target
SET PATH=%OPATH%
I manually set the BOOST_JAM_TOOLSET_ROOT variable from external batch file and this worked fine. Beware of the ending "\" character, as the build.bat inside append the path variable as this:
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
Thanks very much for any comments and suggestions.