build spatialite4.3.0.a from source using external proj and geos

636 views
Skip to first unread message

excelsi...@gmail.com

unread,
Jun 3, 2016, 11:24:47 AM6/3/16
to SpatiaLite Users
Hello,
I tried to build spatialite 4.3.0.a from source but i failed ./configure recognizing my compiled versions in folder /anydirectory/geosdir/build/ and  /anydirectory/proj/build/
compile on debian 8. i don't want to use debian version, because I want to use my built versions! no double installations!
configure: WARNING: unrecognized options: --with-proj-include, --with-proj-lib, --with-geos-include, --with-geos-lib
any ideas to solve the problems!

mj10777

unread,
Jun 4, 2016, 10:08:31 AM6/4/16
to SpatiaLite Users
There may be 2 ways in doing this:
 
1) using '/usr/local' to install your geo and proj4 library's
    - the debian versions are most likely install in the default '/usr'
    When compiling spatialite, the default installation is also in '/usr/local'
    - so it should use those libraries (i.e. geos,proj4 in '/usr/local')

--

2) use another install directory structure for you installment
    - use the  '--prefix=' option for geos,proj4 and spatialite

Sample: 
I compiled and install all of the spatialite versions from 1.0a to 3.0.1
- goal was to create original databases of those versions

So in a directory called 'old_versions'
- inside that, directories for each version
-- 'bin_3_0_1'


LDFLAGS="-L//home/mj10777/000_links/libspatialite/archive/old_versions/bin_3_0_1/lib"
CFLAGS="-I//home/mj10777/000_links/libspatialite/archive/old_versions/bin_3_0_1/include"

# for geos,proj4,sqlite3 and spatialite
./configure --prefix=/home/mj10777/000_links/libspatialite/archive/old_versions/bin_3_0_1 
-- includedir=/home/mj10777/000_links/libspatialite/archive/old_versions/bin_3_0_1/include
--libdir=/home/mj10777/000_links/libspatialite/archive/old_versions/bin_3_0_1/lib

make
make install

When completed for all projects, you should have something like this inside 'bin_3_0_1'

bin
include
lib
share

To check which library's a program uses, use the ldd command:

ldd bin_3_0_1/bin/spatialite

linux-vdso.so.1 =>  (0x00007ffd6638b000)
libspatialite.so.2 => /home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/lib/libspatialite.so.2 (0x00007f25396ad000)
libsqlite3.so.0 => /home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/lib/libsqlite3.so.0 (0x00007f25393fd000)
libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x00007f25390d0000)
libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f2538e8a000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2538b83000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f25387bf000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f25385a1000)
libfreexl.so.1 => /usr/local/lib/libfreexl.so.1 (0x00007f2538392000)
libgeos_c.so.1 => /home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/lib/libgeos_c.so.1 (0x00007f2538169000)
libproj.so.0 => /home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/lib/libproj.so.0 (0x00007f2537f25000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2537d20000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f2537af7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2539be0000)
libgeos-3.3.0.so => /home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/lib/libgeos-3.3.0.so (0x00007f2537765000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2537456000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f253723f000)


Then in your '.bashrc', set the desired path, as the first to be searched

export PATH=/home/some_directory/libspatialite/archive/old_versions/bin_3_0_1/bin:$PATH

--

Using '/usr/local' is a simpler solution, but the other is also possible.

Hope this helps.

Mark



 

excelsi...@gmail.com

unread,
Jun 7, 2016, 6:39:54 AM6/7/16
to SpatiaLite Users
Dear Mark,
yes, i've already built geos and proj sucessfully and it's running fine with gdal and grass giss and so on, my question is how do Iget spatialite to use my existing running versions of proj and geos, which are not compiled in usr/ or usr/local , they are built in home/dic/dicproj/build and home/dicgeos/build. and I've tried with LD flags and CDFlags pointing to my installations of proj ad geos but it seems that the configure script only look in usr/local or /usr/ for proj and geos. I also share my libs with source /mysharedlibs/libs.sh which wiorked fine for all my compiled programms. but not for spatialite.
what can I do? Do I really need to compile geos and proj into usr/ or usr/local? 
cheers chris

mj10777

unread,
Jun 7, 2016, 7:01:48 AM6/7/16
to SpatiaLite Users


On Tuesday, 7 June 2016 12:39:54 UTC+2, excelsi...@gmail.com wrote:
Dear Mark,
yes, i've already built geos and proj sucessfully and it's running fine with gdal and grass giss and so on, my question is how do Iget spatialite to use my existing running versions of proj and geos, which are not compiled in usr/ or usr/local , they are built in home/dic/dicproj/build and home/dicgeos/build. and I've tried with LD flags and CDFlags pointing to my installations of proj ad geos but it seems that the configure script only look in usr/local or /usr/ for proj and geos.

That is what this is for (in the '.config' command):

--includedir=your_dir/geos/include
--libdir=your_dir/geos/lib

What I am not sure of, is how to add multiple directories (possibly adding a ';' or multiple '--includedir ')
- yours should be the first and the standard (as is /usr/include) the last
-- the first one found, wins

excelsi...@gmail.com

unread,
Jun 7, 2016, 9:30:28 AM6/7/16
to SpatiaLite Users
./configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build --includedir=/home/christoph/myworld/proj-4.9.2/build/include/ --libdir=/home/christoph/myworld/proj-4.9.2/build/lib/ gives following error message.
 

/configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build --includedir=/home/christoph/myworld/proj-4.9.2/build/include/ --libdir=/home/christoph/myworld/proj-4.9.2/build/lib/
checking
for a BSD-compatible install... /usr/bin/install -c
checking whether build environment
is sane... yes
/home/christoph/myworld/libspatialite-4.3.0a/missing: Unknown `--is-lightweight' option
Try `
/home/christoph/myworld/libspatialite-4.3.0a/missing --help' for more information
configure: WARNING: '
missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
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 whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -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 stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking sqlite3.h usability... yes
checking sqlite3.h presence... yes
checking for sqlite3.h... yes
checking sqlite3ext.h usability... yes
checking sqlite3ext.h presence... yes
checking for sqlite3ext.h... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
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 whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
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 the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
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 dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
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 -m elf_x86_64) 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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) 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 -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for an ANSI C-conforming const... yes
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working volatile... yes
checking whether lstat correctly handles trailing slash... yes
checking whether lstat accepts an empty string... no
checking whether lstat correctly handles trailing slash... (cached) yes
checking for working memcmp... yes
checking whether stat accepts an empty string... no
checking for strftime... yes
checking for memset... yes
checking for sqrt... no
checking for strcasecmp... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for fdatasync... yes
checking for ftruncate... yes
checking for getcwd... yes
checking for gettimeofday... yes
checking for localtime_r... yes
checking for memmove... yes
checking for strerror... (cached) yes
checking for sqlite3_prepare_v2 in -lsqlite3... yes
checking for inflateInit_ in -lz... yes
checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
configure: error: cannot find proj_api.h, bailing out

in config.log strange enough he can fine include and lib dir but anyway bailing out!!? 

bindir='${exec_prefix}/bin'
build
='x86_64-unknown-linux-gnu'
build_alias
=''
build_cpu
='x86_64'
build_os
='linux-gnu'
build_vendor
='unknown'
datadir
='${datarootdir}'
datarootdir
='${prefix}/share'
docdir
='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir
='${docdir}'
exec_prefix
='NONE'
host
='x86_64-unknown-linux-gnu'
host_alias
=''
host_cpu
='x86_64'
host_os
='linux-gnu'
host_vendor
='unknown'
htmldir
='${docdir}'
includedir
='/home/christoph/myworld/proj-4.9.2/build/include'
infodir
='${datarootdir}/info'
install_sh
='${SHELL} /home/christoph/myworld/libspatialite-4.3.0a/install-sh'
libdir
='/home/christoph/myworld/proj-4.9.2/build/lib'
libexecdir
='${exec_prefix}/libexec'
localedir
='${datarootdir}/locale'
localstatedir
='${prefix}/var'
mandir
='${datarootdir}/man'
mkdir_p
='$(MKDIR_P)'
oldincludedir
='/usr/include'
pdfdir
='${docdir}'
prefix
='/home/christoph/myworld/libspatialite-4.3.0a/build'
program_transform_name
='s,x,x,'
psdir
='${docdir}'
sbindir
='${exec_prefix}/sbin'
sharedstatedir
='${prefix}/com'
sysconfdir
='${prefix}/etc'
target_alias
=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "libspatialite"
#define PACKAGE_TARNAME "libspatialite"
#define PACKAGE_VERSION "4.3.0a"
#define PACKAGE_STRING "libspatialite 4.3.0a"
#define PACKAGE_BUGREPORT "a.fu...@lqt.it"
#define PACKAGE_URL ""
#define PACKAGE "libspatialite"
#define VERSION "4.3.0a"
#define _LARGE_FILE 1
#define _FILE_OFFSET_BITS 64
#define _LARGEFILE_SOURCE 1
#define NDEBUG 1
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_MATH_H 1
#define HAVE_FLOAT_H 1
#define HAVE_FCNTL_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_UNISTD_H 1
#define HAVE_SQLITE3_H 1
#define HAVE_SQLITE3EXT_H 1
#define HAVE_ZLIB_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define TIME_WITH_SYS_TIME 1
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
#define HAVE_STRFTIME 1
#define HAVE_MEMSET 1
#define HAVE_STRCASECMP 1
#define HAVE_STRERROR 1
#define HAVE_STRNCASECMP 1
#define HAVE_STRSTR 1
#define HAVE_FDATASYNC 1
#define HAVE_FTRUNCATE 1
#define HAVE_GETCWD 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_LOCALTIME_R 1
#define HAVE_MEMMOVE 1
#define HAVE_STRERROR 1
#define HAVE_LIBSQLITE3 1
#define HAVE_LIBZ 1
#define TARGET_CPU "x86_64-linux-gnu"
#define OMIT_GEOCALLBACKS 1

configure
: exit 1

It's just working when I install my


Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

excelsi...@gmail.com

unread,
Jun 7, 2016, 11:04:07 AM6/7/16
to SpatiaLite Users
it's just working when I install proj to standard directory. I've done that so know i've the same version installed in usr/local and home/projdir/build, okay ./configer is fine  now :-), but i can not rum make because of following error.
libtool: link: cannot find the library `/usr/lib/libproj.la' or unhandled argument `/usr/lib/libproj.la'
Makefile:533: recipe for target '
libspatialite.la' failed
make[3]: *** [libspatialite.la] Error 1
make[3]: Leaving directory '
/home/christoph/myworld/libspatialite-4.3.0a/src'
Makefile:596: recipe for target '
all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '
/home/christoph/myworld/libspatialite-4.3.0a/src'
Makefile:473: recipe for target '
all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '
/home/christoph/myworld/libspatialite-4.3.0a'
Makefile:380: recipe for target '
all' failed
make: *** [all] Error 2

Anyone an Idea on this?
Things that i found out till now.
configure just runs when proj and geos are installted in /usr or usr/local no individual directories accepted, and make has even problems with that ???!!
why this? proj and geos running smoothly even grass compilation without problems. gdal without troubles what is missing for spatialite???


Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

excelsi...@gmail.com

