astro-informatics / sopt

Sparse OPTimisation using state-of-the-art convex optimisation algorithms.
http://astro-informatics.github.io/sopt/
GNU General Public License v2.0
9 stars 11 forks source link

Unable to build google benchmarks (development branch) #364

Open krishnakumarg1984 opened 1 year ago

krishnakumarg1984 commented 1 year ago

When trying to build the project (at development branch current HEAD) with benchmarks enabled as follows:

$ mkdir build && cd build
$ conan install .. --build missing -pr:h=default -pr:b=default -o benchmarks=on 
$ conan build ..

we get the following error:

sopt/cpp/benchmarks/wavelets.cc:2:10: fatal error: benchmark/benchmark.h: No such file or directory
    2 | #include <benchmark/benchmark.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [cpp/benchmarks/CMakeFiles/benchmark_wavelets.dir/build.make:76: cpp/benchmarks/CMakeFiles/benchmark_wavelets.dir/wavelets.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1761: cpp/benchmarks/CMakeFiles/benchmark_wavelets.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
ERROR: conanfile.py (sopt/4.0.0): Error in build() method, line 78
        cmake.build()
        ConanException: Error 2 while executing cmake --build "sopt/build" '--' '-j8'
tkoskela commented 1 year ago

This is a bit confusing, since it is a requirement in

https://github.com/astro-informatics/sopt/blob/203106724c9b05e7a5d362a21349ef1864f42301/conanfile.py#L15

Is this just a matter of missing

find_package(benchmark)

in https://github.com/astro-informatics/sopt/blob/development/cmake_files/dependencies.cmake

SJaffa commented 1 year ago

This info might help: https://github.com/google/benchmark#usage-with-cmake