How to check the version of OpenMP on Linux

前端 未结 6 1636
臣服心动
臣服心动 2020-12-13 08:53

I wonder how to check the version of OpenMP on a Linux remote machine?

I don\'t know where it is installed either.

6条回答
  •  囚心锁ツ
    2020-12-13 09:37

    Here's a short C++11 program to display your OpenMP version; it also covers version 5.0 which was released in November 2018.

    #include 
    #include 
    #include 
    
    int main(int argc, char *argv[])
    {
      std::unordered_map map{
        {200505,"2.5"},{200805,"3.0"},{201107,"3.1"},{201307,"4.0"},{201511,"4.5"},{201811,"5.0"},{202011,"5.1"}};
      std::cout << "We have OpenMP " << map.at(_OPENMP) << ".\n";
      return 0;
    }
    

    and compile it with:

    g++ -std=c++11 -fopenmp foobar.cpp
    

提交回复
热议问题