Re: Error compiling Ictranc

From: Craig Tierney <Craig.Tierney_at_nyahnyahspammersnyahnyah>
Date: Wed, 16 Apr 2008 12:01:51 -0600

Mary Haley wrote:
>
> Craig,
>
> Even though ifcore is a Fortran library, you still need it
> in order to resolve the symbols for ictrans. This kind of thing
> can happen when you have C programs calling Fortran routines, and
> vice versa, which is the case for ictrans and just about everything
> else in NCAR Graphics and NCL source code.
>
> You should still be able to link against ifcore, even though it's a
> Fortran library. As Rick pointed out, you need to tell the C compiler
> where this library can be found by using the "-L" option.
>
> Usually, though, if you are using ifort and icc, I'm surprised that
> "icc" doesn't automatically know where to find this library, unless
> icc and ifort were installed separately of each other, and are unaware
> of each other's existence, so to speak.
>

Mary,

I understand the linking issues between Fortran and C. Intel provides
different packages for ifort and icc (and always have). I don't even
think you can purchase them together.

I am not trying to figure out how to fix my build. What I want make
sure that with 5.X comes out, that the NCL build process does the right
thing and I don't have to worry about this issue in the future.

Craig

> --Mary
>
>
> On Wed, 16 Apr 2008, Craig Tierney wrote:
>
>> Rick Grubin wrote:
>>> Hi Tristan
>>>
>>>> I 'm trying to compile NCL 5.0 with Intel Fortan & C compiler. Idt
>>>> doesn't display anything (just say "translator aborted"). Seem that's
>>>> something wrong about 'ictrans'.
>>>>
>>>> Indeed ictrans's compilation crash with "(.text+0x6eb5): undefined
>>>> reference to `for_cpystr`"
>>>
>>> 'for_cpystr' is a symbol from the Intel Fortran compiler's library
>>> 'libifcore'
>>>
>>>> Intel(R) C Compiler for applications running on IA-32, Version 10.1
>>>> Build 20070913 Package ID: l_cc_p_10.1.008
>>>> Intel(R) Fortran Compiler for applications running on IA-32, Version
>>>> 10.1 Build 20070913 Package ID: l_fc_p_10.1.008
>>>> [...]
>>>>
>>>> icc -mp -ansi -O -o ictrans main.o
>>>> [...] -L/opt/1/intel_cc_10.1/ia32/lib -lcxa -lifcore -lcprts -lm
>>>>
>>>> ../../../.././ncarview/src/lib/libictrans/libictrans.o: In function
>>>> `giargs_':
>>>> (.text+0x6eb5): undefined reference to `for_cpystr'
>>>> [...]
>>>> CTOFLIBS = -L/opt/1/intel_cc_10.1/ia32/lib -lcxa -lifcore -lcprts
>>>> -lm
>>>
>>> It would appear that you've done this, based on the output from the
>>> compilation and your Makefile. Could you
>>> please send along your 'LINUX' config file, located in:
>>> /path/to/ncl_source_code/ncarg/config/LINUX ?
>>>
>>> Also, as was pointed out to me by a user, strictly speaking, the
>>> references to libraries 'cxa' and 'cprts' are not
>>> necessary, but shouldn't hurt either.
>>>
>>> One other thing to verify, as we cannot duplicate your host here, is
>>> that there is indeed a 'libifcore.a' located
>>> in /opt1/intel_cc_10.1/ia32/lib -- that directory seems, by its
>>> name, to refer to the Intel C compiler library, and
>>> 'libifcore.a' is an Intel Fortran compiler library. Is there a
>>> directory similarly named that refers to the Fortran compiler
>>> present in /opt1 ?
>>>
>>
>> I am having this same problem. I was talking offline with Mary about
>> this. The library libifcore.a is a fortran library, not a C library. In
>> Intel compiler versions 8 through 10 (didn't check back further), it is
>> not included in the C compiler. One solution to this problem is to
>> replace the linker icc with "ifort -nofor-main".
>>
>>
>> Craig
>>
>>
>>
>>
>>> ---- Rick Grubin NCAR/TDD/CISL/VETS
>>> Visualization + Enabling Technologies
>>> grubin_at_ucar.edu 303.497.1832
>>>
>>>
>>> _______________________________________________
>>> ncl-install mailing list
>>> ncl-install_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>>
>>
>> --
>> Craig Tierney (craig.tierney_at_noaa.gov)
>> _______________________________________________
>> ncl-install mailing list
>> ncl-install_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-install
>>

-- 
Craig Tierney (craig.tierney_at_noaa.gov)
Received on Wed Apr 16 2008 - 12:01:51 MDT

This archive was generated by hypermail 2.2.0 : Sun Apr 20 2008 - 07:42:57 MDT