Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  Missing postgres.imp

    Posted Fri June 06, 2025 02:22 AM

    Hi,

    I'm trying to build pgvector on AIX 7.2 and get following linkage error:

    ld: 0706-003 Cannot find or read import file: /opt/freeware/lib64/postgresql/postgres.imp
            ld:accessx(): No such file or directory
    collect2: error: ld returned 255 exit status

    # rpm -qa | grep postgres
    postgresql15-libs-15.10-1.ppc
    postgresql15-15.10-1.ppc
    postgresql15-devel-15.10-1.ppc
    postgresql15-server-15.10-1.ppc

    Am I missing a package? Or, maybe is the postgres.imp missing in postgres15-devel package?



    ------------------------------
    Emanuel Reisinger
    ------------------------------

    #AIXOpenSource


  • 2.  RE: Missing postgres.imp

    Posted Fri June 06, 2025 03:13 AM
      |   view attached

    Yes, looks like the import file is missed in the packaging. We will fix this. 
    For now, you can take the attached file here as postgres.imp



    ------------------------------
    Ayappan P
    ------------------------------

    Attachment(s)

    txt
    postgres_imp.txt   191 KB 1 version


  • 3.  RE: Missing postgres.imp

    Posted Fri June 06, 2025 04:30 AM

    Maybe the following error is caused by postgres.imp or a problem in postgres packages?

    pgvector# make OPTFLAGS="" AR="ar -X64"
    rm -f libvector.a
    ar -X64 crs libvector.a src/bitutils.o src/bitvec.o src/halfutils.o src/halfvec.o src/hnsw.o src/hnswbuild.o src/hnswinsert.o src/hnswscan.o src/hnswutils.o src/hnswvacuum.o src/ivfbuild.o src/ivfflat.o src/ivfinsert.o src/ivfkmeans.o src/ivfscan.o src/ivfutils.o src/ivfvacuum.o src/sparsevec.o src/vector.o
    touch libvector.a
    /opt/freeware/lib64/postgresql/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh libvector.a vector.so >libvector.exp
    /opt/freeware/bin/gcc  -maix64   -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -I/home/buildusr/rpmbuild/BUILD/postgresql-15.10/64bit/src/include -I/home/buildusr/rpmbuild/BUILD/postgresql-15.10/64bit/src/interfaces/ecpg/include -I/opt/freeware/include -I/usr/include  -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -o vector.so libvector.a -Wl,-bE:libvector.exp -L/opt/freeware/lib64  -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -L/opt/freeware/lib  -Wl,-blibpath:'/opt/freeware/lib64:/opt/freeware/lib64:/opt/freeware/lib64:/usr/lib64:/opt/freeware/lib:/usr/lib:/opt/freeware/lib:/usr/lib:/lib' -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:/opt/freeware/lib64/postgresql/postgres.imp
    ld: 0711-244 ERROR: No csects or exported symbols have been saved.
    collect2: error: ld returned 8 exit status
    make: *** [/opt/freeware/lib64/postgresql/pgxs/src/makefiles/../../src/Makefile.shlib:333: vector.so] Error 1
    make: *** Deleting file 'vector.so'



    ------------------------------
    Emanuel Reisinger
    ------------------------------



  • 4.  RE: Missing postgres.imp

    Posted Fri June 06, 2025 05:54 AM

    The error is because the .exp file is not having any symbols. Try the below steps.,
    make clean
    export OBJECT_MODE=64
    make OPTFLAGS="-lm"



    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: Missing postgres.imp

    Posted Fri June 06, 2025 06:19 AM

    Now, it seems any library or libraries are missing.

    # export OBJECT_MODE=64
    # make OPTFLAGS="-lm" AR="ar -X64"

    /opt/freeware/lib64/postgresql/pgxs/src/makefiles/../../src/backend/port/aix/mkldexport.sh libvector.a vector.so >libvector.exp
    /opt/freeware/bin/gcc  -maix64   -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -I/home/buildusr/rpmbuild/BUILD/postgresql-15.10/64bit/src/include -I/home/buildusr/rpmbuild/BUILD/postgresql-15.10/64bit/src/interfaces/ecpg/include -I/opt/freeware/include -I/usr/include -lm -ftree-vectorize -fassociative-math -fno-signed-zeros -fno-trapping-math -o vector.so libvector.a -Wl,-bE:libvector.exp -L/opt/freeware/lib64  -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -L/opt/freeware/lib  -Wl,-blibpath:'/opt/freeware/lib64:/opt/freeware/lib64:/opt/freeware/lib64:/usr/lib64:/opt/freeware/lib:/usr/lib:/opt/freeware/lib:/usr/lib:/lib' -Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -Wl,-bI:/opt/freeware/lib64/postgresql/postgres.imp
    ld: 0711-317 ERROR: Undefined symbol: pg_number_of_ones
    ld: 0711-317 ERROR: Undefined symbol: .pg_detoast_datum
    ld: 0711-317 ERROR: Undefined symbol: .pnstrdup
    ld: 0711-317 ERROR: Undefined symbol: .pq_getmsgint
    ld: 0711-317 ERROR: Undefined symbol: .pq_begintypsend
    ld: 0711-317 ERROR: Undefined symbol: .pq_endtypsend
    ld: 0711-317 ERROR: Undefined symbol: .build_reloptions
    ld: 0711-317 ERROR: Undefined symbol: .index_open
    ld: 0711-317 ERROR: Undefined symbol: .list_sort
    ld: 0711-317 ERROR: Undefined symbol: .list_delete_last
    ld: 0711-317 ERROR: Undefined symbol: .index_getprocid
    ld: 0711-317 ERROR: Undefined symbol: .index_getprocinfo
    ld: 0711-317 ERROR: Undefined symbol: pg_global_prng_state
    ld: 0711-317 ERROR: Undefined symbol: .pg_prng_double
    ld: 0711-317 ERROR: Undefined symbol: .list_make1_impl
    ld: 0711-317 ERROR: Undefined symbol: .index_close
    ld: 0711-317 ERROR: Undefined symbol: .table_beginscan_parallel
    ld: 0711-317 ERROR: Undefined symbol: .pgstat_progress_update_param
    ld: 0711-317 ERROR: Undefined symbol: .pg_prng_uint32
    ld: 0711-317 ERROR: Undefined symbol: maintenance_work_mem
    ld: 0711-317 ERROR: Undefined symbol: .plan_create_index_workers
    ld: 0711-317 ERROR: Undefined symbol: .index_form_tuple
    ld: 0711-317 ERROR: Undefined symbol: .table_parallelscan_estimate
    ld: 0711-317 ERROR: Undefined symbol: .table_parallelscan_initialize
    ld: 0711-317 ERROR: Undefined symbol: .log_newpage_range
    ld: 0711-317 ERROR: Undefined symbol: .pgstat_report_activity
    ld: 0711-317 ERROR: Undefined symbol: .table_open
    ld: 0711-317 ERROR: Undefined symbol: .table_close
    ld: 0711-317 ERROR: Undefined symbol: .pq_getmsgfloat4
    ld: 0711-317 ERROR: Undefined symbol: .pq_sendfloat4
    ld: 0711-317 ERROR: Undefined symbol: .pg_qsort
    ld: 0711-317 ERROR: Undefined symbol: .pg_ltoa
    ld: 0711-317 ERROR: Undefined symbol: process_shared_preload_libraries_in_progress
    ld: 0711-317 ERROR: Undefined symbol: max_parallel_maintenance_workers
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status
    make: *** [/opt/freeware/lib64/postgresql/pgxs/src/makefiles/../../src/Makefile.shlib:333: vector.so] Error 1



    ------------------------------
    Emanuel Reisinger
    ------------------------------



  • 6.  RE: Missing postgres.imp

    Posted Fri June 06, 2025 08:50 AM

    All these symbols should be part of the postgres.imp file. Please recheck whether the file is proper and have these symbols. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: Missing postgres.imp

    Posted Tue June 10, 2025 11:45 AM

    Indeed, my postgres.imp file was incomplete. 

    Now I could compile pgvector.

    Thx.



    ------------------------------
    Emanuel Reisinger
    ------------------------------