Skip to content

Conversation

miyanyan
Copy link
Contributor

this's my build instructions for #40

@sebsjames
Copy link
Owner

Thank you very much for this. I'll get a chance to try it out next week.

```

### Install dependencies with vcpkg

Copy link
Owner

@sebsjames sebsjames Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vcpkg new --application?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't use this command

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's when setting up an application to use vcpkg. I understand that this is not the right command to use in this case.

#### Mainfest mode(recommended)

When `vcpkg.json` is in the root directory of the project, vcpkg will automatically install the required dependencies when you run the CMake configuration step.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp mathplot/vcpkg/vcpkg.json mathplot/vcpkg.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, vcpkg will auto install if vcpkg.json in root dir

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another step? To run the vcpkg install step from inside Visual Studio?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't use the vcpkg from visual studio, I clone the repo https://github.com/microsoft/vcpkg and run bootstrap-vcpkg.bat

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you run bootstrap-vcpkg.bat from inside mathplot/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, this bat file just download the vcpkg executable, it only need to run once


### Install Qt5

To use Qt, you need to install the Qt SDK using the [official installer](https://download.qt.io/official_releases/online_installers/).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Official installer shows only version 6.9.x. I assume you installed 5.15.x, by drilling down into the menus?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image maybe you need to enable the archive checkbox

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll figure out precisely which options to check and add this to the description (I don't have 50 GB to install everything for Qt 5.15!)


### Build the examples and test programs

You can build the examples and test programs using the Visual Studio/VSCode(with cmake plugins).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to do this. I open the mathplot folder from Visual Studio and it tries to run the cmake process, which fails when it attempts to find glfw3. I think I didn't correctly install glfw3 with vcpkg first, but I don't know how.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can I see the output of vscode console?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1> CMake generation started for default configuration: 'x64-debug'.
1> Environment settings:
1>     CommandPromptType=Native
1>     DevEnvDir=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\
1>     ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
1>     EXTERNAL_INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt
1>     Framework40Version=v4.0
1>     FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
1>     FrameworkVersion=v4.0.30319
1>     FrameworkVersion64=v4.0.30319
1>     IGCCSVC_DB=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAj4WsguMZ+UO9CfYEw7cbpwQAAAACAAAAAAAQZgAAAAEAACAAAAAuI6jc3lAERAZpCbgadbTSa/IF3PTRKRySJ1fAaN697QAAAAAOgAAAAAIAACAAAAB6wU+Cbxkg8UpRznDAegbth0EI4kKGNykzWUSdkbPAkGAAAAAc9rYqXdvscRweDcn62l6/FAkkPsUGZzhaGOWT+d+/5cE02V0msWynu7eC45NrshaghQ0r5w5kfXw4HahhM+72Y+KTc4WoAb4klc2SxVR+erOy6mYqNqLxPIMbYFAbQTlAAAAAh6yu8ZvaezNSmrw7dG9Mgel6K8yy2v2LMpt3+7URbCSHFPvu1ZOju8fJYd79XvhRqoKBuBnkX9XzuMjiqZQBGw==
1>     INCLUDE=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\ATLMFC\include;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt;C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt
1>     LIB=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22621.0\\um\x64
1>     LIBPATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\ATLMFC\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\lib\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319
1>     Path=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64;C:\Program Files (x86)\Windows Kits\10\bin\\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\sebj\vcpkg;C:\Users\sebj\AppData\Local\Microsoft\WindowsApps;C:\Qt\6.9.1\mingw_64\bin;;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg
1>     PROMPT=$P$G
1>     UCRTVersion=10.0.22621.0
1>     UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
1>     VCIDEInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\
1>     VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\
1>     VCPKG_ROOT=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg
1>     VCToolsInstallDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\
1>     VCToolsRedistDir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.42.34433\
1>     VCToolsVersion=14.43.34808
1>     VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\
1>     VSCMD_ARG_app_plat=Desktop
1>     VSCMD_ARG_HOST_ARCH=x64
1>     VSCMD_ARG_no_logo=1
1>     VSCMD_ARG_TGT_ARCH=x64
1>     VSCMD_DEBUG=5 
1>     VSCMD_VER=17.13.0
1>     VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\
1>     WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.22621.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.22621.0
1>     WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
1>     WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
1>     WindowsSDKLibVersion=10.0.22621.0\
1>     WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\
1>     WindowsSDKVersion=10.0.22621.0\
1>     __DOTNET_ADD_64BIT=1
1>     __DOTNET_PREFERRED_BITNESS=64
1>     __VSCMD_PREINIT_PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\sebj\vcpkg;C:\Users\sebj\AppData\Local\Microsoft\WindowsApps;C:\Qt\6.9.1\mingw_64\bin;
1>     SystemDrive=C:
1>     ProgramFiles(x86)=C:\Program Files (x86)
1>     VSAPPIDDIR=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\
1>     ProgramW6432=C:\Program Files
1>     PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 183 Stepping 1, GenuineIntel
1>     TMP=C:\Users\sebj\AppData\Local\Temp
1>     PROCESSOR_ARCHITECTURE=AMD64
1>     PkgDefApplicationConfigFile=C:\Users\sebj\AppData\Local\Microsoft\VisualStudio\17.0_e2a3f164\devenv.exe.config
1>     USERPROFILE=C:\Users\sebj
1>     VsPerMonitorDpiAwarenessEnabled.12772=TRUE
1>     PROCESSOR_REVISION=b701
1>     ServiceHubLogSessionKey=57AADABE
1>     FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
1>     FPS_BROWSER_USER_PROFILE_STRING=Default
1>     LOGONSERVER=\\SEBROG
1>     TEMP=C:\Users\sebj\AppData\Local\Temp
1>     USERNAME=sebj
1>     SystemRoot=C:\WINDOWS
1>     VSSKUEDITION=Community
1>     OneDrive=C:\Users\sebj\OneDrive
1>     USERDOMAIN_ROAMINGPROFILE=SEBROG
1>     CommonProgramFiles=C:\Program Files\Common Files
1>     ZES_ENABLE_SYSMAN=1
1>     PROCESSOR_LEVEL=6
1>     ProgramData=C:\ProgramData
1>     VS_Perf_Session_GCHeapCount=2
1>     RlsSvcPort=22112
1>     HOMEPATH=\Users\sebj
1>     IGCCSVC_DB=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAj4WsguMZ+UO9CfYEw7cbpwQAAAACAAAAAAAQZgAAAAEAACAAAAAuI6jc3lAERAZpCbgadbTSa/IF3PTRKRySJ1fAaN697QAAAAAOgAAAAAIAACAAAAB6wU+Cbxkg8UpRznDAegbth0EI4kKGNykzWUSdkbPAkGAAAAAc9rYqXdvscRweDcn62l6/FAkkPsUGZzhaGOWT+d+/5cE02V0msWynu7eC45NrshaghQ0r5w5kfXw4HahhM+72Y+KTc4WoAb4klc2SxVR+erOy6mYqNqLxPIMbYFAbQTlAAAAAh6yu8ZvaezNSmrw7dG9Mgel6K8yy2v2LMpt3+7URbCSHFPvu1ZOju8fJYd79XvhRqoKBuBnkX9XzuMjiqZQBGw==
1>     COMPUTERNAME=SEBROG
1>     ALLUSERSPROFILE=C:\ProgramData
1>     CommonProgramW6432=C:\Program Files\Common Files
1>     ThreadedWaitDialogDpiContext=-4
1>     GCExpConfigUsedInSession=3
1>     QT5_DIR=C:\Qt
1>     VisualStudioDir=C:\Users\sebj\Documents\Visual Studio 2022
1>     SESSIONNAME=Console
1>     DriverData=C:\Windows\System32\Drivers\DriverData
1>     HOMEDRIVE=C:
1>     windir=C:\WINDOWS
1>     NUMBER_OF_PROCESSORS=32
1>     OS=Windows_NT
1>     ProgramFiles=C:\Program Files
1>     ComSpec=C:\WINDOWS\system32\cmd.exe
1>     EFC_15996_1592913036=1
1>     PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
1>     VSLANG=1033
1>     PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
1>     APPDATA=C:\Users\sebj\AppData\Roaming
1>     USERDOMAIN=SEBROG
1>     ACSvcPort=17532
1>     LOCALAPPDATA=C:\Users\sebj\AppData\Local
1>     VisualStudioVersion=17.0
1>     VisualStudioEdition=Microsoft Visual Studio Community 2022
1>     CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
1>     OneDriveConsumer=C:\Users\sebj\OneDrive
1>     PUBLIC=C:\Users\Public
1>     VSAPPIDNAME=devenv.exe
1>     MSBuildLoadMicrosoftTargetsReadOnly=true
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Users/sebj/mathplot/out/install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "C:\Users\sebj\mathplot" 2>&1"
1> Working directory: C:/Users/sebj/mathplot/out/build/x64-debug
1> [CMake] -- Install prefix: C:/Users/sebj/mathplot/out/install/x64-debug
1> [CMake] --   (This can be changed with `cmake -DCMAKE_INSTALL_PREFIX=/some/place`
1> [CMake] -- Could NOT find OpenMP_C: Found unsuitable version "2.0", but required is at least "3" (found -openmp)
1> [CMake] -- Could NOT find OpenMP_CXX: Found unsuitable version "2.0", but required is at least "3" (found -openmp)
1> [CMake] -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) (Required is at least version "3")
1> [CMake] CMake Error at C:\Users\sebj\mathplot\CMakeLists.txt:122 (find_package):
1> [CMake]   By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
1> [CMake]   asked CMake to find a package configuration file provided by "glfw3", but
1> [CMake]   CMake did not find one.
1> [CMake] 
1> [CMake]   Could not find a package configuration file provided by "glfw3" (requested
1> [CMake]   version 3.2...3.4) with any of the following names:
1> [CMake] 
1> [CMake]     glfw3Config.cmake
1> [CMake]     glfw3-config.cmake
1> [CMake] 
1> [CMake]   Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
1> [CMake]   "glfw3_DIR" to a directory containing one of the above files.  If "glfw3"
1> [CMake]   provides a separate development package or SDK, be sure it has been
1> [CMake]   installed.
1> [CMake] 
1> [CMake] 
1> [CMake] -- Configuring incomplete, errors occurred!
1> 'C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Users/sebj/mathplot/out/install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "C:\Users\sebj\mathplot" 2>&1"' execution failed with error: ''C:\WINDOWS\system32\cmd.exe' '/c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"  -G "Ninja"  -DCMAKE_C_COMPILER:STRING="cl.exe" -DCMAKE_CXX_COMPILER:STRING="cl.exe" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:/Users/sebj/mathplot/out/install/x64-debug"   -DCMAKE_MAKE_PROGRAM="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "C:\Users\sebj\mathplot" 2>&1"' returned with exit code: 1'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the vcpkg.json file is in the root folder, maybe you didn't install vcpkg right, or remove the build folder and reconfig cmake

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I figured this process out for morphologica (which still opens ok on my Windows laptop) but I have forgotten it!

I think it might be necessary to open a Developer PowerShell from inside Visual Studio and run vcpkg install.

When I did this (and vcpkg.json was in my project root) I got a vcpkg_installed folder containing the libraries. However, mathplot still didn't build. I'll try later.

@sebsjames
Copy link
Owner

So I guess I'm stuck for now...

Comment on lines +2 to +8

# --- vcpkg
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
message(STATUS "VCPKG_ROOT: $ENV{VCPKG_ROOT}")
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add this to cmake, so if VCPKG_ROOT env is set, it will set CMAKE_TOOLCHAIN_FILE automatically

Copy link
Owner

@sebsjames sebsjames Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so that refers to the VCPKG_ROOT env var, and side-steps the built-in Visual Studio vcpkg (which I think is what I used before with my morphologica build)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants