Closed andrewdavidsmith closed 5 months ago
@cb4github I think the C++ standard included with gcc 8.5.0 does not include all of C++17. I made a conda env and got the most recent build they have of gxx 8.5.0 and this is what I found:
(gcc_eight_point_five_2) [18:09][ build (master*)]$ cat testgpp85.cpp
#include <iostream>
#include <numeric>
#include <vector>
int main(int argc, char *argv[]) {
std::vector<double> x = {0.0, 1.0, 3.0, 10};
std::inclusive_scan(begin(x), end(x), begin(x));
for (auto i: x)
std::cout << i << std::endl;
return 0;
}
(gcc_eight_point_five_2) [18:09][ build (master*)]$ g++ --version
g++ (conda-forge gcc 8.5.0-19) 8.5.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(gcc_eight_point_five_2) [18:09][ build (master*)]$ g++ -std=c++17 -o testgpp85 testgpp85.cpp
testgpp85.cpp: In function 'int main(int, char**)':
testgpp85.cpp:9:8: error: 'inclusive_scan' is not a member of 'std'
std::inclusive_scan(begin(x), end(x), begin(x));
^~~~~~~~~~~~~~
(gcc_eight_point_five_2) [18:09][ build (master*)]$ g++-11 -std=c++17 -o testgpp85 testgpp85.cpp
(gcc_eight_point_five_2) [18:09][ build (master*)]$ ./testgpp85
0
1
4
14
(gcc_eight_point_five_2) [18:09][ build (master*)]$
Also, after seeing complaints about these in some old mailing lists, I checked the source for the numeric
header between gcc 8.5 and gcc 9.5:
[18:18][garage]$ ls -lh gcc-8.5.0/libstdc++-v3/include/std/numeric
-rw-rw-r-- 1 andrewds andrewds 5.4K May 14 2021 gcc-8.5.0/libstdc++-v3/include/std/numeric
[18:19][garage]$ ls -lh gcc-9.5.0/libstdc++-v3/include/std/numeric
-rw-r--r-- 1 andrewds andrewds 25K May 27 2022 gcc-9.5.0/libstdc++-v3/include/std/numeric
[18:19][Garage]$ grep -c inclusive_scan gcc-8.5.0/libstdc++-v3/include/std/numeric
0
[18:19][garage]$ grep -c inclusive_scan gcc-9.5.0/libstdc++-v3/include/std/numeric
8
[18:19][garage]$
The std::inclusive_scan
function isn't the only thing that seems off in gcc 8.5.0, so I'm not sure I should change any sources to support it. I'll close this issue, as it pertains specifically to gcc 8.5.0. Please feel free to open another issue if you encounter a different problem. If you want to discuss how to get dnmtools working for you, please feel free to contact me directly. Thanks again for submitting the issue @cb4github -- it helps!
module load gcc/8.5.0 htslib/1.19 autoconf/2.71 htslib/1.20 gsl/2.6
Here's the resulting (warning: entire) log of my attempted make. Thanks again.
Originally posted by @cb4github in https://github.com/smithlabcode/dnmtools/issues/209#issuecomment-2161512142