This forum has been archived. All content is frozen. Please use KDE Discuss instead.

PGI Compiler Support

Tags: None
(comma "," separated)
panyala
Registered Member
Posts
4
Karma
0

PGI Compiler Support

Sun Nov 05, 2017 10:34 pm
Hello,

The Eigen cmake build fails when trying to use the latest PGI compilers.
The problem seems to be that many GCC flags used by the build are not recognized by the PGI C++ compiler.
Are there any plans to support PGI compilers?

Thanks
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: PGI Compiler Support

Tue Nov 07, 2017 8:49 pm
Note that Eigen is header only, so you can try without running Eigen's cmake. Perhaps the problem is that cmake does not properly recognize PGI? Because before adding any flags we check whether the compiler support it. Could you be more specific on the errors you get?
panyala
Registered Member
Posts
4
Karma
0

Re: PGI Compiler Support

Thu Nov 16, 2017 12:06 am
Thanks! I forgot to mention in my earlier post that I was indeed able to use it as header only (without running CMake) when using PGI compiler. When using CMake however, it's precisely as you mentioned - eigen-3.3.4/CMakeLists.txt adds some standard GNU compiler flags like "-Wall", "-Wextra", etc to the list of compile options. PGI compiler does not recognize these flags (it has the equivalent of these flags, but with different names), which is why the cmake build fails. Error log at : https://pastebin.com/zRGZeK7w
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: PGI Compiler Support

Thu Nov 16, 2017 2:43 pm
How did you ran cmake ? This output should not be displayed by cmake. Basically, before adding any flags, like -Wall, we ask cmake to try to compile with this flags, and if it fails, we don't add it. So those errors are expected errors. I just don't why you see them.
panyala
Registered Member
Posts
4
Karma
0

Re: PGI Compiler Support

Fri Nov 17, 2017 3:13 am
Ah. I see. I thought the compile tests were causing the errors. My mistake.

Here is how I ran cmake and the output:

cmake .. -DCMAKE_C_COMPILER=pgcc -DCMAKE_CXX_COMPILER=pgc++

which shows a cmake error as follows:

CMake Error at cmake/EigenTesting.cmake:567 (string):
string sub-command REGEX, mode MATCH needs at least 5 arguments total to
command.
Call Stack (most recent call first):
cmake/EigenTesting.cmake:555 (ei_get_compilerver_from_cxx_version_string)
cmake/EigenTesting.cmake:657 (ei_get_compilerver)
cmake/EigenConfigureTesting.cmake:8 (ei_set_build_string)
CMakeLists.txt:419 (include)


Complete Output of above cmake command: https://pastebin.com/xW8vXxp1

Here is CMakeOutput.log: https://pastebin.com/DZWuNr7t


Thanks
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: PGI Compiler Support  Topic is solved

Fri Nov 17, 2017 11:16 am
what about the following patch:

Code: Select all
--- a/cmake/EigenTesting.cmake
+++ b/cmake/EigenTesting.cmake
@@ -544,16 +544,18 @@ macro(ei_get_compilerver VAR)
       include(EigenDetermineVSServicePack)
       EigenDetermineVSServicePack( my_service_pack )

       if( my_service_pack )
         set(${VAR} ${my_service_pack})
       else()
         set(${VAR} "na")
       endif()
+    else if(${CMAKE_CXX_COMPILER_ID} EQUAL "PGI")
+      set(${VAR} "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")
     else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
     # supporting a "--version" or "/version" flag

     if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} EQUAL "Intel")
       set(EIGEN_CXX_FLAG_VERSION "/version")
     else()
       set(EIGEN_CXX_FLAG_VERSION "--version")
panyala
Registered Member
Posts
4
Karma
0

Re: PGI Compiler Support

Fri Nov 17, 2017 6:42 pm
Thanks! The patch helps fix the error - a minor change had to be done as highlighted below:

+ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "PGI")
+ set(${VAR} "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: PGI Compiler Support

Fri Nov 17, 2017 9:54 pm
thanks for testing and fixing the fix ;)


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]