|
| 1 | +## Install nmos-cpp Using Conan |
| 2 | + |
| 3 | +The following steps describe how to install and set up nmos-cpp using the Conan package manager. |
| 4 | +For many platforms, a binary package is available from Conan Center Index so it isn't necessary to build nmos-cpp or any of its dependencies. |
| 5 | + |
| 6 | +1. Install conan: |
| 7 | + ```sh |
| 8 | + pip install --upgrade conan~=2.0.5 |
| 9 | + ``` |
| 10 | + |
| 11 | + `pip` is the package installer for Python. Install Python 3 if necessary. |
| 12 | + |
| 13 | + If the python Scripts directory is not on the PATH you will get a warning like: |
| 14 | + > WARNING: The script conan.exe is installed in 'C:\Users\\%USERNAME%\\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts' which is not on PATH. |
| 15 | + > Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. |
| 16 | +
|
| 17 | + On Windows, you can use _System Properties \> Environment Variables..._ to permanently add the directory to the user PATH. Restart the Command Prompt and run `conan --help` to ensure Conan is found. |
| 18 | + |
| 19 | +2. Detect profile: |
| 20 | + ```sh |
| 21 | + conan profile detect |
| 22 | + ``` |
| 23 | + This will create a Conan profile with values based on your current platform, compiler, etc. |
| 24 | + Ideally the profile should be similar to these: |
| 25 | + |
| 26 | + Windows |
| 27 | + ```ini |
| 28 | + [settings] |
| 29 | + arch=x86_64 |
| 30 | + build_type=Release |
| 31 | + compiler=msvc |
| 32 | + compiler.cppstd=14 |
| 33 | + compiler.runtime=dynamic |
| 34 | + compiler.version=193 |
| 35 | + os=Windows |
| 36 | + ``` |
| 37 | + Linux |
| 38 | + ```ini |
| 39 | + [settings] |
| 40 | + arch=x86_64 |
| 41 | + build_type=Release |
| 42 | + compiler=gcc |
| 43 | + compiler.cppstd=17 |
| 44 | + compiler.version=11 |
| 45 | + os=Linux |
| 46 | + ``` |
| 47 | + |
| 48 | +3. Install nmos-cpp: |
| 49 | + ```sh |
| 50 | + conan install --tool-requires=nmos-cpp/cci.20240223 |
| 51 | + ``` |
| 52 | + This installs the **nmos-cpp-registry** and **nmos-cpp-node** applications in the Conan cache, and generates a script to make these executables available in the current session. |
| 53 | + On Windows, run `.\conanbuild.bat` to add the install directory to the PATH. |
| 54 | + On Linux, run `./conanbuild.sh`. |
| 55 | + |
| 56 | + Alternatively the nmos-cpp installation can be copied to the current working directory using a Conan deployer: |
| 57 | + ```sh |
| 58 | + conan install --requires=nmos-cpp/cci.20240223 --deployer=direct_deploy |
| 59 | + ``` |
| 60 | + |
| 61 | + On Windows, the executables are then found in the _.\direct_deploy\nmos-cpp\bin\Release_ directory. |
| 62 | + On Linux, the executables are found in the _./direct_deploy/nmos-cpp/bin_ directory. |
| 63 | + |
| 64 | +4. Try starting nmos-cpp-registry and/or nmos-cpp-node: |
| 65 | + ```sh |
| 66 | + nmos-cpp-registry |
| 67 | + ``` |
| 68 | + or |
| 69 | + ```sh |
| 70 | + nmos-cpp-node |
| 71 | + ``` |
| 72 | + For more information about running these applications and the JSON configuration file that can be passed on the command-line, see the [tutorial](Tutorial.md). |
0 commit comments