unread,
Jun 7, 2016, 3:11:01 PM6/7/16
to SpatiaLite Users
Okay,
if you want to build libspatialite, you need to build your geos or proj in /usr/local , otherwise it didn't work for me, sad thing because you ill have two same installations (at least i have now) buat that was the only way to not have conflicts with debian package installations that i didn't want to havo on my system. It would libspatialte runs fine but it woud be great to implement the possibility of including proj and geos which are not in /usr or /usr/local. Finally I successfully comiled qgis with libspatialite 4.3,0.a! :-), but it was quite a challenge and I needed to install proj and geos twice which i tried to avoid. :-( !
Hope this will help others with the same issues!
cheers chris!

Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

Brad Hards

unread,
Jun 7, 2016, 5:38:51 PM6/7/16
to spatiali...@googlegroups.com

I think this represents a misunderstanding of how dynamic linking works. The linking at compile time does not tie in a particular path for the libraries that are used at runtime.

 

That is, dynamic linking resolves dynamically, based on a set of configured paths. You can modify the paths using LD_LIBRARY_PATH.

 

So an

export LD_LIBRARY_PATH=/anydirectory/geosdir/build/lib:/anydirectory/proj/build/lib:/usr/local/lib:$LD_LIBRARY_PATH

followed by

ldconfig –a

might be enough. The values in the envvar obviously need to reflect the real location where your DLLs are located, and you need to add the export to the .bashconfig or similar if you want it to be persistent.

 

Brad

 

 

--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Visit this group at https://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.

excelsi...@gmail.com

unread,
Jun 13, 2016, 6:57:52 AM6/13/16
to SpatiaLite Users
Hello,
I really think that there is a bug in ./configure cause I cannot get spatialite to recognize my librarys
ldconfig -v shows my libs

/home/christoph/myworld/geos-3.5.0/build/lib:
    libgeos_c
.so.1 -> libgeos_c.so.1.9.0
    libgeos
-3.5.0.so -> libgeos.so

/home/christoph/myworld/proj-4.9.2/build/lib:
    libproj
.so.9 -> libproj.so.9.1.0


So everything seems to be alright but libspatialite doesn't find it ?????
Does anybody has a idea why this occure?
greets chris




Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

Mark Johnson

unread,
Jun 13, 2016, 7:18:08 AM6/13/16
to spatiali...@googlegroups.com
2016-06-13 12:57 GMT+02:00 <excelsi...@gmail.com>:
Hello,
I really think that there is a bug in ./configure cause I cannot get spatialite to recognize my librarys
ldconfig -v shows my libs

/home/christoph/myworld/geos-3.5.0/build/lib:
    libgeos_c
.so.1 -> libgeos_c.so.1.9.0
    libgeos
-3.5.0.so -> libgeos.so

/home/christoph/myworld/proj-4.9.2/build/lib:
    libproj
.so.9 -> libproj.so.9.1.0


So everything seems to be alright but libspatialite doesn't find it ?????
Does anybody has a idea why this occur?
greets chris
Show us please the complete (with all parameters) ./config command that you use. 
- while running it will print out what it finds and what it does not find
-- so that too (proj4 and geo) , would be useful to see




Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:
Hello,
I tried to build spatialite 4.3.0.a from source but i failed ./configure recognizing my compiled versions in folder /anydirectory/geosdir/build/ and  /anydirectory/proj/build/
compile on debian 8. i don't want to use debian version, because I want to use my built versions! no double installations!
configure: WARNING: unrecognized options: --with-proj-include, --with-proj-lib, --with-geos-include, --with-geos-lib
any ideas to solve the problems!

--
You received this message because you are subscribed to a topic in the Google Groups "SpatiaLite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spatialite-users/-Hkf4bCewwE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spatialite-use...@googlegroups.com.

Brad Hards

unread,
Jun 13, 2016, 7:23:19 AM6/13/16
to spatiali...@googlegroups.com
Can you show your PKG_CONFIG_PATH?

What does pkg-config --libs proj show?
What does pkg-config --cflags proj show?
What does pkg-config --modversion proj show?

What does geos-config --prefix show?
What does geos-config --libs show?
What does geos-config --version show?
What does geos-config --cflags show?



a.fu...@lqt.it

unread,
Jun 13, 2016, 2:44:01 PM6/13/16
to spatiali...@googlegroups.com
On Mon, 13 Jun 2016 03:57:51 -0700 (PDT), excelsi...@gmail.com
wrote:
> Hello,
> I really think that there is a bug in ./configure cause I cannot get
> spatialite to recognize my librarys
> ldconfig -v shows my libs
>
> /home/christoph/myworld/geos-3.5.0/build/lib:
>     libgeos_c.so.1 -> libgeos_c.so.1.9.0
>     libgeos-3.5.0.so -> libgeos.so
>
> /home/christoph/myworld/proj-4.9.2/build/lib:
>     libproj.so.9 -> libproj.so.9.1.0
>
> So everything seems to be alright but libspatialite doesn't find it
> ?????
> Does anybody has a idea why this occure?
>

Hi Chris,

the ./configure script is intended to facilitate as much as possible
the process of correctly locating all required dependencies on
your local filesystem.
it's flexible enough to successfully adapt to the weirdest
configurations
(this including any custom non-standard location), but in this case you
are obviously expected to better specify few more details so to help
the script to correctly understand what you are exactly intending.

few basic rules to be always kept in mind:

1. ./configure will search any required header file within its own
standard locations: this usually covers /usr/include and very
often /usr/local/include as well, but it depends on each single
platform.
in any case, you are absolutely free to set your own searching
rules overriding or extending the platform specific ones by
simply defining the environment variable CFLAGS (or CPPFLAGS,
or may be CXXFLAGS).
* CFLAGS is intended for plain C
* CXXFLAGS is intended for C++
* CPPFLAGS is intended for the macro-preprocessor

just a basic example:

export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"

the above directive is instructing the ./configure script to
explore your own custom location when searching for header files.

2. more or less the same is for libraries, but in this case the
appropriate environment variable to be set is LDFLAGS.

export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"

3. many packages (but not all) support a more sophisticated approach,
based on PKG-CONFIG (a powerful tool intended to facilitate the
local configuration of each package).
the specific searching rules for PKG-CONFIG strongly vary from
platform to platform, anyway you can always override the default
by explicitly setting the PKG_CONFIG_PATH env-variable,
something like this:

export "PKG_CONFIG_PATH=/home/sandro/mybuild/lib"

4. few other packages support a non-standard configuration tool
of their own (different from PKG-CONFIG); this exactly is the
case of GEOS, that supports its own GEOS-CONFIG tool.

> configure: WARNING: unrecognized options: --with-proj-include,
> --with-proj-lib, --with-geos-include, --with-geos-lib

5. please note: you can't invent at your fantasy ./configure
non-standard options. other packages are absolutely free
to implement e.g. --with-geos-lib, but SpatiaLite isn't
necessarily obliged to follow their behaviour when a
more canonic alternative exists.

---------------------------------------------
All together now:

export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"
export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"
./configure
--with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config

I'm rather confident that ./configure will nicely support
your own custom non-standard local configuration, once
it will be correctly instructed.

bye Sandro

excelsi...@gmail.com

unread,
Jun 14, 2016, 6:41:58 AM6/14/16
to SpatiaLite Users
Thank you so much for your effort, I#m really not that experinced in linux but I really want to know how this thing is working :-)!
so I tried what you told me, so what happens is that it compiler does find geos and uses it's libraries but fails to get proj libraries,
root@excelsior:/home/christoph/myworld# proj
Rel. 4.9.2, 08 September 2015
usage
: proj [ -beEfiIlormsStTvVwW [args] ] [ +opts[=arg] ] [ files ]
root@excelsior
:/home/christoph/myworld# geos-config  --prefix
/home/christoph/myworld/geos-3.5.0/build
root@excelsior
:/home/christoph/myworld#  geos-config  --libs
-L/home/christoph/myworld/geos-3.5.0/build/lib -lgeos
root@excelsior
:/home/christoph/myworld# geos-config  --version
3.5.0
root@excelsior
:/home/christoph/myworld# geos-config --cflags
-I/home/christoph/myworld/geos-3.5.0/build/include
root@excelsior
:/home/christoph/myworld# pkg-config --libs proj
-L/usr/local/lib -lproj
root@excelsior
:/home/christoph/myworld# pkg-config --cflags proj
-I/usr/local/include
root@excelsior
:/home/christoph/myworld#  pkg-config --modversion proj
4.9.2


      my /etc/ld.so.conf.d/ file: looks like this:
        /home/christoph/myworld/proj-4.9.2/build/lib
/home/christoph/myworld/tiff-4.0.6/build/lib
/home/christoph/myworld/libgeotiff-1.4.0/build/lib
/home/christoph/myworld/geos-3.5.0/build/lib
/home/christoph/myworld/gdal-trunk/build/lib
/home/christoph/myworld/cc-trunk/build/lib
/home/christoph/myworld/laszip-2.1.0/build/lib
/home/christoph/myworld/libLAS-1.8/build/lib
/home/christoph/myworld/cmake-3.5.2/lib
/home/christoph/myworld/hdf-4.2.11/build/lib
/home/christoph/myworld/hdf5-1.8.17/build/lib
/home/christoph/myworld/netcdf-4.4.0/build/lib
/home/christoph/myworld/erdas_v.5.2.1/build/lib/x64/release
/home/christoph/myworld/qt-everywhere-opensource-src-5.6.0/build/lib
/home/christoph/myworld/hdf5-1.8.17/build/lib
/home/christoph/myworld/netcdf-4.4.0/build/lib
/home/christoph/myworld/erdas_v.5.2.1/build/lib/x64/release
/home/christoph/myworld/qt-everywhere-opensource-src-5.6.0/build/lib
/home/christoph/myworld/wxWidgets-3.1.0/build/lib
 
when i run ./configure in lispatialite folowing output: look at proj????

 
 ./configure \
> --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build/ \
> --with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config \
> --enable-freexl=no
' script is too old or missing
checking proj_api.h usability... yes
checking proj_api.h presence... no
configure: WARNING: proj_api.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: proj_api.h: proceeding with the compiler'
s result
checking
for proj_api.h... yes
checking
for library containing pj_init_plus... -lproj
checking
for library containing pj_init_ctx... none required
checking iconv
.h usability... yes
checking iconv
.h presence... yes
checking
for iconv.h... yes
checking
for library containing iconv... none required
checking
for library containing locale_charset... no
checking
for library containing nl_langinfo... none required
Using user-specified geos-config file: /home/christoph/myworld/geos-3.5.0/build/bin/geos-config
checking geos_c
.h usability... yes
checking geos_c
.h presence... yes
checking
for geos_c.h... yes
checking
for library containing GEOSCoveredBy... -lgeos_c
checking
for library containing GEOSDelaunayTriangulation... none required
checking
for pkg-config... /usr/bin/pkg-config
checking pkg
-config is at least version 0.9.0... yes
checking
for LIBXML2... yes
checking that generated files are newer than configure
... done
configure
: creating ./config.status
config
.status: creating Makefile
config
.status: creating src/Makefile
config
.status: creating src/headers/Makefile
config
.status: creating src/gaiaaux/Makefile
config
.status: creating src/gaiaexif/Makefile
config
.status: creating src/gaiageo/Makefile
config
.status: creating src/gaiageo/flex/Makefile
config
.status: creating src/gaiageo/lemon/Makefile
config
.status: creating src/gaiageo/lemon/lemon_src/Makefile
config
.status: creating src/geopackage/Makefile
config
.status: creating src/spatialite/Makefile
config
.status: creating src/shapefiles/Makefile
config
.status: creating src/dxf/Makefile
config
.status: creating src/md5/Makefile
config
.status: creating src/control_points/Makefile
config
.status: creating src/srsinit/Makefile
config
.status: creating src/srsinit/epsg_update/Makefile
config
.status: creating src/connection_cache/Makefile
config
.status: creating src/connection_cache/generator/Makefile
config
.status: creating src/virtualtext/Makefile
config
.status: creating src/wfs/Makefile
config
.status: creating test/Makefile
config
.status: creating test/sql_stmt_tests/Makefile
config
.status: creating test/sql_stmt_geos_tests/Makefile
config
.status: creating test/sql_stmt_geosadvanced_tests/Makefile
config
.status: creating test/sql_stmt_geopackage_tests/Makefile
config
.status: creating test/sql_stmt_proj_tests/Makefile
config
.status: creating test/sql_stmt_mathsql_tests/Makefile
config
.status: creating test/sql_stmt_lwgeom_tests/Makefile
config
.status: creating test/sql_stmt_libxml2_tests/Makefile
config
.status: creating test/sql_stmt_security_tests/Makefile
config
.status: creating test/sql_stmt_xmlsec_tests/Makefile
config
.status: creating test/sql_stmt_freexl_tests/Makefile
config
.status: creating test/sql_stmt_cache_tests/Makefile
config
.status: creating test/sql_stmt_nocache_tests/Makefile
config
.status: creating examples/Makefile
config
.status: creating Doxyfile
config
.status: creating spatialite.pc
config
.status: creating config.h
config
.status: config.h is unchanged
config
.status: executing depfiles commands
config
.status: executing libtool commands

Hope this gives a little insight in the structure of my build environment!
cheers chris








 
So it seems that proj pkg doesn't show to installed directories mybe that's the reason?!
        greets chris 

Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

mj10777

unread,
Jun 14, 2016, 6:48:54 AM6/14/16
to SpatiaLite Users
Did you do:
export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"
export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"
before calling ./configure?

excelsi...@gmail.com

unread,
Jun 14, 2016, 6:54:28 AM6/14/16
to SpatiaLite Users
yes I did
root@excelsior:/home/christoph/myworld/libspatialite-4.3.0a# export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# ./configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build/ --with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config --enable-freexl=no

in this order!
cheers



Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

Brad Hards

unread,
Jun 14, 2016, 6:59:03 AM6/14/16
to spatiali...@googlegroups.com
It looks like your proj version is the same as the distro version:
> root@excelsior:/home/christoph/myworld# pkg-config --modversion proj
> 4.9.2
and
> /home/christoph/myworld/proj-4.9.2/build/lib

However assuming you really did want to use yours, you should set PKG_CONFIG_PATH.
I asked what this was set to previously, but you can see it if you:
echo $PKG_CONFIG_PATH

(it might come back empty).

If you want to use a different set of proj libraries, you should find the matching proj.pc file
If it is at /home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig/proj.pc
Then you should do something like:
export PKG_CONFIG_PATH=/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig

If you haven't installed it, proj.pc may not have the right values though - I'm not that familiar with the proj build system.

HTH

Brad

mj10777

unread,
Jun 14, 2016, 7:03:41 AM6/14/16
to SpatiaLite Users


On Tuesday, 14 June 2016 12:54:28 UTC+2, excelsi...@gmail.com wrote:
yes I did
root@excelsior:/home/christoph/myworld/libspatialite-4.3.0a# export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# ./configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build/ --with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config --enable-freexl=no

in this order!

This is the cause: it has found the .h file
- Brads suggestion may resolve this
 (export PKG_CONFIG_PATH=/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig)
accepted by the compiler, rejected by the preprocessor!

 
cheers

mj10777

unread,
Jun 14, 2016, 7:22:09 AM6/14/16
to SpatiaLite Users


On Tuesday, 14 June 2016 13:03:41 UTC+2, mj10777 wrote:


On Tuesday, 14 June 2016 12:54:28 UTC+2, excelsi...@gmail.com wrote:
yes I did
root@excelsior:/home/christoph/myworld/libspatialite-4.3.0a# export "CFLAGS=-I/home/christoph/myworld/proj-4.9.2/build/include"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# export "LDFLAGS=-L/home/christoph/myworld/proj-4.9.2/build/lib"
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# ./configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build/ --with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config --enable-freexl=no

in this order!

This is the cause: it has found the .h file
- Brads suggestion may resolve this
 (export PKG_CONFIG_PATH=/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig)
accepted by the compiler, rejected by the preprocessor!

 
cheers


Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:
Hello,
I tried to build spatialite 4.3.0.a from source but i failed ./configure recognizing my compiled versions in folder /anydirectory/geosdir/build/ and  /anydirectory/proj/build/
compile on debian 8. i don't want to use debian version, because I want to use my built versions! no double installations!
A note on the side:
- if you are the only person using your machine (excelsior), then this is what '/usr/local/' is for
-- to use your own build versions. System/Debian versions will always be installed in '/usr
It would also simplify your configuration problems.
'root' permissions would be needed when installing (i.e. 'sudo make install')
- using the 'root' user, is BTW, a very bad idea

excelsi...@gmail.com

unread,
Jun 14, 2016, 8:42:05 AM6/14/16
to SpatiaLite Users
You are right,
echo $PKG_CONFIG_PATH came back emty,
so I did export CONFIG_PATH and now
Then make distclean for lisaptialite.
./configure again
output
root@excelsior:/home/christoph/myworld/libspatialite-4.3.0a# pkg-config --libs proj-L/home/christoph/myworld/proj-4.9.2/build/lib -lproj
root@excelsior
:/home/christoph/myworld/libspatialite-4.3.0a# pkg-config --cflags proj-I/home/christoph/myworld/proj-4.9.2/build/include

root@excelsior:/home/christoph/myworld/libspatialite-4.3.0a# ./configure --prefix=/home/christoph/myworld/libspatialite-4.3.0a/build/ --with-geosconfig=/home/christoph/myworld/geos-3.5.0/build/bin/geos-config --enable-freexl=no
config.status: executing depfiles commands
config.status: executing libtool commands
Same thing!



Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

mj10777

unread,
Jun 14, 2016, 9:17:51 AM6/14/16
to SpatiaLite Users
I also know little about pkgconfig

Based on Brads suggestion
export PKG_CONFIG_PATH=/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig

you must insure that there is a directory called 
pkgconfig
- inside that there should be a 'proj.pc' file

On my machine the proj.pc file contains the following 
(shown with: sudo cat /usr/local/lib/pkgconfig/proj.pc)

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: proj
Description: Cartographic Projections Library.
Requires:
Version: 4.8.0
Libs: -L${libdir} -lproj
Cflags: -I${includedir}


Yours should have something like:
prefix=/home/christoph/myworld/proj-4.9.2/build

Is this so?

Mark

excelsi...@gmail.com

unread,
Jun 14, 2016, 9:26:26 AM6/14/16
to SpatiaLite Users
Yes my looks like this
christoph@excelsior:~/myworld/libspatialite-4.3.0a$ cat /home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig/proj.pc
prefix
=/home/christoph/myworld/proj-4.9.2/build
exec_prefix
=${prefix}
libdir
=/home/christoph/myworld/proj-4.9.2/build/lib
includedir
=/home/christoph/myworld/proj-4.9.2/build/include

Name: proj
Description: Cartographic Projections Library.
Requires:
Version: 4.9.2

Libs: -L${libdir} -lproj
Cflags: -I${includedir}

looks fine!







Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

mj10777

unread,
Jun 14, 2016, 9:45:25 AM6/14/16
to SpatiaLite Users


On Tuesday, 14 June 2016 15:26:26 UTC+2, excelsi...@gmail.com wrote:
Yes my looks like this
christoph@excelsior:~/myworld/libspatialite-4.3.0a$ cat /home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig/proj.pc
prefix
=/home/christoph/myworld/proj-4.9.2/build
exec_prefix
=${prefix}
libdir
=/home/christoph/myworld/proj-4.9.2/build/lib
includedir
=/home/christoph/myworld/proj-4.9.2/build/include

Name: proj
Description: Cartographic Projections Library.
Requires:
Version: 4.9.2
Libs: -L${libdir} -lproj
Cflags: -I${includedir}

looks fine!
Yes, it does

Before you wrote:
echo $PKG_CONFIG_PATH came back emty,
so I did export CONFIG_PATH

But you must do it with 'PKG_CONFIG_PATH' and not 'CONFIG_PATH' (possibly only a typo)
- does 'echo $PKG_CONFIG_PATH ' now show a result?
-- it MUST show a result to work correctly

 pkg-config  retrieves  information  about packages from special metadata files. These files are named after the package, and
       has a
.pc extension.  On most systems, pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig,  /usr/local/lib/pkgcon
       fig  
and  /usr/local/share/pkgconfig  for  these files.  It will additionally look in the colon-separated (on Windows, semi
       colon
-separated) list of directories specified by the PKG_CONFIG_PATH environment variable.
- since you are not using any of the default directories, 
'echo $PKG_CONFIG_PATH ' must show a result.

Mark

 

excelsi...@gmail.com

unread,
Jun 14, 2016, 9:48:35 AM6/14/16
to SpatiaLite Users
Was a typo everything looks fine
christoph@excelsior:~/myworld/libspatialite-4.3.0a$ echo $PKG_CONFIG_PATH
/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig



Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

mj10777

unread,
Jun 14, 2016, 9:51:43 AM6/14/16
to SpatiaLite Users


On Tuesday, 14 June 2016 15:48:35 UTC+2, excelsi...@gmail.com wrote:
Was a typo everything looks fine
christoph@excelsior:~/myworld/libspatialite-4.3.0a$ echo $PKG_CONFIG_PATH
/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig

Well, then I have no idea
- best to install proj4 into /usr/local 

excelsi...@gmail.com

unread,
Jun 14, 2016, 9:59:48 AM6/14/16
to SpatiaLite Users
Yes, this is what I did, as well as geos because make failed with geos, although configure went well!
you are right, I should compile to usr/local, but my intention was if something goes wrong with the system I have programs backed on /home and a lot of debian package are old versions which are interfering, and why not use the latest compiled packages? But anyway thank you so much for your help! :-)!
cheers chris  
Am Freitag, 3. Juni 2016 17:24:47 UTC+2 schrieb excelsi...@gmail.com:

