Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Fix C++ unit tests#9349

Merged
cjolivier01 merged 2 commits intoapache:masterfrom
lebeg:link_fix
Jan 12, 2018
Merged

Fix C++ unit tests#9349
cjolivier01 merged 2 commits intoapache:masterfrom
lebeg:link_fix

Conversation

@lebeg
Copy link
Copy Markdown
Contributor

@lebeg lebeg commented Jan 8, 2018

Description

Fixes the C++ unit tests. The operation registrations were not invoked due to symbol stripping by the linker on Mac (clang).

Dependencies

This change depends on:

  • apache:master -> Fix broken unit test compilation #9321
  • dmlc:master -> Add fully qualified type on define default_real_t #317

Checklist

Essentials

  • Passed code style checking (make lint)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

@lebeg lebeg requested a review from cjolivier01 as a code owner January 8, 2018 16:56
@lebeg lebeg changed the title Link fix Fix C++ unit tests on Mac (clang) Jan 8, 2018
Comment thread tests/CMakeLists.txt Outdated
set(UNITTEST_STATIC_LINK ON)
endif()

if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be part of the BEGIN_WHOLE_ARCHIVE/E#ND_WHOLE_ARCHIVE definition in the top-level CMakeLists.txt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, done.

@lebeg lebeg force-pushed the link_fix branch 3 times, most recently from 7e35588 to e1fd101 Compare January 9, 2018 14:22
@lebeg lebeg changed the title Fix C++ unit tests on Mac (clang) Fix C++ unit tests Jan 9, 2018
@lebeg
Copy link
Copy Markdown
Contributor Author

lebeg commented Jan 9, 2018

The verification requires on dmlc:master 'Add fully qualified type on define default_real_t' #317 to be merged first.

@lebeg
Copy link
Copy Markdown
Contributor Author

lebeg commented Jan 12, 2018

@cjolivier01 Could you take another look please?

Comment thread CMakeLists.txt
set(END_WHOLE_ARCHIVE -Wl,--no-whole-archive)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
set(BEGIN_WHOLE_ARCHIVE -Wl,-force_load)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: in the interest of completeness and readability, it would be nice to have a set(END_WHOLE_ARCHIVE "") here

@cjolivier01 cjolivier01 merged commit 1732460 into apache:master Jan 12, 2018
yuxiangw pushed a commit to yuxiangw/incubator-mxnet that referenced this pull request Jan 25, 2018
* Removed tabs from CMakeLists.txt

* Fixed symbol linking in unit tests
@lebeg lebeg deleted the link_fix branch April 16, 2018 15:22
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
* Removed tabs from CMakeLists.txt

* Fixed symbol linking in unit tests
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* Removed tabs from CMakeLists.txt

* Fixed symbol linking in unit tests
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants