<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using static library: piculiar problem in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740369#M303</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/271365"&gt;roddur&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Ok,&lt;BR /&gt;thanks!!&lt;BR /&gt;But I am confused!! As you can see from the make file, these routines are in different folder(LMTO-A and LMTO-B), but yes...under these folder everything is same.......it do not take into consideration that main folder is different? why this is so?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;The folder location is not preserved by the compiler. It also doesn't matter that the same named routines are placed into physically different static libs. The source is compiled into an object form (.o). The object contains only the routine name(s) as declared within the source (and following OS specific upper/lower case convention).&lt;BR /&gt;&lt;BR /&gt;This is just the way things are designed. It would be a nightmare to maintain source code if folder names were somehow folded into the procedure's name in the object. &lt;BR /&gt;&lt;BR /&gt;Think about your case. You would not be able to simply have: &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CALL lm_a(&lt;THE long="" argument="" list=""&gt;)&lt;BR /&gt;&lt;/THE&gt;&lt;/STRONG&gt;&lt;BR /&gt;You'd have to modify your source to be:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CALL /home/rudra/LMTO-A/lm_a( &lt;THELONG argument="" list=""&gt;)&lt;BR /&gt;&lt;/THELONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;Or something similar, right?&lt;BR /&gt;&lt;BR /&gt;And what happens when you move the source containing procedure lm_a? You have to modify your source that calls the routine.&lt;BR /&gt;&lt;BR /&gt;I'm not sure of your needs, but if you have procedures that are in common between the two paths through your program, then consider creating a third library, call it liblm_c.a, that contains only these common routines. This would then only require you change the source to any common procedure in one place to pick up a change applicable to either execution path.&lt;BR /&gt;&lt;BR /&gt;Splitting out the common routines also makes liblm_a and liblm_b truly unique to the "a" and "b" paths in your program and probably makes them much smaller since each only contains routines unique to each path. You could even go a bit further perhaps if the uniqueness of these routines to the "a" and "b" paths includes procedure names, in which case all these unique procedures could actually live in one library as well since there would be no name clashes.&lt;BR /&gt;&lt;BR /&gt;Anyway, hope this helps.</description>
    <pubDate>Mon, 26 Oct 2009 15:55:05 GMT</pubDate>
    <dc:creator>Kevin_D_Intel</dc:creator>
    <dc:date>2009-10-26T15:55:05Z</dc:date>
    <item>
      <title>Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740359#M293</link>
      <description>Dear friends,&lt;BR /&gt;In my code, I want to use two static libray(which generally do the same work, but from two different dir.) generated using makefile:&lt;BR /&gt;&lt;BR /&gt; ar -rcs liblm_a.a lm-lib.o lm-lib-end.o $(lmobj) ...from LMTO_A&lt;BR /&gt;and &lt;BR /&gt; ar -rcs liblm_b.a lm-lib.o lm-lib-end.o $(lmobj) ...from LMTO_B&lt;BR /&gt;&lt;BR /&gt;Now while "make"ing it, by&lt;BR /&gt; irun: $(FOBJ)&lt;BR /&gt; $(FC) $(FFLAGS) $(FPAR) -o $@  $(FOBJ) -L/home/rudra/LMTO-A -llm_a -L/home/rudra/LMTO-B/ -llm_b&lt;BR /&gt;&lt;BR /&gt;i am facing a problem that the output comes like:&lt;BR /&gt;&lt;BR /&gt;LM  A called&lt;BR /&gt; Inside finits&lt;BR /&gt; /home/rudra/Recursion/ASR/CTRL_A&lt;BR /&gt; Hera I am&lt;BR /&gt; INITLG: redirect output to file: LM  &lt;BR /&gt; INITLG: redirect error messages to file: ERR &lt;BR /&gt; lm-lib A Done&lt;BR /&gt; Starting LMTO_B&lt;BR /&gt; LM  B called&lt;BR /&gt; Inside finits&lt;BR /&gt; /home/rudra/Recursion/ASR/CTRL_A&lt;BR /&gt; Hera I am&lt;BR /&gt; INITLG: redirect output to file: LM  &lt;BR /&gt; INITLG: redirect error messages to file: ERR &lt;BR /&gt; OK&lt;BR /&gt; lm-lib B Done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;like this.....which shows, the execution goes to LM_A and LM_B but as you can see, writes same directory: &lt;BR /&gt;/home/rudra/Recursion/ASR/CTRL_A&lt;BR /&gt;which should be actually  /home/rudra/Recursion/ASR/CTRL_B in LM_B&lt;BR /&gt;&lt;BR /&gt;what is peculiar is if I jus inverse the order of linking the library, like&lt;BR /&gt;irun: $(FOBJ)&lt;BR /&gt; $(FC) $(FFLAGS) $(FPAR) -o $@  $(FOBJ) -L/home/rudra/LMTO-B/ -llm_b -L/home/rudra/LMTO-A -llm_a &lt;BR /&gt;&lt;BR /&gt;then the output comes:&lt;BR /&gt;LM  A called&lt;BR /&gt; B-inits&lt;BR /&gt; /home/rudra/Recursion/ASR/CTRL_B&lt;BR /&gt; lm-lib A Done&lt;BR /&gt; Starting LMTO_B&lt;BR /&gt; LM  B called&lt;BR /&gt; B-inits&lt;BR /&gt; /home/rudra/Recursion/ASR/CTRL_B&lt;BR /&gt; lm-lib B Done&lt;BR /&gt;&lt;BR /&gt;I have no idea of what is going on.....can you plz suggest something? If necessary, my system is(testbench, tested on other also, with same result):&lt;BR /&gt;$ uname -a&lt;BR /&gt;Linux roddur 2.6.30.8-64.fc11.i686.PAE #1 SMP Fri Sep 25 04:56:58 EDT 2009 i686 i686 i386 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;$ ifort -v&lt;BR /&gt;Version 11.1 &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 24 Oct 2009 16:45:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740359#M293</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-24T16:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740360#M294</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Looks like maybe you have a like named procedure present in both libraries and the one that is called depends on the link order of your two libraries.&lt;BR /&gt;&lt;BR /&gt;I can't really guess from your output what the procedure name is, but it seems to be the one writing "Inside finits" (in the case lib liblm_a.a) and "B-inits" (in the case lib liblm_b.a).&lt;BR /&gt;&lt;BR /&gt;If you expect each library to initialize differently when called then the cannot share the same initialization procedure name.&lt;BR /&gt;&lt;BR /&gt;You could verify from which library the routine is linked from by generating a link map for the final executableusing the ifort &lt;STRONG&gt;-Wl &lt;/STRONG&gt;option to pass the linker (ld) &lt;STRONG&gt;-Map&lt;/STRONG&gt; option like this:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;iforthello.f90 -Wl,-Map,hello.map&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;This command generates the link map named hello.map&lt;BR /&gt;</description>
      <pubDate>Sun, 25 Oct 2009 11:40:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740360#M294</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-25T11:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740361#M295</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/335337"&gt;Kevin Davis (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; You could verify from which library the routine is linked from by generating a link map for the final executableusing the ifort &lt;STRONG&gt;-Wl &lt;/STRONG&gt;option to pass the linker (ld) &lt;STRONG&gt;-Map&lt;/STRONG&gt; option like this:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;iforthello.f90 -Wl,-Map,hello.map&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;This command generates the link map named hello.map&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;This is a bit problematic as the libraries discussed here is of 55k &lt;BR /&gt; lines. in the main code i have called them as: &lt;BR /&gt; !the lmto library function                       ! &lt;BR /&gt; &lt;/SPAN&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;!Function for atom A &lt;BR /&gt; call lm_a(oidxdn,opnu,opold,oqnu,oqold,        &amp;amp; &lt;BR /&gt; clabl_1,lmx,w_oidn,w_opp,w_oqnu,w_oqold,            &amp;amp; &lt;BR /&gt; d_ialpha,d_ifmt3d,d_itrans,d_jbasdn,d_ldn,d_lmaxw,       &amp;amp; &lt;BR /&gt; d_ltmax,d_mdn,d_mmixat,d_mmixpq,d_nbas,d_nclass,d_ndimin,    &amp;amp; &lt;BR /&gt; d_ngen,d_nit,d_nitat,d_niter,d_nkdmx,d_nkxyz,d_nl,d_nopts,   &amp;amp; &lt;BR /&gt; d_norder,d_npts,d_nrxc,d_nrxyz,d_nsp,              &amp;amp; &lt;BR /&gt; d_as,d_beta,d_dele,d_deltr,d_efermi,d_kap2,d_kfit,       &amp;amp; &lt;BR /&gt; d_emax,d_emaxc,d_emin,d_eminc,d_eps,d_facvol,d_gamma,d_ommax1, &lt;BR /&gt; &amp;amp; &lt;BR /&gt; d_ommax2,d_range,d_rmaxes,d_rmaxs,d_rmaxs2,d_rmines,d_rms2,   &amp;amp; &lt;BR /&gt; d_rmsdel,d_tolef,d_toleto,d_tolews,d_vmtz,d_wc,d_width,sw13) &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;write(*,*) "Starting LMTO_B" &lt;BR /&gt; !Function for atom B &lt;BR /&gt; call lm_b(oidxdn,opnu,opold,oqnu,oqold,         &amp;amp; &lt;BR /&gt; clabl_1,lmx,w_oidn,w_opp,w_oqnu,w_oqold,            &amp;amp; &lt;BR /&gt; d_ialpha,d_ifmt3d,d_itrans,d_jbasdn,d_ldn,d_lmaxw,       &amp;amp; &lt;BR /&gt; d_ltmax,d_mdn,d_mmixat,d_mmixpq,d_nbas,d_nclass,d_ndimin,    &amp;amp; &lt;BR /&gt; d_ngen,d_nit,d_nitat,d_niter,d_nkdmx,d_nkxyz,d_nl,d_nopts,   &amp;amp; &lt;BR /&gt; d_norder,d_npts,d_nrxc,d_nrxyz,d_nsp,              &amp;amp; &lt;BR /&gt; d_as,d_beta,d_dele,d_deltr,d_efermi,d_kap2,d_kfit,       &amp;amp; &lt;BR /&gt; d_emax,d_emaxc,d_emin,d_eminc,d_eps,d_facvol,d_gamma,d_ommax1, &lt;BR /&gt; &amp;amp; &lt;BR /&gt; d_ommax2,d_range,d_rmaxes,d_rmaxs,d_rmaxs2,d_rmines,d_rms2,   &amp;amp; &lt;BR /&gt; d_rmsdel,d_tolef,d_toleto,d_tolews,d_vmtz,d_wc,d_width,sw13) &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;! &lt;BR /&gt; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~! &lt;BR /&gt; and filenames are hard coded as: &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt; write(*,*)"Inside finits" &lt;BR /&gt; lmdir="/home/rudra/Recursion/ASR/" &lt;BR /&gt; atspec="A" &lt;BR /&gt; cband=lmdir//'BAND_'//atspec; cbnds=lmdir//'BNDS_'//atspec; &lt;BR /&gt; cbak =lmdir//'CBAK_'//atspec; cctrl=lmdir//'CTRL_'//atspec; &lt;BR /&gt; cdos =lmdir//'DOS_'//atspec; ceign=lmdir//'EIGN_'//atspec; &lt;BR /&gt; celf =lmdir//'ELF_'//atspec; celfc=lmdir//'ELFC_'//atspec; &lt;BR /&gt; celfv=lmdir//'ELFV_'//atspec; cinit=lmdir//'INIT_'//atspec; &lt;BR /&gt; clmdm=lmdir//'LMDM_'//atspec; clmfs=lmdir//'LMFS_'//atspec; &lt;BR /&gt; cmixm=lmdir//'MIXM_'//atspec; cmoms=lmdir//'MOMS_'//atspec; &lt;BR /&gt; cnalp=lmdir//'NALP_'//atspec; cnilp=lmdir//'NILP_'//atspec; &lt;BR /&gt; cnspt=lmdir//'NSPT_'//atspec; cpot =lmdir//'POT_'//atspec; &lt;BR /&gt; cpoti=lmdir//'POTI_'//atspec; crho =lmdir//'RHO_'//atspec; &lt;BR /&gt; crhof=lmdir//'RHOF_'//atspec; crhoc=lmdir//'RHOC_'//atspec; &lt;BR /&gt; crhos=lmdir//'RHOS_'//atspec; crhov=lmdir//'RHOV_'//atspec; &lt;BR /&gt; cstr =lmdir//'STR_'//atspec; cstr0=lmdir//'STR0_'//atspec; &lt;BR /&gt; cstr1=lmdir//'STR1_'//atspec; ctmp =lmdir//'TMP_'//atspec; &lt;BR /&gt; write(*,*) cctrl &lt;BR /&gt; C --- Set up the file logical units --- &lt;BR /&gt; ifi=fadd(cband,4) &lt;BR /&gt; ifi=fadd(cbnds,0) &lt;BR /&gt; ifi=fadd(cbak, 0) &lt;BR /&gt; ifi=fadd(cctrl,0) &lt;BR /&gt; ifi=fadd(cdos, 4) &lt;BR /&gt; ifi=fadd(ceign,4) &lt;BR /&gt; ifi=fadd(celf, 0) &lt;BR /&gt; ifi=fadd(celfc,0) &lt;BR /&gt; ifi=fadd(celfv,0) &lt;BR /&gt; ifi=fadd(cinit,0) &lt;BR /&gt; ifi=fadd(clmdm,4) &lt;BR /&gt; ifi=fadd(clmfs,0) &lt;BR /&gt; ifi=fadd(cmixm,4) &lt;BR /&gt; ifi=fadd(cmoms,4) &lt;BR /&gt; which gives the name of the files. &lt;BR /&gt; in ifort, i have tried to compile with &lt;BR /&gt; irun: $(FOBJ) &lt;BR /&gt; $(FC) $(FFLAGS) $(FPAR) -o $@ $(FOBJ) -L/home/rudra/LMTO-A -L/home/rudra/LMTO-B -llm_b -llm_a -Wl, -Map, hello.map &lt;BR /&gt; and hello.map shows result like: &lt;BR /&gt; $ grep liblm_b hello.map |wc -l &lt;BR /&gt; 1691 &lt;BR /&gt; and &lt;BR /&gt; $ grep liblm_a hello.map |wc -l &lt;BR /&gt; 9 &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="fixed_width" style="font-family: Courier,Monospaced;"&gt;which should be same. &lt;BR /&gt; how to get pass this? &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2009 09:20:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740361#M295</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T09:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740362#M296</link>
      <description>&lt;BR /&gt;The snippets show calling different named routines so the link map idea isn't useful in hunting down your initial concern. If you believe the number of instances of the library name in the link map should be equal (when they clearly are not) then you should look at the details of link map and determine why more routines are resolved from liblm_b vs. liblm_a. All I can guess is that you have like named routines residing in these libraries and the linker resolves external reference from the first instance of the name found when searching libraries to resolve external references. Given that liblm_b is specified first, like named routines between these libraries will be resolved from liblm_b.&lt;BR /&gt;&lt;BR /&gt;As for the source snippet shown, do you perhaps assign atspec in both procedures lm_a and lm_b as:&lt;BR /&gt;&lt;BR /&gt;atspec="A"&lt;BR /&gt;&lt;BR /&gt;Curious also, your comment refers to them as "Function for", but invocation is via CALL. I assume both are declared as SUBROUTINE and not FUNCTION.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Oct 2009 10:16:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740362#M296</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-26T10:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740363#M297</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
&lt;EM&gt;&lt;/EM&gt;
&lt;PRE&gt;[cpp]As for the source snippet shown, do you perhaps assign atspec in both procedures lm_a and lm_b as:

atspec="A"
[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;yes...i have done that, as:&lt;BR /&gt;
&lt;PRE&gt;[cpp] write(*,*)"Inside finits" &lt;BR /&gt;        lmdir="/home/rudra/Recursion/ASR/"&lt;BR /&gt;        atspec="A"  &lt;BR /&gt;        cband=lmdir//'BAND_'//atspec; cbnds=lmdir//'BNDS_'//atspec;&lt;BR /&gt;[/cpp]&lt;/PRE&gt;
&lt;EM&gt;is it wrong? how to fix that?&lt;BR /&gt;&lt;BR /&gt;Curious also, your comment refers to them as "Function for", but invocation is via CALL. I assume both are declared as SUBROUTINE and not FUNCTION.&lt;BR /&gt;&lt;BR /&gt;its my mistake; they are subroutines&lt;/EM&gt;</description>
      <pubDate>Mon, 26 Oct 2009 11:12:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740363#M297</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T11:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740364#M298</link>
      <description>There's nothing incorrect with the assignment and you can ignore my question. It doesn't make sense what I asked because if both libraries assigned "A" to atspec then the program would never print "CTRL_B" for the path as you showed earlier.&lt;BR /&gt;&lt;BR /&gt;I'm guessing in liblm_b, you assign atspec to "B", correct?&lt;BR /&gt;&lt;BR /&gt;Let's go back to the same named routine theory, because in re-reading your post I think what you showed is the entry call into each library (which is lm_a and lm_b) but that's probably not theinitialization routine that shares the same name.&lt;BR /&gt;&lt;BR /&gt;It appears the program only prints "Inside finits" from the initialization routine in liblm_a, is that correct?&lt;BR /&gt;It appears this same initialization routine from liblm_b prints "B-init", is that correct?&lt;BR /&gt;&lt;BR /&gt;So what's the name of the routine from each library that prints these unique statements?&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Oct 2009 12:08:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740364#M298</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-26T12:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740365#M299</link>
      <description>&lt;EM&gt;I'm guessing in liblm_b, you assign atspec to "B", correct?&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;yes&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;EM&gt;So what's the name of the routine from each library that prints these unique statements?&lt;/EM&gt; &lt;BR /&gt;it is IOLIB/finits.f&lt;BR /&gt;for liblm_a, it is:&lt;BR /&gt;
&lt;PRE&gt;[cpp]&lt;BR /&gt;     subroutine finits&lt;BR /&gt;C- Machine and compiler-dependent initialization&lt;BR /&gt;C-----------------------------------------------------------------------&lt;BR /&gt;      implicit none&lt;BR /&gt;C Local variables:&lt;BR /&gt;      integer fadd,ifi,ifree&lt;BR /&gt;      character*55 cmd&lt;BR /&gt;      character(26)::lmdir&lt;BR /&gt;      character(1)::atspec&lt;BR /&gt;        &lt;BR /&gt;        character(32)::cband,cbnds,cbak,cctrl,cdos,ceign,celf,celfc, &lt;BR /&gt;     .  celfv,cinit,clmdm,clmfs,cmixm,cmoms,cnalp,cnilp,cnspt,cpot,&lt;BR /&gt;     .  cpoti,crho,crhof,crhoc,crhos,crhov,cstr,cstr0,cstr1,ctmp&lt;BR /&gt;&lt;BR /&gt;        write(*,*)"Inside finits" &lt;BR /&gt;        lmdir="/home/rudra/Recursion/ASR/"&lt;BR /&gt;        atspec="A"  &lt;BR /&gt;        cband=lmdir//'BAND_'//atspec; cbnds=lmdir//'BNDS_'//atspec;&lt;BR /&gt;        cbak =lmdir//'CBAK_'//atspec; cctrl=lmdir//'CTRL_'//atspec;&lt;BR /&gt;        cdos =lmdir//'DOS_'//atspec;  ceign=lmdir//'EIGN_'//atspec;&lt;BR /&gt;        celf =lmdir//'ELF_'//atspec;  celfc=lmdir//'ELFC_'//atspec;&lt;BR /&gt;        celfv=lmdir//'ELFV_'//atspec; cinit=lmdir//'INIT_'//atspec;&lt;BR /&gt;        clmdm=lmdir//'LMDM_'//atspec; clmfs=lmdir//'LMFS_'//atspec;&lt;BR /&gt;        cmixm=lmdir//'MIXM_'//atspec; cmoms=lmdir//'MOMS_'//atspec;&lt;BR /&gt;        cnalp=lmdir//'NALP_'//atspec; cnilp=lmdir//'NILP_'//atspec;&lt;BR /&gt;        cnspt=lmdir//'NSPT_'//atspec; cpot =lmdir//'POT_'//atspec;&lt;BR /&gt;        cpoti=lmdir//'POTI_'//atspec; crho =lmdir//'RHO_'//atspec;&lt;BR /&gt;        crhof=lmdir//'RHOF_'//atspec; crhoc=lmdir//'RHOC_'//atspec;&lt;BR /&gt;        crhos=lmdir//'RHOS_'//atspec; crhov=lmdir//'RHOV_'//atspec;&lt;BR /&gt;        cstr =lmdir//'STR_'//atspec; cstr0=lmdir//'STR0_'//atspec;&lt;BR /&gt;        cstr1=lmdir//'STR1_'//atspec; ctmp =lmdir//'TMP_'//atspec;&lt;BR /&gt;        write(*,*) cctrl&lt;BR /&gt;C --- Set up the file logical units ---&lt;BR /&gt;      ifi=fadd(cband,4)&lt;BR /&gt;      ifi=fadd(cbnds,0)&lt;BR /&gt;      ifi=fadd(cbak, 0)&lt;BR /&gt;      ifi=fadd(cctrl,0)&lt;BR /&gt;      ifi=fadd(cdos, 4)&lt;BR /&gt;      ifi=fadd(ceign,4)&lt;BR /&gt;      ifi=fadd(celf, 0)&lt;BR /&gt;      ifi=fadd(celfc,0)&lt;BR /&gt;      ifi=fadd(celfv,0)&lt;BR /&gt;      ifi=fadd(cinit,0)&lt;BR /&gt;      ifi=fadd(clmdm,4)&lt;BR /&gt;      ifi=fadd(clmfs,0)&lt;BR /&gt;      ifi=fadd(cmixm,4)&lt;BR /&gt;      ifi=fadd(cmoms,4)&lt;BR /&gt;      ifi=fadd(cnalp,0)&lt;BR /&gt;      ifi=fadd(cnilp,0)&lt;BR /&gt;      ifi=fadd(cnspt,0)&lt;BR /&gt;      ifi=fadd(cpot, 0)&lt;BR /&gt;      ifi=fadd(cpoti,0)&lt;BR /&gt;      ifi=fadd(crho, 0)&lt;BR /&gt;      ifi=fadd(crhof,0)&lt;BR /&gt;      ifi=fadd(crhoc,0)&lt;BR /&gt;      ifi=fadd(crhos,0)&lt;BR /&gt;      ifi=fadd(crhov,0)&lt;BR /&gt;      ifi=fadd(cstr, 4)&lt;BR /&gt;      ifi=fadd(cstr0,4)&lt;BR /&gt;      ifi=fadd(cstr1,4)&lt;BR /&gt;      ifi=fadd(ctmp, 4)&lt;BR /&gt;&lt;BR /&gt;        write(*,*) "Hera I am"&lt;BR /&gt;300   format(' FINITS: free disc-space in KB: ',i10)&lt;BR /&gt;      end[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;&lt;EM&gt;&lt;BR /&gt;and for liblm_b, it is
&lt;/EM&gt;&lt;PRE&gt;&lt;EM&gt;[cpp]&lt;EM&gt; subroutine finits&lt;BR /&gt;C- Machine and compiler-dependent initialization&lt;BR /&gt;C-----------------------------------------------------------------------&lt;BR /&gt;      implicit none&lt;BR /&gt;C Local variables:&lt;BR /&gt;      integer fadd,ifi,ifree&lt;BR /&gt;      character*55 cmd&lt;BR /&gt;      character(1)::atspec&lt;BR /&gt;      character(26)::lmdir&lt;BR /&gt;        &lt;BR /&gt;      character(32)::cband,cbnds,cbak,cctrl,cdos,ceign,celf,celfc, &lt;BR /&gt;     .  celfv,cinit,clmdm,clmfs,cmixm,cmoms,cnalp,cnilp,cnspt,cpot,&lt;BR /&gt;     .  cpoti,crho,crhof,crhoc,crhos,crhov,cstr,cstr0,cstr1,ctmp&lt;BR /&gt;      external fadd,lsequ&lt;BR /&gt;&lt;BR /&gt;        write(*,*)"B-inits"&lt;BR /&gt;        lmdir="/home/rudra/Recursion/ASR/"&lt;BR /&gt;        atspec="B"  &lt;BR /&gt;        cband=lmdir//'BAND_'//atspec; cbnds=lmdir//'BNDS_'//atspec;&lt;BR /&gt;        cbak =lmdir//'CBAK_'//atspec; cctrl=lmdir//'CTRL_'//atspec;&lt;BR /&gt;        cdos =lmdir//'DOS_'//atspec;  ceign=lmdir//'EIGN_'//atspec;&lt;BR /&gt;        celf =lmdir//'ELF_'//atspec;  celfc=lmdir//'ELFC_'//atspec;&lt;BR /&gt;        celfv=lmdir//'ELFV_'//atspec; cinit=lmdir//'INIT_'//atspec;&lt;BR /&gt;        clmdm=lmdir//'LMDM_'//atspec; clmfs=lmdir//'LMFS_'//atspec;&lt;BR /&gt;        cmixm=lmdir//'MIXM_'//atspec; cmoms=lmdir//'MOMS_'//atspec;&lt;BR /&gt;        cnalp=lmdir//'NALP_'//atspec; cnilp=lmdir//'NILP_'//atspec;&lt;BR /&gt;        cnspt=lmdir//'NSPT_'//atspec; cpot =lmdir//'POT_'//atspec;&lt;BR /&gt;        cpoti=lmdir//'POTI_'//atspec; crho =lmdir//'RHO_'//atspec;&lt;BR /&gt;        crhof=lmdir//'RHOF_'//atspec; crhoc=lmdir//'RHOC_'//atspec;&lt;BR /&gt;        crhos=lmdir//'RHOS_'//atspec; crhov=lmdir//'RHOV_'//atspec;&lt;BR /&gt;        cstr =lmdir//'STR_'//atspec; cstr0=lmdir//'STR0_'//atspec;&lt;BR /&gt;        cstr1=lmdir//'STR1_'//atspec; ctmp =lmdir//'TMP_'//atspec;&lt;BR /&gt;         &lt;BR /&gt;C --- Set up the file logical units ---&lt;BR /&gt;      ifi=fadd(cband,4)&lt;BR /&gt;      ifi=fadd(cbnds,0)&lt;BR /&gt;      ifi=fadd(cbak, 0)&lt;BR /&gt;      ifi=fadd(cctrl,0)&lt;BR /&gt;      ifi=fadd(cdos, 4)&lt;BR /&gt;      ifi=fadd(ceign,4)&lt;BR /&gt;      ifi=fadd(celf, 0)&lt;BR /&gt;      ifi=fadd(celfc,0)&lt;BR /&gt;      ifi=fadd(celfv,0)&lt;BR /&gt;      ifi=fadd(cinit,0)&lt;BR /&gt;      ifi=fadd(clmdm,4)&lt;BR /&gt;      ifi=fadd(clmfs,0)&lt;BR /&gt;      ifi=fadd(cmixm,4)&lt;BR /&gt;      ifi=fadd(cmoms,4)&lt;BR /&gt;      ifi=fadd(cnalp,0)&lt;BR /&gt;      ifi=fadd(cnilp,0)&lt;BR /&gt;      ifi=fadd(cnspt,0)&lt;BR /&gt;      ifi=fadd(cpot, 0)&lt;BR /&gt;      ifi=fadd(cpoti,0)&lt;BR /&gt;      ifi=fadd(crho, 0)&lt;BR /&gt;      ifi=fadd(crhof,0)&lt;BR /&gt;      ifi=fadd(crhoc,0)&lt;BR /&gt;      ifi=fadd(crhos,0)&lt;BR /&gt;      ifi=fadd(crhov,0)&lt;BR /&gt;      ifi=fadd(cstr, 4)&lt;BR /&gt;      ifi=fadd(cstr0,4)&lt;BR /&gt;      ifi=fadd(cstr1,4)&lt;BR /&gt;      ifi=fadd(ctmp, 4)&lt;BR /&gt;&lt;BR /&gt;        write(*,*)cctrl&lt;BR /&gt;300   format(' FINITS: free disc-space in KB: ',i10)&lt;BR /&gt;      end&lt;/EM&gt;[/cpp]&lt;/EM&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Oct 2009 12:42:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740365#M299</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T12:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740366#M300</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
And as you suggest, I think adding the hello.map will be usefull....this is attached.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Oct 2009 12:48:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740366#M300</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740367#M301</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;The link map isn't really needed. Your previous posts shows why your program behaved in the manner it did. You have the same named routine, finits, defined in each library. The linker will only link in one instance of this routine, not both,and the one that's linked in will be the first one seen based on the link order of your libraries. That's why you saw the output you did when you rearranged the libraries for the link step.&lt;BR /&gt;&lt;BR /&gt;If you have other routines in these libraries that share the same names, and I suspect you do based on grep counts shown earlier, then the instance of the routine used will be the one that is seen first during the link step.&lt;BR /&gt;&lt;BR /&gt;The only way to accomplishwhat I think you are seekingis to rename the same named routines to be unique to the library, perhaps adding a suffix of "A" or "B", which is likely a lot of work.</description>
      <pubDate>Mon, 26 Oct 2009 13:31:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740367#M301</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-26T13:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740368#M302</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Ok,&lt;BR /&gt;thanks!!&lt;BR /&gt;But I am confused!! As you can see from the make file, these routines are in different folder(LMTO-A and LMTO-B), but yes...under these folder everything is same.......it do not take into consideration that main folder is different? why this is so?&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Oct 2009 13:43:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740368#M302</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T13:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740369#M303</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/271365"&gt;roddur&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Ok,&lt;BR /&gt;thanks!!&lt;BR /&gt;But I am confused!! As you can see from the make file, these routines are in different folder(LMTO-A and LMTO-B), but yes...under these folder everything is same.......it do not take into consideration that main folder is different? why this is so?&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;The folder location is not preserved by the compiler. It also doesn't matter that the same named routines are placed into physically different static libs. The source is compiled into an object form (.o). The object contains only the routine name(s) as declared within the source (and following OS specific upper/lower case convention).&lt;BR /&gt;&lt;BR /&gt;This is just the way things are designed. It would be a nightmare to maintain source code if folder names were somehow folded into the procedure's name in the object. &lt;BR /&gt;&lt;BR /&gt;Think about your case. You would not be able to simply have: &lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CALL lm_a(&lt;THE long="" argument="" list=""&gt;)&lt;BR /&gt;&lt;/THE&gt;&lt;/STRONG&gt;&lt;BR /&gt;You'd have to modify your source to be:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CALL /home/rudra/LMTO-A/lm_a( &lt;THELONG argument="" list=""&gt;)&lt;BR /&gt;&lt;/THELONG&gt;&lt;/STRONG&gt;&lt;BR /&gt;Or something similar, right?&lt;BR /&gt;&lt;BR /&gt;And what happens when you move the source containing procedure lm_a? You have to modify your source that calls the routine.&lt;BR /&gt;&lt;BR /&gt;I'm not sure of your needs, but if you have procedures that are in common between the two paths through your program, then consider creating a third library, call it liblm_c.a, that contains only these common routines. This would then only require you change the source to any common procedure in one place to pick up a change applicable to either execution path.&lt;BR /&gt;&lt;BR /&gt;Splitting out the common routines also makes liblm_a and liblm_b truly unique to the "a" and "b" paths in your program and probably makes them much smaller since each only contains routines unique to each path. You could even go a bit further perhaps if the uniqueness of these routines to the "a" and "b" paths includes procedure names, in which case all these unique procedures could actually live in one library as well since there would be no name clashes.&lt;BR /&gt;&lt;BR /&gt;Anyway, hope this helps.</description>
      <pubDate>Mon, 26 Oct 2009 15:55:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740369#M303</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-26T15:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740370#M304</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Yes, it really helped!! thanks a lot!!&lt;BR /&gt;first i was in the impression that changing the file name inside the folder will serve it.....but this is not!!! I have to change the toutines, just like finits_a(&lt;ARGUMENT list=""&gt;) and finits_b(&lt;ARGUMENT list=""&gt;), right?&lt;BR /&gt;&lt;BR /&gt;Or, for one suggestion! what this two library do is take to elements(A and B), it creates different folder, do some calculation (and writes the output in the file created by finits).&lt;BR /&gt;So, if I call the same library twice with atspec as a variable argument, will there be any such clash? I think no. But just want to ensure before I move,,,,,,&lt;BR /&gt;&lt;/ARGUMENT&gt;&lt;/ARGUMENT&gt;</description>
      <pubDate>Mon, 26 Oct 2009 21:45:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740370#M304</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-10-26T21:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using static library: piculiar problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740371#M305</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Glad to hear that helped. &lt;BR /&gt;&lt;BR /&gt;Yes, you are correct about needing to rename the routines finits_a/finits_b or follow your second ideaand only include one instance of finits in one of the libraries and use a variable argument for atspec. I think for overall clarity it would be best to have a single library containing the shared common routines only, but that's not required to get you past your immediate need.&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
      <pubDate>Tue, 27 Oct 2009 08:10:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-static-library-piculiar-problem/m-p/740371#M305</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-10-27T08:10:04Z</dc:date>
    </item>
  </channel>
</rss>

