Closed yurivict closed 12 months ago
Moving to c++20 is unlikely as support for some older long-time supported OS’s is desirable. Regarding the other option, the gtest suite is essential to confirm that everything is working as expected, which appears to be especially important for packaging. Note that Cantera is now compiled with C++17, so there should not be an issue? To me, the error message about C++ 14 makes little sense (is this an upstream bug?); in case there are peculiarities of gtest-port
compatibilities, PR’s would certainly be welcome.
PS: I had assumed that this was for the development version (main
), but I just noticed that the flag std=c++11
was set, which will no longer work for the upcoming Cantera release regardless. If this is for an older version, please provide the information that the bug report template is asking for.
The latest googletest fails with --std=c++11. You should change this to at least --std=c++14.
The latest googletest fails with --std=c++11. You should change this to at least --std=c++14.
I am not sure that I am following. Unless defaults are somehow overridden, all of Cantera is configured to use c++17 (including googletests, which you can see for the GH Action tests, e.g. https://github.com/Cantera/cantera/actions/runs/5476211997/jobs/9974847774).
scons: Configure: Checking for C++ header file gtest/gtest.h...
.sconf_temp/conftest_56ec5a054fca65531fcaacd0904ff277_0.cpp <-
|
|#include "gtest/gtest.h"
|
|
g++ -o .sconf_temp/conftest_56ec5a054fca65531fcaacd0904ff277_0_27d2dbb2e9f27db465058811a3e62d19.o -c -isystem /usr/share/miniconda3/envs/test/include -std=c++17 -pthread -O3 -ffast-math -fno-finite-math-only -DNDEBUG .sconf_temp/conftest_56ec5a054fca65531fcaacd0904ff277_0.cpp
.sconf_temp/conftest_56ec5a054fca65531fcaacd0904ff277_0.cpp:2:10: fatal error: gtest/gtest.h: No such file or directory
2 | #include "gtest/gtest.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
scons: Configure: no
(This is for a sundials runner on Ubuntu, which will use a private gtest installation)
Version 2.6.0 has c++11 in SConstruct.
Ok. It would have helped if you had kept critical information we ask for in our bug report template:
**System information**
- Cantera version: [for example, 2.5.0 or the git commit hash]
- OS: [for example, Windows 10]
- Python/MATLAB/other software versions:
You should be able to disable the system gtest or skip it altogether by using the configuration option
googletest: [ 'default' | 'system' | 'submodule' | 'none' ] Select whether to use gtest/gmock from system installation (system), from a Git submodule (submodule), to decide automatically (default) or don't look for gtest/gmock (none) and don't run tests that depend on gtest/gmock.
default: 'default'
(See https://cantera.org/compiling/config-options.html#scons-config)
I'm closing this. We're about to start beta for 3.0 which resolves this anyways and the option to disable googltest is clearly documented. Please feel free to reopen if there are other changes needed.
Problem description
configure prints:
Corresponding lines in config.log:
Steps to reproduce regular configure
Suggested solutions (1) Do not require googletest during build. The purpose of googletest is for testing, so if the users would like to run tests - they would be required to have googletest. (2) Use c++20. Now in 2023 virtually all compilers support c++20.