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:[email protected]] On Behalf Of Steven G. Johnson Sent: 22. september 2014 18:11 To: [email protected] Subject: Re: [NLopt-discuss] NLOpt linked to Intel Fortran Compiler for Windows On Sep 22, 2014, at 7:09 AM, Jon A. Rønningen <[email protected]<mailto:[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
