Bug 227901 - math/saga: Update to 6.3.0
Summary: math/saga: Update to 6.3.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Wen Heping
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-01 16:32 UTC by Rainer Hurling
Modified: 2018-06-17 23:09 UTC (History)
2 users (show)

See Also:
rhurlin: maintainer-feedback+


Attachments
patch to update math/saga from 6.1.0 to 6.3.0 (16.07 KB, patch)
2018-05-01 16:32 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff
Update math/saga to 6.3.0, with some corrections (16.57 KB, patch)
2018-05-02 16:48 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff
patch to update math/saga to 6.3.0, with corrected wxgtk30 failures (17.66 KB, patch)
2018-05-04 14:59 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff
patch to update math/saga to 6.3.0; adapted to opencv 3.4.1 (18.10 KB, patch)
2018-05-10 14:59 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff
patch to update math/saga to 6.3.0; adapted to opencv 3.4.1, corrected typo (18.06 KB, patch)
2018-06-16 13:33 UTC, Rainer Hurling
rhurlin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling freebsd_committer freebsd_triage 2018-05-01 16:32:34 UTC
Created attachment 192970 [details]
patch to update math/saga from 6.1.0 to 6.3.0

After changing the naming scheme of devel/liblas12, math/saga in version 6.1.0 did not build and install on FreeBSD any more. The changing in liblas12 was necessary to avoid naming conflicts, because SAGA GIS needs this old version of libLAS12, and other ports like databases/grass7 needs the newer devel/liblas (bug #225281).


This patch updates math/saga from 6.1.0 to 6.3.0. It brings many bugfixes and some new features. A small selection is:

- db_pqsql, saga_api, saga_gui: postgis export for grid collections
- db_pgsql, loading attributes from raster tables
- saga_gui, data set naming: general option added (data manager properties): use file name to name a data set, when loaded from file
- 3D Map View: fix crash because of invalid character (degree sign) in status bar report
- table field calculator: adding no-data function support and some related features
- imagery_tools, landsat scene import: adjusting mss band naming for newer mtl
- grid_tools, clip grids: clear output list (an issue with copying grid collection settings)
- ta_channels/ChannelNetwork_Distance: bug fix, parameter enabling and flow velocity
- tool chains, filter tools for grid collections added
- saga_api, tool library manager, get library/tool: do not return a library for tool chains, search for tool chain separately
- imagery_tools/landsat_toar: bug fix, etm band 7 input/output
- imagery_tools/landsat_toar: output as grid collection, meta data, band naming
- saga_gui, grid collections: display values at map's mouse position in status bar

For the upcoming version 3.0.3 of x11-toolkits/wxgtk30, SAGA GIS integrated some patches for FreeBSD.



The changes of the port math/saga are:

- Update version from 6.1.0 to 6.3.0
- Use devel/liblas12 with changed naming scheme
- If using openMP, change the compiler from gcc to clang
- Change USES=python:2.7 to USES=python:2
- Recreate some patches with makepatch
- Drop patch-git_6e14443b30ce, it is in sources now
- Add a patch for wxGTK30, which is not in sources yet
- Add new patches for using devel/liblas12
- Small changes in pkg-plist



Tested with Poudriere (F10.4i/a, F11.1i/a, and HEADi/a).
'portlint -AC' is also fine.


Some test runs are also done in HEAD amd64 and 10.4 i386.
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2018-05-02 05:46:52 UTC
USES= python:2 doesn't exist.
Comment 2 Rainer Hurling freebsd_committer freebsd_triage 2018-05-02 16:48:18 UTC
Created attachment 193003 [details]
Update math/saga to 6.3.0, with some corrections


Thanks Antoine, For the hint. I didn't know, how this crept in.

I filed a new patch, because there were some other problems, too:

- Need clang50 even, when option OPENMP disabled
- Integrate .if statements into OPENMP option
- Use post-patch-OPENMP-on target instead of .if statement
Comment 3 Rainer Hurling freebsd_committer freebsd_triage 2018-05-04 14:59:03 UTC
Created attachment 193043 [details]
patch to update math/saga to 6.3.0, with corrected wxgtk30 failures

After the update of x11-toolkits/wxgtk30 to version 3.0.3.1 in the ports tree, it turns out, that the previous patch #193003 for SAGA GIS 6.0.3 was not sufficient.

I discussed the errors upstream with the SAGA devs, and Volker Wichmann added a patch to SAGA GIS trunk[1], which seems to solve the recent wxgtk30 failures.

In the newest patch for the FreeBSD port, I substituted the previous patch in files/patch-src_tools_io_io__grid__image_grid__to__kml.cpp with the one of Volker Wichmann.

The port now buids and installs on 10.4, 11.2, and HEAD, on i386 and amd4. Running SAGA GIS on 10.4i and HEADa also seem to work fine.


[1] https://sourceforge.net/p/saga-gis/code/ci/a1fa6c10ba06b1f1198c92b1efd184a53367bfee/
Comment 4 Rainer Hurling freebsd_committer freebsd_triage 2018-05-10 14:59:46 UTC
Created attachment 193234 [details]
patch to update math/saga to 6.3.0; adapted to opencv 3.4.1

After the ports system update graphics/opencv from 2.4.13.1 to 3.4.1, math/saga fails to build again. The attached patch should fix this.


The summary of changes of the port math/saga are:

- Update version from 6.1.0 to 6.3.0
- Use devel/liblas12 with changed naming scheme
- Change the compiler from gcc to clang (not only for OpenMP)
- Recreate some patches with makepatch
- Drop patch-git_6e14443b30ce, it is in sources now
- Add a patch for wxGTK30, which is not in sources yet
- Add new patches for using devel/liblas12
- Small changes in pkg-plist
- Integrate .if statements into OPENMP option
- Use post-patch-OPENMP-on target instead of .if statement
- Better patch-src_tools_io_io__grid__image_grid__to__kml.cpp
- Small fixes for new graphics/opencv 3.4.1


The port now buids and installs on 10.4, 11.1, and HEAD, on i386 and amd4. Running SAGA GIS on 10.4i and HEADa also seem to work fine.

'portlint -AC' with no problems.
Comment 5 Wen Heping freebsd_committer freebsd_triage 2018-06-05 05:05:56 UTC
The build failed on FreeBSD-10.4 i386 system, the last lines of the build log is :

./shapes.h:708:25: note: hidden overloaded virtual function 'CSG_Shapes::Get_Selection' declared here: type mismatch at 1st parameter ('int' vs 'size_t' (aka 'unsigned int'))
        virtual CSG_Shape *                             Get_Selection                   (int Index = 0)                 {       return( (CSG_Shape *)CSG_Table::Get_Selection(Index) ); };
                                                        ^
In file included from saga_api_wrap.cxx:3349:
./tool.h:380:18: warning: 'CSG_Tool_Grid::Set_Progress' hides overloaded virtual function [-Woverloaded-virtual]
        virtual bool                            Set_Progress                    (int  iRow);
                                                ^
./tool.h:285:18: note: hidden overloaded virtual function 'CSG_Tool::Set_Progress' declared here: type mismatch at 1st parameter ('double' vs 'int')
        virtual bool                            Set_Progress                            (double Percent);
                                                ^
--- tool_library.lo ---
36 warnings generated.
libtool: compile:  clang++50 -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include -isystem /usr/local/include -fPIC -Wall -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -pthread -D_THREAD_SAFE -D_SAGA_LINUX -D_SAGA_UNICODE -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_API_EXPORTS -D_SAGA_PYTHON -fopenmp -lomp -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -MT tool_library.lo -MD -MP -MF .deps/tool_library.Tpo -c tool_library.cpp -o tool_library.o >/dev/null 2>&1
--- libsaga_api.la ---
/bin/sh ../../../libtool  --tag=CXX    --mode=link clang++50  -fPIC -Wall `/usr/local/bin/wxgtk2u-3.0-config --unicode=yes --cxxflags base` -D_SAGA_LINUX -D_SAGA_UNICODE -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_API_EXPORTS   -D_SAGA_PYTHON -fopenmp -lomp -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -fPIC -shared -Wall `/usr/local/bin/wxgtk2u-3.0-config --unicode=yes --libs base,net,xml,html` -lhpdf -D_SAGA_PYTHON -release 6.3.0  -L/usr/local/lib -lm -pthread -L/usr/local/lib -fstack-protector -o libsaga_api.la -rpath /usr/local/lib api_callback.lo api_colors.lo api_core.lo  api_file.lo api_memory.lo api_string.lo api_translator.lo  clipper.lo data_manager.lo dataobject.lo datetime.lo  geo_classes.lo geo_functions.lo grid.lo grids.lo grid_io.lo  grid_memory.lo grid_operation.lo grid_pyramid.lo  grid_system.lo mat_formula.lo mat_grid_radius.lo  mat_indexing.lo mat_matrix.lo mat_regression.lo  mat_regression_multiple.lo mat_regression_weighted.lo  mat_mRMR.lo mat_spline.lo mat_tools.lo mat_trend.lo  metadata.lo parameter.lo parameter_data.lo parameters.lo  pointcloud.lo projections.lo quadtree.lo saga_api.lo shape.lo  shape_line.lo shape_part.lo shape_point.lo shape_points.lo  shape_polygon.lo shapes.lo shapes_io.lo shapes_ogis.lo  shapes_polygons.lo shapes_search.lo shapes_selection.lo  table.lo table_dbase.lo table_io.lo table_record.lo  table_selection.lo tin.lo tin_elements.lo tin_triangulation.lo  tool.lo tool_chain.lo tool_grid.lo tool_grid_interactive.lo  tool_interactive.lo tool_interactive_base.lo tool_library.lo  tool_library_interface.lo  -L/usr/local/lib
libtool: link: clang++50  -fPIC -DPIC -shared -nostdlib /usr/lib/crti.o /usr/lib/crtbeginS.o  .libs/api_callback.o .libs/api_colors.o .libs/api_core.o .libs/api_file.o .libs/api_memory.o .libs/api_string.o .libs/api_translator.o .libs/clipper.o .libs/data_manager.o .libs/dataobject.o .libs/datetime.o .libs/geo_classes.o .libs/geo_functions.o .libs/grid.o .libs/grids.o .libs/grid_io.o .libs/grid_memory.o .libs/grid_operation.o .libs/grid_pyramid.o .libs/grid_system.o .libs/mat_formula.o .libs/mat_grid_radius.o .libs/mat_indexing.o .libs/mat_matrix.o .libs/mat_regression.o .libs/mat_regression_multiple.o .libs/mat_regression_weighted.o .libs/mat_mRMR.o .libs/mat_spline.o .libs/mat_tools.o .libs/mat_trend.o .libs/metadata.o .libs/parameter.o .libs/parameter_data.o .libs/parameters.o .libs/pointcloud.o .libs/projections.o .libs/quadtree.o .libs/saga_api.o .libs/shape.o .libs/shape_line.o .libs/shape_part.o .libs/shape_point.o .libs/shape_points.o .libs/shape_polygon.o .libs/shapes.o .libs/shapes_io.o .libs/shapes_ogis.o .libs/shapes_polygons.o .libs/shapes_search.o .libs/shapes_selection.o .libs/table.o .libs/table_dbase.o .libs/table_io.o .libs/table_record.o .libs/table_selection.o .libs/tin.o .libs/tin_elements.o .libs/tin_triangulation.o .libs/tool.o .libs/tool_chain.o .libs/tool_grid.o .libs/tool_grid_interactive.o .libs/tool_interactive.o .libs/tool_interactive_base.o .libs/tool_library.o .libs/tool_library_interface.o   -lomp -L/usr/local/lib -lwx_baseu-3.0 -lwx_baseu_net-3.0 -lwx_baseu_xml-3.0 -lwx_gtk2u_html-3.0 -lhpdf -L/usr/lib -lc++ -lm -lc -lgcc -lgcc_s /usr/lib/crtendS.o /usr/lib/crtn.o  -pthread -fopenmp -O2 -fstack-protector -pthread -pthread -fstack-protector   -pthread -fopenmp -Wl,-soname -Wl,libsaga_api-6.3.0.so -o .libs/libsaga_api-6.3.0.so
clang-5.0: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]
/usr/bin/ld: cannot find -lomp
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libsaga_api.la] Error code 1

make[5]: stopped in /wrkdirs/usr/ports/math/saga/work/saga-6.3.0/src/saga_core/saga_api
--- _saga_api_la-saga_api_wrap.lo ---
36 warnings generated.
libtool: compile:  clang++50 -DHAVE_CONFIG_H -I. -I../../.. -I/usr/local/include/python2.7 -D_SWIG_WCHAR -D_SAGA_UNICODE -I/usr/local/include -isystem /usr/local/include -fPIC -Wall -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -pthread -D_THREAD_SAFE -D_SAGA_LINUX -D_SAGA_UNICODE -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -D_SAGA_API_EXPORTS -D_SAGA_PYTHON -fopenmp -lomp -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -MT _saga_api_la-saga_api_wrap.lo -MD -MP -MF .deps/_saga_api_la-saga_api_wrap.Tpo -c saga_api_wrap.cxx -o _saga_api_la-saga_api_wrap.o >/dev/null 2>&1
mv -f .deps/_saga_api_la-saga_api_wrap.Tpo .deps/_saga_api_la-saga_api_wrap.Plo
1 error

make[5]: stopped in /wrkdirs/usr/ports/math/saga/work/saga-6.3.0/src/saga_core/saga_api
*** [all-recursive] Error code 1

make[4]: stopped in /wrkdirs/usr/ports/math/saga/work/saga-6.3.0/src/saga_core
1 error

make[4]: stopped in /wrkdirs/usr/ports/math/saga/work/saga-6.3.0/src/saga_core
*** [all-recursive] Error code 1

make[3]: stopped in /wrkdirs/usr/ports/math/saga/work/saga-6.3.0/src

Would you have a check of it ?
Thanks !

wen
Comment 6 Rainer Hurling freebsd_committer freebsd_triage 2018-06-16 13:33:44 UTC
Created attachment 194306 [details]
patch to update math/saga to 6.3.0; adapted to opencv 3.4.1, corrected typo

(In reply to Wen Heping from comment #5)

Sorry Wen, for the very late answer.

It turns out, that the reason for the breakage was only a small typo. The linker failed with

/usr/bin/ld: cannot find -lomp
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libsaga_api.la] Error code 1


After changing -OPENMP_LIB_DEPEND=libomp.so:devel/openmp into OPENMP_LIB_DEPENDS=libomp.so:devel/openmp [missing 'S'], all seems to work fine again. I have really no idea, how this crept in.
Comment 7 commit-hook freebsd_committer freebsd_triage 2018-06-17 22:57:17 UTC
A commit references this bug:

Author: wen
Date: Sun Jun 17 22:56:22 UTC 2018
New revision: 472649
URL: https://svnweb.freebsd.org/changeset/ports/472649

Log:
  - Update version from 6.1.0 to 6.3.0
  - Use devel/liblas12 with changed naming scheme
  - If using openMP, change the compiler from gcc to clang
  - Recreate some patches with makepatch

  PR:		227901
  Submitted by:	rhurlin@gwdg.de(maintainer)

Changes:
  head/math/saga/Makefile
  head/math/saga/distinfo
  head/math/saga/files/patch-configure
  head/math/saga/files/patch-configure.ac
  head/math/saga/files/patch-git_6e14443b30ce
  head/math/saga/files/patch-src_saga__core_saga__cmd_saga__cmd.cpp
  head/math/saga/files/patch-src_saga__core_saga__gui_dlg__about.cpp
  head/math/saga/files/patch-src_tools_imagery_imagery__opencv_opencv.h
  head/math/saga/files/patch-src_tools_imagery_imagery__svm_MLB__Interface.cpp
  head/math/saga/files/patch-src_tools_imagery_imagery__svm_svm__grids.h
  head/math/saga/files/patch-src_tools_io_io__grid__image_grid__to__kml.cpp
  head/math/saga/files/patch-src_tools_io_io__shapes__las_Makefile.am
  head/math/saga/files/patch-src_tools_io_io__shapes__las_las__export.cpp
  head/math/saga/files/patch-src_tools_io_io__shapes__las_las__import.cpp
  head/math/saga/files/patch-src_tools_io_io__shapes__las_las__info.h
  head/math/saga/pkg-plist