mj10777

unread,
Jun 14, 2016, 10:05:49 AM6/14/16
to SpatiaLite Users


On Tuesday, 14 June 2016 15:59:48 UTC+2, excelsi...@gmail.com wrote:
Yes, this is what I did, as well as geos because make failed with geos, although configure went well!
you are right, I should compile to usr/local, but my intention was if something goes wrong with the system I have programs backed on /home and a lot of debian package are old versions which are interfering, and why not use the latest compiled packages?
Yes indeed, but that is one of the major purposes of '/usr/local' 
- that is why most of these projects default to 'prefix=/usr/local'
-- another is to test if a newer version works correctly before deploying in '/usr'
---> and only after testing, replacing the '/usr' version

Mark

a.fu...@lqt.it

unread,
Jun 14, 2016, 4:46:23 PM6/14/16
to spatiali...@googlegroups.com
On Tue, 14 Jun 2016 04:22:09 -0700 (PDT), 'mj10777' via SpatiaLite
Users wrote:
> A note on the side:
> - if you are the only person using your machine (excelsior), then
> this
> is what '/USR/LOCAL/' is for
> -- to use your own build versions. System/Debian versions will always
> be installed in '/USR' 
> It would also simplify your configuration problems.
> 'root' permissions would be needed when installing (i.e. 'SUDO MAKE
> INSTALL')
> - using the 'root' user, is BTW, a very bad idea
>

Just a further comment: it looks that many developers coming from
Windows are fond of very complex and sparse disk layouts, as e.g.:

/somedir/libalpha-1.0.0/include
/somedir/libalpha-1.0.0/lib
/somedir/libbeta-3.2.1/include
/somedir/libbeta-3.2.1/lib
/somedir/libgamma-2.5.0/include
/somedir/libgamma-2.5.0/lib
... and so on

On Linux (and on any Unix-like system) adopting such a sparse
disk layout usually causes many unrequited headaches.
The straightforward way on Unix/Linux is always the one to
place all your custom libraries within a _single_ directory
internally containing -/include, -/lib and -/bin subdirs.
the most canonic location is /usr/local, but nothing forbids
to adopt any other location such as /home/name/my_builds.

after adopting a simpler and more rational disk layout
for your custom builds, you'll then discover that:

1. you just have to pass the same --prefix=/home/name/my_builds
directive to all your ./configure calls
2. you have to set just three env-variables:
export "CFLAGS=-I/home/name/my_builds/include"
export "LDFLAGS=-L/home/name/my_builds/lib"
export "PKG_CONFIG_PATH=/home/name/my_builds/lib"
3. and that's all. stop.

you'll then discover that after adopting these elementary
precautions many apparently difficult configuration problems
will simply vanish into nothing. ;-)

bye Sandro
.


Brad Hards

unread,
Jun 14, 2016, 11:18:26 PM6/14/16
to spatiali...@googlegroups.com
> christoph@excelsior:~/myworld/libspatialite-4.3.0a$ echo $PKG_CONFIG_PATH
>/home/christoph/myworld/proj-4.9.2/build/lib/pkgconfig
To test this, use pkg-config. I provided the instructions earlier.

It is possible there are still bugs in the configure script that this non-standard approach is hitting, but if you want to understand, you need to debug, not make random changes.

Brad

Reply all
Reply to author
Forward
0 new messages