Home > Archive > Fortran > May 2005 > standard question: function overload
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
standard question: function overload
|
|
| Christoph Arns 2005-05-31, 4:00 am |
| Hi,
I have three modules of the following type,
module spt_it_i1
use precision, only: sp, dp, i4b, i2b, lgt, iw => i1b
use edt_lscan, only: edt4
use int_ext_pol, only: hunt
use neighbours, only: ijk
use random, only: ran2
use util_args, only: assert
use util_error, only: error
implicit none
logical(lgt), parameter :: output = .true.
integer(i4b), allocatable, save :: hist(:)
integer(iw), allocatable, save :: rad2(:)
contains
include "spt_it.i90"
end module spt_it_i1
where iw points to 1,2,4 byte integer types (replace i1 by i2, i4 in the
module). The include statement provides two functions from each of these
modules, named spt_2d and spt_3d, thus each of these functions is now
available as 1,2,4 byte integer type.
I now use these three modules to generate a publicly accessible function
as follows:
module spt_it
use precision
use util_args, only: assert
use spt_it_i1, only: spt_2d_i1 => spt_2d, spt_3d_i1 => spt_3d
use spt_it_i2, only: spt_2d_i2 => spt_2d, spt_3d_i2 => spt_3d
use spt_it_i4, only: spt_2d_i4 => spt_2d, spt_3d_i4 => spt_3d
implicit none
private
public spt
interface spt
module procedure spt_2d_i1 , spt_3d_i1
module procedure spt_2d_i2 , spt_3d_i2
module procedure spt_2d_i4 , spt_3d_i4
end interface
contains
....
end module spt_it
This used to work fine on several platforms. Now I get with Intel8,
Intel8.1, Intel9 on altix:
/opt/intel-fc/9.0.015/bin/ifort -o perm.ia64 -O2 sv_tensor.o
perc_fire.o int_ext_pol.o phase_field.o sysdep_io.o util_iloc.o
perm_call.o edt_lscan.o perc_com.o perm_type.o perm_view.o util_comp.o
perm_proc.o perm_sub.o perm_prc.o phase_field_com.o edt_grow.o
perm_coll.o util_error.o precision.o perm_stream.o partition.o crt_mop.o
io_tomo_phs.o stats.o util_arth.o util_args.o neighbours.o minkowski.o
random.o perc_burn.o spt_it_mod.o io_tomo_func.o spec_fun.o perm_com.o
perm_eq.o perc_func.o lin_alg.o sorts.o util_copy.o spt_it.o util_vabs.o
util_realloc.o util_outer.o perc_thres.o perm_lat.o util_swap.o
-L/usr/local/netcdf-3.6.0-p1/Intel9/lib -lnetcdf
spt_it.o(.text+0x0): In function `spt_it_i1_':
: multiple definition of `spt_it_i1_'
spt_it_mod.o(.text+0x0): first defined here
ld: Disabling relaxation: it will not work with multiple definitions
spt_it.o(.text+0x40): In function `spt_it_i1_mp_spt_2d_':
: multiple definition of `spt_it_i1_mp_spt_2d_'
spt_it_mod.o(.text+0x40): first defined here
spt_it.o(.text+0xc1c0): In function `spt_it_i1_mp_ppos_':
that is, it fails on the link step?
Any help appretiated.
ta, Christoph
| |
| Steve Lionel 2005-05-31, 4:01 pm |
| On Tue, 31 May 2005 15:13:22 +1000, Christoph Arns
<cha110@rsphysse.anu.edu.au> wrote:
>This used to work fine on several platforms. Now I get with Intel8,
>Intel8.1, Intel9 on altix:
snip
>
>that is, it fails on the link step?
Without seeing a complete source, it's hard to know what the problem is.
Please submit an example to Intel Premier Support at http://premier.intel.com/
and we'll be glad to take a look.
Steve Lionel
Software Products Division
Intel Corporation
Nashua, NH
User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/
|
|
|
|
|