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

Add make clean in docker/build.sh to avoid link problem among different environment #8075

Closed
luotao1 opened this issue Feb 2, 2018 · 0 comments · Fixed by #8076
Closed

Comments

@luotao1
Copy link
Contributor

luotao1 commented Feb 2, 2018

There is no make clean before make -j now.

function run_build() {
cat <<EOF
============================================
Building in /paddle/build ...
============================================
EOF
make -j `nproc`
}

The test order of teamcity is: 1. CPU(openblas), 2.CPU(mkl)+GPU

Thus, #7827 encounter a multiple definition mistake when compiling static library libpaddle_fluid.a in the second CPU+GPU mode.

[22:21:24]	libpaddle_fluid.a(tensor_generated_tensor_util.cu.o): In function `paddle::framework::HasInf(paddle::framework::Tensor const&)':
[22:21:24]	tmpxft_00003645_00000000-4_tensor_util.compute_61.cudafe1.cpp:(.text+0x5c0): multiple definition of `paddle::framework::HasInf(paddle::framework::Tensor const&)'
[22:21:24]	libpaddle_fluid.a(tensor_util.cc.o):tensor_util.cc:(.text+0x190): first defined here
[22:21:24]	libpaddle_fluid.a(tensor_generated_tensor_util.cu.o): In function `paddle::framework::HasNAN(paddle::framework::Tensor const&)':
[22:21:24]	tmpxft_00003645_00000000-4_tensor_util.compute_61.cudafe1.cpp:(.text+0xf40): multiple definition of `paddle::framework::HasNAN(paddle::framework::Tensor const&)'
[22:21:24]	libpaddle_fluid.a(tensor_util.cc.o):tensor_util.cc:(.text+0x430): first defined here
[22:21:24]	libpaddle_fluid.a(tensor_util.cc.o): In function `paddle::framework::Tensor::mutable_data(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace>, std::type_index)':
[22:21:24]	tensor_util.cc:(.text._ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index[_ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index]+0x2c3): undefined reference to `paddle::platform::is_cpu_place(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&)'
[22:21:24]	tensor_util.cc:(.text._ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index[_ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index]+0x2cf): undefined reference to `paddle::platform::is_gpu_place(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&)'
[22:21:24]	tensor_util.cc:(.text._ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index[_ZN6paddle9framework6Tensor12mutable_dataEN5boost7variantINS_8platform9CUDAPlaceEJNS4_8CPUPlaceEEEESt10type_index]+0xa70): undefined reference to `paddle::platform::is_cpu_place(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&)'
[22:21:24]	libpaddle_fluid.a(tensor_util.cc.o): In function `bool paddle::framework::AnyVisitor<paddle::framework::HasInfPredicate>::operator()<paddle::platform::CPUPlace>(paddle::platform::CPUPlace const&) const':
[22:21:24]	tensor_util.cc:(.text._ZNK6paddle9framework10AnyVisitorINS0_15HasInfPredicateEEclINS_8platform8CPUPlaceEEEbRKT_[_ZNK6paddle9framework10AnyVisitorINS0_15HasInfPredicateEEclINS_8platform8CPUPlaceEEEbRKT_]+0x766): undefined reference to `paddle::platform::DeviceContextPool::Get(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&)'
[22:21:24]	libpaddle_fluid.a(tensor_util.cc.o): In function `bool paddle::framework::AnyVisitor<paddle::framework::HasNANPredicate>::operator()<paddle::platform::CPUPlace>(paddle::platform::CPUPlace const&) const':
[22:21:24]	tensor_util.cc:(.text._ZNK6paddle9framework10AnyVisitorINS0_15HasNANPredicateEEclINS_8platform8CPUPlaceEEEbRKT_[_ZNK6paddle9framework10AnyVisitorINS0_15HasNANPredicateEEclINS_8platform8CPUPlaceEEEbRKT_]+0x766): undefined reference to `paddle::platform::DeviceContextPool::Get(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace> const&)'

The reason is that tensor_util.cu is a soft link to tensor_util.cc

./tensor_util.cc

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 a pull request may close this issue.

1 participant