Skip to content

Generate capi pacakge #7237

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

Merged
merged 1 commit into from
Jan 5, 2018
Merged

Conversation

Yancey0623
Copy link
Contributor

@Yancey0623 Yancey0623 commented Jan 5, 2018

related #7181

@Yancey0623 Yancey0623 changed the title Genearte capi pacakge Generate capi pacakge Jan 5, 2018
make DESTDIR="$install_prefix" install

if [[ ${WITH_MKL:-OFF} == "ON" ]]; then
find ./third_party/install -name 'libmklml_gnu.so' -exec cp {} $install_prefix/usr/local/lib \;
Copy link
Contributor

Choose a reason for hiding this comment

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

libmklml_gnu.so不用copy

find ./third_party/install -name 'libmklml_gnu.so' -exec cp {} $install_prefix/usr/local/lib \;
find ./third_party/install -name 'libmklml_intel.so' -exec cp {} $install_prefix/usr/local/lib \;
cp -P ./third_party/install/mkldnn/lib/* $install_prefix/usr/local/lib/
fi
Copy link
Contributor

@luotao1 luotao1 Jan 5, 2018

Choose a reason for hiding this comment

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

可以仿照如下写法来代替204-206么? @tensor-tang

if '${MKL_SHARED_LIBS}'!= '':
paddle_rt_libs += '${MKL_SHARED_LIBS}'.split(';')

cp -P ./third_party/install/mkldnn/lib/* $install_prefix/usr/local/lib/
fi

find ./third_party/install -name 'libiomp5.so' -exec cp {} $install_prefix/usr/local/lib \;
Copy link
Contributor

Choose a reason for hiding this comment

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

209行的libiomp5只在WITH_MKL=ON的时候用,应该放到上面的if判断中。

@luotao1 luotao1 requested a review from tensor-tang January 5, 2018 08:56
@tensor-tang
Copy link
Contributor

tensor-tang commented Jan 5, 2018

Could we make things simple, how about separate into 2 parts:

  1. adding this package code in this PR, focusing on how to generate package for capi.
  2. actually fix the issue The size of libmkldnn.so.0 is 0B in capi #7181 in next PR. I can follow this later.

Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

I agree with #7237 (comment) . LGTM!

@luotao1
Copy link
Contributor

luotao1 commented Jan 5, 2018

The ldd result is as follows now
image

if [[ ${WITH_MKL:-OFF} == "ON" ]]; then
find ./third_party/install -name 'libmklml_gnu.so' -exec cp {} $install_prefix/usr/local/lib \;
find ./third_party/install -name 'libmklml_intel.so' -exec cp {} $install_prefix/usr/local/lib \;
cp -P ./third_party/install/mkldnn/lib/* $install_prefix/usr/local/lib/
Copy link
Contributor

Choose a reason for hiding this comment

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

执行make install命令时,cmake中设定自动将一些third_party库拷贝到CMAKE_INSTALL_PREFIX/third_party目录下,目前会自动拷贝的库有zlibgloggflagsprotobufopenblas,如:

IF(WITH_C_API)
INSTALL(DIRECTORY ${GLOG_INCLUDE_DIR} DESTINATION third_party/glog)
IF(ANDROID)
INSTALL(FILES ${GLOG_LIBRARIES} DESTINATION third_party/glog/lib/${ANDROID_ABI})
ELSE()
INSTALL(FILES ${GLOG_LIBRARIES} DESTINATION third_party/glog/lib)
ENDIF()
ENDIF()

可以考虑下要不要采用这种方式。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's a better way, and maybe @tensor-tang could consider with this.

@Yancey0623 Yancey0623 merged commit 643ff03 into PaddlePaddle:develop Jan 5, 2018
@Yancey0623 Yancey0623 deleted the build_capi branch January 5, 2018 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants