0

I am trying to install Poststat on debian squeeze. http://poststat.projects.postgresql.org This project looks not so old (2008), but I am having some difficulties to install it. Although it seems to be a really interesting project, google is empty. I'll try here to sum up what I did (postgres 8.4 is installed) :

apt-get install fort77 postgresql-server-dev-8.4 libblas-dev liblapack-dev gfortran

First, as it is said on the official website, unpack the tar.gz and go in the directory f77stat and 'make'.

Then if you have libpq-dev installed, on debian squeeze it install also its owns pg_config in /usr/bin/ wich report false infos. (see http://postgresql.1045698.n5.nabble.com/Bug-report-Wrong-version-in-pg-config-td2123792.html) One solution :

 mv /usr/bin/pg_config pg_config_bak
 ln -s /usr/lib/postgresql/8.4/bin/pg_config pg_config

This is important because the makefile of Poststat is retrieving some info with pg_config.

Then in the main Makefile there is the line :

-lblas -llapack -lg2c

Install those package for blas and lapack :

apt-get install libatlas-base-dev libatlas-dev libatlas-doc libatlas3gf-base

Now my problem is about g2c. According to google, g2c is obsolete so I edited the Makefile and replace -lg2c with -lgfortrant

Last step : compile and import the new statitics functions in my database.

make && sudo make install
psql -f poststat.sql <database>

Sadly,

psql:poststat.sql:18: ERROR: unable to load the library 
 « /usr/lib/postgresql/8.4/lib/poststat.so » : /usr/lib/postgresql/8.4/lib/poststat.so:
undefined symbol: s_stop

Any thought ? fortran is not my world, and packages seem to have change a lot in debian about fortran. My switch from -lg2c to -lgfortrant is probably wrong. In fact removing this include does at the end produce the same error.

Laurent Debricon
  • 4,307
  • 2
  • 24
  • 26

2 Answers2

1

libg2c belongs to the g77 (http://stackoverflow.com/questions/2406581/what-is-libg2c-library), which is obsolete and unsupported for many years. Switching to a more current compiler involves more than just replacing this library. You need to replace the compiler also, e.g., gfortran. You might need to change the default compiler options of gfortran to be able to compile FORTRAN 77 code. I use: -O2 -ffixed-form -ffixed-line-length-none. If you use gfortran as the linker you won't need to explicitly include the fortran run-time library.

M. S. B.
  • 28,968
  • 2
  • 46
  • 73
0

change -lg2c by -lf2c

Add to poststat.c , at the end

int MAIN__(){
   return (0);
}
Laurent Debricon
  • 4,307
  • 2
  • 24
  • 26