Compiling a user C function in 7.2.1

From: John Gunther <inbox(at)bucksvsbytes(dot)com>
To:
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Compiling a user C function in 7.2.1
Date: 2002-07-25 12:43:59
Message-ID: 3D3FF28F.1070304@bucksvsbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
I'm writing additional C functions to extend PostgreSQL 7.2.1 on Red Hat
Linux 7.3, a process whose details are apparently not well documented.<br>
<br>
I've got my first function written, using the functions in the source file
numeric.c as a model. I tried compiling it using the advice offered by Bruce
Momjian in his book (highly recommended), <i>PostgreSQL: Introduction and
Concepts</i>:<br>
<i><br>
</i>
<p><i> The next step is to compile the C file into an object file that contains
<small>CPU</small> instructions. As part of this step, you must create a special
object file that can be <em>dynamically linked<a name="12379">&nbsp;</a></em> into
the P<small>OSTGRE</small>SQL server. Many operating systems require special
flags to create an object file that can be dynamically linked. The best way
to find the required flags is to go to <tt>pgsql/src/test/regress</tt> and
type <tt>make clean</tt> and then <tt>make regress.so</tt><em>.</em> <a
name="tex2html247"
href="http://www.ca.postgresql.org/docs/aw_pgsql_book/footnode.html#foot21643"><sup>24.1</sup></a>
This command will display the compile commands used to generate the dynamically
linkable object file <tt>regress.so</tt><em>.</em> The <em>-I</em> compile
flags allow searching for include files. Other flags are used for generating
dynamic object files; use them to compile your C code into a dynamically
linkable object file. You may need to consult your operating system documentation
for assistance in locating the proper flags. </i></p>
<br>
This is where I'm stumped. <tt>make clean</tt> yields the error message "<tt>GNUmakefile:16:
../../../src/Makefile.global: No such file or directory</tt>". I then tried
renaming the file <tt>Makefile.global.in</tt> to <tt>Makefile.global</tt>
and running <tt>make clean</tt> again. This got a little farther but resulted
in the message "<tt>../../../src/Makefile.global:269: ../../../src/Makefile.port:
No such file or directory</tt>". I can't find a <tt>Makefile.port</tt> file
anywhere. Any idea what I'm doing wrong?<br>
<br>
Thanks in advance for your guidance.<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 2.2 KB

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ludwig Lim 2002-07-25 13:25:29 Re: Advantage of using cursors...
Previous Message Josh Jore 2002-07-25 11:54:26 Re: Trigger question