View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

mkpkg and Fortran options

slouren@ll.iac.es wrote on Mar 13, 1998


Hello IRAF programmers,

Q1: I'm using a small 'mkpkg' file (I include this file in the attachments) to compile a Fortran program within IRAF.
I would like to compile the Fortran source ('lijnst.f') with double precision (something very easy to do in a shell command line) but I don't know how to specify this option in the mkpkg file .
I've tried it setting a XFLAGS option for the XC compiler, but I haven't been able to make it work...

Q2: If I want to use an external Fortran library like say a NAG library, to calculate an integration in a program of the 'mkpkg' file list (say, a call in 'lijnst.f'), how I must specify this in the 'mkpkg' file? (if it's possible) and; where this libraries must be located (i.e. if they need to be in a different directory from the default one, like in one of the IRAF logical directories or it doesn't matter).

May you help me on this, please?

Many thanks,

Sergio

slouren@ll.iac.es wrote on Mar 13, 1998


Sorry, I forgot the 'mkpkg' file...


----- Begin Included Message -----


# Make the lijnst program.

$call lijnst
$exit

update:
	$call lijnst
	;


libls.a:
	xlijnst.x
	lijnst.f
        xlsnew.x
        lsnew.f
        xlstest.x
	lstest.f
	ioplay.f
	xioplay.x
	;


iraflib.a:
	argument.f
	fit.f
	gimr.f
	gimw.f
	gproms.f
	gwrit.f
	imname.f
	input.f
	lenc.f
	maskpix.f
	mod.f
	parse.f
	readin.f
	startsub.f
	;


lijnst:
	$set	LIBS = "-lxtools"
        $set    LF77 = "/soft/iraf/extern/stsdas/bin.ssun/libiraf77.a"
        $set    LUTIL= "/soft/iraf/extern/stsdas/bin.ssun/libf77util.a"

	$update   libls.a
	$update   iraflib.a

	$omake	x_lijnst.x
	$link	x_lijnst.o libls.a  iraflib.a $(LF77) \
	$(LUTIL) $(LIBS) -o x_lijnst.e
	;


----- End Included Message -----

Mike Fitzpatrick wrote on Mar 13, 1998



> Q1: I'm using a small 'mkpkg' file (I include this file in the
> attachments) to compile a Fortran program within IRAF.  I would like to
> compile the Fortran source ('lijnst.f') with double precision (something
> very easy to do in a shell command line) but I don't know how to specify
> this option in the mkpkg file .  I've tried it setting a XFLAGS option for
> the XC compiler, but I haven't been able to make it work...
	I assume you mean you want to use the -dbl or -r8 flag to the F77
compiler?  To do this you need to define XFLAGS before calling the library
update part of the mkpkg file, and you need to escape the host compiler
command using "-/".  For example, your XFLAGS definition should look some-
thing like

	$set   XFLAGS = "$(XFLAGS) -/r8"

Put this as the first line in the libls.a or iraflib.a target of your mkpkg
file, or at the top so it's always defined.  Tasks are linked with the C
compiler so these flags don't make any sense on the link line, but you can
similaryly define LFLAGS to set any link flags you want to use.

> Q2: If I want to use an external Fortran library like say a NAG library,
> to calculate an integration in a program of the 'mkpkg' file list (say, a
> call in 'lijnst.f'), how I must specify this in the 'mkpkg' file? (if it's
> possible) and; where this libraries must be located (i.e. if they need to
> be in a different directory from the default one, like in one of the IRAF
> logical directories or it doesn't matter).
	It depends on where the library is installed in your system.  If
it's in the normal library search path in e.g. /usr/lib just use "-lnag" on
the link line and it should be found.  If it's on say /usr/local/lib then
you can either specify the path explicitly, or using the above trick put
a "-L/usr/local/lib" on the LFLAGS, e.g

	$set   LIBS   = "-lxtools -lnag"
	$set   LFLAGS = "$(LFLAGS) -/L/usr/local/lib"

Also, I noticed you make use of some STSDAS libraries.  Rather than use
the explicit path you can import the package environment with the '-p'
flag so they will be found automatically.  So for example part of your
mkpkg file could be rewritten as (assuming you use the NAG lib):


lijnst:
	$set LIBS   = "-lxtools -liraf77 -lf77util -lnag"
	$set LFLAGS = "$(LFLAGS) -/L/usr/local/lib -p stsdas"
	$set XFLAGS = "$(XFLAGS) -/r8"
	$update   libls.a
	$update   iraflib.a
	$omake	  x_lijnst.x
	$link	  x_lijnst.o libls.a iraflib.a $(LIBS) -o x_lijnst.e
	;

Hope this helps.

-Mike

Last post on Mar 13, 1998