Thread: Error during make, second install

Error during make, second install

From
"David G. Johnston"
Date:
Hey,

I installed PostgreSQL source for the first time a few weeks ago.  I am now just getting to my first pull-and-reinstall.  I run make again at the top of the repo and I get:

git @ 7fe3083f4

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -O2 [...] -L../../src/port -L../../src/common   -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib',--enable-new-dtags  -Wl,-E -lpthread -lrt -ldl -lm -o postgres
catalog/catalog.o: In function `GetNewRelFileNode':
catalog.c:(.text+0x3f3): undefined reference to `ParallelMasterBackendId'
catalog/storage.o: In function `RelationCreateStorage':
storage.c:(.text+0x283): undefined reference to `ParallelMasterBackendId'
utils/adt/dbsize.o: In function `pg_relation_filepath':
dbsize.c:(.text+0x166e): undefined reference to `ParallelMasterBackendId'
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target 'postgres' failed
make[2]: *** [postgres] Error 1
make[2]: Leaving directory '/home/postgres/postgresql/src/backend'
Makefile:42: recipe for target 'all-backend-recurse' failed
make[1]: *** [all-backend-recurse] Error 2
make[1]: Leaving directory '/home/postgres/postgresql/src'
GNUmakefile:11: recipe for target 'all-src-recurse' failed
make: *** [all-src-recurse] Error 2

I then ran ./configure again and got the same result.  Ubuntu 18.04.

Simply checking out and re-making 3a990a12635 (plus my two patches) works just fine.

Please advise, fixing stuff in the C parts of the codebase is not a skill I've picked up yet - been focused on docs and tests.

Thanks!

David J.

Re: Error during make, second install

From
"David G. Johnston"
Date:
On Fri, Jul 17, 2020 at 8:58 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
Hey,

I installed PostgreSQL source for the first time a few weeks ago.  I am now just getting to my first pull-and-reinstall.  I run make again at the top of the repo and I get:
[...]

I then ran ./configure again and got the same result.  Ubuntu 18.04.

Sorry for the noise - though maybe some insight is still warranted - but running make clean first seems to have cleared up my problem.

David J.

Re: Error during make, second install

From
Alvaro Herrera
Date:
On 2020-Jul-17, David G. Johnston wrote:

> On Fri, Jul 17, 2020 at 8:58 AM David G. Johnston <
> david.g.johnston@gmail.com> wrote:

> Sorry for the noise - though maybe some insight is still warranted - but
> running make clean first seems to have cleared up my problem.

Do you run "configure --enable-depend"?  If not, then make clean is
mandatory before pulling changes.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: Error during make, second install

From
Tom Lane
Date:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Sorry for the noise - though maybe some insight is still warranted - but
> running make clean first seems to have cleared up my problem.

Yeah.  Just doing "git pull" and "make" will often fail, because by
default there's nothing guaranteeing that all dependent files are remade.
There are two safe workflows that I know of:

1. Run "make distclean" when pulling an update.  It works a bit cleaner
if you do this before not after "git pull".  If there was no update
of the configure script, you can get away with just "make clean", but
you generally don't know that before pulling ...

2. Always configure with --enable-depend.

I prefer #1, as I find it more reliable.  If you use ccache the
build-speed advantage of #2 is pretty minimal.

In either case, when in doubt, try "git clean -dfx" and rebuild
from scratch.

            regards, tom lane