vcpkg and Eigen3: Eigen3 set to NOT FOUND - visual-studio

I have used vcpkg install eige3:x64-windows and then the integrate install command on Windows 10. Now, from inside CMakeLists.txt I do find_package(Eigen3 CONFIG REQUIRED), but I get the following in the Visual Studio 2019:
Severity Code Description Project File Line Suppression State
Error CMake Error at C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:792 (_find_package):
Found package configuration file:
C:/dev/vcpkg/installed/x64-windows/share/eigen3/Eigen3Config.cmake
but it set Eigen3_FOUND to FALSE so package "Eigen3" is considered to be
NOT FOUND. C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake 792
How to fix this problem?

Related

Use vcpkg on WSL 1 with Visual Studio

I'm adventuring myself into compiling a CMake project using Visual Studio, targeting WSL 1.
Following Microsoft's tutorial to setup a CMake project in Visual Studio and debugging on WSL works fine. Things break when I try to install and use packages using Microsoft's vcpkg package manager after installing vcpkg into a separate Windows directory and integrating it into Visual Studio.
A simple example that fails:
# CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(test)
find_package(protobuf CONFIG REQUIRED)
with the following error message:
CMake Error at C:\test\CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by
"protobuf" with any of the following names
protobufConfig.cmake
protobuf-config.cmake
Add the installation prefix of "unofficial-sqlite3" to CMAKE_PREFIX_PATH or
set "protobuf_DIR" to a directory containing one of the above
files. If "protobuf" provides a separate development package or
SDK, be sure it has been installed.
I'm getting Intellisense to recognize find_package and suggesting to install the package or copying the vcpkg command to clipboard.
The CMake toolchain file is pointing to the "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" file in the WSL-GCC-Debug configuration settings. Installing vcpkg on the Linux system and setting the CMake toolchain file to the corresponding path creates the exact same error output.
Running the "vcpkg install protobuf:x64-linux" command in the terminal creates the following output:
Computing installation plan...
The following packages will be built and installed:
protobuf[core]:x64-linux -> 3.14.0#1
Detecting compiler hash for triplet x64-linux...
Error: while detecting compiler information:
The log content at C:\vcpkg\buildtrees\detect_compiler\stdout-x64-linux.log is:
-- Configuring x64-linux
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:108 (message):
Command failed: ninja -v
Working Directory: C:/vcpkg/buildtrees/detect_compiler/x64-linux-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
C:\vcpkg\buildtrees\detect_compiler\config-x64-linux-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:319 (vcpkg_execute_required_process)
scripts/detect_compiler/portfile.cmake:18 (vcpkg_configure_cmake)
scripts/ports.cmake:128 (include)
Error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.
This is not a surprise as I don't expect it to be able to build packages targeting Linux on my Windows machine.
I'm new to cross-platform development and I find documentation on vcpkg + WSL rather sparse. Am I right in assuming that the packages should be installed by vcpkg running on the Linux system? Or do I need to have CMake setup on Windows to make vcpkg work on the Windows side?
Setup:
Windows 10 Build 19041
Visual Studio 2019 (16.8.5) with Visual C++ for Linux Development
Ubuntu 20.04 LTS as WSL
vcpkg commit f226416d2
It seems that I was a bit off track.
vcpkg installed on the Windows machine is accessible on the Linux system the same way as the actual CMake project is accessible. Setting the "CMAKE_TOOLCHAIN_FILE" variable to the absolute "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" path gets translated into "/mnt/c/vcpkg/scripts/buildsystems/vcpkg.cmake".
The missing step was to run the ./bootstrap-vcpkg.sh script on the Linux system to make sure packages can be installed by vcpkg on the Linux system.
I also learned that packages have to be installed manually by running the vcpkg install command since there is no "build in" way to do this via CMake.

Pytorch not building with cmake in Developer Console

I've mostly used languages with simple IDEs until now, so I don't have the best knowledge of compiling and running git and cmake and everything else through command line. I need to use Pytorch for a project though, so it's necessary to use those skills. I'm installing it according to the tutorial for windows found here:
https://caffe2.ai/docs/getting-started.html?platform=windows&configuration=compile
I've gotten to the point where I'm running build_windows.bat, but I'm getting this output with an error from the Developer Command Prompt.
The system cannot find the drive specified.
Requirement already satisfied: pyyaml in g:\programs\python27\lib\site-packages (3.13)
CAFFE2_ROOT=G:\Programs\Caffe2\pytorch\scripts\..
CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
CMAKE_BUILD_TYPE=Release
-- Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error at CMakeLists.txt:6 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 9/25/2018 4:20:32 PM.
Project "G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" on node 1 (default targets).
G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj" (default target) (1) ->
G:\Programs\Caffe2\pytorch\build\CMakeFiles\3.12.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.15
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "G:/Programs/Caffe2/pytorch/build/CMakeFiles/CMakeOutput.log".
"Caffe2 building failed"
The CMakeOutput.log file only contains this:
The system is: Windows - 10.0.17134 - AMD64
Which isn't very useful. I'm not sure what I'm doing wrong here.
If you just need to test or experiment with pytorch I suggest that you first try to install it through the pip package. It is much easier.
If you really need to install it from source, then I suggest that you read the build_windows.bat file to check that it really suits your configuration and modify it if needed. Make sure you are targeting the correct Visual Studio version for example.
The error you are getting doesn't seem to come from the pytorch project itself.

