Samsung / UTopia

UT based automated fuzz driver generation
Apache License 2.0
159 stars 25 forks source link

Local build failed #10

Closed rhezashan closed 1 year ago

rhezashan commented 1 year ago

Hi,

I'm facing an error on local build on ubuntu. I want to try UTopia on my machine.

[100%] Linking CXX executable ../bin/tests
/usr/bin/ld: CMakeFiles/tests.dir/generation/TestFuzzInput.cpp.o: in function `TestFuzzInputFactory_NullDefinitionN_Test::TestBody()':
/home/x0x0/UTopia/tests/generation/TestFuzzInput.cpp:246: undefined reference to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)'
/usr/bin/ld: CMakeFiles/tests.dir/generation/TestFuzzInput.cpp.o: in function `TestFuzzInputFactory_NullTypeN_Test::TestBody()':
/home/x0x0/UTopia/tests/generation/TestFuzzInput.cpp:252: undefined reference to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)'
/usr/bin/ld: CMakeFiles/tests.dir/inputanalysis/TestInputAnalysisReport.cpp.o: in function `TestInputAnalysisReport_fromJsonN_Test::TestBody()':
/home/x0x0/UTopia/tests/inputanalysis/TestInputAnalysisReport.cpp:77: undefined reference to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)'
/usr/bin/ld: CMakeFiles/tests.dir/utils/TestFileUtil.cpp.o: in function `TestFileUtilDeathTest_RebasePathInvalidN_Test::TestBody()':
/home/x0x0/UTopia/tests/utils/TestFileUtil.cpp:24: undefined reference to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)'
/usr/bin/ld: CMakeFiles/tests.dir/apiloader/TestAPILoader.cpp.o: in function `APIJsonLoaderDeathTest_NotExistPublicAPIJsonLoadN_Test::TestBody()':
/home/x0x0/UTopia/tests/apiloader/TestAPILoader.cpp:19: undefined reference to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)'
/usr/bin/ld: CMakeFiles/tests.dir/apiloader/TestAPILoader.cpp.o:/home/x0x0/UTopia/tests/apiloader/TestAPILoader.cpp:38: more undefined references to `testing::internal::DeathTest::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/tests.dir/build.make:1071: bin/tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:1957: tests/CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:101: all] Error 2

Maybe you know where I missed steps here?

sole2 commented 1 year ago

Hello. @rhezashan Maybe version compatibility issue with gtest. Which gtest version are you using? Or if you doesn't have plan to modify sources, you can try adding -DBUILD_TESTING=false option to disable tests.

cd $UTOPIA_HOME_DIR
cmake -B build -S . -DBUILD_TESTING=false
cmake --build build -j$(nproc)
rhezashan commented 1 year ago

Hi, Thanks for the advice. I was able to install UTopia without failures with added command cmake -B build -S . -DBUILD_TESTING=false

anyway, I'm using gtest version release-1.8.1

sole2 commented 1 year ago

It is strange as we use same version in our docker image. Anyway closing the issue as it seems not bother you anymore. If you have any other problems, please re-open it.