From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Mar 8 20:20:01 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F147A1065672 for ; Sun, 8 Mar 2009 20:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C6E778FC0C for ; Sun, 8 Mar 2009 20:20:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n28KK1xp068794 for ; Sun, 8 Mar 2009 20:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n28KK1fH068793; Sun, 8 Mar 2009 20:20:01 GMT (envelope-from gnats) Resent-Date: Sun, 8 Mar 2009 20:20:01 GMT Resent-Message-Id: <200903082020.n28KK1fH068793@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thierry Thomas Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC73D106566C for ; Sun, 8 Mar 2009 20:11:57 +0000 (UTC) (envelope-from thierry@pompo.net) Received: from smtpfb2-g21.free.fr (smtpfb2-g21.free.fr [212.27.42.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0ADB18FC19 for ; Sun, 8 Mar 2009 20:11:55 +0000 (UTC) (envelope-from thierry@pompo.net) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb2-g21.free.fr (Postfix) with ESMTP id 5E6A8CA9EBB for ; Sun, 8 Mar 2009 20:53:35 +0100 (CET) Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id E6A624B01B4; Sun, 8 Mar 2009 20:53:28 +0100 (CET) Received: from graf.pompo.net (unknown [78.225.128.39]) by smtp2-g21.free.fr (Postfix) with ESMTP id A03DC4B01AA; Sun, 8 Mar 2009 20:53:25 +0100 (CET) Received: by graf.pompo.net (Postfix, from userid 1001) id 4A7471143B; Sun, 8 Mar 2009 20:53:25 +0100 (CET) Message-Id: <20090308195325.4A7471143B@graf.pompo.net> Date: Sun, 8 Mar 2009 20:53:25 +0100 (CET) From: Thierry Thomas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: sunpoet@sunpoet.net Subject: ports/132430: science/netcdf: fix and make packageable WITH_FORTRAN X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Thierry Thomas List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2009 20:20:02 -0000 >Number: 132430 >Category: ports >Synopsis: science/netcdf: fix and make packageable WITH_FORTRAN >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Mar 08 20:20:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Thierry Thomas >Release: FreeBSD 7.1-STABLE i386 >Organization: Kabbale Eros >Environment: System: FreeBSD graf.pompo.net 7.1-STABLE FreeBSD 7.1-STABLE #0: Tue Feb 3 22:52:14 CET 2009 thierry@graf.pompo.net:/usr/obj/usr/src/sys/GRAF071102 i386 >Description: 1) When you set the option WITH_FORTRAN, the port builds fine, but the consumer program cannot link with libnetcdff: it gives this kind of errors: /usr/local/lib/libnetcdff.a(netcdf.o)(.text+0x1b): In function `nf90_inq_libvers': /usr/ports/science/netcdf-ftn/work/netcdf-3.6.3/f90/netcdf_file.f90:5: undefined reference to `nf_inq_libvers_' /usr/local/lib/libnetcdff.a(netcdf.o)(.text+0x56): In function `nf90_strerror': /usr/ports/science/netcdf-ftn/work/netcdf-3.6.3/f90/netcdf_file.f90:12: undefined reference to `nf_strerror_' /usr/local/lib/libnetcdff.a(netcdf.o)(.text+0x8e): In function `nf90_inq_base_pe': /usr/ports/science/netcdf-ftn/work/netcdf-3.6.3/f90/netcdf_file.f90:23: undefined reference to `nf_inq_base_pe_' /usr/local/lib/libnetcdff.a(netcdf.o)(.text+0xb2): In function `nf90_set_base_pe': /usr/ports/science/netcdf-ftn/work/netcdf-3.6.3/f90/netcdf_file.f90:30: undefined reference to `nf_set_base_pe_' /usr/local/lib/libnetcdff.a(netcdf.o)(.text+0x107): In function `nf90_create': etc. (same result with the shared library) To fix this problem, -Df2cFortran must be replaced by -DpgiFortran. Note: %%FORTRAN%%include/netcdf.inc must also be added to plist. 2) This option WITH_FORTRAN is off by default, and other ports which could use it cannot be packaged (e.g. the new version of science/abinit). The simplest solution to solve this problem would be to bump PORTREVISION and to default this option to on, but if for some reason the maintainer does not like this idea, another solution is to create a slave port for netcdf with Fortran support. Attached is a diff and a shar file for the new slave port. >How-To-Repeat: Try to link a program with libnetcdff. >Fix: - either apply the following patch and create the new slave port from the shar file; - or just: . bump PORTREVISION; . default the optin WITH_FORTRAN to on; . s/-Df2cFortran/-DpgiFortran/; . fix pkg-plist. --- netcdf.diff begins here --- diff -urN science/netcdf.orig/Makefile science/netcdf/Makefile --- science/netcdf.orig/Makefile 2009-01-21 08:29:15.000000000 +0100 +++ science/netcdf/Makefile 2009-03-08 14:23:39.000000000 +0100 @@ -13,17 +13,19 @@ http://sunpoet.net/distfiles/ MAINTAINER= sunpoet@sunpoet.net -COMMENT= Library for machine-independent, array-oriented data access +COMMENT?= Library for machine-independent, array-oriented data access CONFLICTS= hdf-4.* netcdf-4.* CONFIGURE_ARGS= --enable-shared -CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include -fPIC -DPIC -Df2cFortran" +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include -fPIC -DPIC ${FTNTYPE}" GNU_CONFIGURE= yes USE_LDCONFIG= yes #CONFIGURE_ENV+= ${MAKE_ENV} +SLAVEDIRS= science/netcdf-ftn + MAN1= ncdump.1 ncgen.1 MAN3= netcdf.3 @@ -49,9 +51,13 @@ .if defined(WITH_FORTRAN) USE_FORTRAN= yes +PKGNAMESUFFIX+= -ftn +CONFLICTS+= netcdf-3.* MAN3+= netcdf_f77.3 netcdf_f90.3 PLIST_SUB+= FORTRAN="" +FTNTYPE= -DpgiFortran .else +CONFLICTS+= netcdf-ftn-3.* CONFIGURE_ARGS+=--disable-f77 PLIST_SUB+= FORTRAN="@comment " .endif diff -urN science/netcdf.orig/pkg-plist science/netcdf/pkg-plist --- science/netcdf.orig/pkg-plist 2009-01-13 19:33:44.000000000 +0100 +++ science/netcdf/pkg-plist 2009-03-08 16:24:40.000000000 +0100 @@ -3,6 +3,7 @@ include/ncvalues.h include/netcdf.h include/netcdf.hh +%%FORTRAN%%include/netcdf.inc %%FORTRAN%%include/netcdf.mod include/netcdfcpp.h %%FORTRAN%%include/typesizes.mod --- netcdf.diff ends here --- --- netcdf-ftn.shar begins here --- # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # science/netcdf-ftn # science/netcdf-ftn/Makefile # echo c - science/netcdf-ftn mkdir -p science/netcdf-ftn > /dev/null 2>&1 echo x - science/netcdf-ftn/Makefile sed 's/^X//' >science/netcdf-ftn/Makefile << '3ac4cf10fbfd950ab8f974d3d140c9a3' X# New ports collection makefile for: netcdf-ftn X# Date created: Sun Mar 08 2009 X# Whom: thierry@pompo.net X# X# $FreeBSD$ X# X XPORTNAME= netcdf X XCOMMENT= Network Common Data Form, with Fortran support X XMASTERDIR= ${.CURDIR}/../netcdf X XWITH_FORTRAN= yes X X.include "${MASTERDIR}/Makefile" 3ac4cf10fbfd950ab8f974d3d140c9a3 exit --- netcdf-ftn.shar ends here --- >Release-Note: >Audit-Trail: >Unformatted: