Skip to content

Commit

Permalink
fix(cpp-client): Instructions to build on windows based on DHSRC and …
Browse files Browse the repository at this point in the history
…DHINSTALL env vars (deephaven#5869)
  • Loading branch information
jcferretti authored Jul 30, 2024
1 parent df8a9ab commit 723eb5e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions cpp-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,45 +237,51 @@ Notes
4. Make a 'dhsrc' directory that will hold the two repositories: the vcpkg
package manager and Deephaven Core. Then make a 'dhinstall' directory that
will hold the libraries and executables that are the result of this
build process.
build process. You can decide on the locations you want for those directories,
the code below creates them under the home directory of the Windows user
running the command prompt; change the definitions of the environment variables
DHSRC and DHINSTALL if you decide to place them somewhere else.
```
mkdir %HOMEDRIVE%%HOMEPATH%\dhsrc
mkdir %HOMEDRIVE%%HOMEPATH%\dhinstall
set DHSRC=%HOMEDRIVE%%HOMEPATH%\dhsrc
set DHINSTALL=%HOMEDRIVE%%HOMEPATH%\dhinstall
mkdir %DHSRC%
mkdir %DHINSTALL%
```
5. Use git to clone the two repositories mentioned above.
If you are using Git for Windows, you can run the "Git Bash Shell"
and type these commands into it:
```
cd $HOME/dhsrc
cd $HOME/dhsrc # change if dhsrc on a different location
git clone https://github.com/microsoft/vcpkg.git
git clone https://github.com/deephaven/deephaven-core.git
```
6. Come back to the Visual Studio developer command prompt and do the
one-time installation steps for vcpkg.
```
cd /d %HOMEDRIVE%%HOMEPATH%\dhsrc\vcpkg
cd /d %DHSRC%\vcpkg
.\bootstrap-vcpkg.bat
```
7. Set VCPKG_ROOT. Note that steps 8 and 9 both rely on it being set correctly.
If you come back to these instructions at a future date, make sure that VCPKG_ROOT
is set before re-running those steps.
```
set VCPKG_ROOT=%HOMEDRIVE%%HOMEPATH%\dhsrc\vcpkg
set VCPKG_ROOT=%DHSRC%\vcpkg
```
8. Change to the Deephaven core directory and build/install the dependent
packages. On my computer this process took about 20 minutes.
```
cd /d %HOMEDRIVE%%HOMEPATH%\dhsrc\deephaven-core\cpp-client\deephaven
cd /d %DHSRC%\deephaven-core\cpp-client\deephaven
%VCPKG_ROOT%\vcpkg.exe install --triplet x64-windows
```
9. Now configure the build for Deephaven Core:
```
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=%HOMEDRIVE%%HOMEPATH%/dhinstall -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=%DHINSTALL% -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
```
10. Finally, build and install Deephaven Core:
Expand All @@ -294,6 +300,6 @@ Notes
then run the tests executable:
```
cd /d %HOMEDRIVE%%HOMEPATH%\dhinstall\bin
cd /d %DHINSTALL%\bin
.\dhclient_tests.exe
```

0 comments on commit 723eb5e

Please sign in to comment.