Detect if the fortran compiler/libs have etime as an intrinsic or not instead

of hard coding it.  This package builds with both f2c and gfortran now.
This commit is contained in:
dmcmahill 2010-03-17 21:47:11 +00:00
parent 4bdec5cb16
commit f298c8d2a6
4 changed files with 46 additions and 7 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.30 2010/01/30 16:28:00 heinz Exp $
# $NetBSD: Makefile,v 1.31 2010/03/17 21:47:11 dmcmahill Exp $
DISTNAME= lapack-lite-3.1.1
PKGNAME= lapack-3.1.1
PKGREVISION= 3
PKGREVISION= 4
CATEGORIES= math
MASTER_SITES= ${MASTER_SITE_NETLIB:=lapack/}
EXTRACT_SUFX= .tgz
@ -21,6 +21,19 @@ BUILD_TARGET= lapacklib
INSTALLATION_DIRS= lib
FFLAGS+= -ffloat-store
# With f2c-20090411nb4, libf2c-20090201nb3, we need EXT_ETIME but gcc44-4.4.1nb3
# needs INT_ETIME. Rather than trying to enumerate all possible fortran compilers,
# just do a test for it.
do-configure:
@${ECHO_N} "Checking if your fortran compiler has etime() as an intrinsic... "
@cd ${WRKDIR} && ${FC} -o etime_test ${FILESDIR}/etime_test.f >${WRKDIR}/etime_test.log 2>&1; \
if test $$? -eq 0 ; then \
${ECHO} "TIMER=INT_ETIME" >> ${WRKSRC}/make.inc ; echo "YES" ; else \
${ECHO} "TIMER=EXT_ETIME" >> ${WRKSRC}/make.inc ; echo "NO" ; fi
@${ECHO} "See ${WRKDIR}/etime_test.log for details on the test"
do-install:
${LIBTOOL} --mode=install ${INSTALL_DATA} ${WRKSRC}/liblapack.la \
${DESTDIR}${PREFIX}/lib

View file

@ -1,9 +1,9 @@
$NetBSD: distinfo,v 1.12 2009/10/20 14:00:23 tnn Exp $
$NetBSD: distinfo,v 1.13 2010/03/17 21:47:11 dmcmahill Exp $
SHA1 (lapack-lite-3.1.1.tgz) = 1ec4ef90b544cf82bc7b4f770cee6fb46da457c5
RMD160 (lapack-lite-3.1.1.tgz) = d81baafd1f0f9859d9f75ac9b658f743544b5f5b
Size (lapack-lite-3.1.1.tgz) = 5332509 bytes
SHA1 (patch-aa) = 75671f2cc3233241f03ecab5a5d79cb505eece15
SHA1 (patch-ab) = fd5989eaafc622f29284759f538ccc0f11dfe624
SHA1 (patch-ac) = 649f7e40142936af49c8c9dbec376bdd1a11b05a
SHA1 (patch-ac) = 594736353b377c72bd41969e2ef62ef1871ae2ca
SHA1 (patch-ad) = eb9cdf3d47cef03e2c679b0eda8d8120c572a2c0

View file

@ -0,0 +1,27 @@
program main
c
c $NetBSD: etime_test.f,v 1.1 2010/03/17 21:47:11 dmcmahill Exp $
c
c Simple program to check if the etime function is available
c
implicit none
real cpu
real etime
intrinsic etime
real t_array(2)
cpu = etime ( t_array )
write ( *, '(a)' ) ' '
write ( *, '(a)' ) ' ETIME reports:'
write ( *, '(a,g14.6)' )
& ' The current CPU time is ', cpu
write ( *, '(a,g14.6)' )
& ' TARRAY(1) = ', t_array(1)
write ( *, '(a,g14.6)' )
& ' TARRAY(2) = ', t_array(2)
stop
end

View file

@ -1,8 +1,8 @@
$NetBSD: patch-ac,v 1.1 2007/12/10 17:50:31 adam Exp $
$NetBSD: patch-ac,v 1.2 2010/03/17 21:47:11 dmcmahill Exp $
--- /dev/null 2007-11-22 18:29:57.000000000 +0100
+++ make.inc
@@ -0,0 +1,10 @@
@@ -0,0 +1,9 @@
+SHELL= /bin/sh
+PLAT= _${MACHINE}
+FORTRAN= ${FC}
@ -11,5 +11,4 @@ $NetBSD: patch-ac,v 1.1 2007/12/10 17:50:31 adam Exp $
+NOOPT=
+LOADER= ${FC}
+LOADOPTS=
+TIMER= EXT_ETIME
+LAPACKLIB= liblapack.la