Trying to compile pgAgent. Get an error wx/setup.h: No such file or directory

On one of our servers pgAgent service does not start with the message "ERROR: Couldn't register event handle" (see DBA Question). So I decided to compile the binary from the source, to further investigate the problem.
I installed Visual Studio Community 2017 Edition. I downloaded pgagent source code 3.4.0 and extracted to F:\pgbuild\pgAgent-3.4.0. I downloaded the wxWidgets 2.8, unpacked into F:\pgbuild\wxWidgets and built with visual studio 2017. I pointed out the these variables
wxMSW=F:\pgbuild\wxWidgets
WXWIN=F:\pgbuild\wxWidgets
PGDIR=C:\Program Files\PostgreSQL\9.6
WIX=C:\Program Files (x86)\WiX Toolset v3.11\
Then I tried to compile the pgAgent. Visual studio could recognize the CMake Project of it. When I compile the cmake project, I get an error:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: '../../../lib/vc_lib/mswd/wx/setup.h': No such file or directory F:\pgbuild\pgAgent-3.4.0\CMakeLists.txt F:\pgbuild\wxWidgets\include\msvc\wx\setup.h 123
There are lots of urls around the problem on the net, but I cannot get a handle on it.
It looks to me that this code needs to be updated:
#ifdef wxSUFFIX
#define wxSETUPH_PATH \
wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
#else // suffix is empty
#define wxSETUPH_PATH \
wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
#endif
I built wxWidgets using wx_vc15.sln in F:\pgbuild\wxWidgets\build\msw. I was trying to build pgAgent as CMake project, although the building instructions say that I need to use the GUI version of CMake.
I was following instructions to build pgAdmin, but now I am wondering whether I need to build pgAdmin (don't mix it up vs. pgAgent) at all.
Any suggestions how?
Update:
I installed CMake for Windows and created a solution file to F:/pgbuild/pgAgent-3.4.0/build. Got some errors lines back:
Then clicked on configure, then on gnerate. This created the visual studio project file. Tried to build it, got the error above (wx/setup.h: No such file or directory). The exact error is
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: '../../../lib/vc_dll/mswd/wx/setup.h': No such file or directory pgagent f:\pgbuild\wxwidgets\include\msvc\wx\setup.h 123

Error while build boost release

I have error while building the release:
1>d:\work\boost\boost/asio/detail/socket_types.hpp(38): fatal error
C1083: Cannot open include file: 'winsock2.h': No such file or
directory
But when build the Debug everything is fine.
What is going on here?
First , check that you have the Windows SDK installed
Windows SDK
Then go to Project property page and in configuration properties , General
select "Visual Studio 2013 - Windows XP (v120_xp)" for Platform Toolset
I had the same problem and fixed by this way

Compiling FFTW source in Visual studio

Recently I am trying to compile the source code of FFTW in Visual studio 2010. I followed the instruction from the FFTW website. I downloaded the source code fftw-3.3.2.zip and corresponding vs 2010 package fftw-3.3-libs-visual-studio-2010.zip.
I got four projects from the solution, bench, benchf, libfftw-3.3, libfftwf-3.3
But on compiling I got following errors on each of the project:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform toolset (Windows7.1SDK) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
which points to the following content
I have tried the debug/release build for both x64 and win32, none of them worked.
Could anyone please help me on this?
It seems that it can be solved without installing the Windows 7.1 SDK
Right click on the 'libfftw-3.3' project and selected properties
Go to Configuration Properties -> General
Switch 'Platfrom Toolset' from 'Windows7.1SDK' to 'v100'
Recompile
Works for the projects 'libfftwf-3.3' and 'libfftw-3.3'
The project 'bench' and 'benchf' are failing to build:
fatal error C1083: Cannot open source file: '....\libbench2\aligned-main.c': No such file or directory
Can be solved by removing the aligned-main.c from both projects.
You can also use CMake - I created this CMake file for fftw-3.3.2 which I tested with Visual Studio 2010 x64:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/CMakeLists.txt?at=default
You also need this config.h file:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/config.h?at=default
It looks like you need to install the Windows 7.1 SDK, if you have already installed it, try reinstalling it incase it is corrupted.
You can download the 7.1 SDK from http://www.microsoft.com/en-us/download/details.aspx?id=8279

Resources