Build compile error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Build compile error

Volkan Kepoglu

I am trying to build QGIS from source code in Ubuntu 7.10 Gutsy Gibbon, but I couldn't. I followed the instructions in the wiki page buildingFromSource. The following error has occurred. I think it is about GEOS. installed version of libgeos-dev is 2.2.3-3.


after then, I build geos-3.0.0rc4 from source code. this was previous error.


In file included from /usr/local/include/geos.h:27,

from /home/vkepoglu/dev/cpp/qgis/src/core/qgsgeometry.h:26,

from /home/vkepoglu/dev/cpp/qgis/src/core/qgslabel.cpp:29:

/usr/local/include/geos/geom.h:145:2: warning: #warning *** FIXME: to be removed, temporarly set to allow a quick successful build


[ 67%] Building CXX object src/app/CMakeFiles/qgis.dir/moc_qgspythondialog.o

Linking CXX executable qgis

/home/vkepoglu/dev/cpp/qgis/build/src/core/libqgis_core.so: undefined reference to `geos::geom::Coordinate::Coordinate(double, double, double)'

/home/vkepoglu/dev/cpp/qgis/build/src/core/libqgis_core.so: undefined reference to `geos::io::WKTReader::~WKTReader()'

/home/vkepoglu/dev/cpp/qgis/build/src/core/libqgis_core.so: undefined reference to `geos::io::WKTReader::WKTReader(geos::geom::GeometryFactory const*)'

/home/vkepoglu/dev/cpp/qgis/build/src/core/libqgis_core.so: undefined reference to `geos::geom::Coordinate::~Coordinate()'

collect2: ld returned 1 exit status

make[2]: *** [src/app/qgis] Error 1

make[1]: *** [src/app/CMakeFiles/qgis.dir/all] Error 2

make: *** [all] Error 2


and then I found explanations for this error in the web suggesting to build GEOS with higher version. The explanation is something like


Some Notes on Compiling Applications Against GEOS 3.0.0rc4

Submitted by dylan on Tue, 2007-12-11 19:52.

I recently upgraded to GEOS 3.0.0rc4 in order to take advantage of its more robust handling of invalid geometries (damn shapefiles!). However, there are two mini-bugs in this release which need to be sorted out when compiling against it (or at least for the two application I was interested in: QGIS and StarSpan). Note that the first issue presented here has been resolved in GEOS 3.0.0rc5.

  1. Several of the GEOS source files contain little notes about "warning *** FIXME: to be removed, temporarly set to allow a quick successful build" which cause compiler warning messages. While this is not a big problem, it makes some applications which use the compiler flags -Wall and -Werror barf. This is the default mode for the latest versions of QGIS, and therefore the "PEDANTIC" flag in its configuration should be set to OFF.

  2. A recent patch to 'source/inlines.cpp' (included in GEOS 3.0.0rc4) meant to deal with compiler problems on Windows causes problems for real operating systems. As documented here suggests changing line 30 of 'source/inlines.cpp' from:

    #if defined(__MINGW32__) && !defined(DLL_EXPORT)

    to

    #if !defined(__MINGW32__) || defined(__MINGW32__) && !defined(DLL_EXPORT)


    After doing this, re-compile / re-install GEOS 3.0.0rc4 and applications built against it should not have any problems with functions not being defined. This has been submitted as ticket #166 on the GEOS Trac page. "


so, I build geos-3.0.0. and pedantic option is off in ccmake by default. However following error is occurred;


In file included from /usr/local/include/geos.h:27,

from /home/vkepoglu/dev/cpp/qgis/src/core/qgsgeometry.h:26,

from /home/vkepoglu/dev/cpp/qgis/python/core/qgsgeometry.sip:21:

/usr/local/include/geos/geom.h:145:2: warning: #warning *** DEPRECATED: You are using deprecated header geom.h. Please, update your sources according to new layout of GEOS headers and namespaces


Do you have any idea? Is there anything that I should do something for GEOS?


Volkan Kepoglu

PHD Candidate,

Department of GGIT in METU

Ankara, Turkey.



_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Martin Dobias
On Jan 20, 2008 4:06 PM, volkan kepoglu <[hidden email]> wrote:
>
>
> I am trying to build QGIS from source code in Ubuntu 7.10 Gutsy Gibbon, but
> I couldn't. I followed the instructions in the wiki page buildingFromSource.
> The following error has occurred. I think it is about GEOS. installed
> version of libgeos-dev is 2.2.3-3.

I use GEOS 2.2.3 from ubuntu 7.10 with no problems.


>  so, I build geos-3.0.0. and pedantic option is off in ccmake by default.
> However following error is occurred;
>
>
>
>
> In file included from /usr/local/include/geos.h:27,
>
>  from /home/vkepoglu/dev/cpp/qgis/src/core/qgsgeometry.h:26,
>
>  from /home/vkepoglu/dev/cpp/qgis/python/core/qgsgeometry.sip:21:
>
> /usr/local/include/geos/geom.h:145:2: warning: #warning *** DEPRECATED: You
> are using deprecated header geom.h. Please, update your sources according to
> new layout of GEOS headers and namespaces

Actually this is not an error, just a warning...

Martin
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Volkan Kepoglu
Thanks alot. it worked. I build QGIS from source code.
 
I don't know previously why it doesn't work. it maybe difference between the package installed with sudo apt-get install libgeos-dev whose version is 2.3.3-3 as stated in snaptic package manager and source code of geos-2.3.3.
 
I am getting the following error in idle 1.2.1 of python 2.5.1
 
>>> from PyQt4.QtCore import *
>>> from PyQt4.QtGui import *
>>> from qgis.core import *
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from qgis.core import *
ImportError: No module named qgis.core
 
I have tried to define the path as follows, in order to try all possibilities.
 
export LD_LIBRARY_PATH=/usr/local/include/qgis:/usr/local/lib/qgis:/usr/local/lib:/usr/local/share/qgis
export PYTHONPATH=/usr/local/share/qgis/python
 
but nothing changed. the same error in python. module couldn't find.
 
I do not know which path to define. in ccmake I accepted all default paths.
what actually do these paths? is it required to define these paths for each session, I mean when ı closed the terminal, path assignment is disappearing.
 
should ı define ld_library_path as the path of source code: /home/vkepoglu/dev/cpp/qgis?
 
should I re-build by setting BINDINGS_GLOBAL_INSTALL variable in CMake to TRUE?
 
maybe I should define in which path to install qgis, isn't it?
but do not know how to define
is CMAKE_BUILD_PREFIX (is it the path definition of installing qgis) the equilavent of CMAKE_INSTALL_PREFIX, because in ccmake version 2.4 there is no CMAKE_BUILD_PREFIX anymore?

 
On 1/20/08, Martin Dobias <[hidden email]> wrote:
On Jan 20, 2008 4:06 PM, volkan kepoglu <[hidden email]> wrote:
>
>
> I am trying to build QGIS from source code in Ubuntu 7.10 Gutsy Gibbon, but
> I couldn't. I followed the instructions in the wiki page buildingFromSource.
> The following error has occurred. I think it is about GEOS. installed
> version of libgeos-dev is 2.2.3-3.

I use GEOS 2.2.3 from ubuntu 7.10 with no problems.


>  so, I build geos-3.0.0. and pedantic option is off in ccmake by default.
> However following error is occurred;
>
>
>
>
> In file included from /usr/local/include/geos.h:27,
>
>  from /home/vkepoglu/dev/cpp/qgis/src/core/qgsgeometry.h:26,
>
>  from /home/vkepoglu/dev/cpp/qgis/python/core/qgsgeometry.sip:21:
>
> /usr/local/include/geos/geom.h:145:2: warning: #warning *** DEPRECATED: You
> are using deprecated header geom.h. Please, update your sources according to
> new layout of GEOS headers and namespaces

Actually this is not an error, just a warning...

Martin


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Martin Dobias
2008/1/21 volkan kepoglu <[hidden email]>:

>
> I am getting the following error in idle 1.2.1 of python 2.5.1
>
> >>> from PyQt4.QtCore import *
> >>> from PyQt4.QtGui import *
> >>> from qgis.core import *
> Traceback (most recent call last):
>   File "<pyshell#2>", line 1, in <module>
>     from qgis.core import *
> ImportError: No module named qgis.core
>
> I have tried to define the path as follows, in order to try all
> possibilities.
>
> export
> LD_LIBRARY_PATH=/usr/local/include/qgis:/usr/local/lib/qgis:/usr/local/lib:/usr/local/share/qgis
> export PYTHONPATH=/usr/local/share/qgis/python

can you check that path /usr/local/share/qgis/python that there's
directory 'qgis' in which there are file core.so, gui.so and
__init__.py ?

if you've installed qgis to /usr/local prefix, you actually don't need
to set LD_LIBRARY_PATH since /usr/local/lib (where are the files
libqgis_core.so and libqgis_gui.so) is already in linker's search
path. Just make sure to call ldconfig after installing to update the
cache of system libraries.

> but nothing changed. the same error in python. module couldn't find.
>
> I do not know which path to define. in ccmake I accepted all default paths.
> what actually do these paths? is it required to define these paths for each
> session, I mean when ı closed the terminal, path assignment is disappearing.

when you do 'export' it will be working only in current shell. So you
have to do first export of PYTHONPATH variable and then in the same
console open python interpreter. Or you can do the same in Python -
before importing qgis modules you can add that path to python's
sys.path array.


> should ı define ld_library_path as the path of source code:
> /home/vkepoglu/dev/cpp/qgis?

no, it's not needed.


> should I re-build by setting BINDINGS_GLOBAL_INSTALL variable in CMake to
> TRUE?

no, it's not necessary.


> maybe I should define in which path to install qgis, isn't it?
> but do not know how to define
> is CMAKE_BUILD_PREFIX (is it the path definition of installing qgis) the
> equilavent of CMAKE_INSTALL_PREFIX, because in ccmake version 2.4 there is
> no CMAKE_BUILD_PREFIX anymore?

it's okay to install it to default path (/usr/local) - if you don't
have any special reasons for not doing it, use the default path.

Martin
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Volkan Kepoglu
thanks a lot. it worked, but each time ı am writing export commands.

On 1/22/08, Martin Dobias <[hidden email]> wrote:

can you check that path /usr/local/share/qgis/python that there's
directory 'qgis' in which there are file core.so, gui.so and
__init__.py ?
 
yes, these files exist in specified path.

if you've installed qgis to /usr/local prefix, you actually don't need
to set LD_LIBRARY_PATH since /usr/local/lib (where are the files
libqgis_core.so and libqgis_gui.so) is already in linker's search
path. Just make sure to call ldconfig after installing to update the
cache of system libraries.
 
my install is /usr/local, it is required to set every time to write "export LD_LIBRARY_PATH=/usr/local/lib" in terminal.
is there way to make this definition permanently?

when you do 'export' it will be working only in current shell. So you
have to do first export of PYTHONPATH variable and then in the same
console open python interpreter. Or you can do the same in Python -
before importing qgis modules you can add that path to python's
sys.path array.
 
How can I add "PYTHONPATH=/usr/local/share/qgis/python" to python's sys.path array.

Martin
Volkan Kepoglu
PHD Candidate
 

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Martin Dobias
2008/1/22 volkan kepoglu <[hidden email]>:

> > if you've installed qgis to /usr/local prefix, you actually don't need
> > to set LD_LIBRARY_PATH since /usr/local/lib (where are the files
> > libqgis_core.so and libqgis_gui.so) is already in linker's search
> > path. Just make sure to call ldconfig after installing to update the
> > cache of system libraries.
>
>
> my install is /usr/local, it is required to set every time to write "export
> LD_LIBRARY_PATH=/usr/local/lib" in terminal.
> is there way to make this definition permanently?

To explain this a bit: normally dynamic linker uses its cache to find
needed shared objects (*.so files). There's usually a file called
/etc/ld.so.conf where is a list of directories. This config file is
used by 'ldconfig' tool which recreates the cache of libraries. It's
usual that /usr/local/lib directory is included, so you just need to
re-create the cache after installing new programs to /usr/local prefix
- so that dynamic linker can find it.
In case you would like to use some special directory to search for
libraries (in addition to the cache), use LD_LIBRARY_PATH variable to
specify it.
So in your case you don't have to specify LD_LIBRARY_PATH everytime,
just reload the cache once after installing QGIS and that's it.


> > when you do 'export' it will be working only in current shell. So you
> > have to do first export of PYTHONPATH variable and then in the same
> > console open python interpreter. Or you can do the same in Python -
> > before importing qgis modules you can add that path to python's
> > sys.path array.
>
>
> How can I add "PYTHONPATH=/usr/local/share/qgis/python" to python's sys.path
> array.

for example:

import sys
sys.path.insert(0, '/usr/local/share/qgis/python')


Martin
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Volkan Kepoglu
I am using Ubuntu in Windows with emulator, VMware workstation 5.5.5
I am new baby in linux, sorry for this.
 
/usr/local/lib definition exits in /etc/ld.so.conf.d/libc.conf
 
maybe the problem is related with python, ı do not know, or with emulator.
or maybe it is not a problem. my way is to use qgis bindings in python as follows;
 
