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

[netCDF #YQI-531762]: Problem compiling with Lahey/Fujitsu compiler

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #YQI-531762]: Problem compiling with Lahey/Fujitsu compiler
  • Date: Thu, 02 Apr 2009 09:01:57 -0600

> New Ticket: Problem compiling with Lahey/Fujitsu compiler
>
> Full Name: Jim Secan
> Email Address: address@hidden
> Organization: NWRA
> Package Version: 3.6.3
> Operating System: CENTOS 4
> Hardware: PC
> Description of problem:
>
> I've seen this problem metioned in several lists, but never a solution
> that works.  When I build a Fortran code using the Lahey/Fujitsu (v6)
> compiler I get errors similar to the following from the link stage:
>
> /usr/local/lib/libnetcdf.a(nc.o)(.text+0x824): In function `NC_endef':
> /home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:246: undefined reference to
`__divdi3'
>
/usr/local/lib/libnetcdf.a(nc.o)(.text+0x89b):/home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:249:
undefined reference to `__divdi3'
>
/usr/local/lib/libnetcdf.a(nc.o)(.text+0xb85):/home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:242:
undefined reference to `__divdi3'
>
/usr/local/lib/libnetcdf.a(nc.o)(.text+0xcea):/home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:280:
undefined reference to `__divdi3'
>
/usr/local/lib/libnetcdf.a(nc.o)(.text+0xd98):/home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:277:
undefined reference to `__divdi3'
>
/usr/local/lib/libnetcdf.a(nc.o)(.text+0xef1):/home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/nc.c:283:
more undefined references to `__divdi3' follow
> /usr/local/lib/libnetcdf.a(posixio.o)(.text+0x383): In function `px_get':
> /home/sadie/jim/netcdf/netcdf-3.6.3/libsrc/posixio.c:408: undefined reference
to `__moddi3'
>
> Has a solution ever been found for this?  I'm dead in the water RE
> netCDF until I can get this fixed.
>
>

Howdy Jim!

I too have been frustrated by this problem. And I don't know what causes it, or
even if my solution is totally insane.

Insane it may be, but it works for me. These functions can be found in the gcc
C library, so I link to the gcc one sometimes, to get rid of this problem. For
example, here's what I have to set to get this problem to go away with an AIX
build:

LDFLAGS=-L/opt/gnu/lib/gcc-lib/powerpc-ibm-aix4.3.0.0/2.95.2/powerpc
LIBS=-lgcc

This pulls those missing functions from the gcc library.

But I have never figured out why I should have to do this. If  I had time to
track this down I would contact the compiler manufacturer (IBM in my case) and
ask what is going on.

But this remains one of the great unresolved mysteries of netCDF porting. So
please let me know if this works for you, or if you ever figure out more about
this problem.

Thanks,

Ed

Ticket Details
===================
Ticket ID: YQI-531762
Department: Support netCDF
Priority: Normal
Status: Closed