From 99f1fc8cc5129126eae7b0d86de9325c8608f289 Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 08:47:55 -0400 Subject: [PATCH 01/10] add visual studio install reqs --- BUILD.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/BUILD.md b/BUILD.md index 73c02eb80..308b507bd 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,5 +1,5 @@ -### Prelim +## Prelim This guide will describe how to retrieve the contents of this repository, and build from source. @@ -11,12 +11,26 @@ Also note: This guide is a 'work-in-progress' and subject to change. Git for Windows: If you do not already have Git for Windows on your machine, please download and install Git for Windows at https://gitforwindows.org/ -Microsoft Visual Studio 2019: +Microsoft Visual Studio 2019 or 2022: https://visualstudio.microsoft.com/downloads/ You may use the Community edition. CMake (Windows win64-x64) https://cmake.org/download/ +### For Visual Studio + +You must install the following tools for visual studio. This is found in the _installer_ (not the extensions). + +1. Desktop Development with C++ +1. .NET desktop build tools +1. .NET build tools +1. MSVC v140 +1. MSVC v142 +1. Testing tools core features - Build Tools + +At the time of writing, this list is a little long, and as we narrow down frequent issues we can hopefully reduce the exact features needed. + +### Get DHART Once the software above is installed on your machine, you may continue with the following: From 577bb015df8fbd6a8f4841bf4aa7366d3b269166 Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 08:54:04 -0400 Subject: [PATCH 02/10] clarify cmake options --- BUILD.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/BUILD.md b/BUILD.md index 308b507bd..e7e73d0dd 100644 --- a/BUILD.md +++ b/BUILD.md @@ -40,13 +40,13 @@ Git Bash (MINGW64) begins at ~, your home directory. You may remain here, or navigate to a directory of your choice. In the next step, you will clone the repository. -1. Type git clone git@github.com/cadop/dhart.git at the prompt -and hit ENTER. The repository will then be cloned to your local machine. +1. For SSH Type `git clone git@github.com:cadop/dhart.git` at the prompt +and hit ENTER. The repository will then be cloned to your local machine. For HTTPS use `git clone https://github.com/cadop/dhart.git`. -### Using CMAKE Commands +### Using CMAKE Command Line -Currently we directly call the configuration arguments when using cmake. +Currently we directly call the configuration arguments when using cmake. (If someone would like to contribute to improving this process feel free to open an issue. ) Python Debug @@ -60,7 +60,11 @@ Python Release 1. `cmake --build . --config Release` -Then +If you are using C#, then following the same script as above for Python, you would change the variable `-DDHARTAPI_EnableCSharp="False"` to `"True"`. + + +After building (assuming it went okay), run: + 1. `cmake --install .` 1. cd to build/Python and run `pip install .` From 840ffe7db462cb0d63656b458095764fa39ca7d3 Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 08:59:05 -0400 Subject: [PATCH 03/10] add visual studio build note --- BUILD.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/BUILD.md b/BUILD.md index e7e73d0dd..d5998c05d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,5 +1,5 @@ -## Prelim +# Prelim This guide will describe how to retrieve the contents of this repository, and build from source. @@ -43,8 +43,11 @@ In the next step, you will clone the repository. 1. For SSH Type `git clone git@github.com:cadop/dhart.git` at the prompt and hit ENTER. The repository will then be cloned to your local machine. For HTTPS use `git clone https://github.com/cadop/dhart.git`. +# Build Process -### Using CMAKE Command Line +You can build using either CMAKE from the command line, _or_ through Visual Studio. Please note the instructions for Visual Studio as they still require the CMAKE installation within visual studio. + +## Using CMAKE Command Line Currently we directly call the configuration arguments when using cmake. (If someone would like to contribute to improving this process feel free to open an issue. ) @@ -69,16 +72,15 @@ After building (assuming it went okay), run: 1. cd to build/Python and run `pip install .` -### Using Visual Studio +## Using Visual Studio 1. Open Microsoft Visual Studio 2019. After seeing the splash/welcome screen, please click the button that reads Open a local folder. - 1. When the Browse window appears, navigate to the folder (the repository that you had cloned) on your local machine. Then, navigate to `src/`. Click the Select folder button to confirm. -1. You may see a banner that asks to generate or configure the cmake project. Click generate. +1. You should see a banner that asks to generate or configure the cmake project. Click generate. **NOTE**: If you do not see this banner, double click on the `CMakeLists.txt` text file. If you still do not see the banner, add a blank space in the file and save (ctrl+s), which should trigger it again, generating the cmake. 1. If the Solution Explorer view is not already open, you may open by navigating to View > Solution Explorer, or alternatively, you can also use the Ctrl + Alt + L shortcut to reveal Solution Explorer. Here, you can examine the sources imported by Visual Studio. From ae90d9e7c45b01bb7edeca8223c85bf1a9d50935 Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 09:01:57 -0400 Subject: [PATCH 04/10] Add more of the .NET reqs for building --- BUILD.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BUILD.md b/BUILD.md index d5998c05d..431271cf5 100644 --- a/BUILD.md +++ b/BUILD.md @@ -23,7 +23,14 @@ You must install the following tools for visual studio. This is found in the _in 1. Desktop Development with C++ 1. .NET desktop build tools +1. .NET Core development tools +1. .NET Core SDK +1. .NET Framework 4.5 targeting pack +1. .NET Framework 4.5.1 targeting pack +1. .NET Framework 4.5.2 targeting pack 1. .NET build tools +1. .NET profiling tools +1. .NET Native 1. MSVC v140 1. MSVC v142 1. Testing tools core features - Build Tools From 092fb9dc5681ad12cf77a56c408a07e6e91a9f1f Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 09:17:25 -0400 Subject: [PATCH 05/10] clarify need for git-lfs --- BUILD.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BUILD.md b/BUILD.md index 431271cf5..878932a9c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -50,6 +50,11 @@ In the next step, you will clone the repository. 1. For SSH Type `git clone git@github.com:cadop/dhart.git` at the prompt and hit ENTER. The repository will then be cloned to your local machine. For HTTPS use `git clone https://github.com/cadop/dhart.git`. +! IMPORTANT ! You _must_ install and use `git-lfs`. If you use `git clone` and don't do this next step, you won't have the `.json` files. + +1. `cd dhart` +1. `git-lfs pull` + # Build Process You can build using either CMAKE from the command line, _or_ through Visual Studio. Please note the instructions for Visual Studio as they still require the CMAKE installation within visual studio. @@ -89,6 +94,8 @@ Then, navigate to `src/`. Click the Select folder button to confirm. 1. You should see a banner that asks to generate or configure the cmake project. Click generate. **NOTE**: If you do not see this banner, double click on the `CMakeLists.txt` text file. If you still do not see the banner, add a blank space in the file and save (ctrl+s), which should trigger it again, generating the cmake. +1. This project uses `CMakeSettings.json`, so you must open the CMake options and ensure that CMake configuration file option is set to `Use CMakePresets.json if available, otherwise use CMakeSettings.json`. You need to also make sure there is no `CMakePresets.json` since this will overwrite the proper settings. + 1. If the Solution Explorer view is not already open, you may open by navigating to View > Solution Explorer, or alternatively, you can also use the Ctrl + Alt + L shortcut to reveal Solution Explorer. Here, you can examine the sources imported by Visual Studio. @@ -100,3 +107,8 @@ There are a few provided configuration files. Specifically, debug and release, a You can find the build files in .\dhart\src\out\build\x64-Debug + + +### FAQ + +- `CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguage` \ No newline at end of file From 803197699ed0dba742a6d3c001df6b94621eb02a Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 09:28:30 -0400 Subject: [PATCH 06/10] add more FAQ, testing explanation, and install instructs --- BUILD.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/BUILD.md b/BUILD.md index 878932a9c..4a17d6bdf 100644 --- a/BUILD.md +++ b/BUILD.md @@ -8,13 +8,17 @@ Please note: DHART is currently designed to run on a PC running the Windows 10 operating system. Also note: This guide is a 'work-in-progress' and subject to change. -Git for Windows: +- Git for Windows: If you do not already have Git for Windows on your machine, please download and install Git for Windows at https://gitforwindows.org/ -Microsoft Visual Studio 2019 or 2022: + +- Git lfs `https://git-lfs.github.com/` + +- Microsoft Visual Studio 2019 or 2022: https://visualstudio.microsoft.com/downloads/ You may use the Community edition. -CMake (Windows win64-x64) + +- CMake (Windows win64-x64) https://cmake.org/download/ ### For Visual Studio @@ -106,9 +110,15 @@ There are a few provided configuration files. Specifically, debug and release, a 1. Once it has successfully built, you need to install. Going back to the same build menu dropdown, click on install. This will save the files to a build directory. -You can find the build files in .\dhart\src\out\build\x64-Debug +You can find the build files in `.\dhart\src\out\build\x64-Debug` or `x63-Release` or (whatever config you selected.) + +### Testing + +After generating the build files, you should be able to open a visual studio solution file in the build directory. If it doesn't display immediately, go to `Test -> Test Explorer` to open the test explorer. Then click `Run All`. ### FAQ -- `CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguage` \ No newline at end of file +- `CMake Error: CMAKE_CSharp_COMPILER not set, after EnableLanguage` | This likely occurs because your `CMakeSettings.json` is not correct. If you did not use `git-lfs pull`, this file will just be a lfs object pointer. +- `CMake Error at X:\XXX\dhart\src\CMakeLists.txt:37: No CMAKE_C_COMPILER could be found.` | This is likely because you are missing the cmake installation or its not configured. Remember, you need _both_ to install cmake from cmake.org _and_ to include it in the visual studio installation settings. +- Some error talking about tests or google-tests. | We use google-tests for the unit testing of the project. If you are struggling to build because of this error, you can edit the `CMakeSettings.json` in visual studio and uncheck the `EnableTests` option and `Build_GMOCK` for the configuration you are interested in using. \ No newline at end of file From 0832011167a379179439323eb393749900829834 Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 09:30:31 -0400 Subject: [PATCH 07/10] typo --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 4a17d6bdf..aad22a1a3 100644 --- a/BUILD.md +++ b/BUILD.md @@ -110,7 +110,7 @@ There are a few provided configuration files. Specifically, debug and release, a 1. Once it has successfully built, you need to install. Going back to the same build menu dropdown, click on install. This will save the files to a build directory. -You can find the build files in `.\dhart\src\out\build\x64-Debug` or `x63-Release` or (whatever config you selected.) +You can find the build files in `.\dhart\src\out\build\x64-Debug` or `x64-Release` or (whatever config you selected.) ### Testing From 79ed3eae80d85a0a419f26bf032b1db85c833d7e Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 13:11:04 -0400 Subject: [PATCH 08/10] add cmake clarity --- BUILD.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BUILD.md b/BUILD.md index aad22a1a3..acac57a48 100644 --- a/BUILD.md +++ b/BUILD.md @@ -21,6 +21,8 @@ You may use the Community edition. - CMake (Windows win64-x64) https://cmake.org/download/ +Note for installing CMake, you must check `Add CMake to the system PATH`. The easiest is probably for all users, but you may know how to work with it for current user as well. + ### For Visual Studio You must install the following tools for visual studio. This is found in the _installer_ (not the extensions). From 571640ea136ff235a16441a6c1b377fe7a53240c Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 13:11:49 -0400 Subject: [PATCH 09/10] clarify visual studio option --- BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index acac57a48..81979e3e6 100644 --- a/BUILD.md +++ b/BUILD.md @@ -14,7 +14,7 @@ please download and install Git for Windows at https://gitforwindows.org/ - Git lfs `https://git-lfs.github.com/` -- Microsoft Visual Studio 2019 or 2022: +- Microsoft Visual Studio 2019 (you can use 2022 but 2019 must be installed because of the build tools it comes with): https://visualstudio.microsoft.com/downloads/ You may use the Community edition. From 903f61e9d3aaac0bccc6f0621860ede7b0cb46ce Mon Sep 17 00:00:00 2001 From: cadop Date: Mon, 11 Jul 2022 13:42:44 -0400 Subject: [PATCH 10/10] add windows sdk install --- BUILD.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index 81979e3e6..a35f1d3cd 100644 --- a/BUILD.md +++ b/BUILD.md @@ -16,7 +16,7 @@ please download and install Git for Windows at https://gitforwindows.org/ - Microsoft Visual Studio 2019 (you can use 2022 but 2019 must be installed because of the build tools it comes with): https://visualstudio.microsoft.com/downloads/ -You may use the Community edition. +You may use the Community edition. Make sure to also check Windows 10 SDK on the installer. - CMake (Windows win64-x64) https://cmake.org/download/ @@ -39,6 +39,7 @@ You must install the following tools for visual studio. This is found in the _in 1. .NET Native 1. MSVC v140 1. MSVC v142 +1. Windows 10 SDK 1. Testing tools core features - Build Tools At the time of writing, this list is a little long, and as we narrow down frequent issues we can hopefully reduce the exact features needed.