Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on Oracle/RHEL Linux 7 fails due to C++ > 11 #46

Open
chrisfw opened this issue Apr 13, 2022 · 1 comment
Open

Compiling on Oracle/RHEL Linux 7 fails due to C++ > 11 #46

chrisfw opened this issue Apr 13, 2022 · 1 comment

Comments

@chrisfw
Copy link

chrisfw commented Apr 13, 2022

Hello,

After much ado getting the arrow prerequisites installed on Oracle Linux 7, I discovered that the fdw won't compile with the version of g++ on version 7 (4.8.5) which seems only to support up to c++11. Is there any way you could create a branch that will compile with c++11? I totally understand if this is not something you would like to support, but we are currently pinned to Oracle Linux 7 which has created this predicament.

Regards,
Chris Whelan

 make install CXXFLAGS='-std=c++11'
g++ -std=c++11 -fPIC -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2   -c
In file included from src/common.cpp:1:0:
src/common.hpp:18:0: warning: "DatumGetJsonbP" redefined [enabled by default]
 #define DatumGetJsonbP DatumGetJsonb
 ^
In file included from src/common.hpp:12:0,
                 from src/common.cpp:1:
./utils/jsonb.h:71:0: note: this is the location of the previous definition
 #define DatumGetJsonbP(d) ((Jsonb *) PG_DETOAST_DATUM(d))
 ^
In file included from src/common.cpp:1:0:
src/common.hpp:19:0: warning: "JsonbPGetDatum" redefined [enabled by default]
 #define JsonbPGetDatum JsonbGetDatum
 ^
In file included from src/common.hpp:12:0,
                 from src/common.cpp:1:
./utils/jsonb.h:73:0: note: this is the location of the previous definition
 #define JsonbPGetDatum(p) PointerGetDatum(p)
 ^
In file included from ./utils/array.h:65:0,
                 from ./utils/jsonb.h:16,
                 from src/common.hpp:12,
                 from src/common.cpp:1:
./utils/expandeddatum.h:67:43: error: typedef ‘EOM_get_flat_size_method’ is initialized (use decltype instead)
 typedef Size (*EOM_get_flat_size_method) (ExpandedObjectHeader *eohptr);
                                           ^
./utils/expandeddatum.h:67:43: error: ‘ExpandedObjectHeader’ was not declared in this scope
./utils/expandeddatum.h:67:65: error: ‘eohptr’ was not declared in this scope
 typedef Size (*EOM_get_flat_size_method) (ExpandedObjectHeader *eohptr);
                                                                 ^
./utils/expandeddatum.h:68:42: error: typedef ‘EOM_flatten_into_method’ is initialized (use decltype instead)
 typedef void (*EOM_flatten_into_method) (ExpandedObjectHeader *eohptr,
                                          ^
./utils/expandeddatum.h:68:42: error: ‘ExpandedObjectHeader’ was not declared in this scope
./utils/expandeddatum.h:68:64: error: ‘eohptr’ was not declared in this scope
 typedef void (*EOM_flatten_into_method) (ExpandedObjectHeader *eohptr,
                                                                ^
./utils/expandeddatum.h:69:12: error: expected primary-expression before ‘void’
            void *result, Size allocated_size);
            ^
./utils/expandeddatum.h:69:31: error: expected primary-expression before ‘allocated_size’
            void *result, Size allocated_size);
                               ^
./utils/expandeddatum.h:74:2: error: ‘EOM_get_flat_size_method’ does not name a type
  EOM_get_flat_size_method get_flat_size;
  ^
./utils/expandeddatum.h:75:2: error: ‘EOM_flatten_into_method’ does not name a type
  EOM_flatten_into_method flatten_into;
  ^
./utils/expandeddatum.h:48:59: error: ‘varatt_expanded’ was not declared in this scope
 #define EXPANDED_POINTER_SIZE (VARHDRSZ_EXTERNAL + sizeof(varatt_expanded))
                                                           ^
./utils/expandeddatum.h:110:19: note: in expansion of macro ‘EXPANDED_POINTER_SIZE’
  char  eoh_rw_ptr[EXPANDED_POINTER_SIZE];
                   ^
./utils/expandeddatum.h:48:59: error: ‘varatt_expanded’ was not declared in this scope
 #define EXPANDED_POINTER_SIZE (VARHDRSZ_EXTERNAL + sizeof(varatt_expanded))
                                                           ^
./utils/expandeddatum.h:113:19: note: in expansion of macro ‘EXPANDED_POINTER_SIZE’
  char  eoh_ro_ptr[EXPANDED_POINTER_SIZE];
                   ^
src/common.cpp: In function ‘void* exc_palloc(std::size_t)’:
src/common.cpp:38:26: error: ‘unlikely’ was not declared in this scope
  if (unlikely(ret == NULL))
                          ^
@chrisfw
Copy link
Author

chrisfw commented Apr 13, 2022

I managed to get a newer g++ compiler (9.3.1) installed via software collections, but unfortunately, the compile still fails. Any assistance in you can provide in order to resolve this issue would be greatly appreciated.

Regards,
Chris

g++ -std=gnu++2a -fPIC -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/common.o src/common.cpp
In file included from src/common.cpp:1:
src/common.hpp:18: warning: "DatumGetJsonbP" redefined
   18 | #define DatumGetJsonbP DatumGetJsonb
      |
In file included from src/common.hpp:12,
                 from src/common.cpp:1:
./utils/jsonb.h:71: note: this is the location of the previous definition
   71 | #define DatumGetJsonbP(d) ((Jsonb *) PG_DETOAST_DATUM(d))
      |
In file included from src/common.cpp:1:
src/common.hpp:19: warning: "JsonbPGetDatum" redefined
   19 | #define JsonbPGetDatum JsonbGetDatum
      |
In file included from src/common.hpp:12,
                 from src/common.cpp:1:
./utils/jsonb.h:73: note: this is the location of the previous definition
   73 | #define JsonbPGetDatum(p) PointerGetDatum(p)
      |
In file included from ./utils/array.h:65,
                 from ./utils/jsonb.h:16,
                 from src/common.hpp:12,
                 from src/common.cpp:1:
./utils/expandeddatum.h:67:16: error: typedef ‘EOM_get_flat_size_method’ is initialized (use decltype instead)
   67 | typedef Size (*EOM_get_flat_size_method) (ExpandedObjectHeader *eohptr);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
./utils/expandeddatum.h:67:43: error: ‘ExpandedObjectHeader’ was not declared in this scope; did you mean ‘MakeExpandedObjectReadOnly’?
   67 | typedef Size (*EOM_get_flat_size_method) (ExpandedObjectHeader *eohptr);
      |                                           ^~~~~~~~~~~~~~~~~~~~
      |                                           MakeExpandedObjectReadOnly
./utils/expandeddatum.h:67:65: error: ‘eohptr’ was not declared in this scope
   67 | typedef Size (*EOM_get_flat_size_method) (ExpandedObjectHeader *eohptr);
      |                                                                 ^~~~~~
./utils/expandeddatum.h:68:16: error: typedef ‘EOM_flatten_into_method’ is initialized (use decltype instead)
   68 | typedef void (*EOM_flatten_into_method) (ExpandedObjectHeader *eohptr,
      |                ^~~~~~~~~~~~~~~~~~~~~~~
./utils/expandeddatum.h:68:42: error: ‘ExpandedObjectHeader’ was not declared in this scope; did you mean ‘MakeExpandedObjectReadOnly’?
   68 | typedef void (*EOM_flatten_into_method) (ExpandedObjectHeader *eohptr,
      |                                          ^~~~~~~~~~~~~~~~~~~~
      |                                          MakeExpandedObjectReadOnly
./utils/expandeddatum.h:68:64: error: ‘eohptr’ was not declared in this scope
   68 | typedef void (*EOM_flatten_into_method) (ExpandedObjectHeader *eohptr,
      |                                                                ^~~~~~
./utils/expandeddatum.h:69:12: error: expected primary-expression before ‘void’
   69 |            void *result, Size allocated_size);
      |            ^~~~
./utils/expandeddatum.h:69:31: error: expected primary-expression before ‘allocated_size’
   69 |            void *result, Size allocated_size);
      |                               ^~~~~~~~~~~~~~
./utils/expandeddatum.h:74:2: error: ‘EOM_get_flat_size_method’ does not name a type
   74 |  EOM_get_flat_size_method get_flat_size;
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
./utils/expandeddatum.h:75:2: error: ‘EOM_flatten_into_method’ does not name a type
   75 |  EOM_flatten_into_method flatten_into;
      |  ^~~~~~~~~~~~~~~~~~~~~~~
./utils/expandeddatum.h:48:59: error: ‘varatt_expanded’ was not declared in this scope
   48 | #define EXPANDED_POINTER_SIZE (VARHDRSZ_EXTERNAL + sizeof(varatt_expanded))
      |                                                           ^~~~~~~~~~~~~~~
./utils/expandeddatum.h:110:19: note: in expansion of macro ‘EXPANDED_POINTER_SIZE’
  110 |  char  eoh_rw_ptr[EXPANDED_POINTER_SIZE];
      |                   ^~~~~~~~~~~~~~~~~~~~~
./utils/expandeddatum.h:48:59: error: ‘varatt_expanded’ was not declared in this scope
   48 | #define EXPANDED_POINTER_SIZE (VARHDRSZ_EXTERNAL + sizeof(varatt_expanded))
      |                                                           ^~~~~~~~~~~~~~~
./utils/expandeddatum.h:113:19: note: in expansion of macro ‘EXPANDED_POINTER_SIZE’
  113 |  char  eoh_ro_ptr[EXPANDED_POINTER_SIZE];
      |                   ^~~~~~~~~~~~~~~~~~~~~
src/common.cpp: In function ‘void* exc_palloc(std::size_t)’:
src/common.cpp:38:6: error: ‘unlikely’ was not declared in this scope
   38 |  if (unlikely(ret == NULL))
      |      ^~~~~~~~
make: *** [<builtin>: src/common.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant