0

Coliru is failing to compile the program listed below. Follow the link for more information.
This is the command used to compile

g++ -std=c++20 -DNDEBUG -O3 -ftree-vectorize -Wall -Wno-unknown-pragmas -fpermissive -pedantic -pthread main.cpp

Am I missing some compilation flag?

The error is

usr/local/include/c++/12.1.0/pstl/parallel_backend_tbb.h:29:6: error: #error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported. 29 | # error Intel(R) Threading Building Blocks 2018 is required; older versions are not supported.

#include <iostream>
#include <algorithm>
#include <vector>
#include <execution>

int main()
{
    std::vector<int> intData {1, 22, 33,42, 57};
    std::vector<double> doubleData (intData.size ());
    
    std::transform (std::execution::par_unseq, intData.begin (), intData.end (), doubleData.begin (), [] (auto value){return static_cast<double> (value) / 2;});
    
    for (size_t ii = 0; ii < intData.size (); ++ii)
    {
        std::cout << intData[ii] << ", " << doubleData[ii] << "\n";
    }
    
    return 0;
}
Catriel
  • 461
  • 3
  • 11

0 Answers0