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

[REGRESSION] Cmake script in 1.8.4 says that its version is 0.0.0, libbenchmark_main.so.1 became libbenchmark_main.so.0 #1792

Closed
yurivict opened this issue May 24, 2024 · 6 comments · Fixed by #1793
Labels
incomplete work needed

Comments

@yurivict
Copy link

Describe the bug
This cmake script:

cmake_minimum_required(VERSION 3.15)

project(x VERSION 0.11.1 LANGUAGES CXX)

find_package(benchmark REQUIRED)
message("benchmark_VERSION=${benchmark_VERSION}")

prints:

benchmark_VERSION=0.0.0

System
Which OS, compiler, and compiler version are you using:

  • OS: FreeBSD 14.0
  • Compiler and version: clang-18
@yurivict yurivict changed the title [REGRESSION] Cmake script in 1.8.4 says that its version is 0.0.0, libbenchmark_main.so.1 beause libbenchmark_main.so.0 [REGRESSION] Cmake script in 1.8.4 says that its version is 0.0.0, libbenchmark_main.so.1 becme libbenchmark_main.so.0 May 24, 2024
@yurivict yurivict changed the title [REGRESSION] Cmake script in 1.8.4 says that its version is 0.0.0, libbenchmark_main.so.1 becme libbenchmark_main.so.0 [REGRESSION] Cmake script in 1.8.4 says that its version is 0.0.0, libbenchmark_main.so.1 became libbenchmark_main.so.0 May 24, 2024
@LebedevRI
Copy link
Collaborator

Seems to be working fine here:

$ git describe 
v1.8.4
$ cmake .. -DBUILD_SHARED_LIBS=ON
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Failed to find LLVM FileCheck
-- Found Git: /usr/bin/git (found version "2.45.1")
-- Google Benchmark version: v1.8.4, normalized to 1.8.4
-- Looking for shm_open in rt
-- Looking for shm_open in rt - found
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST
-- Performing Test HAVE_CXX_FLAG_WOLD_STYLE_CAST - Success
-- Performing Test HAVE_CXX_FLAG_WCONVERSION
-- Performing Test HAVE_CXX_FLAG_WCONVERSION - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Compiling and running to test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Compiling and running to test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Compiling and running to test HAVE_PTHREAD_AFFINITY
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for Google Test sources
-- Looking for Google Test sources in /repositories/googlebenchmark/googletest
-- Found Google Test in /repositories/googlebenchmark/googletest
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /repositories/googlebenchmark/build-Clang17-release/third_party/googletest
[1/9] Creating directories for 'googletest'
[2/9] No download step for 'googletest'
[3/9] No update step for 'googletest'
[4/9] No patch step for 'googletest'
[5/9] No configure step for 'googletest'
[6/9] No build step for 'googletest'
[7/9] No install step for 'googletest'
[8/9] No test step for 'googletest'
[9/9] Completed 'googletest'
-- The C compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: /usr/bin/python3 (found version "3.11.9") found components: Interpreter
-- Performing Test HAVE_CXX_FLAG_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_CXX_FLAG_WNO_UNUSED_VARIABLE - Success
-- Performing Test BENCHMARK_HAS_O3_FLAG
-- Performing Test BENCHMARK_HAS_O3_FLAG - Success
-- Performing Test BENCHMARK_HAS_DEPRECATED_DECLARATIONS_FLAG
-- Performing Test BENCHMARK_HAS_DEPRECATED_DECLARATIONS_FLAG - Success
-- Performing Test BENCHMARK_HAS_WNO_ODR
-- Performing Test BENCHMARK_HAS_WNO_ODR - Success
-- Performing Test BENCHMARK_HAS_WNO_LTO_TYPE_MISMATCH
-- Performing Test BENCHMARK_HAS_WNO_LTO_TYPE_MISMATCH - Success
-- Configuring done (3.3s)
-- Generating done (0.0s)
-- Build files have been written to: /repositories/googlebenchmark/build-Clang17-release
$ ninja
[115/115] Linking CXX executable test/benchmark_gtest
$ ls -lah lib/
total 1.4M
drwxr-xr-x 1 lebedevri lebedevri  194 May 24 19:16 .
drwxr-xr-x 1 lebedevri lebedevri  520 May 24 19:16 ..
lrwxrwxrwx 1 lebedevri lebedevri   18 May 24 19:16 libgmock.so -> libgmock.so.1.14.0
-rwxr-xr-x 1 lebedevri lebedevri 328K May 24 19:16 libgmock.so.1.14.0
lrwxrwxrwx 1 lebedevri lebedevri   23 May 24 19:16 libgmock_main.so -> libgmock_main.so.1.14.0
-rwxr-xr-x 1 lebedevri lebedevri 7.6K May 24 19:16 libgmock_main.so.1.14.0
lrwxrwxrwx 1 lebedevri lebedevri   18 May 24 19:16 libgtest.so -> libgtest.so.1.14.0
-rwxr-xr-x 1 lebedevri lebedevri 1.1M May 24 19:16 libgtest.so.1.14.0
$ git describe 
v1.8.4
$
$ cmake . -Dbenchmark_DIR=/repositories/googlebenchmark/build-Clang17-release
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
benchmark_VERSION=1.8.4
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/qq

@LebedevRI LebedevRI added the incomplete work needed label May 24, 2024
@yurivict
Copy link
Author

You use the variable NORMALIZED_VERSION here.

It is not defined.

Where is this variable documented?

@LebedevRI
Copy link
Collaborator

Please provide reproduction steps for the issue described in your original comment.

@LebedevRI
Copy link
Collaborator

Ok, so it does not work when using tarball source.

LebedevRI added a commit to LebedevRI/benchmark that referenced this issue May 24, 2024
google#1742 changed the placeholder version from `0.0.0` to `v0.0.0`,
but this line which was further dealing with it, was not updated.

Fixes google#1792
dmah42 added a commit that referenced this issue May 28, 2024
#1742 changed the placeholder version from `0.0.0` to `v0.0.0`,
but this line which was further dealing with it, was not updated.

Fixes #1792

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
@aprokop
Copy link

aprokop commented Jul 17, 2024

Would it be possible to create a release soon with this fix? Right now, it does not seem to be a good workaround for codes that do find_package(benchmark 1.6) or similar. Or is checking for 0.0.0 version guarantees that it only happens in 1.8.4?

@dmah42
Copy link
Member

dmah42 commented Jul 18, 2024

Would it be possible to create a release soon with this fix? Right now, it does not seem to be a good workaround for codes that do find_package(benchmark 1.6) or similar. Or is checking for 0.0.0 version guarantees that it only happens in 1.8.4?

done. v1.8.5 now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete work needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants