Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29393 Discussions

Problem while compiling IOAPI library with intel fortran compiler 11.0

cmaheshwari16
Beginner
2,849 Views
Hi ,

While compiling the IOAPI library I get the below error.
The libioapi.a is very well created but the m3tools folder is creating some problems.

now when I do
make -f Makefile nocpl

It gives

*******************************************************************************************

ar: creating libioapi.a
a - bilin.o
a - bmatvec.o
a - chkfil3.o
a - ckdesc3.o
a - ckfile3.o
a - ckgeom.o
a - ckname.o
a - cktflag3.o
a - close3.o
a - crdict3.o
a - crtbuf3.o
a - currstep.o
a - dble2real.o
a - dmatvec.o
a - dscgrid.o
a - dt2str.o
a - filchk3.o
a - m3utilio.o
a - matxatts.o
make[1]: Leaving directory `/home/PATH/IOAPI/ioapi'
(cd /home/PATH/IOAPI/notcdf ; make all)
make[1]: Entering directory `/home/PATH/IOAPI/notcdf'

make[1]: Entering directory `/home/PATH/IOAPI/notcdf'
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ifort -auto -cm -w90 -w95 -warn notruncated_source -Bstatic -c -I/home/PATH/IOAPI/ioapi -O3 -no-fp-port -unroll -stack_temps -safe_cray_ptr -tpp7 -traceback -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DAVOID_FLUSH=1 -DBIT32=1 /home/PATH/IOAPI/notcdf/notcdf.f
ifort: command line remark #10148: option '-tp' not supported
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ar rv libnotcdf.a notcdf.o; echo 'To use the "notCDF" interface, you must > MANUALLY < copy'; echo '"libnotcdf.a" to "libnetcdf.a" in directory '/home/PATH/IOAPI/Linux2_x86_64ifort
r - notcdf.o
To use the "notCDF" interface, you must > MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64ifort
make[1]: Leaving directory `/home/PATH/IOAPI/notcdf'
(cd /home/PATH/IOAPI/m3tools ; make -f Makefile.nocpl all)
make[1]: Entering directory `/home/PATH/IOAPI/m3tools'
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ifort -auto -cm -w90 -w95 -warn notruncated_source -Bstatic /home/PATH/IOAPI/Linux2_x86_64ifort/bcwndw.o /home/PATH/IOAPI/Linux2_x86_64ifort/bcstep.o -L/home/PATH/IOAPI/Linux2_x86_64ifort -lioapi -lnetcdf -openmp -Vaxlib -Bstatic -o bcwndw
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(desc3.o): In function `desc3_':
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x287): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x467): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x62f): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x7f7): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x9bb): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0xb7f): undefined reference to `ncagt_'
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(desc3.o):/home/PATH/IOAPI/ioapi/desc3.F:(.text+0xd43): more undefined references to `ncagt_' follow
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(desc3.o): In function `desc3_':
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x10cf): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x129b): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x1467): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x16ab): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x16ab): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x189c): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x1c58): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x1e9b): undefined reference to `ncanam_'
/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x20ef): undefined reference to `ncagt_'
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(init3.o): In function `init3_':
/home/PATH/IOAPI/ioapi/init3.F:(.text+0x8e): undefined reference to `ncpopt_'
/home/PATH/IOAPI/ioapi/init3.F:(.text+0xa1): undefined reference to `nf_inq_libvers_'
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(open3.o): In function `open3_':
/home/PATH/IOAPI/ioapi/open3.F:(.text+0x702): undefined reference to `ncclos_'
/home/PATH/IOAPI/ioapi/open3.F:(.text+0x724): undefined reference to `ncclos_'
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(opnfil3.o): In function `opnfil3_':
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xdd): undefined reference to `nf_open_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x122): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x15b): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x1d4): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x20d): undefined reference to `ncagt_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x246): undefined reference to `ncagt_'
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(opnfil3.o):/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x27f): more undefined references to `ncagt_' follow
/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(opnfil3.o): In function `opnfil3_':
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x5a4): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x5cc): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x5fe): undefined reference to `ncdid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x63b): undefined reference to `ncdinq_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x852): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x8ca): undefined reference to `ncagtc_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x949): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0x9d3): undefined reference to `ncvinq_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xa34): undefined reference to `ncsnc_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xa5d): undefined reference to `ncclos_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xad1): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xb03): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xb35): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xb67): undefined reference to `ncvid_'
/home/PATH/IOAPI/ioapi/opnfil3.F:(.text+0xb95): undefined reference to `ncvid_'


and many more.


Can anyone please tell whats the problem.

I tried the option -assume nounderscore with the ifort compiler, also then it gives:

MEASSAGES.......

ar: creating libioapi.a
a - bilin.o
a - bmatvec.o
a - chkfil3.o
a - ckdesc3.o
a - ckfile3.o
a - ckgeom.o
a - ckname.o
a - cktflag3.o
a - close3.o
a - crdict3.o
a - crtbuf3.o
a - currstep.o
a - dble2real.o
a - dmatvec.o
a - dscgrid.o
a - dt2str.o
a - filchk3.o

a - time2secc.o
a - wkdayc.o
a - wratt3c.o
a - write3c.o
a - write4dc.o
a - xtract3c.o
a - m3utilio.o
a - matxatts.o

[MANY MORE .O FILES CREATED]

make[1]: Leaving directory `/home/PATH/IOAPI/ioapi'
(cd /home/PATH/IOAPI/notcdf ; make all)
make[1]: Entering directory `/home/PATH/IOAPI/notcdf'
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ifort -assume nounderscore -auto -cm -w90 -w95 -warn notruncated_source -Bstatic -c -I/home/PATH/IOAPI/ioapi -assume nounderscore -O3 -no-fp-port -unroll -stack_temps -safe_cray_ptr -tpp7 -traceback -DAUTO_ARRAYS=1 -DF90=1 -DFLDMN=1 -DFSTR_L=int -DIOAPI_NO_STDOUT=1 -DAVOID_FLUSH=1 -DBIT32=1 /home/PATH/IOAPI/notcdf/notcdf.f
ifort: command line remark #10148: option '-tp' not supported
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ar rv libnotcdf.a notcdf.o; echo 'To use the "notCDF" interface, you must > MANUALLY < copy'; echo '"libnotcdf.a" to "libnetcdf.a" in directory '/home/PATH/IOAPI/Linux2_x86_64ifort
r - notcdf.o
To use the "notCDF" interface, you must > MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64ifort
make[1]: Leaving directory `/home/PATH/IOAPI/notcdf'
(cd /home/PATH/IOAPI/m3tools ; make -f Makefile.nocpl all)
make[1]: Entering directory `/home/PATH/IOAPI/m3tools'
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ifort -assume nounderscore -auto -cm -w90 -w95 -warn notruncated_source -Bstatic /home/PATH/IOAPI/Linux2_x86_64ifort/bcwndw.o /home/PATH/IOAPI/Linux2_x86_64ifort/bcstep.o -L/home/garuda/garuda3/Chandan/STE
To use the "notCDF" interface, you must > MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64ifort
make[1]: Leaving directory `/home/PATH/IOAPI/notcdf'
(cd /home/PATH/IOAPI/m3tools ; make -f Makefile.nocpl all)
make[1]: Entering directory `/home/PATH/IOAPI/m3tools'
cd /home/PATH/IOAPI/Linux2_x86_64ifort; ifort -assume nounderscore -auto -cm -w90 -w95 -warn notruncated_source -Bstatic /home/PATH/IOAPI/Linux2_x86_64ifort/bcwndw.o /home/PATH/IOAPI/Linux2_x86_64ifort/bcstep.o -L/home/PATH/IOAPI/Linux2_x86_64ifort -lioapi -lnetcdf -openmp -Vaxlib -Bstatic -o bcwndw
/home/PATH/IOAPI/Linux2_x86_64ifort/bcwndw.o: In function `MAIN__':
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x5f): undefined reference to `init3_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x68c): undefined reference to `promptmfile_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x6eb): undefined reference to `open3_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x742): undefined reference to `m3exit_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x756): undefined reference to `desc3_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x796): undefined reference to `trimlen_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x8dd): undefined reference to `m3exit_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x957): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x97b): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x98a): undefined reference to `time2sec_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x9a7): undefined reference to `sec2time_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x9d0): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x9e1): undefined reference to `time2sec_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x9f1): undefined reference to `time2sec_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xa35): undefined reference to `trimlen_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xa7b): undefined reference to `trimlen_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xc45): undefined reference to `trimlen_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xe12): undefined reference to `getstr_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xe59): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xe96): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0xec4): undefined reference to `getnum_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x118b): undefined reference to `m3exit_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x121c): undefined reference to `m3exit_'
/home/PATH/IOAPI/m3tools/bcwndw.f:(.text+0x12ad): undefined reference to `m3exit_'
/home/PATH/IOAPI/Linux2_x86_64ifort/bcstep.o: In function `bcstep_':
/home/PATH/IOAPI/m3tools/bcstep.F:(.text+0x1b4): undefined reference to `read3_'
/home/PATH/IOAPI/m3tools/bcstep.F:(.text+0x5fb): undefined reference to `write3_'
/home/PATH/IOAPI/m3tools/bcstep.F:(.text+0x6dd): undefined reference to `m3exit_'
/home/PATH/IOAPI/m3tools/bcstep.F:(.text+0x75e): undefined reference to `m3exit_'
make[1]: *** [bcwndw] Error 1
make[1]: Leaving directory `/home//IOAPI/m3tools'
make: *** [nocpl] Error 2


CAN ANYONE PLEASE TELL WHAT SHOULD i DO??
THANKS
0 Kudos
6 Replies
Kevin_D_Intel
Employee
2,849 Views

I don't believe the issue is the underscores so you should remove the -assume nounderscoreoption you added.

It appears the undefined references occur because no libnetcdf.a was found in accordance with the -lnetcdf link option. Perhaps that is because you didn't follow the instruction given by the make where it says:

To use the "notCDF" interface, you must > MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64

If you did not do this, then copy the library to the new name as instructed above and then rerun the make.

0 Kudos
cmaheshwari16
Beginner
2,849 Views
Thanks Kevin,
for your quick reply. Actually I used both the option with and without -assume underscore.
As you can see both the outputs I have given.


[bash]To use the "notCDF" interface, you must > MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64

If you did not do this, then copy the library to the new name as instructed above and then rerun the make.[/bash]
Also libnetcdf.a file I have copied to
[bash]/home/PATH/IOAPI/Linux2_x86_64

But I do not understand the meaning of
MANUALLY < copy
"libnotcdf.a" to "libnetcdf.a" in directory /home/PATH/IOAPI/Linux2_x86_64
because libnotcdf.a is generated at the time of compilation,
and how to copy
"libnotcdf.a" to "libnetcdf.a"

[/bash]
0 Kudos
Kevin_D_Intel
Employee
2,849 Views

The undefined reference error is more typical of a missing library or missing routines so an option that alters the name decoration of external routine names will not help in the case of a missing library or routines. You should only use such an option if you know for certain names are decorated accordingly, otherwise, you should pursue the undefined reference as a missing library or missing routines and try to determine the root-cause.

It appears in the initial failed link that the missing routines (like desc3_, ncagtc_, ncagt_, ncanam_) are NETCDF routines, so if you saying you have a copy of libnetcdf.a, then I expect you would ignore the message to use the libnotcdf.a.

First, double check that you copied libnetcdf.a into: /home/PATH/IOAPI/Linux2_x86_64ifort

Next, try to determine whether it provides those external names indicated in the errors for the initial link attempt or not. You might try something like:

nm /home/PATH/IOAPI/Linux2_x86_64ifort/libnetcdf.a | grep -i ncanam

You could search for any of the undefined references from your initial failed link.

If you are not finding those routine names in your libnetcdf.a then that would explain the errors and youll have to determine why that is and see if you obtained or created the version you need.

0 Kudos
cmaheshwari16
Beginner
2,849 Views
I dont believe that there are some problems with the netCDF library. Because one of my application that is using the netCDF is working perfectly fine and not giving any error. But this time when I am copiling the IOAPI library its showing these references errors[underscore.

First, double check that you copied libnetcdf.a into: /home/PATH/IOAPI/Linux2_x86_64ifort

I have copied the libnetcdf* from the lib folder of the netCDF installed library to the /home/PATH/IOAPI/Linux2_x86_64ifort


There are some of the outputs

[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i ncanam
0000000000000310 T ncanam_
[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i ncanam
0000000000000310 T ncanam_
[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i desc3
[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i desc3_
[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i ncagtc_
00000000000005d0 T ncagtc_

*****************************************************************************************************************************

As you can see from my 1st post [where i have given two outputs of the compilation , one with using assume underscore and another without underscore.] all the undefined references says that it is from main__.


see the process is that ioapi has different folders which gets compiled one by one.
first ioapi folder is compiled which creates libioapi.a with some .o files.

then notcdf folder .f and .c files are compiled that used this libioapi.a and creates libnotcdf.a

then m3tools folder .f and .C files are compiles that also uses the above .a files and then creates its own .o files now in this step there is some problem in the communication between .f and .c files.

I dont know much about this. but I feel that this is the cause.if you want i can give you the complete log file of the compilation.

Can you once help me to find how to compile IOAPI libraries with intel fortran compiler 11.0.

my uname -a is
Linux blr.tfg 2.6.18-53.1.4.el5 #1 SMP Thu Nov 29 12:18:58 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

and the compiler version is
ifort -v
Version 11.0

mpiifort -v
mpiifort for the Intel MPI Library 3.2.1 for Linux*
Copyright(C) 2003-2009, Intel Corporation. All rights reserved.
Version 11.0

I dont have PVM libraries in the system

so admin told me to use
/opt/intel/impi/3.2.2.006/bin64/mpiicc


IOAPI version I am using is

ioapi3.0
Fri Jul 23 08:18:38 EDT 2010

******************************************************************************************************************

Can you please tellme the step by step of how to compile IOAPI library.
I got one refrence from

http://www.cmascenter.org/help/model_docs/cmaq/4.6/IOAPI.txt

Thanks





0 Kudos
Kevin_D_Intel
Employee
2,849 Views

First, I agree, your libndtcdf.a looks valid.

Next, the *first* failed link you show does not say MAIN__ and theres no evidence -assume nounderscore was used in at least the link command shown which I assume probably reflects compiler options used for compilations that come before this link.

The *second* failed link you show does say MAIN__ and that's because you compiled with -assume nounderscore which is inappropriate option to be using here.

The undefined references for the *first* failed link originate from libioapi.a routines. The entry points you just showed that exist in your libnetcdf.a have a trailing underscore and those names match the undefined references reported in the *first* failed link.

For example, you show this entry point:

[garuda3@gg-blr IOAPI]$ nm Linux2_x86_64ifort/libnetcdf.a | grep -i ncanam
0000000000000310 T ncanam_

And from the first failed link, routine 'desc3_' from libioapi.a was seeking this routine. Here are the salient lines from the *first* failed link:

/home/PATH/IOAPI/Linux2_x86_64ifort/libioapi.a(desc3.o): In function `desc3_':

