Skip to content

make fails to build pgsql-11 under centos 7 #8

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

Closed
malcook opened this issue Apr 3, 2019 · 4 comments · Fixed by #9
Closed

make fails to build pgsql-11 under centos 7 #8

malcook opened this issue Apr 3, 2019 · 4 comments · Fixed by #9

Comments

@malcook
Copy link

malcook commented Apr 3, 2019

after successful install of pg 11 on centos 7 as

sudo  yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm
sudo yum -y install postgresql11-server
sudo yum -y install postgresql11
sudo yum search postgresql11 # see what else there is to install
sudo yum -y install  postgresql11-{server,contrib,docs,libs,odbc,plperl,plpython,libs,devel}

I find that make fails as

make 
...
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o mkdir.o mkdir.c
mkdir.c: In function 'fio_mkdir':
mkdir.c:42:22: error: 'FALSE' undeclared (first use in this function)
     bool recursive = FALSE;
                      ^
mkdir.c:42:22: note: each undeclared identifier is reported only once for each function it appears in
make: *** [<builtin>: mkdir.o] Error 1

I have successfully installed pgsql-fio into earlier versions of postgresql.

workarounds/patches welcome.

Thanks

@usta
Copy link
Contributor

usta commented Apr 3, 2019

hello
could you please add
#define FALSE 0
#define TRUE 1

in fio.h file and retry.

@malcook
Copy link
Author

malcook commented Apr 3, 2019

Yes, that fixed it. Thanks.

FYI: I then got the error during make:

error `make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found` 

which was resolved by

make  with_llvm=no

which solution was recommended in resolution to similar situation: oracle_fdw extension not able to create

@usta
Copy link
Contributor

usta commented Apr 3, 2019

you need to llvm-toolset-7 and devtools-7 in order to not get those error or just like you did you need to mention not to use clang to make

@malcook
Copy link
Author

malcook commented Apr 3, 2019

Even after

sudo yum install centos-release-scl
sudo yum install devtoolset-7
scl enable centos-release-scl devtoolset-7 bash
which clang
/usr/bin/clang

I get

make
...
make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found

giving the path to clang helps, but I still get

make CLANG=/usr/bin/clang
/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include -flto=thin -emit-llvm -c -o fio.bc fio.c
clang: error: unknown argument: '-flto=thin'
make: *** [/usr/pgsql-11/lib/pgxs/src/makefiles/../../src/Makefile.global:1025: fio.bc] Error 1

where as

 make CLANG=/usr/bin/clang with_llvm=no

finishes and I find the extension installs and works.

Am I missing something?

Honestly, I don't really know the consequence of compiling with_llvm=no.

Thanks.

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

Successfully merging a pull request may close this issue.

2 participants