On Sat, 23 Sep 2017 07:57:23 -0700 (PDT), Majid Hojati wrote:
> thanks very much but which file do I must add? for example on my
> ubuntu usr/local/lib there are some files which names
> mod_rasterlite2.so,mod_rasterlite2.so.1 and so on.. so.1 file does
> not
> matter right??
>
Hi Majid,
on Linux any shared library is usually identified by several alias
names; it's a standard platform requirement intended to allow for
the installation of more alternative versions of the same library.
if you check all details, you'll easily discover that:
- /usr/local/lib/mod_rasterlite2.so.1.0.0
this is a physical file and has a size of several MB.
- /usr/local/lib/mod_rasterlite2.so.1
this simply is a symbolic link (aka softlink aka symlink)
referencing the previous one, and has a size of few bytes.
- /usr/local/lib/mod_rasterlite2.so
yet another symlink.
you are usually expected to load 'mod_rasterlite.so' so
to avoid requesting any specific version, and the system
will automatically load the most recent one.
there are obvious exceptions to the above base rule;
sometimes you could be compelled (for any good reason)
to load a specific version, and in this case explicitly
specifying a full module name including version infos
should be required, but it's the exception and not
the rule.
> also if I only address
> load_extentions('mod_spatialite.so') does it works on ubuntu or I
> should reference load_extentions('usr/local/lib/mod_spatialite.so')
>
there is no absolute rule, it depends on the specific
rules adopted by your Linux (that may well be, could be
possibly be modified by some local setting imposed by
your system administrator).
adopting the short form 'mod_spatialite' (note: the
.so suffix isn't strictly required) practically
intends "please system, search this module in all
directories covered by the currently set standard
searching rules for binary executables, by applying
the pre-defined priorities".
the long form intends instead "system, just look
at this file I'm referencing by its relative or
absolute path"
the usual best practice on Linux is to always depend
on system-wide searching rules, but you are obviously
free (under your full responsibility) to act
differently if you think this could be appropriate.
hint: you can eventually extend / change the standard
searching rules for your current shell session by
executing a directive like:
export "LD_LIBRARY_PATH=/usr/local/lib"
this will automatically include "/usr/local/lib"
to the list of directories being searched.
note: when loading _BOTH_ mod_spatialite and
mod_rasterlite2 you should always load RL2 first
and splite second.
bye Sandro