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

Tests fail to link #24

Open
yurivict opened this issue Aug 26, 2022 · 2 comments
Open

Tests fail to link #24

yurivict opened this issue Aug 26, 2022 · 2 comments

Comments

@yurivict
Copy link

[ 96%] Linking CXX executable run_tests
cd /disk-samsung/freebsd-ports/math/spla/work/.build/tests && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/run_tests.dir/link.txt --verbose=1
/usr/bin/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  -Wl,-rpath=/usr/local/lib/gcc11  -L/usr/local/lib/gcc11 -B/usr/local/bin -fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc11 -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib/gcc11 -fopenmp=libomp CMakeFiles/run_tests.dir/programs/run_tests.cpp.o CMakeFiles/run_tests.dir/test_pool_allocator.cpp.o CMakeFiles/run_tests.dir/test_gemm.cpp.o CMakeFiles/run_tests.dir/test_gemm_ssb.cpp.o CMakeFiles/run_tests.dir/test_gemm_sbs.cpp.o -o run_tests  -Wl,-rpath,/disk-samsung/freebsd-ports/math/spla/work/.build/src:/usr/local/lib ../src/libspla_test.so.1.5.4 ../_deps/googletest-build/googletest/libgtest_main.a /usr/lib/libdl.so /usr/local/lib/libmpicxx.so /usr/local/lib/libmpi.so /usr/lib/libomp.so /usr/local/lib/libopenblas.so ../_deps/googletest-build/googletest/libgtest.a -pthread /usr/local/lib/libscalapack.so 
/usr/local/bin/ld: CMakeFiles/run_tests.dir/programs/run_tests.cpp.o: in function `gtest_mpi::(anonymous namespace)::PrettyMPIUnitTestResultPrinter::OnTestCaseStart(testing::TestSuite const&)':
run_tests.cpp:(.text+0xb85): undefined reference to `testing::TestSuite::test_to_run_count() const'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/programs/run_tests.cpp.o: in function `gtest_mpi::(anonymous namespace)::PrettyMPIUnitTestResultPrinter::OnTestCaseEnd(testing::TestSuite const&)':
run_tests.cpp:(.text+0x2128): undefined reference to `testing::TestSuite::test_to_run_count() const'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm.cpp.o: in function `testing::internal::ParameterizedTestSuiteInfo<GemmTest<double> >* testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder<GemmTest<double> >(char const*, testing::internal::CodeLocation)':
test_gemm.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI8GemmTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI8GemmTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): undefined reference to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm.cpp.o: in function `testing::internal::ParameterizedTestSuiteInfo<GemmTest<std::__1::complex<double> > >* testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder<GemmTest<std::__1::complex<double> > >(char const*, testing::internal::CodeLocation)':
test_gemm.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI8GemmTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI8GemmTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): undefined reference to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm_ssb.cpp.o: in function `testing::internal::ParameterizedTestSuiteInfo<GemmSSBTest<double> >* testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder<GemmSSBTest<double> >(char const*, testing::internal::CodeLocation)':
test_gemm_ssb.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSSBTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSSBTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): undefined reference to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm_ssb.cpp.o: in function `testing::internal::ParameterizedTestSuiteInfo<GemmSSBTest<std::__1::complex<double> > >* testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder<GemmSSBTest<std::__1::complex<double> > >(char const*, testing::internal::CodeLocation)':
test_gemm_ssb.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSSBTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSSBTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): undefined reference to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm_sbs.cpp.o: in function `testing::internal::ParameterizedTestSuiteInfo<GemmSBSTest<double> >* testing::internal::ParameterizedTestSuiteRegistry::GetTestSuitePatternHolder<GemmSBSTest<double> >(char const*, testing::internal::CodeLocation)':
test_gemm_sbs.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSBSTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSBSTestIdEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): undefined reference to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)'
/usr/local/bin/ld: CMakeFiles/run_tests.dir/test_gemm_sbs.cpp.o:test_gemm_sbs.cpp:(.text._ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSBSTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE[_ZN7testing8internal30ParameterizedTestSuiteRegistry25GetTestSuitePatternHolderI11GemmSBSTestINSt3__17complexIdEEEEEPNS0_26ParameterizedTestSuiteInfoIT_EEPKcNS0_12CodeLocationE]+0x23b): more undefined references to `testing::internal::ReportInvalidTestSuiteType(char const*, testing::internal::CodeLocation)' follow
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [tests/run_tests] Error code 1

Version: 1.5.4
clang-14
FreeBSD 13.1

@AdhocMan
Copy link
Collaborator

Unfortunately I can't test on FreeBSD myself, but it looks like symbols of the google test library cannot be found by the linker.
My suggestion for a workaround would be to try to build the google test library as a shared library instead. You can do this by configuring with the cmake option -DBUILD_SHARED_LIBS=ON.

@yurivict
Copy link
Author

Tests in the version 1.5.5 fail to compile:

In file included from /usr/ports/math/spla/work/spla-1.5.5/tests/programs/run_tests.cpp:5:
In file included from /usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi.hpp:74:
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi_internal.hpp:180:22: error: no type named 'Int32' in namespace 'testing::internal'
::testing::internal::Int32 Int32FromEnvOrDie(const char* var,
~~~~~~~~~~~~~~~~~~~~~^
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi_internal.hpp:181:67: error: no type named 'Int32' in namespace 'testing::internal'
                                             ::testing::internal::Int32 default_val) {
                                             ~~~~~~~~~~~~~~~~~~~~~^
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi_internal.hpp:189:3: error: unknown type name 'Int32'
  Int32 result;
  ^
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi_internal.hpp:240:9: error: unknown type name 'Int32'
  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
        ^
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi_internal.hpp:241:9: error: unknown type name 'Int32'
  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
        ^
In file included from /usr/ports/math/spla/work/spla-1.5.5/tests/programs/run_tests.cpp:5:
/usr/ports/math/spla/work/.build/_deps/gtest_mpi-src/include/gtest_mpi/gtest_mpi.hpp:167:11: error: unknown type name 'Int32'
    const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
          ^
6 errors generated.

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

No branches or pull requests

2 participants