[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20050315: udunits: calling from a fortran code



Roderick,

The UDUNITS package isn't set-up to compile Fortran code.  There is no
Fortran code in the package (other than the "udunits.inc" include-file).
The Fortran API is actually implemented in C.  So there's no need for
the UDUNITS package to compile Fortran code and it doesn't.

Once you've installed the UDUNITS package, then you should compile and
link your Fortran code against the installed UDUNITS include-file(s)
and the installed library: you should not attempt to use the UDUNITS
makefile to build your program.

Regards,
Steve Emmerson

------- Original Message

Date:    Tue, 15 Mar 2005 15:20:28 -0700
From:    "Pearson, Roderick R" <address@hidden>To:      "Steve Emmerson" <st
          address@hidden>
Subject: RE: 20050315: udunits: calling from a fortran code 

This is a multi-part message in MIME format.

------_=_NextPart_001_01C529AD.D60767B7
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hello,
Thank you for your prompt reply
I just did a make distclean and then configure.  What I get in the =
makefile does not lead me to believe that the fortran component will =
work. How should I configure this process to make it compile the code =
correctly?    Here is what get from make file: =
I########################################################################=
####
# General Macros:
#########################################################################=
###
prefix          =3D /users/students/rpearson/udunits-1.12.4
exec_prefix     =3D /users/students/rpearson/udunits-1.12.4
AR              =3D ar
CC              =3D cc
CPP             =3D cc -E
CC_MAKEDEPEND   =3D cc -xM
CXX             =3D @CXX@
FC              =3D @FC@
LINT            =3D lint
LINTFLAGS       =3D -u
MAKEINFO        =3D @MAKEINFO@
NCDUMP          =3D @NCDUMP@
NCGEN           =3D @NCGEN@
NEQN            =3D neqn
OS              =3D sunos5
SHELL           =3D /bin/sh
TBL             =3D tbl
WHICH           =3D @WHICH@

#########################################################################=
###
# Compilation:
#########################################################################=
###
FORTC           =3D @FORTC@

# Compile C++ code.
.cc.o:
        $(CXX) -c $(CXXFLAGS) $(CXXCPPFLAGS) $<

# Compile FORTRAN code.
#
.f.o:
        $(FC) -c $(FFLAGS) $<
.F.o:
        ln -s $< $*.c && \
            ($(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c >$*.i && \
            sed '/^# *[0-9]/d' $*.i > $*.f) || \
            (rm -f $*.f $*.i $*.c ; exit 1) && \
            rm $*.i
        $(FC) -c $(FFLAGS) $*.f && rm $*.f $*.c
.F.f:
        ln -s $< $*.c && \
            ($(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c >$*.i && \
            grep -v '^#' $*.i > $@) || \
            (rm -f $@ $*.i $*.c; exit 1) && \
            rm $*.i $*.c
.F.i:
        ln -s $< $*.c && \
            $(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c >$*.i

# Generate FORTRAN-callable C code.
#
.fc.o:
        $(FORTC) -O $(OS) $< > $*.c \
            || ( rm -f $*.c; exit 1)
        $(CC) -c $(CFLAGS) $(CPPFLAGS) $*.c
.fc.c:
        $(FORTC) -O $(OS) $< > $@ \
            || (rm -f $*.c; exit 1)



------_=_NextPart_001_01C529AD.D60767B7
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7226.0">
<TITLE>RE: 20050315: udunits: calling from a fortran code </TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

<P><FONT SIZE=3D2>Hello,<BR>
Thank you for your prompt reply<BR>
I just did a make distclean and then configure.&nbsp; What I get in the =
makefile does not lead me to believe that the fortran component will =
work. How should I configure this process to make it compile the code =
correctly?&nbsp;&nbsp;&nbsp; Here is what get from make file: =
I########################################################################=
####<BR>
# General Macros:<BR>
#########################################################################=
###<BR>
prefix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D =
/users/students/rpearson/udunits-1.12.4<BR>
exec_prefix&nbsp;&nbsp;&nbs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;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; =3D sunos5<BR>
SHELL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D =
/bin/sh<BR>
TBL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p; =3D tbl<BR>
WHICH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D =
@WHICH@<BR>
<BR>
#########################################################################=
###<BR>
# Compilation:<BR>
#########################################################################=
###<BR>
FORTC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =3D =
@FORTC@<BR>
<BR>
# Compile C++ code.<BR>
.cc.o:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CXX) -c $(CXXFLAGS) =
$(CXXCPPFLAGS) $&lt;<BR>
<BR>
# Compile FORTRAN code.<BR>
#<BR>
.f.o:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(FC) -c $(FFLAGS) $&lt;<BR>
.F.o:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s $&lt; $*.c &amp;&amp; =
\<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
($(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c &gt;$*.i &amp;&amp; \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sed =
'/^# *[0-9]/d' $*.i &gt; $*.f) || \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (rm =
-f $*.f $*.i $*.c ; exit 1) &amp;&amp; \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm =
$*.i<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(FC) -c $(FFLAGS) $*.f =
&amp;&amp; rm $*.f $*.c<BR>
.F.f:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s $&lt; $*.c &amp;&amp; =
\<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
($(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c &gt;$*.i &amp;&amp; \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; grep =
-v '^#' $*.i &gt; $@) || \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (rm =
-f $@ $*.i $*.c; exit 1) &amp;&amp; \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm =
$*.i $*.c<BR>
.F.i:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ln -s $&lt; $*.c &amp;&amp; =
\<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
$(CPP) -DUD_FORTRAN_SOURCE $(CPPFLAGS) $*.c &gt;$*.i<BR>
<BR>
# Generate FORTRAN-callable C code.<BR>
#<BR>
.fc.o:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(FORTC) -O $(OS) $&lt; &gt; =
$*.c \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || ( =
rm -f $*.c; exit 1)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(CC) -c $(CFLAGS) =
$(CPPFLAGS) $*.c<BR>
.fc.c:<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $(FORTC) -O $(OS) $&lt; &gt; =
$@ \<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || =
(rm -f $*.c; exit 1)<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C529AD.D60767B7--

------- End of Original Message