On Sep 22, 2014, at 7:09 AM, Jon A. Rønningen <[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
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to