Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

standard question: function overload
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


Report this thread to moderator Post Follow-up to this message
Old Post
Christoph Arns
05-31-05 09:00 AM


Re: standard question: function overload
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/[/ur...rums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/

Report this thread to moderator Post Follow-up to this message
Old Post
Steve Lionel
05-31-05 09:01 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:40 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.