Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Dec 2013 00:23:57 +0100
From:      Tijl Coosemans <tijl@FreeBSD.org>
To:        Jan Henrik Sylvester <me@janh.de>
Cc:        Maho Nakata <maho@FreeBSD.org>, FreeBSD Current <freebsd-current@FreeBSD.org>
Subject:   Re: libc++ vs. libstdc++ usage in the ports tree
Message-ID:  <20131204002357.203ea09d@kalimero.tijl.coosemans.org>
In-Reply-To: <529E4F1E.4050001@janh.de>
References:  <77CB2B92-216A-4C80-B033-7E582B5F0DFC@FreeBSD.org> <20131112165422.GA2939@troutmask.apl.washington.edu> <E0FE40D9-726C-4501-B31A-3622510C1C68@FreeBSD.org> <20131112175556.GA3319@troutmask.apl.washington.edu> <20131112201922.GA4330@troutmask.apl.washington.edu> <20131113173143.Horde.a-9M7JQ_vHo3tpDIMsGK6g1@webmail.df.eu> <CAFMmRNxk25AJ3TMuceSG=EmL3qSE9Xhk_wpL5pAD8YvZrA6gkg@mail.gmail.com> <5283CA3C.3080201@FreeBSD.org> <352D9465-9840-43F0-A3A9-327DC12B0967@FreeBSD.org> <B2F7EDA4-DF34-4D5D-B995-5ADA1A9898D8@FreeBSD.org> <20131114144555.GA22093@troutmask.apl.washington.edu> <52963A90.4000201@janh.de> <20131127204556.2974a3f5@kalimero.tijl.coosemans.org> <20131201150640.12ea18c8@kalimero.tijl.coosemans.org> <529E3E6A.2090107@janh.de> <20131203215445.68b9bc4e@kalimero.tijl.coosemans.org> <529E4F1E.4050001@janh.de>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/kCilWNwDVtwlEXWkOXXHhZq
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, 03 Dec 2013 22:37:34 +0100 Jan Henrik Sylvester wrote:
> On 12/03/2013 21:54, Tijl Coosemans wrote:
>> On Tue, 03 Dec 2013 21:26:18 +0100 Jan Henrik Sylvester wrote:
>>> On 12/01/2013 15:06, Tijl Coosemans wrote:
>>>> The tests were successful:
>>>> https://redports.org/buildarchive/20131201105316-94935/ (octave)
>>>> https://redports.org/buildarchive/20131201115701-22333/ (octave-forge-base)
>>>> The octave logs also contain the results of running the regression-test
>>>> target.  The output is the same on all FreeBSD versions.
>>>>
>>>> The problem is that USE_FORTRAN=yes implies USE_GCC=yes.  This means
>>>> the C++ code in math/octave is compiled with gcc46/libstdc++ which
>>>> does not work if dependencies have been built with clang/libc++.
>>>>
>>>> The patch copies the USE_FORTRAN=yes logic from Mk/bsd.gcc.mk into a
>>>> new file Mk/Uses/fortran.mk.  It allows ports to use a Fortran compiler
>>>> together with the base system C/C++ compiler.
>>>
>>> With the patch, math/octave fails for me on 9.2-RELEASE/amd64 and
>>> 10.0-BETA4/amd64 with:
>>>
>>> checking for amd64-portbld-freebsd(9.2|10.0)-gfortran... f77
>>> checking whether we are using the GNU Fortran 77 compiler... no
>>> checking whether f77 accepts -g... no
>>> checking how to get verbose linking output from f77... configure:
>>> WARNING: compilation failed
>>>
>>> checking for Fortran 77 libraries of f77...
>>> checking for dummy main to link with Fortran 77 libraries... none
>>> checking for Fortran 77 name-mangling scheme... configure: error: in
>>> `/usr/ports/math/octave/work/octave-3.6.4':
>>> configure: error: cannot compile a simple Fortran program
>>>
>>> Full logs attached (each with and without your patch).
>>>
>>> In both cases, it tries to use f77, while the original port uses gfortran46.
>>>
>>> Any idea what is wrong on my system?
>> 
>> Do you define FC in make.conf maybe?
> 
> No, besides some options (*_SET / *_UNSET) for some unrelated ports, I
> only have got this in make.conf:

Hmm, apparently FC is defined by sys.mk.  I've attached a new patch.
--MP_/kCilWNwDVtwlEXWkOXXHhZq
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=octave-fortran.patch

Index: math/octave/Makefile
===================================================================
--- math/octave/Makefile	(revision 335568)
+++ math/octave/Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 PORTNAME=	octave
 PORTVERSION=	3.6.4
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	math
 MASTER_SITES=	ftp://ftp.gnu.org/gnu/octave/ \
 		ftp://ftp.u-aizu.ac.jp/pub/SciEng/numanal/Octave/bleeding-edge/
@@ -32,7 +32,7 @@ LIB_DEPENDS=	GraphicsMagick:${PORTSDIR}/
 		umfpack.1:${PORTSDIR}/math/suitesparse \
 		glpk:${PORTSDIR}/math/glpk
 
-USES=		charsetfix gmake perl5 pkgconfig
+USES=		charsetfix fortran gmake perl5 pkgconfig
 USE_BZIP2=	yes
 USE_PERL5=	build
 USE_TEX=	dvipsk:build
@@ -74,8 +74,6 @@ BLAS=		-lptf77blas
 LAPACK=		-lalapack -lptcblas
 .endif
 
-USE_FORTRAN=	yes
-
 OCTAVE_VERSION=	${PORTVERSION}
 GNU_HOST=	${ARCH}-portbld-freebsd${OSREL}
 PLIST_SUB=	OCTAVE_VERSION=${OCTAVE_VERSION} GNU_HOST=${GNU_HOST}
@@ -140,7 +138,8 @@ post-install:
 	${ECHO_CMD} @dirrm share/octave >> ${WRKDIR}/PLIST
 	cd ${WRKDIR} ; ${SED} -i -e "/PLIST/ r PLIST" ${TMPPLIST}
 
-check:
+check: regression-test
+regression-test: build
 	(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_ARGS} check)
 
 .include <bsd.port.post.mk>
Index: math/octave/files/patch-configure
===================================================================
--- math/octave/files/patch-configure	(revision 0)
+++ math/octave/files/patch-configure	(working copy)
@@ -0,0 +1,11 @@
+--- configure.orig	2013-02-21 21:21:49.000000000 +0100
++++ configure	2013-11-22 20:34:49.000000000 +0100
+@@ -58248,7 +58248,7 @@
+ main ()
+ {
+ 
+-      std::unordered_map m;
++      std::unordered_map<int, int> m;
+ 
+   ;
+   return 0;

Property changes on: math/octave/files/patch-configure
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: math/octave/files/patch-libgnu-math.in.h
===================================================================
--- math/octave/files/patch-libgnu-math.in.h	(revision 0)
+++ math/octave/files/patch-libgnu-math.in.h	(working copy)
@@ -0,0 +1,11 @@
+--- libgnu/math.in.h.orig	2013-02-21 21:21:17.000000000 +0100
++++ libgnu/math.in.h	2013-11-22 12:35:47.000000000 +0100
+@@ -17,7 +17,7 @@
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+-#ifndef _@GUARD_PREFIX@_MATH_H
++#if 1
+ 
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@

Property changes on: math/octave/files/patch-libgnu-math.in.h
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: math/octave/files/patch-liboctave-eigs-base.cc
===================================================================
--- math/octave/files/patch-liboctave-eigs-base.cc	(revision 0)
+++ math/octave/files/patch-liboctave-eigs-base.cc	(working copy)
@@ -0,0 +1,11 @@
+--- liboctave/eigs-base.cc.orig	2013-02-21 21:19:24.000000000 +0100
++++ liboctave/eigs-base.cc	2013-11-22 20:19:19.000000000 +0100
+@@ -3832,7 +3832,7 @@
+                              bool cholB = 0, int disp = 0, int maxit = 300);
+ #endif
+ 
+-#ifndef _MSC_VER
++#if !defined(_MSC_VER) && !defined(__clang__)
+ template static octave_idx_type
+ lusolve (const SparseMatrix&, const SparseMatrix&, Matrix&);
+ 

Property changes on: math/octave/files/patch-liboctave-eigs-base.cc
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: Mk/Uses/fortran.mk
===================================================================
--- Mk/Uses/fortran.mk	(revision 0)
+++ Mk/Uses/fortran.mk	(working copy)
@@ -0,0 +1,31 @@
+# $FreeBSD$
+#
+# Establish Fortran-capable compiler as a build dependency
+#
+# MAINTAINER:	fortran@FreeBSD.org
+#
+# Feature:	fortran
+# Usage:	USES=fortran
+# Valid ARGS:	does not require args
+
+.if !defined(_INCLUDE_USES_FORTRAN_MK)
+_INCLUDE_USES_FORTRAN_MK=	yes
+
+.if defined(fortran_ARGS)
+IGNORE=		USES=fortran does not require args
+.endif
+
+BUILD_DEPENDS+=	gfortran46:${PORTSDIR}/lang/gcc
+RUN_DEPENDS+=	gfortran46:${PORTSDIR}/lang/gcc
+
+USE_BINUTILS=	yes
+
+F77=		gfortran46
+FC=		gfortran46
+FFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc46
+LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc46
+
+CONFIGURE_ENV+=	F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}"
+MAKE_ENV+=	F77="${F77}" FC="${FC}" FFLAGS="${FFLAGS}"
+
+.endif

Property changes on: Mk/Uses/fortran.mk
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+FreeBSD=%H
\ No newline at end of property

--MP_/kCilWNwDVtwlEXWkOXXHhZq--



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