STK: Undefined symbols for architecture...
Created by: tjfulle
STK fails to link with the following error:
"stk::unit_test_util::create_parallel_output(int)", referenced from:
_main in UnitTestMain.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [packages/stk/stk_unit_test_utils/libstk_unit_main.12.13.dylib] Error 1
make[1]: *** [packages/stk/stk_unit_test_utils/CMakeFiles/stk_unit_main.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
@trilinos/stk
Expectations
That no link error will occur.
Current Behavior
The link error copied above.
Possible Solution
Adding stk_unit_test_utils
to the list of library dependencies for stk_unit_main
, as in the following patch, resolves the issue.
diff --git a/packages/stk/stk_unit_test_utils/CMakeLists.txt b/packages/stk/stk_unit_test_utils/CMakeLists.txt
index 91d6527..e213c3e 100644
--- a/packages/stk/stk_unit_test_utils/CMakeLists.txt
+++ b/packages/stk/stk_unit_test_utils/CMakeLists.txt
@@ -27,6 +27,7 @@ FILE(GLOB UNIT_MAIN_SOURCES unit_main_lib/*.cpp)
TRIBITS_ADD_LIBRARY(
stk_unit_main
SOURCES ${UNIT_MAIN_SOURCES}
+ DEPLIBS stk_unit_test_utils
)
TRIBITS_SUBPACKAGE_POSTPROCESS()
Your Environment
- Relevant repo SHA1s: HEAD of develop branch
- Relevant configure flags or configure script:
- Operating system and version: macOS
- Compiler and TPL versions: gcc 6.4.0
Related Issues
- Similar to: #62