Skip to content

Commit

Permalink
Add installation of dependencies to page about compiling OpenSpiel as…
Browse files Browse the repository at this point in the history
… a C++ library.

Resolves: #1058.
PiperOrigin-RevId: 526678722
Change-Id: Ia89f73fc5219611b0ff9b6984adcad1855abd4a0
  • Loading branch information
lanctot committed Apr 24, 2023
1 parent 3b9b777 commit 4c96de2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ a shared library once, and then load it dynamically at runtime. This page walks
through how to do this assuming a bash shell on Linux, but is very similar on
MacOS or for other shells.

## Install Dependencies

The dependencies of OpenSpiel need to be installed before it can be used as a
library. On MacOS and Debian/Ubuntu Linux, this is often simply just running
`./install.sh`. Please see the [installation from source instructions](https://github.com/deepmind/open_spiel/blob/master/docs/install.md#installation-from-source) for more details.

## Compiling OpenSpiel as a Shared Library

To build OpenSpiel as a shared library, simply run:
Expand Down Expand Up @@ -49,8 +55,8 @@ do it every time you load the library. Of course, if you are already using
```
cd ../open_spiel/examples
clang++ -I${HOME}/open_spiel -I${HOME}/open_spiel/open_spiel/abseil-cpp \
-L${HOME}/open_spiel/build -lopen_spiel -std=c++17 \
-o shared_library_example shared_library_example.cc
-std=c++17 -o shared_library_example shared_library_example.cc \
-L${HOME}/open_spiel/build -lopen_spiel
```

The first two flags are the include directory paths and the third is the link
Expand Down

0 comments on commit 4c96de2

Please sign in to comment.