Skip to content

Commit

Permalink
build: begin working on supporting PGI
Browse files Browse the repository at this point in the history
PGI doesn't actually work yet; there are a few things to fix in Squash:

 * The splicing code relies on TLS, but PGI doesn't support it (!).
   It should be possible to tweak the code a bit to avoid TLS, which
   would be a good thing for portability in general; TCC doesn't
   support TLS either, though PGI is the only modern non-toy compiler
   I'm aware of which doesn't.
 * PGI doesn't like -fno-builtin, and it's not MSVC.

There also may be something we can fix in Hedley; I was getting an
error from the conformant array parameters (HEDLEY_ARRAY_PARAM).  It
should work in any C99-compliant compiler, but the error was
sufficiently cryptic that I want to take a closer look before pushing
a change.

Additionally, there are issues in libaries various plugins use.  IIRC
brotli, gipfeli, and libdeflate (and maybe others) have issues I
haven't looked at yet.

If anyone wants to take a stab, there is now a community edition:

  http://www.pgroup.com/products/community.htm

I'll try to get back to it soon (I'm curious about performance).  IIRC
brotli, gipfeli, libdeflate, and possibly others will need some
changes.
  • Loading branch information
nemequ committed Feb 12, 2017
1 parent e6a725a commit 9c35e23
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions cmake/RequireStandard.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
include (AddCompilerFlags)

function (target_require_c_standard target standard)
if (${CMAKE_VERSION} VERSION_LESS 3.1 OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "PGI")
get_target_property (sources ${target} SOURCES)
if ("${standard}" STREQUAL "c90")
set(standard "c89")
endif ()

foreach (source ${sources})
if ("${source}" MATCHES "\\.c$")
source_file_add_compiler_flags ("${source}" "-${standard}")
endif ()
endforeach (source)

unset (sources)
elseif (${CMAKE_VERSION} VERSION_LESS 3.1 OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
get_target_property (sources ${target} SOURCES)

foreach (source ${sources})
Expand Down Expand Up @@ -29,7 +42,17 @@ function (target_require_c_standard target standard)
endfunction ()

function (target_require_cxx_standard target standard)
if (${CMAKE_VERSION} VERSION_LESS 3.1 OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")
get_target_property (sources ${target} SOURCES)

foreach (source ${sources})
if ("${source}" MATCHES "\\.(cpp|cc|cxx)$")
source_file_add_compiler_flags ("${source}" "-${standard}")
endif ()
endforeach (source)

unset (sources)
elseif (${CMAKE_VERSION} VERSION_LESS 3.1 OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
get_target_property (sources ${target} SOURCES)

foreach (source ${sources})
Expand Down

0 comments on commit 9c35e23

Please sign in to comment.