Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

postgresql - Error creating a spatial database. ERROR : could not load library "/usr/pgsql-9.1/lib/rtpostgis-2.0.so"

I am running PostgreSQL 9.1 with Postgis 2.0 on Fedora 15.

When trying to install the raster support,

psql -d database -f rtpostgis.sql -v ON_ERROR_STOP=1

I get the following error

psql:rtpostgis.sql:46: ERROR:  
     could not load library "/usr/pgsql-9.1/lib/rtpostgis-2.0.so": libhdf5.so.6: 
     cannot open shared object file: No such file or directory

A locate libhdf5.so.6 gives the following paths.

/usr/lib64/mpich2/lib/libhdf5.so.6
/usr/lib64/mpich2/lib/libhdf5.so.6.0.4

Reinstalling the GDAL from the repositories did not solve the problem. The version of the installed GDAL.

gdal.x86_64                                1.7.3-14.fc15                @updates
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Checked for whether /etc/ld.so.conf has a reference to the path /usr/lib64/mpich2/lib.

by doing ldconfig -p | grep libhdf5.

Which did not output anything.

On checking that /etc/ld.so.conf had include ld.so.conf.d/*.conf.

Checked for the files in directory ld.so.conf.d. One of the conf file in include ld.so.conf.d was /etc/ld.so.conf.d/atlas-x8664.conf which contained /usr/lib64/atlas.

So I,

  • created a file called gdal.conf in the directory ld.so.conf.d.
  • Added the string /usr/lib64/mpich2/lib to the file.
  • Ran ldconfig.
  • Now, ldconfig -p | grep libhdf5 had the paths to llibhdf5 files.

After doing the above, postgis raster support installation went smoothly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...