Jon A. Rønningen <jon.a.ronningen@...> writes:

> 
> 
> 
> Dear Steven.
>  
> It works! I passed
> “/Qlowercase /assume:underscore” to the ifort compiler and now the 
tutorial example runs and gives the expected results. Looking forward to 
exploring the NLopt library in
>  the weeks to come. Thank for very much for your help.
>  
> 
> Kind regards
> Jon
> 
>  
> 
> 
> From: NLopt-discuss [mailto:nlopt-discuss-bounces <at> ab-
initio.mit.edu]
> On Behalf Of Steven G. JohnsonSent: 22. september 2014 18:11To: nlopt-
[email protected]: Re: 
[NLopt-discuss] NLOpt linked to Intel Fortran Compiler for Windows
> 
> 
>  
> On Sep 22, 2014, at 7:09 AM, Jon A. Rønningen <jon.a.ronningen-
[email protected]> wrote:
> 
> 
> 
> 
> I am working on getting NLOpt to work on Intel Fortran for Windows 
using the precompiled DLL. Any help or prior experience regarding this 
would be highly appreciated.
>  Please see the description of the problem below.
> 
> 
> 
> 
> 
>  
> 
> 
> In general, a Fortran compiler mangles a symbol “foo” to some other 
spelling when linking, typically “foo_”.   The naming in the C library 
has to match the mangling used by the Fortran compiler.   NLopt actually 
includes multiple symbols
>  to cover various possibilities: foo, foo_, and foo__.
> 
> 
>  
> 
> 
> I haven’t tried ifort on Windows, but I thought its default was foo_ 
(this is what it uses on Unix), but it looks like maybe it uses FOO? 
> 
> 
>  
> 
> 
> You can try passing some compiler flags to change the mangling. 
 e.g. https://www.uni-
muenster.de/imperia/md/content/physik_ct/pdf/05_intel_optimierung.pdf
>  indicates that passing “/Qlowercase /assume:underscore” should make 
it use foo_   … you might also need to force it to use the C calling 
convention if it is defaulting to  stdcall 
(https://software.intel.com/sites/products/documentation/hpc/composerxe/
en-us/2011Update/fortran/win/copts/fortran_options/option_iface.htm)
>  via /iface:cref (although this is apparently the only choice on 64-
bit systems).
> 
> 
>  
> 
> 
> Otherwise, you have to recompile NLopt from source to change the 
mangling.
> 
> 
>  
> 
> 
> —SGJ
> 
> 
> 
> 
> <div>
> <div class="WordSection1">
> <p class="MsoNormal"><span>Dear Steven.<p></p></span></p>
> <p class="MsoNormal"><span><p> </p></span></p>
> <p class="MsoNormal"><span lang="EN-US">It works! I passed
> </span><span lang="EN-US">“/Qlowercase /assume:underscore” 
to the ifort compiler and now the tutorial example runs and gives the 
expected results. Looking forward to exploring the NLopt library in
>  the weeks to come. </span><span lang="EN-US">Thank for very much for 
your help.<p></p></span></p>
> <p class="MsoNormal"><span lang="EN-US"><p> </p></span></p>
> <div>
> <p class="MsoNormal"><span lang="EN-US">Kind regards<p></p></span></p>
> <p class="MsoNormal"><span lang="EN-US">Jon<p></p></span></p>
> </div>
> <p class="MsoNormal"><span lang="EN-US"><p> </p></span></p>
> <div>
> <div>
> <p class="MsoNormal"><span lang="EN-US">From:</span><span lang="EN-
US"> NLopt-discuss [mailto:nlopt-discuss-bounces <at> ab-initio.mit.edu]
> On Behalf Of Steven G. Johnson<br>Sent: 22. september 2014 
18:11<br>To: nlopt-discuss@...<br>Subject: Re: [NLopt-discuss] NLOpt 
linked to Intel Fortran Compiler for Windows<p></p></span></p>
> </div>
> </div>
> <p class="MsoNormal"><p> </p></p>
> <p class="MsoNormal">On Sep 22, 2014, at 7:09 AM, Jon A. 
Rønningen <<a 
href="mailto:jon.a.ronningen@...";>jon.a.ronningen@...</a>> wrote:<p>
</p></p>
> <div>
> <blockquote>
> <div>
> <div>
> <p class="MsoNormal"><span lang="EN-US">I am working on getting NLOpt 
to work on Intel Fortran for Windows using the precompiled DLL. Any help 
or prior experience regarding this would be highly appreciated.
>  Please see the description of the problem below.</span><span><p></p>
</span></p>
> </div>
> </div>
> </blockquote>
> </div>
> <div>
> <p class="MsoNormal"><p> </p></p>
> </div>
> <div>
> <p class="MsoNormal">In general, a Fortran compiler mangles a symbol 
“foo” to some other spelling when linking, typically 
“foo_”.   The naming in the C library has to match the 
mangling used by the Fortran compiler.   NLopt actually includes 
multiple symbols
>  to cover various possibilities: foo, foo_, and foo__.<p></p></p>
> </div>
> <div>
> <p class="MsoNormal"><p> </p></p>
> </div>
> <div>
> <p class="MsoNormal">I haven’t tried ifort on Windows, but I 
thought its default was foo_ (this is what it uses on Unix), but it 
looks like maybe it uses FOO? <p></p></p>
> </div>
> <div>
> <p class="MsoNormal"><p> </p></p>
> </div>
> <div>
> <p class="MsoNormal">You can try passing some compiler flags to change 
the mangling.  e.g. <a href="https://www.uni-
muenster.de/imperia/md/content/physik_ct/pdf/05_intel_optimierung.pdf">h
ttps://www.uni-
muenster.de/imperia/md/content/physik_ct/pdf/05_intel_optimierung.pdf</a
>
>  indicates that passing “/Qlowercase /assume:underscore” 
should make it use foo_   … you might also need to force it 
to use the C calling convention if it is defaulting to  stdcall (<a 
href="https://software.intel.com/sites/products/documentation/hpc/compos
erxe/en-
us/2011Update/fortran/win/copts/fortran_options/option_iface.htm">https:
//software.intel.com/sites/products/documentation/hpc/composerxe/en-
us/2011Update/fortran/win/copts/fortran_options/option_iface.htm</a>)
>  via /iface:cref (although this is apparently the only choice on 64-
bit systems).<p></p></p>
> </div>
> <div>
> <p class="MsoNormal"><p> </p></p>
> </div>
> <div>
> <p class="MsoNormal">Otherwise, you have to recompile NLopt from 
source to change the mangling.<p></p></p>
> </div>
> <div>
> <p class="MsoNormal"><p> </p></p>
> </div>
> <div>
> <p class="MsoNormal">—SGJ<p></p></p>
> </div>
> </div>
> </div>
> 
Maybe I'm being a rube here, but how would I go about passing 
“/Qlowercase /assume:underscore” to the ifort compiler in Visual Studio? 
Do I put that text somewhere in one of the tabs in Project-->Properties? 
I'm having almost the identical problem as Jon, and I certainly hope 
Steven's solution works for me, but I have to know how to implement the 
solution!





_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to