[mpich-discuss] undefined reference to `__muldc3'

Rayson Ho raysonlogin at gmail.com
Wed Aug 1 16:55:46 CDT 2012


Ted,

__muldc3 (and friends) is an internal function defined by the compiler runtime.

It is called from opprod.c because in that file MPIR_PROD() computes
complex datatypes... I think there is a library missing from the
mpif90 link command. C does not have native complex data type support,
but fortran does, so if you compile C code that computes compldex
numbers but link with a fortran compiler, then you can encounter
problems like this!

The easiest way to check is to compile this code and look at the linker map:

main()
{
 double a, b, c, d;

 return __muldc3(a, b, c, d);
}

% cc a.c -Wl,--print-map >&map

>From the map, I found that it is defined in:

 .text          0x00000000004004c0      0x3b2
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/libgcc.a(_muldc3.o)
                0x00000000004004c0                __muldc3

If you are on Solaris then you will need to find the name of the
option in the ld man page.

Rayson

==================================================
Open Grid Scheduler - The Official Open Source Grid Engine
http://gridscheduler.sourceforge.net/


On Wed, Aug 1, 2012 at 5:24 PM, Ted Sariyski <tsariysk at craft-tech.com> wrote:
> The same error without -j
> --Ted
>
>
> On 08/01/2012 05:22 PM, Anthony Chan wrote:
>>
>> mpich2-1.4.1p1 does not support parallel make which is
>> available in 1.5 and later releases, so try to build mpich2
>> with just "make" without -j.
>>
>> ----- Original Message -----
>>>
>>> Hi,
>>> I compiled mpich2-1.4.1p1 with the following script:
>>>
>>> export FC=sunf90
>>> export F77=sun77
>>> export CC=suncc
>>> export CXX=sunCC
>>> make distclean
>>> ./configure --prefix=/opt/mpich2-1.4.1p1_sun
>>> make -j 6
>>>
>>> Compilation and installation went clean, but when compile the example
>>> under examples/f90 i get:
>>>
>>> make
>>> ../../bin/mpif90 -o pi3f90 pi3f90.o -lrt -lpthread
>>> /home/tsariysk/mpich2-1.4.1p1/lib/libmpich.a(opprod.o): In function
>>> `MPIR_PROD':
>>> opprod.c:(.text+0x858): undefined reference to `__muldc3'
>>> opprod.c:(.text+0xa28): undefined reference to `__mulsc3'
>>> opprod.c:(.text+0x1083): undefined reference to `__mulxc3'
>>> make: *** [pi3f90] Error 2
>>>
>>> I also tried to use the system c and c++ compilers, but the error
>>> persists. What do I miss here?
>>>
>>> I'll highly appreciate any help.
>>> Thanks,
>>> --Ted
>>> _______________________________________________
>>> mpich-discuss mailing list mpich-discuss at mcs.anl.gov
>>> To manage subscription options or unsubscribe:
>>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>>
>> _______________________________________________
>> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
>> To manage subscription options or unsubscribe:
>> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
>
>
> _______________________________________________
> mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> To manage subscription options or unsubscribe:
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


More information about the mpich-discuss mailing list