Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

View: New views
5 Messages — Rating Filter:   Alert me  

Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

by Tyler Erickson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm having problems building PostGIS 1.4.0 on Ubuntu 9.04 (a new install).  At the configure step for building PostGIS I get the following error:

configure: error: the PGXS Makefile /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.

pg_config reports the (supposed) location of the pgxs.mk file, but no file was actually installed there during the PostgreSQL install...

root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# pg_config --pgxs
/usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk
root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# ls $(pg_config --pgxs)
ls: cannot access /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory


I have included the PostGIS ./configure output and the bash script I use to build the libraries below.

Is this a bug with the PostgreSQL installer?  Is there a way to get around this by modifying the configure script for PostGIS?

- Tyler




root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# ./configure --prefix=$POSTGIS_PATH --datadir=$PG_SHARE --with-geosconfig=$GEOS_PATH/bin/geos-config --with-projdir=$PROJ_PATH
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking if g++ supports -Wall... yes
checking if g++ supports -Wmissing-prototypes... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... no
checking for byacc... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking for convert... no
configure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be built
checking for xsltproc... /usr/bin/xsltproc
checking for dblatex... no
configure: WARNING: dblatex is not installed so PDF documentation cannot be built
configure: WARNING: could not locate Docbook stylesheets required to build the documentation
checking CUnit/CUnit.h usability... no
checking CUnit/CUnit.h presence... no
checking for CUnit/CUnit.h... no
configure: WARNING: could not locate CUnit required for liblwgeom unit tests
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for libiconv_open in -liconv... no
checking for iconv_open in -lc... yes
checking for pg_config... /usr/bin/pg_config
configure: error: the PGXS Makefile /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk cannot be found. Please install the PostgreSQL server development packages and re-run configure.


Here is the bash script that I have been using to build the libraries...

USER=$SUDO_USER
SRCDIR=/home/$USER/src
GEOS_VER=3.1.1
GEOS_PATH=/usr/local/geos/$GEOS_VER
PROJ_VER=4.6.1
PROJ_PATH=/usr/local/proj/$PROJ_VER
GDAL_VER=1.6.2
GDAL_PATH=/usr/local/gdal/$GDAL_VER
LIBGEOTIFF_VER=1.2.5
LIBGEOTIFF_PATH=/usr/local/libgeotiff/$LIBGEOTIFF_VER
POSTGRESQL_VER=8.3
POSTGIS_VER=1.4.0
POSTGIS_PATH=/usr/local/postgis/$POSTGIS_VER
POSTGIS_TEMPLATE=postgis-template

if [ ! -d $SRCDIR ]; then
    mkdir $SRCDIR
fi

echo "Installing the essential build packages"
sudo aptitude install -y build-essential

echo "Installing g++"
sudo apt-get install -y g++

echo "Installing version control tools..."
sudo apt-get install -y subversion mercurial qct

echo "Installing PostgreSQL $POSTGRESQL_VER..."
sudo aptitude install -y postgresql python-psycopg2 postgresql-server-dev-$POSTGRESQL_VER flex libpq-dev

echo "Building and installing GEOS $GEOS_VER..."
if [ ! -d $SRCDIR/geos ]; then
        mkdir $SRCDIR/geos
        cd $SRCDIR/geos
        wget http://download.osgeo.org/geos/geos-$GEOS_VER.tar.bz2
        tar xjf geos-$GEOS_VER.tar.bz2
        cd geos-$GEOS_VER
        ./configure --prefix=$GEOS_PATH
        make
        sudo make install
    sudo sh -c "echo $GEOS_PATH'/lib' > /etc/ld.so.conf.d/geos.conf"
    sudo ldconfig
fi

echo "Building and installing Proj $PROJ_VER..."
if [ ! -d $SRCDIR/proj ]; then
    mkdir $SRCDIR/proj    
    cd $SRCDIR/proj
    wget http://download.osgeo.org/proj/proj-$PROJ_VER.tar.gz
    wget http://download.osgeo.org/proj/proj-datumgrid-1.4.tar.gz
fi
if [ ! -d $SRCDIR/proj/proj-$PROJ_VER ]; then
    tar xzf proj-$PROJ_VER.tar.gz
    cd proj-$PROJ_VER/nad
    tar xzf ../../proj-datumgrid-1.4.tar.gz
    cd ..
    ./configure --prefix=$PROJ_PATH
    make
    sudo make install
    sudo sh -c "echo $PROJ_PATH'/lib' > /etc/ld.so.conf.d/proj.conf"
    sudo ldconfig
fi

echo "Building and installing PostGIS $POSTGIS_VER..."
if [ ! -d $SRCDIR/postgis ]; then
    mkdir $SRCDIR/postgis
    cd $SRCDIR/postgis
    wget http://postgis.refractions.net/download/postgis-$POSTGIS_VER.tar.gz
fi
if [ ! -d $SRCDIR/postgis/postgis-$POSTGIS_VER ]; then
    tar xzf postgis-$POSTGIS_VER.tar.gz
    cd postgis-$POSTGIS_VER
    PG_SHARE=$(pg_config --sharedir)
    ./configure --prefix=$POSTGIS_PATH --datadir=$PG_SHARE --with-geosconfig=$GEOS_PATH/bin/eos-config --with-projdir=$PROJ_PATH
    make
    sudo make install
    sh -c "echo $POSTGIS_PATH'/lib' > /etc/ld.so.conf.d/postgis.conf"
    ldconfig
fi

Re: Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

by Mateusz Loskot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tyler Erickson wrote:

> I'm having problems building PostGIS 1.4.0 on Ubuntu 9.04 (a new
> install). At the configure step for building PostGIS I get the
> following error:
>
> configure: error: the PGXS Makefile
> /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk cannot be
> found. Please install the PostgreSQL server development packages and
> re-run configure.
>
> pg_config reports the (supposed) location of the pgxs.mk file, but no
> file was actually installed there during the PostgreSQL install...
>
> root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0#
> pg_config --pgxs
> /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk
> root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# ls
> $(pg_config --pgxs) ls: cannot access
> /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk: No such file
> or directory

Tyler,

I presume you have not installed postgresql-server-dev package for the
version of PostgreSQL you use.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users
--
Mateusz Loskot
http://mateusz.loskot.net

Re: Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

by Mark Cave-Ayland-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tyler Erickson wrote:

> I'm having problems building PostGIS 1.4.0 on Ubuntu 9.04 (a new install).
> At the configure step for building PostGIS I get the following error:
>
> configure: error: the PGXS Makefile
> /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk cannot be found.
> Please install the PostgreSQL server development packages and re-run
> configure.
>
> pg_config reports the (supposed) location of the pgxs.mk file, but no file
> was actually installed there during the PostgreSQL install...
>
> root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# pg_config
> --pgxs
> /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk
> root@vb-ubuntu-serva:/home/tylere/src/postgis/postgis-1.4.0# ls $(pg_config
> --pgxs)
> ls: cannot access /usr/lib/postgresql/8.3/lib/pgxs/src/makefiles/pgxs.mk: No
> such file or directory
>
> I have included the PostGIS ./configure output and the bash script I use to
> build the libraries below.
>
> Is this a bug with the PostgreSQL installer?  Is there a way to get around
> this by modifying the configure script for PostGIS?
>
> - Tyler

Hi Tyler,

Nope, it's just that Debian (and derivatives) supply a skeleton
pg_config file with the default PostgreSQL installation which doesn't
contain the files required for building PostgreSQL modules.

Installing the postgresql-server-dev package should resolve this.


HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

Re: Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

by Tyler Erickson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Installing the postgresql-server-dev-8.3 package added the missing pgxs.mk file and solved the issue.

I thought I had correctly written the script to install postgresql-server-dev-8.3, but I seem to have outsmarted myself in using the environment variables.

- Tyler

Mateusz Loskot wrote:
Tyler,

I presume you have not installed postgresql-server-dev package for the
version of PostgreSQL you use.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


-----
--
Mateusz Loskot
http://mateusz.loskot.net

Re: Problem building PostGIS 1.4.0 on Ubuntu 9.04 (missing pgxs.mk)

by antonio nuno de castro santa rosa santa rosa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gentlemen, my windwos is XP. My installation does not work. My test
time to perform the IMPORT command.

The Mateusz you have the recipe ....

thanks

Nuno

steps...

1- python-2.6.4.msi ;
2-numpy-1.3.0-win32-superpack-python2.6.exe ;
3-GDAL-1.6.1.win32-py2.6.exe;
4-gdalwin32exe160.
+++++++++++++++++++++++++++++++++++++++++++++++++






2009/10/30 Tyler Erickson <tyler.erickson@...>:

>
> Installing the postgresql-server-dev-8.3 package added the missing pgxs.mk
> file and solved the issue.
>
> I thought I had correctly written the script to install
> postgresql-server-dev-8.3, but I seem to have outsmarted myself in using the
> environment variables.
>
> - Tyler
>
>
> Mateusz Loskot wrote:
>>
>> Tyler,
>>
>> I presume you have not installed postgresql-server-dev package for the
>> version of PostgreSQL you use.
>>
>> Best regards,
>> --
>> Mateusz Loskot, http://mateusz.loskot.net
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users@...
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>> -----
>> --
>> Mateusz Loskot
>> http://mateusz.loskot.net
>>
>
> --
> View this message in context: http://old.nabble.com/Problem-building-PostGIS-1.4.0-on-Ubuntu-9.04-%28missing-pgxs.mk%29-tp26131926p26133643.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@...
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users