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

Update bench.cpp #242

Merged
merged 1 commit into from
Dec 10, 2022
Merged

Conversation

dabao085
Copy link
Contributor

fix bench compile error
I encountered a compilation error when I tried to cmake with -DBUILD_TESTS=ON -DBUILD_BENCHMARK=ON and make on Centos7. The error messages were:

/root/clickhouse-cpp/bench/bench.cpp:8:29: error: 'getEnvOrDefault' was not declared in this scope
         .SetHost(           getEnvOrDefault("CLICKHOUSE_HOST",     "localhost"))
                             ^~~~~~~~~~~~~~~
/root/clickhouse-cpp/bench/bench.cpp:9:29: error: 'getEnvOrDefault' was not declared in this scope
         .SetPort( std::stoi(getEnvOrDefault("CLICKHOUSE_PORT",     "9000")))
                             ^~~~~~~~~~~~~~~
/root/clickhouse-cpp/bench/bench.cpp:10:29: error: 'getEnvOrDefault' was not declared in this scope
         .SetUser(           getEnvOrDefault("CLICKHOUSE_USER",     "default"))
                             ^~~~~~~~~~~~~~~
/root/clickhouse-cpp/bench/bench.cpp:11:29: error: 'getEnvOrDefault' was not declared in this scope
         .SetPassword(       getEnvOrDefault("CLICKHOUSE_PASSWORD", ""))
                             ^~~~~~~~~~~~~~~
/root/clickhouse-cpp/bench/bench.cpp:12:29: error: 'getEnvOrDefault' was not declared in this scope
         .SetDefaultDatabase(getEnvOrDefault("CLICKHOUSE_DB",       "default"))

After adding #include <ut/utils.h> in bench/bench.cpp, the compilation succeeded.

fix bench compile error
@CLAassistant
Copy link

CLAassistant commented Oct 31, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@Enmk Enmk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dabao085 ! Thank you for your contribution!

Right now CI/CD doesn't build bench.cpp, could you please fix that?

That would require installing/provisioning benchmark/benchmark.h (and maybe other things too) do you know which version of that utility and how to get/install it?

@Enmk Enmk merged commit 4774da1 into ClickHouse:master Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants