Re: libc++ vs. libstdc++ usage in the ports tree

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Fri, 13 Dec 2013 12:41:52 +0100
Please commit (Approved by: portmgr(bapt)) if needed

regards,
Bapt

On Sun, Dec 01, 2013 at 03:06:40PM +0100, Tijl Coosemans wrote:
> On Wed, 27 Nov 2013 20:45:56 +0100 Tijl Coosemans wrote:
> > On Wed, 27 Nov 2013 19:31:44 +0100 Jan Henrik Sylvester wrote:
> >> Trying to migrate to 10, I would like to keep octave. Have you found
> >> anything new? Having build the port and all dependencies with standard
> >> options, octave is segfaulting for me, too. Anyhow, I can run octave with:
> >> 
> >> env LD_PRELOAD=/usr/lib/libc++.so.1 octave
> >> 
> >> Some very light testing indicates that it is working. Of course, this is
> >> not ideal.
> >> 
> >> Maybe this gives a clue how to fix the octave port properly.
> > 
> > I have a preliminary patch for math/octave that I wanted to test on
> > redports first, but it is down at the moment so here it is.
> 
> 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.

> Index: math/octave/Makefile
> ===================================================================
> --- math/octave/Makefile	(revision 335379)
> +++ math/octave/Makefile	(working copy)
> _at__at_ -3,7 +3,7 _at__at_
>  
>  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/
> _at__at_ -32,7 +32,7 _at__at_ 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
> _at__at_ -74,8 +74,6 _at__at_ 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}
> _at__at_ -140,7 +138,8 _at__at_ post-install:
>  	${ECHO_CMD} _at_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)
> _at__at_ -0,0 +1,11 _at__at_
> +--- configure.orig	2013-02-21 21:21:49.000000000 +0100
> ++++ configure	2013-11-22 20:34:49.000000000 +0100
> +_at__at_ -58248,7 +58248,7 _at__at_
> + 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)
> _at__at_ -0,0 +1,11 _at__at_
> +--- 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
> +_at__at_ -17,7 +17,7 _at__at_
> +    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 __at_GUARD_PREFIX_at__MATH_H
> ++#if 1
> + 
> + #if __GNUC__ >= 3
> + _at_PRAGMA_SYSTEM_HEADER_at_
> 
> 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)
> _at__at_ -0,0 +1,11 _at__at_
> +--- 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
> +_at__at_ -3832,7 +3832,7 _at__at_
> +                              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)
> _at__at_ -0,0 +1,32 _at__at_
> +# $FreeBSD$
> +#
> +# Establish Fortran-capable compiler as a build dependency
> +#
> +# MAINTAINER:	ports_at_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
> +
> +.if !defined(FC)
> +BUILD_DEPENDS+=	gfortran46:${PORTSDIR}/lang/gcc
> +RUN_DEPENDS+=	gfortran46:${PORTSDIR}/lang/gcc
> +
> +USE_BINUTILS=	yes
> +
> +FC=		gfortran46
> +FFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc46
> +LDFLAGS+=	-Wl,-rpath=${LOCALBASE}/lib/gcc46
> +.endif
> +
> +CONFIGURE_ENV+=	F77="${FC}" FC="${FC}" FFLAGS="${FFLAGS}"
> +MAKE_ENV+=	F77="${FC}" 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


Received on Fri Dec 13 2013 - 10:42:03 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:45 UTC