[flang-commits] [PATCH] D80377: [flang] Google test infrastructure support for unittests

sameeran joshi via Phabricator via flang-commits flang-commits at lists.llvm.org
Sat May 23 08:28:01 PDT 2020


sameeranjoshi added a comment.

In D80377#2052113 <https://reviews.llvm.org/D80377#2052113>, @tskeith wrote:

> In D80377#2051422 <https://reviews.llvm.org/D80377#2051422>, @sameeranjoshi wrote:
>
> > In D80377#2051051 <https://reviews.llvm.org/D80377#2051051>, @tskeith wrote:
> >
> > > When I try to build I get this error:
> > >
> > >   ld: library not found for -lgtest_main
> > >
> > >
> > > Please update the README to indicate how to do the correct setup. A link to elsewhere in LLVM is fine.
> >
> >
> > I tried twice building the compiler in-tree on 2 different m/c. I couldn't reproduce the issue, here's how my cmake looks like:
> >
> >   cmake -G "Ninja"  -DCMAKE_INSTALL_PREFIX=../install/  -DCMAKE_BUILD_TYPE="Release"  -DLLVM_TARGETS_TO_BUILD=host -DLLVM_ENABLE_PROJECTS="mlir;flang" -DCMAKE_CXX_STANDARD=17 -DFLANG_INCLUDE_TESTS=ON ../llvm-project/llvm/
> >  
> >
>
>
> Where is it finding the `gtest_main` library? Is it built as part of llvm or coming from outside?


Googletest is built with LLVM, source should be in llvm-project/llvm/utils/unittest/googletest

In D80377#2052155 <https://reviews.llvm.org/D80377#2052155>, @sameeranjoshi wrote:

> In D80377#2052113 <https://reviews.llvm.org/D80377#2052113>, @tskeith wrote:
>
> > In D80377#2051422 <https://reviews.llvm.org/D80377#2051422>, @sameeranjoshi wrote:
> >
> > > In D80377#2051051 <https://reviews.llvm.org/D80377#2051051>, @tskeith wrote:
> > >
> > > > When I try to build I get this error:
> > > >
> > > >   ld: library not found for -lgtest_main
> > > >
> > > >
> > > > Please update the README to indicate how to do the correct setup. A link to elsewhere in LLVM is fine.
> > >
> > >
> > > I tried twice building the compiler in-tree on 2 different m/c. I couldn't reproduce the issue, here's how my cmake looks like:
> > >
> > >   cmake -G "Ninja"  -DCMAKE_INSTALL_PREFIX=../install/  -DCMAKE_BUILD_TYPE="Release"  -DLLVM_TARGETS_TO_BUILD=host -DLLVM_ENABLE_PROJECTS="mlir;flang" -DCMAKE_CXX_STANDARD=17 -DFLANG_INCLUDE_TESTS=ON ../llvm-project/llvm/
> > >  
> > >
> >
> >
> > Where is it finding the `gtest_main` library? Is it built as part of llvm or coming from outside?
>
>
> Googletest is built with LLVM, source should be in llvm-project/llvm/utils/unittest/googletest


Also you should try considering below commit in fir-dev.
https://github.com/flang-compiler/f18-llvm-project/pull/91

This would add the `check-flang-unit` target, without the FIR dependency, so the other pending post merge task 
https://github.com/flang-compiler/f18/issues/995
could not have a blocker.

And the out-of-tree building would still fail as there are issues in building flang with out of tree with FLANG_INCLUDE_TESTS=ON, that's the reason I didn't mention in README


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80377/new/

https://reviews.llvm.org/D80377





More information about the flang-commits mailing list