[GRASS-dev] [GRASS GIS] #2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
------------------------+-------------------------
Reporter: pieside | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Keywords: FreeBSD | CPU: x86-64
Platform: Other Unix |
------------------------+-------------------------
Dear all,

I'm trying to compile Grass-7.0.3 under FreeBSD (with Zsh) and the
compilation stops in

include/Make/GuiScript.make:37: recipe for target 'g.gui.tplot.tmp.html'
failed
include/Make/GuiScript.make:23: recipe for target 'guiscript' failed

Here you can find the log created by running
{{{
cd grass-7.0.3/gui/wxpython/tplot &&
make
}}}

{{{
gmake /home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/docs/html/g.gui.tplot.html
gmake[1]: Entering directory
'/home/pierre/tmp/grass7/grass-7.0.3/gui/wxpython/tplot'
GISRC=/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/demolocation/.grassrc70
GISBASE=/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2 PATH="/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/bin:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/bin:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/scripts:$PATH"
PYTHONPATH="/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/etc/python:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64
-unknown-freebsd10.2/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/bin:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/bin:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/scripts:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64
-unknown-freebsd10.2/lib:/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64
-unknown-freebsd10.2/lib:" LC_ALL=C
/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/scripts/g.gui.tplot --html-description < /dev/null | grep -v
'</body>\|</html>' > g.gui.tplot.tmp.html
Traceback (most recent call last):
   File "/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/scripts/g.gui.tplot", line 131, in <module>
     main()
   File "/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/scripts/g.gui.tplot", line 78, in main
     options, flags = gscript.parser()
   File "/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/etc/python/grass/script/core.py", line 712, in parser
     p = subprocess.Popen([prog, '-n'] + argv, stdout=subprocess.PIPE)
   File "/usr/local/lib/python2.7/subprocess.py", line 710, in __init__
     errread, errwrite)
   File "/usr/local/lib/python2.7/subprocess.py", line 1335, in
_execute_child
     raise child_exception
OSError: [Errno 2] No such file or directory
../../../include/Make/GuiScript.make:37: recipe for target
'g.gui.tplot.tmp.html' failed
gmake[1]: *** [g.gui.tplot.tmp.html] Error 1
rm g.gui.tplot.tmp.html
gmake[1]: Leaving directory
'/home/pierre/tmp/grass7/grass-7.0.3/gui/wxpython/tplot'
../../../include/Make/GuiScript.make:23: recipe for target 'guiscript'
failed
gmake: *** [guiscript] Error 2
}}}

What do you think about all that?

Thank you,

Pierre.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------
Changes (by pieside):

* Attachment "error.log" added.

Error log

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by neteler):

From the log I see that the first error came up in

{{{
/home/pierre/tmp/grass7/grass-7.0.3/lib/vector/diglib
}}}

Please run

{{{
cd /home/pierre/tmp/grass7/grass-7.0.3/lib/vector/diglib
make
}}}

to see what's missing. Likewise for the others. Note that later errors may
result from previous ones since some libraries such as above are a
dependency for subsequent code.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by pieside):

The problems seems to be an old friend:

{{{
/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to `libiconv'
/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to
`libiconv_open'
/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to
`libiconv_close'
}}}

As written in the Porter's Handbook ([https://www.freebsd.org/doc/en/books
/porters-handbook/index.html]), there are two versions of libiconv in
FreeBSD: "FreeBSD 10-CURRENT and newer versions have a native iconv in
the operating system (in libc). On earlier versions, converters/libiconv
was used as a dependency". So we have a System iconv and Libiconv iconv
(/usr/local/include/iconv.h).

One way to overcome this is to deinstall and remove
/usr/local/include/iconv.h. But some really important softwares depend on
it: "Despite the default implementation of iconv enabled by default in
libc, a few ports (like [http://www.freshports.org/devel/glib20/)] depend
on converters/libiconv again due to missing functionality in the base
iconv implementation" (written in the /usr/ports/UPDATING file).

Another solution is suggested in this post (http://osdir.com/ml/grass-
development-gis/2014-12/msg00435.html). I did add "ICONVLIB = -liconv" in
include/Make/Platform.make but it doesn't compile for me.

What all this evoke to you?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by glynn):

Replying to [comment:2 pieside]:
> The problems seems to be an old friend:
>
{{{
/home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to `libiconv'
}}}

This usually means that it's including <iconv.h> from libiconv but linking
against the system iconv (which may be part of libc).

One way to solve issues with multiple library versions is to create
"include" and "lib" directories, populate them with symlinks to the
desired versions of the headers and libraries, and use --with-includes=
and --with-libs= to put those directories at the front of the search path.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by mmetz):

Replying to [comment:3 glynn]:
> Replying to [comment:2 pieside]:
> > The problems seems to be an old friend:
> >
> {{{
> /home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to `libiconv'
> }}}
>
> This usually means that it's including <iconv.h> from libiconv but
linking against the system iconv (which may be part of libc).
>
> One way to solve issues with multiple library versions is to create
"include" and "lib" directories, populate them with symlinks to the
desired versions of the headers and libraries, and use --with-includes=
and --with-libs= to put those directories at the front of the search path.

You can also configure GRASS, then manually edit
include/Make/Platform.make and set

{{{
ICONVLIB =
}}}

to

{{{
ICONVLIB = -liconv
}}}

Most of GRASS then compiles for me on FreeBSD 10.3 with both clang and
gcc, with the exception of wxnviz and the temporal modules (problem with
numpy + ctypes), but that is a different problem.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by pieside):

I can continue compiling by editing /include/Make/Platform.make:

{{{
ICONVLIB = -liconv
}}}

But, as you said, others errors arise and I'm wondering if using the
FreeBSD ports tree would not help us to compile Grass7 on this OS. In
order to avoid duplicated work, I inform the GRASS community that I'm
trying to do it. For now, I'm not pretty sure how, so I'm completely
opened to suggestions.

I've also opened a ticket on the FreeBSD forum:
https://forums.freebsd.org/threads/56558/.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.6
Component: Default | Version: 7.0.3
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by lbartoletti):

Hi,

I've tried to build grass 7.2 on our poudriere system (FreeBSD 11 amd 64
without success). Here the
[https://gist.githubusercontent.com/lbartoletti/dee8bb053df33682f82af9bae834fdb8/raw/bb9e8b80deadfacf4d7b8b96c8808141d329a3d1/gistfile1.txt
log] and the [https://forums.freebsd.org/threads/56558/#post-334096
discussion on FreeBSD Forum.]

I can't be present at FOSS4G-E code sprint, but if something can help us
:slight_smile:

Thanks!

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------
Changes (by lbartoletti):

* cc: lbartoletti (added)
* version: 7.0.3 => 7.2.0
* milestone: 7.0.6 => 7.2.2

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by neteler):

Replying to [comment:8 lbartoletti]:
> Hi,
>
> I've tried to build grass 7.2 on our poudriere system (FreeBSD 11 amd 64
without success). Here the
[https://gist.githubusercontent.com/lbartoletti/dee8bb053df33682f82af9bae834fdb8/raw/bb9e8b80deadfacf4d7b8b96c8808141d329a3d1/gistfile1.txt
log] and the [https://forums.freebsd.org/threads/56558/#post-334096
discussion on FreeBSD Forum.]
>
> I can't be present at FOSS4G-E code sprint, but if something can help us
:slight_smile:

Yes :slight_smile:

So, the log contains:

{{{
env: python: No such file or directory
}}}

The reason is that there is not link from python2.7 --> python on your
system (or it is not in $PATH), so that the first line in GRASS' Python
scripts fails:

{{{
#!/usr/bin/env python
}}}

A lot of the errors there might be secondary ones due to this link
missing.
Can you add this link, try again and report here?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:10&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by lbartoletti):

Normally, Python is already present.
It does not matter, I'll start from scratch. Here's what I get by
compiling directly
[https://raw.githubusercontent.com/lbartoletti/grass7/master/build_log
log].

That's how I configured it:

{{{
./configure --with-includes=/usr/local/include --with-libs=/usr/local/lib
--with-freetype-includes=/usr/local/include/freetype2 --with-cairo --with-
nls --with-cxx --with-readline --with-proj-share=/usr/local/share/proj
}}}
and the
[https://raw.githubusercontent.com/lbartoletti/grass7/master/config_log
log for it]

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by neteler):

Replying to [comment:11 lbartoletti]:
> Normally, Python is already present.
> It does not matter, I'll start from scratch. Here's what I get by
compiling directly
[https://raw.githubusercontent.com/lbartoletti/grass7/master/build_log
log].

Here is a line from your log, appearing for most t.* modules:

{{{
gmake[5]: Entering directory
'/usr/home/Loic/grass7/work/grass-7.2.0/temporal/t.create'
/usr/bin/install -c t.create.py
/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/scripts/t.create
if [ "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/scripts/t.create" != "" ] ; then
GISRC=/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/demolocation/.grassrc72
GISBASE=/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0 PATH="/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/bin:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/bin:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/scripts:$PATH"
PYTHONPATH="/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/gui/wxpython:$PYTHONPATH"
LD_LIBRARY_PATH="/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/bin:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/bin:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-
freebsd11.0/scripts:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/lib:/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64
-portbld-freebsd11.0/lib:" LC_ALL=C
/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/scripts/t.create --html-description < /dev/null | grep -v
'</body>\|</html>' > t.create.tmp.html ; fi
Traceback (most recent call last):
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/scripts/t.create", line 62, in <module>
     import grass.temporal as tgis
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/temporal/__init__.py", line 3, in <module>
     from .core import *
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/temporal/core.py", line 45, in <module>
     from .c_libraries_interface import *
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/temporal/c_libraries_interface.py", line 28,
in <module>
     from grass.pygrass.rpc.base import RPCServerBase
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/pygrass/rpc/__init__.py", line 21, in
<module>
     from grass.pygrass.vector import *
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/pygrass/vector/__init__.py", line 13, in
<module>
     from grass.pygrass.vector.vector_type import VTYPE
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/pygrass/vector/vector_type.py", line 9, in
<module>
     from grass.pygrass.vector import geometry as geo
   File "/usr/home/Loic/grass7/work/grass-7.2.0/dist.amd64-portbld-
freebsd11.0/etc/python/grass/pygrass/vector/geometry.py", line 12, in
<module>
     import numpy as np
   File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line
142, in <module>
     from . import add_newdocs
   File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line
13, in <module>
     from numpy.lib import add_newdoc
   File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py",
line 8, in <module>
     from .type_check import *
   File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py",
line 11, in <module>
     import numpy.core.numeric as _nx
   File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py",
line 14, in <module>
     from . import multiarray
ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by
/usr/local/lib/gcc5/libgfortran.so.3 not found
gmake[5]: *** [../..//include/Make/Html.make:14: t.create.tmp.html] Error
1
}}}

... to be fixed on your server.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by mmetz):

Replying to [comment:11 lbartoletti]:
> Normally, Python is already present.

... but not the link python -> python2

You need to `pkg install python`

this creates that link (at least on FreeBSD 12).

> It does not matter, I'll start from scratch.

No need to start from scratch, just run gmake again.

I get GRASS trunk (7.3) compiled on FreeBSD 12 without errors. GRASS is
running, but there is no GUI because there is a problem with numpy:

{{{
ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by
/usr/local/lib/gcc5/libgfortran.so.3 not found
}}}

That seems to be an error in the numpy/gcc ports because a gcc5 lib
requires a gcc4 lib which seems odd.

> Here's what I get by compiling directly
[https://raw.githubusercontent.com/lbartoletti/grass7/master/build_log
log].
>
> That's how I configured it:
>
> {{{
> ./configure --with-includes=/usr/local/include --with-
libs=/usr/local/lib --with-freetype-includes=/usr/local/include/freetype2
--with-cairo --with-nls --with-cxx --with-readline --with-proj-
share=/usr/local/share/proj
> }}}
> and the
[https://raw.githubusercontent.com/lbartoletti/grass7/master/config_log
log for it]
>

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:13&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by mmetz):

Replying to [comment:3 glynn]:
> Replying to [comment:2 pieside]:
> > The problems seems to be an old friend:
> >
> {{{
> /home/pierre/tmp/grass7/grass-7.0.3/dist.x86_64-unknown-
freebsd10.2/lib/libgrass_gis.7.0.3.so: undefined reference to `libiconv'
> }}}
>
> This usually means that it's including <iconv.h> from libiconv but
linking against the system iconv (which may be part of libc).