/home/PATH/IOAPI/ioapi/desc3.F:(.text+0x1e9b): undefined reference to `ncanam_'


This all suggests the libnetcdf.a contains the routines needed but for some unknown reason the library was unavailable when the link for the m3tool named "bcwndw" executed which resulted in the undefined references.

The entries you show that exist in your libnetcdf.a using 'nm' also demonstrates that you do not want to compile with -assume nounderscore, so please forget about the output you received when using that option as it is not applicable and please do not use the option.

Youwill need to focus on the link for the m3tool "bcwndw" to determine why it did not pick up the libnetcdf.a that you placed into the designated directory. I'm sorry, I do not have all the required components to be able to attempt building this library to offer you step by step help. From what you have shown in the *first* failed link, it seems the root-cause is that the libnetcdf.a is justnot getting found during the link.

The two attached logs where created when compiling with -assume nounderscore so they shown the same erroneous undefined references. I also noted the two logs have slightly different paths, intentional on your part I'm sure, but just wanting to note that to make sure libnetcdf* files were copied down both paths.

One uses: /home/PATH/IOAPI/Linux2_x86_64ifort/
The other: /homePATH/IOAPI/Linux2_x86_64ifort/

0 Kudos
cmaheshwari16
Beginner
2,849 Views
happy new year to you and ur family.....

Well coming to the point , if you are saying that there is no need to give the option -assume nounderscore.

so that means that the second file that I have given in which no option is used is to be taken care of and the errors to be handled.

So can you please tell me that what should I do to compile IOAPI successfully.....
also dont get confused with the path they both have the sme path just "/" is replaced by mistaken.....


the libnetcdf* is copied in the reqd folder..... also the netcdf libraries is compiled successfully as one of my model that used this library is successfully running.


can u provide some documentation in which there is a step by step procedure to compile IOAPI....

Also if the model is successfully running with using libnetcdf* , then it sures that there is no problem with these files.
0 Kudos
Reply