Skip to content

Commit bd5883a

Browse files
authored
Clean up README (onnx#3961)
* Trim trailing space * Use relative links. Absolute links were needed because of <dhimmel/obonet#12>, which is fixed now. * Fix typos. * master -> main. Signed-off-by: Gary Miguel <garymiguel@microsoft.com>
1 parent 48d2e7c commit bd5883a

File tree

1 file changed

+31
-52
lines changed

1 file changed

+31
-52
lines changed

README.md

+31-52
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ ONNX is [widely supported](http://onnx.ai/supported-tools) and can be found in m
1818
* [Pre-trained ONNX models](https://github.com/onnx/models)
1919

2020
# Learn about the ONNX spec
21-
* [Overview][overview]
22-
* [ONNX intermediate representation spec][ir]
23-
* [Versioning principles of the spec][versioning]
24-
* [Operators documentation][operators]
25-
* [Python API Overview][python_api]
21+
* [Overview](docs/Overview.md)
22+
* [ONNX intermediate representation spec](docs/IR.md)
23+
* [Versioning principles of the spec](docs/Versioning.md)
24+
* [Operators documentation](docs/Operators.md)
25+
* [Python API Overview](docs/PythonAPIOverview.md)
2626

2727
# Programming utilities for working with ONNX Graphs
28-
* [Shape and Type Inference][shape_inference]
28+
* [Shape and Type Inference](docs/ShapeInference.md)
2929
* [Graph Optimization](https://github.com/onnx/optimizer)
30-
* [Opset Version Conversion][version_converter]
30+
* [Opset Version Conversion](docs/VersionConverter.md)
3131

3232
# NOTICE: ONNX now uses main branch as default branch
3333
Here are the [steps](https://github.com/onnx/onnx/wiki/How-to-migrate-to-main-branch-in-local-repo) from ONNX wiki for migrating to main branch in local repo.
3434

3535
# Contribute
36-
ONNX is a [community project][community]. We encourage you to join the effort and contribute feedback, ideas, and code. You can participate in the [SIGs][sigs] and [Working Groups][wgs] to shape the future of ONNX.
36+
ONNX is a [community project](community/readme.md). We encourage you to join the effort and contribute feedback, ideas, and code. You can participate in the [Special Interest Groups](community/sigs.md) and [Working Groups](community/working-groups.md) to shape the future of ONNX.
3737

38-
Check out our [contribution guide][contributing] to get started.
38+
Check out our [contribution guide](docs/CONTRIBUTING.md) to get started.
3939

4040
If you think some operator should be added to ONNX specification, please read
41-
[this document][new_op].
41+
[this document](docs/AddNewOp.md).
4242

4343
# Discuss
4444
We encourage you to open [Issues](https://github.com/onnx/onnx/issues), or use [Slack](https://slack.lfai.foundation/) for more real-time discussion
@@ -82,9 +82,9 @@ You can also use the [onnx-dev docker image](https://hub.docker.com/r/onnx/onnx-
8282

8383

8484
## Build ONNX from Source
85-
Before building from source uninstall any existing versions of onnx `pip uninstall onnx`.
85+
Before building from source uninstall any existing versions of onnx `pip uninstall onnx`.
8686

87-
Generally spreaking, you need to install [protobuf C/C++ libraires and tools](https://github.com/protocolbuffers/protobuf) before proceeding forward. Then depending on how you installed protobuf, you need to set environment variable CMAKE_ARGS to "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" or "-DONNX_USE_PROTOBUF_SHARED_LIBS=OFF". For example, you may need to run the following command:
87+
Generally speaking, you need to install [protobuf C/C++ libraries and tools](https://github.com/protocolbuffers/protobuf) before proceeding forward. Then depending on how you installed protobuf, you need to set environment variable CMAKE_ARGS to "-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" or "-DONNX_USE_PROTOBUF_SHARED_LIBS=OFF". For example, you may need to run the following command:
8888

8989
Linux:
9090
```bash
@@ -99,7 +99,7 @@ The ON/OFF depends on what kind of protobuf library you have. Shared libraries a
9999

100100

101101
### Windows
102-
If you are building ONNX from source, it is recommended that you also build Protobuf locally as a static library. The version distributed with conda-forge is a DLL, but ONNX expects it to be a static library. Building protobuf locally also lets you control the verison of protobuf. The tested and recommended version is 3.16.0.
102+
If you are building ONNX from source, it is recommended that you also build Protobuf locally as a static library. The version distributed with conda-forge is a DLL, but ONNX expects it to be a static library. Building protobuf locally also lets you control the version of protobuf. The tested and recommended version is 3.16.0.
103103

104104
The instructions in this README assume you are using Visual Studio. It is recommended that you run all the commands from a shell started from "x64 Native Tools Command Prompt for VS 2019" and keep the build system generator for cmake (e.g., cmake -G "Visual Studio 16 2019") consistent while building protobuf as well as ONNX.
105105

@@ -109,19 +109,19 @@ git clone https://github.com/protocolbuffers/protobuf.git
109109
cd protobuf
110110
git checkout v3.16.0
111111
cd cmake
112-
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=<protobug_install_dir> -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF .
112+
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=<protobuf_install_dir> -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF .
113113
msbuild protobuf.sln /m /p:Configuration=Release
114114
msbuild INSTALL.vcxproj /p:Configuration=Release
115115
```
116-
Then it will be built as a static library and installed to <protobug_install_dir>. Please add the bin directory(which contains protoc.exe) to your PATH.
116+
Then it will be built as a static library and installed to <protobuf_install_dir>. Please add the bin directory(which contains protoc.exe) to your PATH.
117117

118118
```bat
119-
set PATH=<protobug_install_dir>/bin;%PATH%
119+
set PATH=<protobuf_install_dir>/bin;%PATH%
120120
```
121121

122-
Please note: if your protobug_install_dir contains spaces, **do not** add quotation marks around it.
122+
Please note: if your protobuf_install_dir contains spaces, **do not** add quotation marks around it.
123123

124-
Alternative: if you don't want to change your PATH, you can set ONNX_PROTOC_EXECUTABLE instead.
124+
Alternative: if you don't want to change your PATH, you can set ONNX_PROTOC_EXECUTABLE instead.
125125
```bat
126126
set CMAKE_ARGS=-DONNX_PROTOC_EXECUTABLE=<full_path_to_protoc.exe>
127127
```
@@ -137,7 +137,7 @@ pip install -e .
137137
```
138138
### Linux
139139

140-
First, you need to install protobuf.
140+
First, you need to install protobuf.
141141

142142
Ubuntu users: the quickest way to install protobuf is to run
143143

@@ -232,25 +232,25 @@ to verify it works.
232232

233233

234234
## Common Build Options
235-
For full list refer to CMakeLists.txt
236-
**Environment variables**
237-
* `USE_MSVC_STATIC_RUNTIME` should be 1 or 0, not ON or OFF. When set to 1 onnx links statically to runtime library.
235+
For full list refer to CMakeLists.txt
236+
**Environment variables**
237+
* `USE_MSVC_STATIC_RUNTIME` should be 1 or 0, not ON or OFF. When set to 1 onnx links statically to runtime library.
238238
**Default**: USE_MSVC_STATIC_RUNTIME=0
239239

240-
* `DEBUG` should be 0 or 1. When set to 1 onnx is built in debug mode. or debug versions of the dependencies, you need to open the [CMakeLists file][CMakeLists] and append a letter `d` at the end of the package name lines. For example, `NAMES protobuf-lite` would become `NAMES protobuf-lited`.
240+
* `DEBUG` should be 0 or 1. When set to 1 onnx is built in debug mode. or debug versions of the dependencies, you need to open the [CMakeLists file](CMakeLists.txt) and append a letter `d` at the end of the package name lines. For example, `NAMES protobuf-lite` would become `NAMES protobuf-lited`.
241241
**Default**: Debug=0
242242

243243
**CMake variables**
244-
* `ONNX_USE_PROTOBUF_SHARED_LIBS` should be ON or OFF.
244+
* `ONNX_USE_PROTOBUF_SHARED_LIBS` should be ON or OFF.
245245
**Default**: ONNX_USE_PROTOBUF_SHARED_LIBS=OFF USE_MSVC_STATIC_RUNTIME=0
246-
`ONNX_USE_PROTOBUF_SHARED_LIBS` determines how onnx links to protobuf libraries.
247-
- When set to ON - onnx will dynamically link to protobuf shared libs, PROTOBUF_USE_DLLS will be defined as described [here](https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md#dlls-vs-static-linking), Protobuf_USE_STATIC_LIBS will be set to OFF and `USE_MSVC_STATIC_RUNTIME` must be 0.
248-
- When set to OFF - onnx will link statically to protobuf, and Protobuf_USE_STATIC_LIBS will be set to ON (to force the use of the static libraries) and `USE_MSVC_STATIC_RUNTIME` can be 0 or 1.
246+
`ONNX_USE_PROTOBUF_SHARED_LIBS` determines how onnx links to protobuf libraries.
247+
- When set to ON - onnx will dynamically link to protobuf shared libs, PROTOBUF_USE_DLLS will be defined as described [here](https://github.com/protocolbuffers/protobuf/blob/master/cmake/README.md#dlls-vs-static-linking), Protobuf_USE_STATIC_LIBS will be set to OFF and `USE_MSVC_STATIC_RUNTIME` must be 0.
248+
- When set to OFF - onnx will link statically to protobuf, and Protobuf_USE_STATIC_LIBS will be set to ON (to force the use of the static libraries) and `USE_MSVC_STATIC_RUNTIME` can be 0 or 1.
249249

250-
* `ONNX_USE_LITE_PROTO` should be ON or OFF. When set to ON onnx uses lite protobuf instead of full protobuf.
250+
* `ONNX_USE_LITE_PROTO` should be ON or OFF. When set to ON onnx uses lite protobuf instead of full protobuf.
251251
**Default**: ONNX_USE_LITE_PROTO=OFF
252252

253-
* `ONNX_WERROR` should be ON or OFF. When set to ON warnings are treated as errors.
253+
* `ONNX_WERROR` should be ON or OFF. When set to ON warnings are treated as errors.
254254
**Default**: ONNX_WERROR=OFF in local builds, ON in CI and release pipelines.
255255

256256

@@ -275,33 +275,12 @@ pytest
275275

276276
# Development
277277

278-
Check out the [contributor guide](https://github.com/onnx/onnx/blob/main/docs/CONTRIBUTING.md) for instructions.
278+
Check out the [contributor guide](docs/CONTRIBUTING.md) for instructions.
279279

280280
# License
281281

282-
[Apache License v2.0][license]
282+
[Apache License v2.0](LICENSE)
283283

284284
# Code of Conduct
285285

286286
[ONNX Open Source Code of Conduct](https://onnx.ai/codeofconduct.html)
287-
288-
289-
<!-- links
290-
NOTE: these are absolute rather than repo-relative because we
291-
this document is rendered by PyPI which doesn't seem to handle
292-
relative links properly. See https://github.com/dhimmel/obonet/issues/12.
293-
-->
294-
[overview]: https://github.com/onnx/onnx/blob/main/docs/Overview.md
295-
[ir]: https://github.com/onnx/onnx/blob/main/docs/IR.md
296-
[versioning]: https://github.com/onnx/onnx/blob/main/docs/Versioning.md
297-
[operators]: https://github.com/onnx/onnx/blob/main/docs/Operators.md
298-
[python_api]: https://github.com/onnx/onnx/blob/main/docs/PythonAPIOverview.md
299-
[shape_inference]: https://github.com/onnx/onnx/blob/main/docs/ShapeInference.md
300-
[version_converter]: https://github.com/onnx/onnx/blob/main/docs/VersionConverter.md
301-
[new_op]: https://github.com/onnx/onnx/blob/main/docs/AddNewOp.md
302-
[community]: https://github.com/onnx/onnx/blob/main/community
303-
[sigs]: https://github.com/onnx/onnx/blob/main/community/sigs.md
304-
[wgs]: https://github.com/onnx/onnx/blob/main/community/working-groups.md
305-
[contributing]: https://github.com/onnx/onnx/blob/main/docs/CONTRIBUTING.md
306-
[CMakeLists]: https://github.com/onnx/onnx/blob/main/CMakeLists.txt
307-
[license]: https://github.com/onnx/onnx/blob/main/LICENSE

0 commit comments

Comments
 (0)