Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

newbie problem with Geo::IP installation through cpan

by jbakshi (Initiate)
on Feb 03, 2010 at 04:37 UTC ( #821080=perlquestion: print w/replies, xml ) Need Help??

jbakshi has asked for the wisdom of the Perl Monks concerning the following question:

Dear list,

Hello to all of you. I am a newbie in cpan and come here to discuss with Geo::IP installation problem through cpan.

For awstats Geo-location report I need Geo::IP in my system. This is a opensuse 11.1 ( x86_64) box with perl v5.10.0 built for x86_64-linux-thread-multi.

I have already downloaded the required the MaxMind GeoIP C API from http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.6.tar.gz and and install it by

````````````````
./configure make make check ( all test are passed) make install
`````````````````````


During "make install" I can see that

``````````
Libraries have been installed in:
/usr/local/lib
`````````````

and to confirm

````````````````````````````````````
# ls /usr/local/lib
libGeoIP.a libGeoIP.so libGeoIPUpdate.a libGeoIPUpdate.so libGeoIPUpdate.so.0.0.0 libGeoIP.la libGeoIP.so.1 libGeoIP.so.1.4.6 libGeoIPUpdate.la libGeoIPUpdate.so.0
````````````````````````

/etc/ld.so.conf has also the above path included.

.........
/usr/x86_64-suse-linux/lib /usr/local/lib /opt/kde3/lib /lib64
.............

Now if I try to install Geo::IP through cpan it reports error as

...............
The GeoIP CAPI is not installed you should do that. Otherwise try
perl Makefile.PL PP=1

to install this module anyway. It uses a slower pure perl version and you can rebuid it later.

GeoIP must be installed prior to building Geo::IP and I can't find it in the standard library directories. You can download GeoIP C API from:

http://www.maxmind.com/app/c

If GeoIP is installed, but in a non-standard directory, then use the following options to Makefile.PL:

perl Makefile.PL LIBS='-L/home/me/lib' INC='-I/home/me/include'

Note that if you build against a shareable library in a non-standard location you may (on some platforms) also have to set your LD_LIBRARY_PATH environment variable at run time for perl to find the library.

If you installed the GeoIP C libraries to the /usr/local/lib directory, then you may need to add /usr/local/lib to /etc/ld.so.conf then run /sbin/ldconfig /etc/ld.so.conf

..................

I am really confused why it is missing the GeoIP C API . I have even done " /sbin/ldconfig /etc/ld.so.conf " and tried to intall the module again but no luck at all :-( could any one kindly provide me a clue ?

with regards,
  • Comment on newbie problem with Geo::IP installation through cpan

Replies are listed 'Best First'.
Re: newbie problem with Geo::IP installation through cpan
by syphilis (Bishop) on Feb 03, 2010 at 08:13 UTC
    Looks like a screwed Makefile.PL to me. I would just unpack the module's source to some location, cd to that location and run perl Makefile.PL LIBS="-L/usr/local/lib -lGeoIP" INC=-I/usr/local/include, followed by make test then sudo make install.

    See if that works around the bug.

    Cheers,
    Rob
      Thanks for your kind attention. I think the module location is given by this line

      CPAN.pm: Going to build B/BO/BORISZ/Geo-IP-1.38.tar.gz

      There is also a suggestion from cpan shell

      if GeoIP is installed, but in a non-standard directory, then use the
      following options to Makefile.PL:

      perl Makefile.PL LIBS='-L/home/me/lib' INC='-I/home/me/include'

      Please clarify a bit more what to do here. Shall I just untar from B/BO/BORISZ/Geo-IP-1.38.tar.gz and run the Makefile.PL there ? Please suggest.

      Thanks
        Hello Rob,

        I have solved it as per your guidance. I have found the Geoip source located at
        /root/.cpan/build/Geo-IP-1.38-ZWHRAD/

        So I have followed your suggestion with in that folder and now I get the Geoip tracking in awstats.

        many many thanks to you
        It seems to me that you have GeoIP installed in a standard location, so you won't need to do anything special except downloading and manually installing Geo::IP. I tried installing GeoIP and Geo::IP, and everything went without a hitch.
        cpan>look Geo::IP
        or
        $ cpanp z Geo::IP
Re: newbie problem with Geo::IP installation through cpan
by zentara (Archbishop) on Feb 03, 2010 at 13:50 UTC
    I just recently experienced similar symptoms. What happened was that the make install for the c lib, didn't do the customary ldconfig, after it installed the libs as root. Just log in as root and do a ldconfig, so the Perl Makefile.pl can find it.

    Or use the old Microsoft Windows technique.... reboot. :-)


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://821080]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2019-12-10 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?