laristra / flecsi

A mirror of FleCSI's internal gitlab repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cinch version and building unit tests

paulanda opened this issue · comments

Hey Flecsi devs,

I'm following the README to build Flecsi on an x86_64 Arch Linux system. The third party debug installs just fine. When I get to the steps to build Flecsi, it fails on make with a few errors related to gtest. E.g.:

In file included from .../flecsi/cinch/gtest/googletest/src/gtest-all.cc:42:
.../flecsi/cinch/gtest/googletest/src/gtest.cc:389:49: error: ambiguating new declaration of ‘const std::vector<std::__cxx11::basic_string<char> >& testing::internal::GetArgvs()’
 const ::std::vector<testing::internal::string>& GetArgvs() {
                                                 ^~~~~~~~

There are a couple of other errors besides those related to GetArgvs(), such as multiple definitions of GTestColor and namespace enclosing involving testing::ScopedTrace.

So I went into the cinch directory and changed the branch to master and rebuilt with ENABLE_UNIT_TESTS=OFF. Flecsi then builds. However, I'd like to build with unit tests on.

When I reenable them, I get the same/similar errors again. I then went into cinch/gtest and also switched it to the master branch. When I do this, Flecsi builds further but has new errors emerge starting with the simple 2d box colorer test. The first error is:

In file included from .../flecsi/cinch/auxiliary/cinchtest.h:9,
                 from .../flecsi/flecsi/coloring/test/test_simple_box_colorer_2d.cc:4:
.../flecsi/cinch/auxiliary/../logging/cinchlog.h:77:19: error: expected identifier before string constant
 #define COLOR_RED ""
                   ^~

My guess is there's a versioning mismatch somewhere still. Any help is greatly appreciated. Thanks.

Cheers,
David

Can you try to use the internal gtest by adding -DDISABLE_FIND_PACKAGE_GTest=ON to the CMake command line?

I added -DCMAKE_DISABLE_FIND_PACKAGE_GTest=TRUE, which sets the install prefix to /usr/local and so picks up the master branch cinch and gtest packages installed via the flecsi-third-party repo. I'm still getting the same errors unfortunately. Let me know if you want a full snippet with all the errors printed.

I dont think flecsi-third-party installs gtest. Cinch is only in that repo to provide some custom FindPackage.cmake

It looks like you have GTest installed on your system. And it looks like the offending line is

https://github.com/laristra/cinch/blob/efd27662b97a2d0849e92cfd0e59064661ec19bb/cmake/unit.cmake#L41

I think it is finding gtest, but there is no target so it is also trying to build it

Can you checkout the branch "gtest" from the cinch repo and try that? It should/may fix it.

Awesome. I successfully built with that branch. Thanks.