<?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 Thank you very much for your in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026684#M109451</link>
    <description>&lt;P&gt;Thank you very much for your prompt reply!&lt;/P&gt;

&lt;P&gt;I have applied your recommendations could successfully built the program and make it run. So I am now ready for the next step: parallelization...&lt;/P&gt;

&lt;P&gt;I indeed inadvertently did not include i1mach.&lt;/P&gt;

&lt;P&gt;Regarding the PRIVATE statement, I used it to ensure that all variables and procedures/functions declared in the module have a separate copy for each thread of this (future) parallel section. But this statement indeed generated the error for DQAG. To work around this problem, I used PUBLIC :: DQAG. Is there any other way to ensure independent copies amongst threads of all involved variables, i.e., to avoid threads interaction on variables as I apparently had before?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2015 12:41:16 GMT</pubDate>
    <dc:creator>Frederic_A_</dc:creator>
    <dc:date>2015-06-05T12:41:16Z</dc:date>
    <item>
      <title>error LNK2019: unresolved external symbol using module</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026682#M109449</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I face a problem which I did not succeed to solve despite several trials based on clues found here and elsewhere on the internet…&lt;/P&gt;

&lt;P&gt;I gathered several functions and procedures in a module ‘mymod.f90'. Some of these procedures are calling other functions or procedures within the same module. I also have a program ‘myprog’ using the module. These files are in attachment.&lt;/P&gt;

&lt;P&gt;I compiled the module without error with ifort –c &amp;nbsp;mymod.f90 and get files ‘mymod.obj’ and ‘mymod.mod’ created&lt;/P&gt;

&lt;P&gt;Then, when I try to compile with ifort mymod.obj myprog.f I have the following errors:&lt;/P&gt;

&lt;P&gt;c:\Users&amp;gt;ifort mymod.obj myprog.f&lt;/P&gt;

&lt;P&gt;Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.202 Build 20140422&lt;/P&gt;

&lt;P&gt;Copyright (C) 1985-2014 Intel Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Microsoft (R) Incremental Linker Version 10.00.40219.01&lt;/P&gt;

&lt;P&gt;Copyright (C) Microsoft Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;-out:mymod.exe&lt;/P&gt;

&lt;P&gt;-subsystem:console&lt;/P&gt;

&lt;P&gt;mymod.obj&lt;/P&gt;

&lt;P&gt;myprog.obj&lt;/P&gt;

&lt;P&gt;mymod.obj : error LNK2019: unresolved external symbol I1MACH referenced in function MYMOD_mp_INTEXJX&lt;/P&gt;

&lt;P&gt;mymod.obj : error LNK2019: unresolved external symbol ZABS referenced in function MYMOD_mp_INTEXJX&lt;/P&gt;

&lt;P&gt;myprog.obj : error LNK2019: unresolved external symbol DQAG referenced in function MAIN__&lt;/P&gt;

&lt;P&gt;mymod.exe : fatal error LNK1120: 3 unresolved externals&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I could solve such errors by removing declarations of variables corresponding to call of functions defined within the module (e.g., variable D1MACH in lines 51,361, 1664,… and variable DGAMLN in lines 3261, 4459 and 4162 of module mymod), as recommended somewhere on this forum. Yet, this did not work for I1MACH and ZABS, for which I get type definition errors. For instance, when removing declaration of variable I1MACH at line 1067 of mymod, I get the following:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;c:\Users&amp;gt;ifort –c mymod.f90&lt;/P&gt;

&lt;P&gt;Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.3.202 Build 20140422&lt;/P&gt;

&lt;P&gt;Copyright (C) 1985-2014 Intel Corporation.&amp;nbsp; All rights reserved.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;mymod.f90(1094): error #6404: This name does not have a type, and must have an explicit type.&amp;nbsp;&amp;nbsp; [I1MACH]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K1 = I1MACH(15)&lt;/P&gt;

&lt;P&gt;-----------^&lt;/P&gt;

&lt;P&gt;mymod.f90(1116): error #6362: The data types of the argument(s) are invalid.&amp;nbsp;&amp;nbsp; [FLOAT]&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;BB=DBLE(FLOAT(I1MACH(9)))*0.5D0&lt;/P&gt;

&lt;P&gt;--------------------^&lt;/P&gt;

&lt;P&gt;compilation aborted for mymod.f90 (code 1)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Besides, I do not know how to solve the error for procedure DQAG called in myprog.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;For further information, the code works when compiling it with functions and procedures in separate files. Yet, I decided to use a module as I got problem when attempting to parallelize the code with OpenMP (i.e. the ‘do loop’ at line 51 in myprog), apparently because of threads interacting on some variables (though these were declared as private and subroutines as recursive, according to recommendations found on the web in this regard). I read that working with module might solve it.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Hope someone can help. Thank you very much in advance!&lt;/P&gt;

&lt;P&gt;Fred&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 14:01:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026682#M109449</guid>
      <dc:creator>Frederic_A_</dc:creator>
      <dc:date>2015-06-04T14:01:54Z</dc:date>
    </item>
    <item>
      <title>You have three problems to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026683#M109450</link>
      <description>&lt;P&gt;You have three problems to fix in your code.&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;Do not apply PRIVATE to subprogram names inside a module that you plan to call from outside the module.&lt;/LI&gt;
	&lt;LI&gt;Do not declare EXTERNAL those subprogram names that are accessible through a USE statement or are contained in the same module.&lt;/LI&gt;
	&lt;LI&gt;Provide missing function subprogram I1MACH(); perhaps the one at &lt;A href="https://community.intel.com/www.netlib.org/slatec/src/i1mach.f" target="_blank"&gt;www.netlib.org/slatec/src/i1mach.f&lt;/A&gt; will do.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;There are several source lines that are longer than 132 characters, and these may give you trouble with other compilers. The source code in the module is in need of clean-up; in particular, many specific names of Fortran intrinsics are given EXTERNAL declarations. You will have to fix these declarations, and possibly replace specific names with generic names.&lt;/P&gt;

&lt;P&gt;I removed the lines from "MODULE..." to "CONTAINS" and the last line, "END MODULE", and the program could be built when I used the I1MACH from Netlib. It needs a data file to be run.&lt;/P&gt;

&lt;P&gt;From what I have seen, the objective of your program is to calculate an integral using numerical quadrature routines from QUADPACK. A clean solution would be possible if you used the F90 interface available provided in IMSL to QUADPACK.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 14:54:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026683#M109450</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-06-04T14:54:00Z</dc:date>
    </item>
    <item>
      <title>Thank you very much for your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026684#M109451</link>
      <description>&lt;P&gt;Thank you very much for your prompt reply!&lt;/P&gt;

&lt;P&gt;I have applied your recommendations could successfully built the program and make it run. So I am now ready for the next step: parallelization...&lt;/P&gt;

&lt;P&gt;I indeed inadvertently did not include i1mach.&lt;/P&gt;

&lt;P&gt;Regarding the PRIVATE statement, I used it to ensure that all variables and procedures/functions declared in the module have a separate copy for each thread of this (future) parallel section. But this statement indeed generated the error for DQAG. To work around this problem, I used PUBLIC :: DQAG. Is there any other way to ensure independent copies amongst threads of all involved variables, i.e., to avoid threads interaction on variables as I apparently had before?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 12:41:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026684#M109451</guid>
      <dc:creator>Frederic_A_</dc:creator>
      <dc:date>2015-06-05T12:41:16Z</dc:date>
    </item>
    <item>
      <title>PUBLIC and PRIVATE are not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026685#M109452</link>
      <description>&lt;P&gt;PUBLIC and PRIVATE are not storage-related. They affect the visibility of symbols inherited from a module. You're looking for the PRIVATE clause on an OpenMP directive.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 12:49:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026685#M109452</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-06-05T12:49:21Z</dc:date>
    </item>
    <item>
      <title>OK, great! Thanks for the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026686#M109453</link>
      <description>&lt;P&gt;OK, great! Thanks for the clarification!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 12:56:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026686#M109453</guid>
      <dc:creator>Frederic_A_</dc:creator>
      <dc:date>2015-06-05T12:56:30Z</dc:date>
    </item>
    <item>
      <title>You have resolved the issue</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026687#M109454</link>
      <description>&lt;P&gt;You have resolved the issue of the visibility of DQAG correctly.&lt;/P&gt;

&lt;P&gt;Regarding the thread safety question: do you have any variables that are passed through COMMON or module variables accessed by USE? If so, you would have to ensure that only one thread modifies those variables and that the modifications are completed before you pass control to the other threads in which those variables are referenced.&lt;/P&gt;

&lt;P&gt;There are tools such as the Intel Inspector XE for debugging threading problems.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2015 13:00:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026687#M109454</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-06-05T13:00:21Z</dc:date>
    </item>
    <item>
      <title>Now the sequential version of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026688#M109455</link>
      <description>&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2015 08:22:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-LNK2019-unresolved-external-symbol-using-module/m-p/1026688#M109455</guid>
      <dc:creator>Frederic_A_</dc:creator>
      <dc:date>2015-06-12T08:22:38Z</dc:date>
    </item>
  </channel>
</rss>

