Skip to content

Conversation

gangliao
Copy link
Contributor

@gangliao gangliao commented Jun 20, 2017

ENHANCEMENT:

If we have lots of source files under framework folder, each of them will invoke cc_library(filename SRC ...) to generate *.a, finally, we must provide a target name framework (framework.a) for the outside usage.

Therefore, we need to merge multiple small libraries into larger one libframework.a. This PR is to solve this problem.

For example,
If you want to merge libddim.a and libplace.a ... into libframework.a, you can use cc_library as follows:

cc_library(framework DEPS ddim place)

After this PR be merged, we can completely refactor the underlying building system of Paddle.

@gangliao gangliao requested review from Xreki and wangkuiyi June 20, 2017 13:47
@gangliao
Copy link
Contributor Author

This PR is verified, please try it.

CI failed because of no space left on device.
Error response from daemon: Error processing tar file(exit status 1): write /build/paddle-0.1.1-Linux.deb: no space left on device

Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

if (cc_library_DEPS)
merge_static_libs(${TARGET_NAME} ${cc_library_DEPS})
else()
message(FATAL "Please specify source file or library in cc_library.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about changing the error message to be "cc_library requires at least SRCS or DEPS"?

# tensor.cc
# DEPS
# variant)
function(merge_static_libs TARGET_NAME)
Copy link
Collaborator

Choose a reason for hiding this comment

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

merge ==> compose ?

if (nv_library_DEPS)
merge_static_libs(${TARGET_NAME} ${nv_library_DEPS})
else()
message(FATAL "Please specify source file or library in nv_library.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about "nv_library requires at least SRCS or DEPS"?

@wangkuiyi wangkuiyi merged commit 603fd43 into PaddlePaddle:develop Jun 21, 2017
chen2016013 pushed a commit to chen2016013/Paddle that referenced this pull request Oct 17, 2025
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.

2 participants