How to compile CLOGS library - c++

I want to compile CLOGS library.I follow this manual.
I use Visual Studio 2010,python 3.4 in windows 10 x64.
I didn't know anything about waf building system.I didn't know how to set Boost's include path. So I copy boost to the include path of msvc 10.
when I run python waf configure --without-xsltproc --msvc_version="msvc 10.0"
the result is
It found foreach.hpp but not found program_options.hpp.But they were at same folder.

Visual Studio 2013 (for x64 environment)
boost 1.61.0
clogs 1.5.0
Do install boost prebuilt binary for your VS version(Not source version)
Prebuilt binary should have lib64-msvc-12.0 folder that has boost_program_options-vc120-mt-1_61.lib for program_options build testing.
Set two windows global environments
INCLUDE=C:\yourboostroot;C:\youropenclheaderpath
LIBPATH=C:\yourboostroot\lib64-msvc-12.0;C:\youropencllibpath
Open VS2013 x64 Native Tools Command Prompt
Go to your clogs source root and type
python waf configure --without-doxygen --without-xsltproc
in this case I do not need cl-headers configure options

Related

Installing OR-Tools to Visual Studio 2022

I am trying to write a code using Google's OR-Tools on Microsoft Visual Studio 2022.
I followed the following steps:
Download OR-Tools from Binary on Windows on their website.
Extracted the .zip file in D:\CodeField
Wrote the complete TSP programs of their website on VS.
In Visual Studio, went to Project > Properties > C/C++ > Additional Include Directories
Added "D:\CodeField\or-tools_x64_VisualStudio2022_cpp_v9.5.2237\include"
Clicked Apply then OK then compiled my code.
I am getting a bunch of linking errors "1>ortools.lib(scip_callback.obj) : error LNK2001: unresolved external symbol SCIPconshdlrGetData".
what should I do?
Try adding the lib folder in linker settings and link ortools_full.lib. If there are other errors try changing the runtime library to /MD. Make sure you use C++17.
Visual Studio
To build and run OR-Tools on Windows, you must have Visual Studio 2019 or later installed on your computer with the C++ toolset for Visual Studio.
You can find more details here.
To build OR-Tools programs from the command line you must use a x64 Native Tools Command Prompt (not the Developer Command Prompt).
You can find more details here.
Git
Git, which can be downloaded from https://git-scm.com/.
CMake
CMake (>= 3.18), which can be downloaded from https://www.cmake.org/download. When installing CMake, select the option for a command-line accessible cmake.
.NET Core 3.1 SDK
You must install the package .NET Core 3.1 SDK version 3.1.100 or higher from the following location: sdk-3.1.425-windows-x64-installer
.Net 6.0 SDK
You must install the package .NET 6.0 SDK from the following location: sdk-6.0.403-windows-x64-installer
Download the source code
There are two distinct branches of the OR-Tools source code on GitHub: stable and main.
The stable branch has been thoroughly tested and should work flawlessly on all supported platforms.
The main branch is where the latest updates and improvements have been applied; it's more current, but less stable.

Visual Studio 2017 cross-platform Linux project with boost

I'd like to ask how to include boost hpp files in cross platform Linux project. I am developing on Windows and compiling remotely on Linux with VS 2017.
For IntelliSense the C++ header files from Linux are automatically copied to Windows machine.
Is it the case with boost hpp files also?
How is it in a case when boost is just extracted from a package on Linux and not installed by apt-get... command?
Do I need to install boost on Windows also?
How to refer to hpp files so that both VS IDE and g++ would find the files?
Thanks.
I have to figure out how to make it work, so I post it here if someone else needs a help:
To make IntelliSense work, the boost has to be on Windows. The VS can not be instructed to download additional include files from Linux. What it downloads from Linux is not user configurable in VS 2017, so we have to install or download boost files on Windows manually.
Add the path to VS in Configuration Properties->C/C++->General->Additional Include Directories. For example $(ProjectDir)../../boost_1_68_0/;
Add path to boost which is on Linux machine. For example: /usr/local/boost_1_68_0/;
Now you should be able to compile VS solution and IntelliSense should work.
If someone knows how to avoid installation of boost on Windows and use only boost installation on Linux, please let me know. I don't understand why VS does not allow to manually specify additional includes for a download.

how to compile cmake on linux so that it can generate vsproj files?

I would like to generate visual studio project files on linux using cmake.
Unfortunately, the visual studio project file generator is not enabled by default on linux.
The cmake build instructions don't mention how to enable this feature on linux. It seems like the generators are enabled based on the host platform cmake is being build. Has anybody a patched cmake to enable the Visual Studio Project Generator on linux ?
We have tools that work on linux and windows for analyzing projects by parsing .sln/.vcxproj files. However generating .sln/.vcxproj files on windows is quite inconvenient as our main development is done on linux/osx.
You cannot generate Visual Studio Solutions under Linux. Nowadays you can generate Visual Studio solutions via ssh to a Windows docker container.

How to cmake, make and compile C++14 on Windows

I'm trying to compile, on Windows 10, a C++ project that is using C++14 features such as std::make_unique<> and things like that.
I'd like to be able to compile easily in command line, using CMake and make and then be able to run my program from any command line or just by clicking it's executable.
Compiling using Cygwin, even if it's indeed working (I used this tutorial), is not an option since the resulting executable won't be usable outside of the Cygwin environment due to missing DLLs.
I've read about MinGW-w64, but it seems like the latest available version for Windows corresponds to GCC 4.8.3.
Same goes for the MinGW installer mingw-get-setup.exe available here, wich only allows me to install the 4.8.1-4 version.
So I'd like to have a procedure on how to compile a C++14 project using CMake, and that will allow me to launch the executable in the default Windows environment.
Thanks.
Update : Chris Drew commented that I could use the latest Visual Studio version to build my project using the Visual C++ compiler instead of GCC. I detailed the workflow in my answer, but I'm still looking for a "GNU-style" way to compile it.
"GNU-style" : Use the link provided in Tive's comment to install a working GCC 5.1 environment and use the normal cmake . -G"Unix Makefiles" && make commands.
See this answer for more details on both solutions.
Using Visual Studio compiler
Following Chris Drew comment, here's what I did in order to compile using CMake to generate a Visual Studio 2015 solution and compile this solution in command line.
Note that this is not using the GNU toolchain as we won't be using gcc / make but the Visual C++ Compiler.
Creating and moving to a build subdirectory (it's recommended since it will generate a lot of files, instead of just a standard Makefile) :
mkdir build && cd build
Generating the Visual Studio 2015 solution :
cmake . -G"Visual Studio 14 2015"
This will generate several project files including YourProjectName.sln that we will use to build the project using the following command :
msbuild YourProjectName.sln
Note that msbuild was not in my PATH, so I had to provide the complete path to the executable wich was, in my case, C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe.
Using an updated MinGW installer
Tive provided a link to a bundled installer that will automatically install GCC 5.1 on your system, this way you can use the normal GNU toolchain by generating an Unix Makefile, and using the make command.
Note that you will need to edit your PATH manually as the installer is not doing it for you.

How to use g2o framework for Graph Optimization (SLAM) on windows?

I'm working on a graph slam project and i want to use g2o framework (https://github.com/RainerKuemmerle/g2o) de develop the application using visual studio 2010. This framework works primarly on linux but it can be used for windows as well.
Could any one tell me how to use with visual studio
Thank you,
Regards
You can use it in Windows because all requirements have a port to Visual Studio.
cmake http://www.cmake.org/
Eigen3 http://eigen.tuxfamily.org
suitesparse http://www.cise.ufl.edu/research/sparse/SuiteSparse/
Qt4 http://qt.nokia.com/
libQGLViewer http://www.libqglviewer.com/
Our primary development platform is Linux. Experimental support for
Mac OS X and Windows (MinGW or MSVC). We recommend a so-called out of
source build which can be achieved by the following command sequence.(1)
Use cmake to build it.
I remember having some issues with building g2o on Windows. But the CMake should work well. Just configure, generate, and you can open the solution with Visual Studio and build. If it says "Configuring Done", it should compile. Eigen3 is sometimes tough to find for CMake, as their find script is not officially distributed with CMake (yet).
You can run (assuming you are in g2o/trunk/build folder, hence ..):
cmake .. -DCMAKE_MODULE_PATH=/path/to/a/dir/containing_the_FindEigen3.cmake_file/
There are also other libraries that solve graph problems efficiently, such as SLAM++, iSAM or GTSAM, they compile on Windows with less problems.