Bug 132430 - science/netcdf: fix and make packageable WITH_FORTRAN
Summary: science/netcdf: fix and make packageable WITH_FORTRAN
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-08 20:20 UTC by Thierry Thomas
Modified: 2009-03-22 22:10 UTC (History)
1 user (show)

See Also:


Attachments
file.shar (847 bytes, text/plain)
2009-03-08 20:20 UTC, Thierry Thomas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Thomas freebsd_committer 2009-03-08 20:20:01 UTC
	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.

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-ftn.shar ends here -----bQ7VQYFQ9tZKZqpjgrZqiE7S7dfERRREhp8dyEPHyYFl3YWk
Content-Type: text/plain; name="netcdf.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="netcdf.diff"

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
How-To-Repeat: 	Try to link a program with libnetcdff.
Comment 1 Edwin Groothuis freebsd_committer 2009-03-08 20:20:36 UTC
Responsible Changed
From-To: freebsd-ports-bugs->thierry

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2009-03-08 20:20:38 UTC
Maintainer of science/netcdf,

Please note that PR ports/132430 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/132430

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer 2009-03-08 20:20:40 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Pav Lucistnik freebsd_committer 2009-03-22 21:04:35 UTC
State Changed
From-To: feedback->closed

Committed, thanks !
Comment 5 dfilter service freebsd_committer 2009-03-22 22:09:54 UTC
pav         2009-03-22 22:09:27 UTC

  FreeBSD ports repository

  Modified files:
    science              Makefile 
    science/netcdf       Makefile pkg-plist 
  Added files:
    science/netcdf-ftn   Makefile 
  Log:
  - Fix Fortran linking
  - Add a slaveport so fortran enabled netcdf can be packaged
  
  PR:             ports/132430
  Submitted by:   thierry
  Approved by:    maintainer timeout (14 days)
  
  Revision  Changes    Path
  1.141     +1 -0      ports/science/Makefile
  1.1       +16 -0     ports/science/netcdf-ftn/Makefile (new)
  1.37      +8 -2      ports/science/netcdf/Makefile
  1.12      +1 -0      ports/science/netcdf/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"