Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compile_paddle_lib_en.md #9795

Merged
merged 2 commits into from
Apr 10, 2018
Merged

Conversation

cwgis
Copy link
Contributor

@cwgis cwgis commented Apr 9, 2018

Fix #8916

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2018

CLA assistant check
All committers have signed the CLA.

@abhinavarora abhinavarora self-requested a review April 9, 2018 18:10
TBD
### Download & Install

Download the latest C-API development package from CI system and install, you can find the required version in the table below:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install, you -> install. You


### From source

User also can compile the C-API library from PaddlePaddle source code, just compiling with the following compilation options:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence should be:

Users can also compile the C-API library from PaddlePaddle source code by compiling with the following compilation options:

<td>ON/OFF</td>
</tr></tbody></table>

It is best to set up with recommended values to avoid link with unnecessary libraries. Set other compilation options as you need.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link -> linking

..
```

After run the above code to generate Makefile , run: `make && make install`. After successfully compiled, the dependencies are required by C-API(includes: (1)PaddlePaddle inference library and header files; (2) Third-party libraries and header files) will be stored in the `PADDLE_ROOT` directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run -> running

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiled -> compilation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the dependencies are required by -> the dependencies required by


### Linking Description:

There are three kinds of link methods:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link ->linking

There are three kinds of link methods:

1. Linking with dynamic library `libpaddle_capi_shared.so`(This way is much more convenient and easier, **Without special requirements, it is recommended**), refer to the following:
   1. Compiling with CPU version and using `OpenBLAS`; only need link one library named `libpaddle_capi_shared.so` to develop prediction program through C-API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need link -> need to link


1. Linking with dynamic library `libpaddle_capi_shared.so`(This way is much more convenient and easier, **Without special requirements, it is recommended**), refer to the following:
   1. Compiling with CPU version and using `OpenBLAS`; only need link one library named `libpaddle_capi_shared.so` to develop prediction program through C-API.
1. Compiling with CPU version and using `MKL` lib, you need link MKL library directly to develop prediction program through PaddlePaddle C-API, due to `MKL` has its own dynamic library.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need link -> need to link

1. Linking with dynamic library `libpaddle_capi_shared.so`(This way is much more convenient and easier, **Without special requirements, it is recommended**), refer to the following:
   1. Compiling with CPU version and using `OpenBLAS`; only need link one library named `libpaddle_capi_shared.so` to develop prediction program through C-API.
1. Compiling with CPU version and using `MKL` lib, you need link MKL library directly to develop prediction program through PaddlePaddle C-API, due to `MKL` has its own dynamic library.
1. Compiling with GPU version, CUDA library will be loaded dynamic on prediction program run-time, and also set CUDA library to  `LD_LIBRARY_PATH` environment variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dynamic -> dynamically

1. This linking methods is mainly used for mobile prediction.
1. Split `libpaddle_capi_whole.a` into two static linking library at least to reduce the size of linking libraries.
1. Specify `-Wl,--whole-archive -lpaddle_capi_layers`  and `-Wl,--no-whole-archive -lpaddle_capi_engine` for linking.
1. The dependencies of third-party need explicitly link same as method 2 above.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependencies of third-party -> third-party dependencies

Copy link
Contributor

@abhinavarora abhinavarora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@abhinavarora abhinavarora merged commit 3ebc5e1 into PaddlePaddle:develop Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants