Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2008 02:59:58 GMT
From:      "Pedro F. Giffuni" <pfgshield-freebsd@yahoo.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/125915: science/netcdf: add a WITH_FORTRAN knob
Message-ID:  <200807240259.m6O2xw1k070889@www.freebsd.org>
Resent-Message-ID: <200807240300.m6O30C6W052405@freefall.freebsd.org>

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

>Number:         125915
>Category:       ports
>Synopsis:       science/netcdf: add a WITH_FORTRAN knob
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 24 03:00:12 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Pedro F. Giffuni
>Release:        6.3-Release
>Organization:
>Environment:
FreeBSD kakumen.cable.net.co 6.3-RELEASE FreeBSD 6.3-RELEASE #10: Sat Jan 19 01:13:55 COT 2008     root@kakumen.cable.net.co:/usr/src/sys/amd64/compile/SMP  amd64

>Description:
- Add experimental WITH_FORTRAN knob and a patch to have it compile.
- It's off by default as it doesn't seem to be required by any port.
- No functional change.
>How-To-Repeat:
- Handle with care: it's not catching gfortran on my system but works fine with f77.
>Fix:
diff -ruN netcdf.orig/Makefile netcdf/Makefile
--- netcdf.orig/Makefile	2008-07-23 21:21:33.000000000 -0500
+++ netcdf/Makefile	2008-07-23 21:27:12.000000000 -0500
@@ -17,7 +17,7 @@
 
 CONFLICTS=	hdf-4.* netcdf-4.*
 
-CONFIGURE_ARGS=	--enable-shared --disable-f77
+CONFIGURE_ARGS=	--enable-shared
 CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include -fPIC -DPIC -Df2cFortran"
 
 GNU_CONFIGURE=	yes
@@ -29,6 +29,12 @@
 INFO=		netcdf netcdf-c netcdf-cxx netcdf-f77 netcdf-f90 \
 		netcdf-install netcdf-tutorial
 
+.ifdef WITH_FORTRAN
+USE_FORTRAN=	yes
+.else
+CONFIGURE_ARGS+=--disable-f77
+.endif
+
 post-install:
 	@${STRIP_CMD} ${PREFIX}/bin/ncdump ${PREFIX}/bin/ncgen
 	${LN} -fs libnetcdf.so.4 ${PREFIX}/lib/libnetcdf.so
diff -ruN netcdf.orig/files/patch-fortran+cfortran.h netcdf/files/patch-fortran+cfortran.h
--- netcdf.orig/files/patch-fortran+cfortran.h	1969-12-31 19:00:00.000000000 -0500
+++ netcdf/files/patch-fortran+cfortran.h	2008-07-23 21:49:47.000000000 -0500
@@ -0,0 +1,21 @@
+--- fortran/cfortran.h.orig	2008-07-23 21:47:30.000000000 -0500
++++ fortran/cfortran.h	2008-07-23 21:48:50.000000000 -0500
+@@ -134,7 +134,8 @@
+ /* Split #if into 2 because some HP-UX can't handle long #if */
+ #if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran)||defined(PATHSCALE_COMPILER)||defined(gFortran))
+ #if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
+-/* If your compiler barfs on ' #error', replace # with the trigraph for #     */
++#define    f2cFortran 
++/* If your compiler barfs on ' #error', replace # with the trigraph for #
+  #error "cfortran.h:  Can't find your environment among:\
+     - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)     \
+     - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000     \
+@@ -158,7 +159,7 @@
+     - Absoft Pro Fortran: Use #define AbsoftProFortran \
+     - Portland Group Fortran: Use #define pgiFortran \
+     - PathScale Fortran: Use #define PATHSCALE_COMPILER"
+-/* Compiler must throw us out at this point! */
++   Compiler must throw us out at this point! */
+ #endif
+ #endif
+ 


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



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