I was hoping setting BINDGEN_EXTRA_CLANG_ARGS
would do it, but it didn't. So I used:
export C_INCLUDE_PATH="/opt/freeware/include"
That made it build "pgrx-pg-sys v0.12.9" and "pgrx v0.12.9" successfully. But it then failed to link "vectorscale v0.7.1":
= note: ld: 0711-224 WARNING: Duplicate symbol: __fe_def_env
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-317 ERROR: Undefined symbol: CurrentMemoryContext
ld: 0711-317 ERROR: Undefined symbol: TopMemoryContext
ld: 0711-317 ERROR: Undefined symbol: TopTransactionContext
ld: 0711-317 ERROR: Undefined symbol: PostmasterContext
ld: 0711-317 ERROR: Undefined symbol: MessageContext
ld: 0711-317 ERROR: Undefined symbol: CurTransactionContext
ld: 0711-317 ERROR: Undefined symbol: ErrorContext
ld: 0711-317 ERROR: Undefined symbol: PortalContext
ld: 0711-317 ERROR: Undefined symbol: CacheMemoryContext
ld: 0711-317 ERROR: Undefined symbol: PG_exception_stack
ld: 0711-317 ERROR: Undefined symbol: error_context_stack
ld: 0711-317 ERROR: Undefined symbol: .palloc0
ld: 0711-317 ERROR: Undefined symbol: .CopyErrorData
ld: 0711-317 ERROR: Undefined symbol: .FreeErrorData
ld: 0711-317 ERROR: Undefined symbol: .build_reloptions
ld: 0711-317 ERROR: Undefined symbol: .pg_detoast_datum_copy
ld: 0711-317 ERROR: Undefined symbol: .pg_detoast_datum
ld: 0711-317 ERROR: Undefined symbol: .get_typlenbyvalalign
ld: 0711-317 ERROR: Undefined symbol: .pfree
ld: 0711-317 ERROR: Undefined symbol: InterruptPending
ld: 0711-317 ERROR: Undefined symbol: .ProcessInterrupts
ld: 0711-317 ERROR: Undefined symbol: .errstart
ld: 0711-317 ERROR: Undefined symbol: .errcode
ld: 0711-317 ERROR: Undefined symbol: .errmsg
ld: 0711-317 ERROR: Undefined symbol: .errdetail
ld: 0711-317 ERROR: Undefined symbol: .errhint
ld: 0711-317 ERROR: Undefined symbol: .errfinish
ld: 0711-317 ERROR: Undefined symbol: .ReadBufferExtended
ld: 0711-317 ERROR: Undefined symbol: .LockBuffer
ld: 0711-317 ERROR: Undefined symbol: .GenericXLogStart
ld: 0711-317 ERROR: Undefined symbol: .GenericXLogRegisterBuffer
ld: 0711-317 ERROR: Undefined symbol: .IsTransactionState
ld: 0711-317 ERROR: Undefined symbol: .UnlockReleaseBuffer
ld: 0711-317 ERROR: Undefined symbol: .PageGetFreeSpace
ld: 0711-317 ERROR: Undefined symbol: .LockRelationForExtension
ld: 0711-317 ERROR: Undefined symbol: .UnlockRelationForExtension
ld: 0711-317 ERROR: Undefined symbol: .PageInit
ld: 0711-317 ERROR: Undefined symbol: .GenericXLogAbort
ld: 0711-317 ERROR: Undefined symbol: .BufferGetBlockNumber
ld: 0711-317 ERROR: Undefined symbol: .PageAddItemExtended
ld: 0711-317 ERROR: Undefined symbol: .MarkBufferDirty
ld: 0711-317 ERROR: Undefined symbol: .GenericXLogFinish
ld: 0711-317 ERROR: Undefined symbol: BufferBlocks
ld: 0711-317 ERROR: Undefined symbol: LocalBufferBlockPointers
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextDelete
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextReset
ld: 0711-317 ERROR: Undefined symbol: .relation_close
ld: 0711-317 ERROR: Undefined symbol: .RelationClose
ld: 0711-317 ERROR: Undefined symbol: .RelationGetNumberOfBlocksInFork
ld: 0711-317 ERROR: Undefined symbol: .ReleaseBuffer
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextAlloc
ld: 0711-317 ERROR: Undefined symbol: .pg_re_throw
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextRegisterResetCallback
ld: 0711-317 ERROR: Undefined symbol: log_min_messages
ld: 0711-317 ERROR: Undefined symbol: client_min_messages
ld: 0711-317 ERROR: Undefined symbol: .table_slot_create
ld: 0711-317 ERROR: Undefined symbol: .slot_getsomeattrs_int
ld: 0711-317 ERROR: Undefined symbol: .ExecDropSingleTupleTableSlot
ld: 0711-317 ERROR: Undefined symbol: .RelationGetIndexScan
ld: 0711-317 ERROR: Undefined symbol: .pgstat_assoc_relation
ld: 0711-317 ERROR: Undefined symbol: .DecrTupleDescRefCount
ld: 0711-317 ERROR: Undefined symbol: .index_getprocinfo
ld: 0711-317 ERROR: Undefined symbol: .FunctionCall0Coll
ld: 0711-317 ERROR: Undefined symbol: .pgstat_progress_update_param
ld: 0711-317 ERROR: Undefined symbol: .AllocSetContextCreateInternal
ld: 0711-317 ERROR: Undefined symbol: .genericcostestimate
ld: 0711-317 ERROR: Undefined symbol: .add_reloption_kind
ld: 0711-317 ERROR: Undefined symbol: .add_string_reloption
ld: 0711-317 ERROR: Undefined symbol: .add_int_reloption
ld: 0711-317 ERROR: Undefined symbol: .add_real_reloption
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextStrdup
ld: 0711-317 ERROR: Undefined symbol: .DefineCustomIntVariable
ld: 0711-317 ERROR: Undefined symbol: .vacuum_delay_point
ld: 0711-317 ERROR: Undefined symbol: .LockBufferForCleanup
ld: 0711-317 ERROR: Undefined symbol: .standard_planner
ld: 0711-317 ERROR: Undefined symbol: .standard_ProcessUtility
ld: 0711-317 ERROR: Undefined symbol: .standard_ExecutorEnd
ld: 0711-317 ERROR: Undefined symbol: .list_free
ld: 0711-317 ERROR: Undefined symbol: .standard_ExecutorFinish
ld: 0711-317 ERROR: Undefined symbol: .standard_ExecutorStart
ld: 0711-317 ERROR: Undefined symbol: .standard_ExecutorRun
ld: 0711-317 ERROR: Undefined symbol: .array_contains_nulls
ld: 0711-317 ERROR: Undefined symbol: MyBgworkerEntry
ld: 0711-317 ERROR: Undefined symbol: MyLatch
ld: 0711-317 ERROR: Undefined symbol: .WaitLatch
ld: 0711-317 ERROR: Undefined symbol: .ResetLatch
ld: 0711-317 ERROR: Undefined symbol: .BackgroundWorkerInitializeConnection
ld: 0711-317 ERROR: Undefined symbol: .ProcessConfigFile
ld: 0711-317 ERROR: Undefined symbol: .SetLatch
ld: 0711-317 ERROR: Undefined symbol: .pqsignal
ld: 0711-317 ERROR: Undefined symbol: .BackgroundWorkerUnblockSignals
ld: 0711-317 ERROR: Undefined symbol: .GetBackgroundWorkerPid
ld: 0711-317 ERROR: Undefined symbol: .TerminateBackgroundWorker
ld: 0711-317 ERROR: Undefined symbol: MyProcPid
ld: 0711-317 ERROR: Undefined symbol: .WaitForBackgroundWorkerStartup
ld: 0711-317 ERROR: Undefined symbol: .WaitForBackgroundWorkerShutdown
ld: 0711-317 ERROR: Undefined symbol: .RegisterBackgroundWorker
ld: 0711-317 ERROR: Undefined symbol: shmem_startup_hook
ld: 0711-317 ERROR: Undefined symbol: .RegisterDynamicBackgroundWorker
ld: 0711-317 ERROR: Undefined symbol: .RegisterXactCallback
ld: 0711-317 ERROR: Undefined symbol: .UnregisterSubXactCallback
ld: 0711-317 ERROR: Undefined symbol: .RegisterSubXactCallback
ld: 0711-317 ERROR: Undefined symbol: .lookup_rowtype_tupdesc
ld: 0711-317 ERROR: Undefined symbol: .palloc
ld: 0711-317 ERROR: Undefined symbol: .get_fn_expr_argtype
ld: 0711-317 ERROR: Undefined symbol: .get_element_type
ld: 0711-317 ERROR: Undefined symbol: .timestamp_date
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_date
ld: 0711-317 ERROR: Undefined symbol: .make_date
ld: 0711-317 ERROR: Undefined symbol: .FlushErrorState
ld: 0711-317 ERROR: Undefined symbol: .extract_date
ld: 0711-317 ERROR: Undefined symbol: .numeric_int2
ld: 0711-317 ERROR: Undefined symbol: .numeric_out
ld: 0711-317 ERROR: Undefined symbol: .numeric_int4
ld: 0711-317 ERROR: Undefined symbol: .GetCurrentTransactionStartTimestamp
ld: 0711-317 ERROR: Undefined symbol: .GetCurrentStatementStartTimestamp
ld: 0711-317 ERROR: Undefined symbol: .GetCurrentTimestamp
ld: 0711-317 ERROR: Undefined symbol: .GetSQLCurrentTimestamp
ld: 0711-317 ERROR: Undefined symbol: .GetSQLLocalTimestamp
ld: 0711-317 ERROR: Undefined symbol: .timeofday
ld: 0711-317 ERROR: Undefined symbol: .pg_detoast_datum_packed
ld: 0711-317 ERROR: Undefined symbol: .GetDatabaseEncoding
ld: 0711-317 ERROR: Undefined symbol: .float8_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .date_mii
ld: 0711-317 ERROR: Undefined symbol: .date_pli
ld: 0711-317 ERROR: Undefined symbol: .interval_div
ld: 0711-317 ERROR: Undefined symbol: .interval_mi
ld: 0711-317 ERROR: Undefined symbol: .interval_mul
ld: 0711-317 ERROR: Undefined symbol: .interval_pl
ld: 0711-317 ERROR: Undefined symbol: .interval_um
ld: 0711-317 ERROR: Undefined symbol: .time_mi_time
ld: 0711-317 ERROR: Undefined symbol: .time_mi_interval
ld: 0711-317 ERROR: Undefined symbol: .time_pl_interval
ld: 0711-317 ERROR: Undefined symbol: .timestamp_mi
ld: 0711-317 ERROR: Undefined symbol: .date_mi_interval
ld: 0711-317 ERROR: Undefined symbol: .date_pl_interval
ld: 0711-317 ERROR: Undefined symbol: .datetime_timestamp
ld: 0711-317 ERROR: Undefined symbol: .timestamp_pl_interval
ld: 0711-317 ERROR: Undefined symbol: .timestamp_mi_interval
ld: 0711-317 ERROR: Undefined symbol: .datetimetz_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .timetz_pl_interval
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_pl_interval
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_mi_interval
ld: 0711-317 ERROR: Undefined symbol: .timetz_mi_interval
ld: 0711-317 ERROR: Undefined symbol: .format_type_extended
ld: 0711-317 ERROR: Undefined symbol: .pstrdup
ld: 0711-317 ERROR: Undefined symbol: .inet_out
ld: 0711-317 ERROR: Undefined symbol: .inet_in
ld: 0711-317 ERROR: Undefined symbol: .make_interval
ld: 0711-317 ERROR: Undefined symbol: .interval_trunc
ld: 0711-317 ERROR: Undefined symbol: .interval_justify_days
ld: 0711-317 ERROR: Undefined symbol: .interval_justify_hours
ld: 0711-317 ERROR: Undefined symbol: .interval_justify_interval
ld: 0711-317 ERROR: Undefined symbol: .time_interval
ld: 0711-317 ERROR: Undefined symbol: .jsonb_out
ld: 0711-317 ERROR: Undefined symbol: .jsonb_in
ld: 0711-317 ERROR: Undefined symbol: .int4_numeric
ld: 0711-317 ERROR: Undefined symbol: .numeric_is_nan
ld: 0711-317 ERROR: Undefined symbol: .numeric_cmp
ld: 0711-317 ERROR: Undefined symbol: .numeric_abs
ld: 0711-317 ERROR: Undefined symbol: .numeric_log
ld: 0711-317 ERROR: Undefined symbol: .numeric_exp
ld: 0711-317 ERROR: Undefined symbol: .numeric_sqrt
ld: 0711-317 ERROR: Undefined symbol: .numeric_ceil
ld: 0711-317 ERROR: Undefined symbol: .numeric_floor
ld: 0711-317 ERROR: Undefined symbol: .numeric_gcd
ld: 0711-317 ERROR: Undefined symbol: .numeric_normalize
ld: 0711-317 ERROR: Undefined symbol: .timestamp_time
ld: 0711-317 ERROR: Undefined symbol: .interval_time
ld: 0711-317 ERROR: Undefined symbol: .timetz_time
ld: 0711-317 ERROR: Undefined symbol: .make_time
ld: 0711-317 ERROR: Undefined symbol: .extract_time
ld: 0711-317 ERROR: Undefined symbol: .numeric_float8
ld: 0711-317 ERROR: Undefined symbol: .make_timestamp
ld: 0711-317 ERROR: Undefined symbol: .date_timestamp
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_timestamp
ld: 0711-317 ERROR: Undefined symbol: .extract_timestamp
ld: 0711-317 ERROR: Undefined symbol: .timestamp_trunc
ld: 0711-317 ERROR: Undefined symbol: .timestamp_age
ld: 0711-317 ERROR: Undefined symbol: .date_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .timestamp_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .make_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .extract_timestamptz
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_zone
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_trunc
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_timetz
ld: 0711-317 ERROR: Undefined symbol: .time_timetz
ld: 0711-317 ERROR: Undefined symbol: .timetz_izone
ld: 0711-317 ERROR: Undefined symbol: .extract_timetz
ld: 0711-317 ERROR: Undefined symbol: .timetz_zone
ld: 0711-317 ERROR: Undefined symbol: .SearchSysCache
ld: 0711-317 ERROR: Undefined symbol: .ReleaseSysCache
ld: 0711-317 ERROR: Undefined symbol: .regtypein
ld: 0711-317 ERROR: Undefined symbol: .parse_ident
ld: 0711-317 ERROR: Undefined symbol: .makeString
ld: 0711-317 ERROR: Undefined symbol: .repalloc
ld: 0711-317 ERROR: Undefined symbol: .LookupFuncName
ld: 0711-317 ERROR: Undefined symbol: .SysCacheGetAttr
ld: 0711-317 ERROR: Undefined symbol: .stringToNode
ld: 0711-317 ERROR: Undefined symbol: .eval_const_expressions
ld: 0711-317 ERROR: Undefined symbol: .DefineCustomBoolVariable
ld: 0711-317 ERROR: Undefined symbol: .DefineCustomStringVariable
ld: 0711-317 ERROR: Undefined symbol: .DefineCustomRealVariable
ld: 0711-317 ERROR: Undefined symbol: .heap_copy_tuple_as_datum
ld: 0711-317 ERROR: Undefined symbol: .heap_copytuple
ld: 0711-317 ERROR: Undefined symbol: .lookup_rowtype_tupdesc_copy
ld: 0711-317 ERROR: Undefined symbol: .CreateTupleDescCopyConstr
ld: 0711-317 ERROR: Undefined symbol: .heap_form_tuple
ld: 0711-317 ERROR: Undefined symbol: .lookup_type_cache
ld: 0711-317 ERROR: Undefined symbol: ExecutorCheckPerms_hook
ld: 0711-317 ERROR: Undefined symbol: ExecutorStart_hook
ld: 0711-317 ERROR: Undefined symbol: ExecutorRun_hook
ld: 0711-317 ERROR: Undefined symbol: ExecutorFinish_hook
ld: 0711-317 ERROR: Undefined symbol: ExecutorEnd_hook
ld: 0711-317 ERROR: Undefined symbol: ProcessUtility_hook
ld: 0711-317 ERROR: Undefined symbol: planner_hook
ld: 0711-317 ERROR: Undefined symbol: post_parse_analyze_hook
ld: 0711-317 ERROR: Undefined symbol: emit_log_hook
ld: 0711-317 ERROR: Undefined symbol: .end_MultiFuncCall
ld: 0711-317 ERROR: Undefined symbol: InterruptHoldoffCount
ld: 0711-317 ERROR: Undefined symbol: .LWLockRelease
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextGetParent
ld: 0711-317 ERROR: Undefined symbol: .MemoryContextAllocZero
ld: 0711-317 ERROR: Undefined symbol: .lappend
ld: 0711-317 ERROR: Undefined symbol: .OpernameGetOprid
ld: 0711-317 ERROR: Undefined symbol: .nodeToString
ld: 0711-317 ERROR: Undefined symbol: .SearchSysCache1
ld: 0711-317 ERROR: Undefined symbol: .RelationIdGetRelation
ld: 0711-317 ERROR: Undefined symbol: .relation_open
ld: 0711-317 ERROR: Undefined symbol: .to_regclass
ld: 0711-317 ERROR: Undefined symbol: .get_namespace_name
ld: 0711-317 ERROR: Undefined symbol: .RelationGetIndexList
ld: 0711-317 ERROR: Undefined symbol: .SPI_cursor_find
ld: 0711-317 ERROR: Undefined symbol: .SPI_connect
ld: 0711-317 ERROR: Undefined symbol: .SPI_finish
ld: 0711-317 ERROR: Undefined symbol: SPI_tuptable
ld: 0711-317 ERROR: Undefined symbol: .SPI_cursor_fetch
ld: 0711-317 ERROR: Undefined symbol: SPI_processed
ld: 0711-317 ERROR: Undefined symbol: .SPI_cursor_close
ld: 0711-317 ERROR: Undefined symbol: .GetCurrentTransactionIdIfAny
ld: 0711-317 ERROR: Undefined symbol: .SPI_execute
ld: 0711-317 ERROR: Undefined symbol: .SPI_execute_with_args
ld: 0711-317 ERROR: Undefined symbol: .SPI_cursor_open_with_args
ld: 0711-317 ERROR: Undefined symbol: .SPI_freeplan
ld: 0711-317 ERROR: Undefined symbol: .SPI_getargcount
ld: 0711-317 ERROR: Undefined symbol: .SPI_execute_plan
ld: 0711-317 ERROR: Undefined symbol: .SPI_cursor_open
ld: 0711-317 ERROR: Undefined symbol: .SPI_keepplan
ld: 0711-317 ERROR: Undefined symbol: .SPI_getbinval
ld: 0711-317 ERROR: Undefined symbol: .SPI_gettypeid
ld: 0711-317 ERROR: Undefined symbol: .SPI_fname
ld: 0711-317 ERROR: Undefined symbol: .SPI_fnumber
ld: 0711-317 ERROR: Undefined symbol: .GetCurrentTransactionId
ld: 0711-317 ERROR: Undefined symbol: .IsBinaryCoercible
ld: 0711-317 ERROR: Undefined symbol: .makeStringInfo
ld: 0711-317 ERROR: Undefined symbol: .enlargeStringInfo
ld: 0711-317 ERROR: Undefined symbol: .appendBinaryStringInfo
ld: 0711-317 ERROR: Undefined symbol: .date_eq
ld: 0711-317 ERROR: Undefined symbol: .date_cmp
ld: 0711-317 ERROR: Undefined symbol: .date_in
ld: 0711-317 ERROR: Undefined symbol: .date_out
ld: 0711-317 ERROR: Undefined symbol: .time_eq
ld: 0711-317 ERROR: Undefined symbol: .time_cmp
ld: 0711-317 ERROR: Undefined symbol: .time_in
ld: 0711-317 ERROR: Undefined symbol: .time_out
ld: 0711-317 ERROR: Undefined symbol: .timetz_eq
ld: 0711-317 ERROR: Undefined symbol: .timetz_cmp
ld: 0711-317 ERROR: Undefined symbol: .timetz_in
ld: 0711-317 ERROR: Undefined symbol: .timetz_out
ld: 0711-317 ERROR: Undefined symbol: .timestamp_eq
ld: 0711-317 ERROR: Undefined symbol: .timestamp_cmp
ld: 0711-317 ERROR: Undefined symbol: .timestamp_in
ld: 0711-317 ERROR: Undefined symbol: .timestamp_out
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_in
ld: 0711-317 ERROR: Undefined symbol: .timestamptz_out
ld: 0711-317 ERROR: Undefined symbol: .interval_eq
ld: 0711-317 ERROR: Undefined symbol: .interval_cmp
ld: 0711-317 ERROR: Undefined symbol: .interval_in
ld: 0711-317 ERROR: Undefined symbol: .interval_out
ld: 0711-317 ERROR: Undefined symbol: .numeric_int8
ld: 0711-317 ERROR: Undefined symbol: .numeric_add
ld: 0711-317 ERROR: Undefined symbol: .numeric_sub
ld: 0711-317 ERROR: Undefined symbol: .numeric_mul
ld: 0711-317 ERROR: Undefined symbol: .numeric_div
ld: 0711-317 ERROR: Undefined symbol: .numeric_mod
ld: 0711-317 ERROR: Undefined symbol: .SPI_prepare
ld: 0711-317 ERROR: Undefined symbol: SPI_result
ld: 0711-317 ERROR: Undefined symbol: .ReadNextFullTransactionId
ld: 0711-317 ERROR: Undefined symbol: .TransactionIdPrecedes
ld: 0711-317 ERROR: Undefined symbol: .nocachegetattr
ld: 0711-317 ERROR: Undefined symbol: .ExecReScan
ld: 0711-317 ERROR: Undefined symbol: my_wait_event_info
ld: 0711-317 ERROR: Undefined symbol: RmgrTable
ld: 0711-317 ERROR: Undefined symbol: .RmgrNotFound
ld: 0711-317 ERROR: Undefined symbol: .smgropen
ld: 0711-317 ERROR: Undefined symbol: .smgrsetowner
ld: 0711-317 ERROR: Undefined symbol: CheckXidAlive
ld: 0711-317 ERROR: Undefined symbol: bsysscan
ld: 0711-317 ERROR: Undefined symbol: .errstart_cold
ld: 0711-317 ERROR: Undefined symbol: .errmsg_internal
ld: 0711-317 ERROR: Undefined symbol: old_snapshot_threshold
ld: 0711-317 ERROR: Undefined symbol: .TestForOldSnapshot_impl
ld: 0711-317 ERROR: Undefined symbol: .pg_server_to_client
ld: 0711-317 ERROR: Undefined symbol: compute_query_id
ld: 0711-317 ERROR: Undefined symbol: query_id_enabled
ld: 0711-317 ERROR: Undefined symbol: .expanded_record_fetch_tupdesc
ld: 0711-317 ERROR: Undefined symbol: .expanded_record_fetch_field
ld: 0711-317 ERROR: Undefined symbol: .tuplestore_end
ld: 0711-317 ERROR: Undefined symbol: .FreeTupleDesc
ld: 0711-317 ERROR: Undefined symbol: .CreateCommandTag
ld: 0711-317 ERROR: Undefined symbol: .GetCommandTagName
ld: 0711-317 ERROR: Undefined symbol: .float_overflow_error
ld: 0711-317 ERROR: Undefined symbol: .float_underflow_error
ld: 0711-317 ERROR: Undefined symbol: .float_zero_divide_error
ld: 0711-317 ERROR: Undefined symbol: .s_lock
warning: `vectorscale` (lib) generated 6 warnings
error: could not compile `vectorscale` (lib) due to 1 previous error; 6 warnings emitted
I'm not sure why the crate build didn't add the postgresql libraries to the link line. I'll ask for help.
------------------------------
Rafik Zurob
------------------------------
Original Message:
Sent: Mon June 16, 2025 12:30 PM
From: Emanuel Reisinger
Subject: Unable to find libclang
Hi,
I have gettext-devel already installed. How can I tell cargo pgrx, rust or someone else to search in /opt/freeware/include, too?
Sorry for these questions but I have no experience with Rust or cargo. I will only compile, install and use pgvectorscale on AIX.
Regards
------------------------------
Emanuel Reisinger
Original Message:
Sent: Mon June 16, 2025 10:38 AM
From: Ranjit Ranjan
Subject: Unable to find libclang
Hi Rafik, Emanuel
Regarding libintl.h availaility, you can install gettext-devel pkg.
Thanks
Ranjit
------------------------------
Ranjit Ranjan
Original Message:
Sent: Fri June 13, 2025 04:29 PM
From: Rafik Zurob
Subject: Unable to find libclang
I think the issue is that shared libraries with an "a" extension on AIX are actually archives containing a shared object. So when you dlopen them you have to provide the archive member in the path name. To work around this without changing the pgvectorscale source, I extracted the shared object:
> cd clang+llvm-19.1.6-powerpc64-ibm-aix-7.2
> mkdir extracted_lib
> cd extracted_lib
> ar -X64 xv ../lib/libclang.a
x - libclang.so.19.1
> ln -s libclang.so.19.1 libclang.a
I then set LIBCLANG_PATH to point to extracted_lib instead of lib. This made the build get past the libclang.a step. It now fails because it can't find "libintl.h". I'm not sure which package provides that. I'll hand this back to the Toolbox team @Ranjit Ranjan.
------------------------------
Rafik Zurob
Original Message:
Sent: Fri June 13, 2025 10:38 AM
From: Emanuel Reisinger
Subject: Unable to find libclang
Hi Rafik,
I've downloaded the community clang release version 19.1.7 (it's the same like ibm-clang --version prints) and set LIBCLANG_PATH.
Now pgvectorscale finds libclang.a but with the error Exec format error.
# cargo pgrx install --release
Using PgConfig("pg15") and `pg_config` from /opt/freeware/bin/pg_config
Building extension with features pg15
Running command "/opt/freeware/lib/RustSDK/1.86/bin/.cargo.orig" "build" "--lib" "--release" "--features" "pg15" "--no-default-features" "--message-format=json-render-diagnostics"
Compiling pgrx-pg-sys v0.12.9
error: failed to run custom build command for `pgrx-pg-sys v0.12.9`
Caused by:
process didn't exit successfully: `/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-ca69a8ad00060318/build-script-bindgen` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=PGRX_BUILD_VERBOSE
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_PATH
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_AS_ENV
cargo:rerun-if-env-changed=LLVM_CONFIG_PATH
cargo:rerun-if-env-changed=LIBCLANG_PATH
cargo:rerun-if-env-changed=LIBCLANG_STATIC_PATH
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64-ibm-aix
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64_ibm_aix
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-changed=include
cargo:rerun-if-changed=pgrx-cshim.c
cargo:rerun-if-changed=/var/lib/postgresql/.pgrx/config.toml
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES
--- stderr
build_paths=BuildPaths { manifest_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9", out_dir: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out", src_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/src/include", shim_src: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/pgrx-cshim.c", shim_dst: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out/pgrx-cshim.c" }
Generating bindings for pg15
pg_config --configure CLANG = None
thread '<unnamed>' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/bindgen-0.70.1/lib.rs:622:27:
Unable to find libclang: "the `libclang` shared library at /opt/IBM/clang-llvm-19.1.7/lib/libclang.a could not be opened: Could not load module /opt/IBM/clang-llvm-19.1.7/lib/libclang.a.\nSystem error: Exec format error"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-bindgen-0.12.9/src/build.rs:274:41:
thread panicked while generating bindings: Any { .. }
warning: build failed, waiting for other jobs to finish...
Usually the error implies there are different architectures. But pgvectorscale is built on AIX 7.2 64Bit and the used community clang release is for this architecture (https://github.com/IBM/llvm-project/releases/download/llvmorg-19.1.7/clang+llvm-19.1.7-powerpc64-ibm-aix-7.2.tar.xz).
What could it be now?
------------------------------
Emanuel Reisinger
Original Message:
Sent: Thu June 12, 2025 11:01 AM
From: Rafik Zurob
Subject: Unable to find libclang
Hi Emanuel. I think there are two things needed by pgvectorscale: 1. A C/C++ compiler. 2. A C/C++ parser that can be embedded into pgvectorscale. The libclang.a library (https://clang.llvm.org/docs/LibClang.html) provides the clang parser as a library for use in programs that want to parse C/C++ source code themselves.
The Open XL C/C++ for AIX product provides a standalone compiler application to compile C/C++ source code. It does not provide the ability to embed the compiler parser into user programs. The community clang releases linked above contain both the C/C++ compiler and this parser library.
------------------------------
Rafik Zurob
Original Message:
Sent: Thu June 12, 2025 08:48 AM
From: Emanuel Reisinger
Subject: Unable to find libclang
Hi Rafik,
I don't understand that. I build pgvectorscale with IBM Open XL C/C++ and need a community clang release to obtain the required library.
Can you explain this a little bit more?
------------------------------
Emanuel Reisinger
Original Message:
Sent: Thu June 12, 2025 08:16 AM
From: Rafik Zurob
Subject: Unable to find libclang
Hi Emanuel. libclang.a is not part of the Open XL compiler product. But you can get it from the community clang releases at https://github.com/IBM/llvm-project/releases.
For example, version 19.1.6 (which matches the version used by Open XL C/C++ for AIX 17.1.3) is available here https://github.com/IBM/llvm-project/releases/download/llvmorg-19.1.6/clang+llvm-19.1.6-powerpc64-ibm-aix-7.2.tar.xz . It's located at "clang+llvm-19.1.6-powerpc64-ibm-aix-7.2/lib/libclang.a" inside that archive.
Regards
Rafik
------------------------------
Rafik Zurob
Original Message:
Sent: Thu June 12, 2025 06:28 AM
From: Ranjit Ranjan
Subject: Unable to find libclang
Hi,
Let me check with openxl team .
Thanks
Ranjit
------------------------------
Ranjit Ranjan
Original Message:
Sent: Thu June 12, 2025 04:13 AM
From: Emanuel Reisinger
Subject: Unable to find libclang
Hi,
This is a follow up of installing pgvectorscale on AIX 7.2 and from the upstreaming problems discussed in thread Rust cargo and openssl on AIX, respectively.
Because this problem does not belong to rust and openssl I've started a new thread.
What I've done so far to install pgvectorscale:
# openssl version
OpenSSL 3.0.15 3 Sep 2024 (Library: OpenSSL 3.0.15 3 Sep 2024)
# git clone --branch 0.7.1 https://github.com/timescale/pgvectorscale
# cd pgvectorscale/pgvectorscale
# export PKG_CONFIG_PATH=/usr/lib/pkgconfig
# export OPENSSL_DIR=/usr
# export CC=ibm-clang
# cargo install --locked cargo-pgrx --version $(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "pgrx") | .version')
# cargo pgrx init --pg15 pg_config
With following step I get the libclang error:
# cargo pgrx install --release
Using PgConfig("pg15") and `pg_config` from /opt/freeware/bin/pg_config
Building extension with features pg15
Running command "/opt/freeware/lib/RustSDK/1.86/bin/.cargo.orig" "build" "--lib" "--release" "--features" "pg15" "--no-default-features" "--message-format=json-render-diagnostics"
Compiling syn v2.0.102
Compiling petgraph v0.6.5
...<truncated for clarity>...
Compiling pgrx-pg-sys v0.12.9
error: failed to run custom build command for `pgrx-pg-sys v0.12.9`
Caused by:
process didn't exit successfully: `/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-ca69a8ad00060318/build-script-bindgen` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=PGRX_BUILD_VERBOSE
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_PATH
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_AS_ENV
cargo:rerun-if-env-changed=LLVM_CONFIG_PATH
cargo:rerun-if-env-changed=LIBCLANG_PATH
cargo:rerun-if-env-changed=LIBCLANG_STATIC_PATH
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64-ibm-aix
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64_ibm_aix
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-changed=include
cargo:rerun-if-changed=pgrx-cshim.c
cargo:rerun-if-changed=/var/lib/postgresql/.pgrx/config.toml
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES
--- stderr
build_paths=BuildPaths { manifest_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9", out_dir: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out", src_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/src/include", shim_src: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/pgrx-cshim.c", shim_dst: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out/pgrx-cshim.c" }
Generating bindings for pg15
pg_config --configure CLANG = None
thread '<unnamed>' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/bindgen-0.70.1/lib.rs:622:27:
Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.a'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-bindgen-0.12.9/src/build.rs:274:41:
thread panicked while generating bindings: Any { .. }
warning: build failed, waiting for other jobs to finish...
With RUST_BACKTRACE=1 set:
Using PgConfig("pg15") and `pg_config` from /opt/freeware/bin/pg_config
Building extension with features pg15
Running command "/opt/freeware/lib/RustSDK/1.86/bin/.cargo.orig" "build" "--lib" "--release" "--features" "pg15" "--no-default-features" "--message-format=json-render-diagnostics"
Compiling pgrx-pg-sys v0.12.9
error: failed to run custom build command for `pgrx-pg-sys v0.12.9`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
process didn't exit successfully: `/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-ca69a8ad00060318/build-script-bindgen` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=PGRX_BUILD_VERBOSE
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_PATH
cargo:rerun-if-env-changed=PGRX_PG_CONFIG_AS_ENV
cargo:rerun-if-env-changed=LLVM_CONFIG_PATH
cargo:rerun-if-env-changed=LIBCLANG_PATH
cargo:rerun-if-env-changed=LIBCLANG_STATIC_PATH
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64-ibm-aix
cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_powerpc64_ibm_aix
cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE
cargo:rerun-if-changed=include
cargo:rerun-if-changed=pgrx-cshim.c
cargo:rerun-if-changed=/var/lib/postgresql/.pgrx/config.toml
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG15
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES_powerpc64-ibm-aix
cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES
--- stderr
build_paths=BuildPaths { manifest_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9", out_dir: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out", src_dir: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/src/include", shim_src: "/var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-pg-sys-0.12.9/pgrx-cshim.c", shim_dst: "/var/lib/postgresql/pgvectorscale/target/release/build/pgrx-pg-sys-eb2aabfbf0730c37/out/pgrx-cshim.c" }
Generating bindings for pg15
pg_config --configure CLANG = None
thread '<unnamed>' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/bindgen-0.70.1/lib.rs:622:27:
Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.a'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: core::result::Result<T,E>::expect
4: bindgen::ensure_libclang_is_loaded::{{closure}}
5: std::sync::once_lock::OnceLock<T>::get_or_init::{{closure}}
6: std::sync::once_lock::OnceLock<T>::initialize::{{closure}}
7: std::sync::poison::once::Once::call_once_force::{{closure}}
8: std::sys::sync::once::queue::Once::call
9: std::sync::poison::once::Once::call_once_force
10: std::sync::once_lock::OnceLock<T>::initialize
11: std::sync::once_lock::OnceLock<T>::get_or_try_init
12: std::sync::once_lock::OnceLock<T>::get_or_init
13: bindgen::ensure_libclang_is_loaded
14: bindgen::clang_version
15: pgrx_bindgen::build::clang::detect_include_paths_for
16: pgrx_bindgen::build::run_bindgen
17: pgrx_bindgen::build::get_bindings
18: pgrx_bindgen::build::generate_bindings
19: pgrx_bindgen::build::main::{{closure}}::{{closure}}::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at /var/lib/postgresql/.cargo/registry/src/index.crates.io-7f555b6b8ccf4919/pgrx-bindgen-0.12.9/src/build.rs:274:41:
thread panicked while generating bindings: Any { .. }
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::result::unwrap_failed
3: core::result::Result<T,E>::expect
4: pgrx_bindgen::build::main::{{closure}}::{{closure}}
5: core::iter::adapters::map::map_try_fold::{{closure}}
6: <alloc::vec::into_iter::IntoIter<T,A> as core::iter::traits::iterator::Iterator>::try_fold
7: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::try_fold
8: <I as alloc::vec::in_place_collect::SpecInPlaceCollect<T,I>>::collect_in_place
9: alloc::vec::in_place_collect::from_iter_in_place
10: alloc::vec::in_place_collect::from_iter_in_place{{reify.shim}}
11: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
12: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
13: core::iter::traits::iterator::Iterator::collect
14: pgrx_bindgen::build::main::{{closure}}
15: std::thread::scoped::scope::{{closure}}
16: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
17: std::panicking::try::do_call
18: __rust_try
19: std::thread::scoped::scope
20: pgrx_bindgen::build::main
21: core::ops::function::FnOnce::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Ok, it searches for libclang.a but cannot find it.
I cannot find libclang.a either. I've searched in /opt/freeware, /opt/lib, /usr/lib, /opt/IBM (where openxlC is installed) and some other directories. As I can see IBM Open XL C/C++ runtime environment filesets does not include such a library.
What's the error?
------------------------------
Emanuel Reisinger
------------------------------