[hidden email] python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from qgis.core import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named qgis.core
>>> import sys
>>> print sys.path
['', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/gst- 0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode']
>>> sys.path.insert (0, '/usr/local/share/qgis/python')
>>> from qgis.core import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libqgis_core.so: cannot open shared object file: No such file or directory
>>> quit()
[hidden email] export LD_LIBRARY_PATH=/usr/local/lib
[hidden email] python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from qgis.core import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named qgis.core
>>> import sys
>>> sys.path.insert (0, '/usr/local/share/qgis/python')
>>> print sys.path
['/usr/local/share/qgis/python', '', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/gst- 0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode']
>>> from qgis.core import *
>>>
>>>
 
"/etc/ld.so.conf" inside of file has following;
 
include /etc/ld.so.conf.d/*.conf
/usr/lib/atlas
 
in "/etc/ld.so.conf.d" folder there are three files; i486-linux-gun, libc.conf, libR.conf
 
libc.conf file has the following;
 
# libc default configuration
/usr/local/lib

On 1/23/08, Martin Dobias <[hidden email]> wrote:
2008/1/22 volkan kepoglu <[hidden email]>:

> > if you've installed qgis to /usr/local prefix, you actually don't need
> > to set LD_LIBRARY_PATH since /usr/local/lib (where are the files
> > libqgis_core.so and libqgis_gui.so) is already in linker's search
> > path. Just make sure to call ldconfig after installing to update the
> > cache of system libraries.
>
>
> my install is /usr/local, it is required to set every time to write "export
> LD_LIBRARY_PATH=/usr/local/lib" in terminal.
> is there way to make this definition permanently?

To explain this a bit: normally dynamic linker uses its cache to find
needed shared objects (*.so files). There's usually a file called
/etc/ld.so.conf where is a list of directories. This config file is
used by 'ldconfig' tool which recreates the cache of libraries. It's
usual that /usr/local/lib directory is included, so you just need to
re-create the cache after installing new programs to /usr/local prefix
- so that dynamic linker can find it.
In case you would like to use some special directory to search for
libraries (in addition to the cache), use LD_LIBRARY_PATH variable to
specify it.
So in your case you don't have to specify LD_LIBRARY_PATH everytime,
just reload the cache once after installing QGIS and that's it.


> > when you do 'export' it will be working only in current shell. So you
> > have to do first export of PYTHONPATH variable and then in the same
> > console open python interpreter. Or you can do the same in Python -
> > before importing qgis modules you can add that path to python's
> > sys.path array.
>
>
> How can I add "PYTHONPATH=/usr/local/share/qgis/python" to python's sys.path
> array.

for example:

import sys
sys.path.insert(0, '/usr/local/share/qgis/python')


Martin


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Martin Dobias
2008/1/23 volkan kepoglu <[hidden email]>:
> I am using Ubuntu in Windows with emulator, VMware workstation 5.5.5
> I am new baby in linux, sorry for this.

Ah, so why don't you use Windows release of QGIS?


> /usr/local/lib definition exits in /etc/ld.so.conf.d/libc.conf
>
> maybe the problem is related with python, ı do not know, or with emulator.
> or maybe it is not a problem. my way is to use qgis bindings in python as
> follows;
>
> [...]

Have you run ldconfig or not? (you need to run it as root)

Martin
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Build compile error

Volkan Kepoglu
I love you, Martin. I solved all my problems, hope so :-)
 
1. /usr/local/lib path definition does not exist in ld.so.conf directly. ld.so.conf refers to in /etc/ld.so.conf.d/libc.conf which has that path definition
 
ı used following commands
 
sudo chown vkepoglu /etc/ld.so.conf  -> take permission to edit file. edit and add path, run
sudo ldconfig
 
it worked.
 
2. for PYTHONPATH, edit bashrc and add path
 
nano /home/vkepoglu/.bashrc -> add the following lines
export PYTHONPATH='usr/local/share/qgis/python' -> save and exit, then from a prompt, run
source /home/vkepoglu/.bashrc
log off and the result in terminal is
 
[hidden email] python
Python 2.5.1 (r251:54863, Oct  5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/local/share/qgis/python', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/gst- 0.10', '/var/lib/python-support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/lib/python-support/python2.5/gtk-2.0', '/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode']
>>> from qgis.core import *
>>>
 
Ah, so why don't you use Windows release of QGIS?
 
Martin
 
I want to learn Linux, not crappy Windows anymore. I am not using QGIS at work but sometimes have time to learn something at work. it depends on me. As ı am also doing phd, trying to make thesis related works. The rules of IT department forces me to use windows. Here, at work we are using ESRI's products. I am using ArcGIS Desktop (ArcINFO licensed) from version 8.0 to 9.1, ArcSDE and ArcIMS as GIS user at work.
 
Thanks for everybody who contributed to do the development of qgis.
 
Volkan Kepoglu
 

 


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer