Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2014 18:18:04 GMT
From:      Rainer Hurling <rhurlin@gwdg.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/185559: [maintainer update] math/saga: unbreak build on 10.0 and higher
Message-ID:  <201401071818.s07II4Ne088291@oldred.freebsd.org>
Resent-Message-ID: <201401071820.s07IK0kC098708@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185559
>Category:       ports
>Synopsis:       [maintainer update] math/saga: unbreak build on 10.0 and higher
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 07 18:20:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Rainer Hurling
>Release:        11.0-CURRENT amd64 (clang)
>Organization:
>Environment:
FreeBSD xxx.xxx.xxx 11.0-CURRENT FreeBSD 11.0-CURRENT #1 r260318: Sun Jan  5 16:39:32 CET 2014     xxx@xxx.xxx.xxx:/usr/obj/usr/src/sys/XXX  amd64
>Description:
Errors with math/saga have been reported from cluster builds for several weeks now, for example
http://beefy2.isc.freebsd.org/bulk/10-release-amd64-RELENG10_0/latest/logs/errors/saga-2.1.0_3.log

While SAGA GIS does build on 8.x and 9.x, it fails on 10.0 and above.

The main problems seem to be related to the new linker behaviour and libstdc++/libc++ changes, both in 10.0 and HEAD.

Because of the upcoming 10.0 release, I decided to submit a (somewhat ugly) workaround. With the appended patch, SAGA GIS should be able to build on all OS versions again (proofed with 9.2 and 11.0-CURRENT).

With OS versions 10.0 and HEAD I tried to use combinations of gcc46+ and CXXFLAGS+=-std=gnu++0x, as suggested by the cluster report. This overcomes the errors reported by the cluster, but fails with new errors, related to wxgtk. I was not able to find a solution, so I decided to waive the OpenMP option for 10.0 and above :(

-------
With clang build on 10.0 and higher, one big problem remains: the SAGA GIS module 'libio_gdal.so' (at /usr/local/lib/saga/) is corrupted and because of this, the usage of 'saga_cmd' core dumps. You can easily try this by running 'saga_cmd' in a terminal.

I would be very happy, if someone could have a deeper look into this GDAL related problem. Perhaps something is wrong in graphics/gdal itself?
-------

While here, I did
- support STAGEDIR
- correct usage of <bsd.port.options.mk>,
  thanks to John Marino, http://www.freebsd.org/cgi/query-pr.cgi?pr=185166
- USES=dos2unix
- different builds, depending on OSVERSION (gcc/clang)
- OpenMP only on FreeBSD 8.x and 9.x (before 10.0)


If this PR will be committed, it would be nice to close PR 185166, see above.


It would be nice also, if someone could have a look at PR 181329 with latest contribution from December 2013, thanks. There is a patch for an update of x11-toolkits/wxgtk29 to x11-toolkits/wxgtk30, which is the better choice for SAGA GIS. http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/181329

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -u saga.orig/Makefile saga/Makefile
--- saga.orig/Makefile	2014-01-04 08:35:30.000000000 +0100
+++ saga/Makefile	2014-01-07 16:56:15.000000000 +0100
@@ -3,7 +3,7 @@
 
 PORTNAME=	saga
 PORTVERSION=	2.1.0
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	math
 MASTER_SITES=	SF/saga-gis/SAGA%20-%20${PORTVERSION:C/\.[[:digit:]]*$//}/SAGA%20${PORTVERSION}
 DISTNAME=	${PORTNAME}_${PORTVERSION}_src
@@ -21,34 +21,38 @@
 		liblas.so:${PORTSDIR}/devel/liblas \
 		libopencv_core.so:${PORTSDIR}/graphics/opencv-core
 
+USES=		dos2unix
+DOS2UNIX_GLOB=	dlg_about.cpp
 USE_ZIP=	yes
-USE_WX=		2.9
+USE_WX=		2.9-3.0
 WX_UNICODE=	yes
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 USE_AUTOTOOLS=	autoconf autoheader automake aclocal libtoolize
 AUTOMAKE_ARGS=	--add-missing
 
-# CLANG is not able to handle neither Fortran nor OpenMP
-USE_GCC=	any
-CFLAGS+=	-I${LOCALBASE}/include
-USE_DOS2UNIX=	dlg_about.cpp
-
-MAN1=		saga_cmd.1 saga_gui.1
-
 DESKTOP_ENTRIES=	"SAGA GIS" "${COMMENT}" "${DATADIR}/saga.png" \
 			"saga_gui" "Science;Geoscience;Math;" true
 
 OPTIONS_DEFINE=	PYTHON OPENMP HARU VIGRA
 OPTIONS_DEFAULT=	OPENMP HARU VIGRA
 NO_OPTIONS_SORT=	yes
-OPENMP_DESC=	Enable Multiprocessing
+OPENMP_DESC=	Enable Multiprocessing (FreeBSD before 10.0 ONLY)
 HARU_DESC=	Enable Haru Free PDF Library
 VIGRA_DESC=	Enable 'Vision with Generic Algorithms' Library
 
-NO_STAGE=	yes
 .include <bsd.port.options.mk>
 
+# CLANG is not able to handle neither Fortran nor OpenMP
+.if ${OSVERSION} < 1000054
+USE_GCC=	any
+#USES+=		compiler:openmp
+#CXXFLAGS+=     -std=gnu++0x
+.else
+USES+=		compiler:c++11-lib
+.endif
+CFLAGS+=	-I${LOCALBASE}/include
+
 LDFLAGS+=	-L${LOCALBASE}/lib -lopencv_core
 CONFIGURE_ARGS+=	CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
 
@@ -57,14 +61,14 @@
 BUILD_DEPENDS+=	swig2.0:${PORTSDIR}/devel/swig20
 RUN_DEPENDS+=	swig2.0:${PORTSDIR}/devel/swig20
 CONFIGURE_ENV+=	SWIG="${LOCALBASE}/bin/swig2.0"
-USE_PYTHON=	2.6-2.7
+USE_PYTHON=	2.7
 PLIST_SUB+=	SAGA_PYTHON=""
 .else
 CONFIGURE_ARGS+=	--disable-python
 PLIST_SUB+=	SAGA_PYTHON="@comment "
 .endif
 
-.if ${PORT_OPTIONS:MOPENMP}
+.if ${PORT_OPTIONS:MOPENMP} && (${OSVERSION} < 1000054)
 LDFLAGS+=		${PTHREAD_LIBS}
 CONFIGURE_ARGS+=	--enable-openmp
 .else
@@ -88,8 +92,6 @@
 PLIST_SUB+=	VIGRA="@comment "
 .endif
 
-.include <bsd.port.pre.mk>
-
 post-extract:
 	@${REINPLACE_CMD} -e's|wx-config |${WX_CONFIG} |g' \
 		${WRKSRC}/configure.in \
@@ -119,12 +121,12 @@
 .endif
 
 post-install:
-	@${MKDIR} ${DATADIR}
-	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga_tip.txt ${DATADIR}
-	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga.png ${DATADIR}
+	@${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga_tip.txt ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga.png ${STAGEDIR}${DATADIR}
 # library helper files are not needed and cripple some math/qgis extensions
-	@${RM} ${PREFIX}/lib/saga/*.la
-	@${RM} ${PREFIX}/lib/saga/*.a
+	@${RM} ${STAGEDIR}${PREFIX}/lib/saga/*.la
+	@${RM} ${STAGEDIR}${PREFIX}/lib/saga/*.a
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Common subdirectories: saga.orig/files and saga/files
diff -u saga.orig/pkg-plist saga/pkg-plist
--- saga.orig/pkg-plist	2013-01-17 11:53:41.000000000 +0100
+++ saga/pkg-plist	2014-01-05 18:15:15.000000000 +0100
@@ -82,6 +82,8 @@
 lib/saga/libtin_tools.so
 lib/saga/libtin_viewer.so
 lib/saga/libtransect.so
+man/man1/saga_cmd.1.gz
+man/man1/saga_gui.1.gz
 %%VIGRA%%lib/saga/libvigra.so
 %%DATADIR%%/saga.png
 %%DATADIR%%/saga_tip.txt


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401071818.s07II4Ne088291>