From: Steven G. Johnson Date: Fri, 28 Jul 2017 19:48:08 +0000 (-0400) Subject: fix compilation problem with MSVC (#131) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7ea2d146179d61881a0e92d145664b3ee33ad2d6;p=nlopt.git fix compilation problem with MSVC (#131) * fix for #51 This pragma fixes a known problem compiling with VS2013 or VS2015 in Release. See issue #51 for more info. * The fix fod Visual Studio starts from version 2013 onwards. This has not been fixed for VS2015, so we keep the macro guard open for future versions of VS. The vectorization of this loop is not that important anyways. See #51. --- diff --git a/cobyla/cobyla.c b/cobyla/cobyla.c index ce394d8..ca4219a 100644 --- a/cobyla/cobyla.c +++ b/cobyla/cobyla.c @@ -1505,6 +1505,12 @@ L130: /* new value of ZDOTA(NACT) and branch if it is not acceptable. */ i__1 = nact; + +/* This pragma fixes a known problem compiling with VS2013 or VS2015 in Release */ +/* see https://connect.microsoft.com/VisualStudio/feedback/details/1028781/c1001-on-release-build */ +#if defined(_MSC_VER) && _MSC_VER >= 1800 + #pragma loop(no_vector) +#endif for (k = 1; k <= i__1; ++k) { d__1 = 0., d__2 = vmultc[k] - ratio * vmultd[k]; vmultc[k] = MAX2(d__1,d__2);