Both the configure tests and the compilation use the same CPPFLAGS
"-I/usr/local/include", i.e. the libiconv version of iconv.h should be
found first for both configure and compilation. The problem is that
configure tests for iconv() include /usr/include/iconv.h from libc despite
CPPFLAGS while the actual compilation includes /usr/local/include/iconv.h
from libiconv which requires linking against libiconv.

>
> One way to solve issues with multiple library versions is to create
"include" and "lib" directories, populate them with symlinks to the
desired versions of the headers and libraries, and use --with-includes=
and --with-libs= to put those directories at the front of the search path.

Or ensure that configure tests and compilation use the same order of
include dirs.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:14&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by lbartoletti):

Hello,

Good news, it's works! :slight_smile:
[[Image(https://raw.githubusercontent.com/lbartoletti/grass7/master/grass_freebsd.png)]]

There was an error in the configuration for the package and also some
grass' files need to be patched.

After the review, the FreeBSD package will be available soon!

You can close this ticket.

Thanks.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:15&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by mmetz):

Replying to [comment:15 lbartoletti]:
> Hello,
>
> Good news, it's works! :slight_smile:
>
> There was an error in the configuration for the package and also some
grass' files need to be patched.

Could you point to or attach the patches? Maybe we can include them in
GRASS.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by lbartoletti):

Replying to [comment:16 mmetz]:
> Replying to [comment:15 lbartoletti]:
> > Hello,
> >
> > Good news, it's works! :slight_smile:
> >
> > There was an error in the configuration for the package and also some
grass' files need to be patched.
>
> Could you point to or attach the patches? Maybe we can include them in
GRASS.

The most changes to the sources is to replace hardcoded python to the
specific version used.
You can see all changes on
[https://svnweb.freebsd.org/ports/head/databases/grass7/Makefile?view=markup
Makefile] and
[https://svnweb.freebsd.org/ports/head/databases/grass7/files/ patches]

The package is now [https://www.freshports.org/databases/grass7 available
on FreeBSD].

To install the port: cd /usr/ports/databases/grass7/ && make install clean

To add the package: pkg install grass7

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:17&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by neteler):

Replying to [comment:17 lbartoletti]:
> The most changes to the sources is to replace hardcoded python to the
specific version used.

@devs: do we want this upstream?

https://svnweb.freebsd.org/ports/head/databases/grass7/Makefile?view=markup

> You can see all changes on
[https://svnweb.freebsd.org/ports/head/databases/grass7/Makefile?view=markup
Makefile] and
[https://svnweb.freebsd.org/ports/head/databases/grass7/files/ patches]

I see specifically these patches:

# test writable check change

https://svnweb.freebsd.org/ports/head/databases/grass7/files/patch-
include_Make_Install.make?view=markup

# ctypes GCC flag change:

https://svnweb.freebsd.org/ports/head/databases/grass7/files/patch-
lib_python_ctypes_ctypesgencore_parser_preprocessor.py?view=markup

but I am not sure if to be updated in G7 or not - any dev having a
suggestion?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:18&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.2
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by mmetz):

Replying to [comment:18 neteler]:
> Replying to [comment:17 lbartoletti]:
> > The most changes to the sources is to replace hardcoded python to the
specific version used.

This can be avoided with `pkg install python` which does not install
python, but creates a link to a specific python version: python -> python2
>
> @devs: do we want this upstream?
>
>
https://svnweb.freebsd.org/ports/head/databases/grass7/Makefile?view=markup
>
> > You can see all changes on
[https://svnweb.freebsd.org/ports/head/databases/grass7/Makefile?view=markup
Makefile] and
[https://svnweb.freebsd.org/ports/head/databases/grass7/files/ patches]
>
> I see specifically these patches:
>
> # test writable check change
>
> https://svnweb.freebsd.org/ports/head/databases/grass7/files/patch-
include_Make_Install.make?view=markup

This patch removes the writable check. IMHO it is a good idea to have this
check.
>
> # ctypes GCC flag change:
>
> https://svnweb.freebsd.org/ports/head/databases/grass7/files/patch-
lib_python_ctypes_ctypesgencore_parser_preprocessor.py?view=markup

Added to trunk and relbr72 in r71356,7 (applied only for FreeBSD).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:19&gt;
GRASS GIS <https://grass.osgeo.org>

#2940: Compiling Grass-7.0.3 under FreeBSD: tplot directory (with log)
----------------------+-------------------------
  Reporter: pieside | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.2.3
Component: Default | Version: 7.2.0
Resolution: | Keywords: FreeBSD
       CPU: x86-64 | Platform: Other Unix
----------------------+-------------------------

Comment (by neteler):

Anything left here?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2940#comment:21&gt;
GRASS GIS <https://grass.osgeo.org>