如何在 Windows 上构建 NLopt

How to build NLopt on Windows

我正在尝试在 Windows 上构建 NLopt。为此,我打开 Visual Studio 2017 Developer Command Prompt 然后:

>cd C:\Users\m3\repos\
>git clone git://github.com/stevengj/nlopt
>cd nlopt
>mkdir build
>cd build
>cmake ..

然后我需要 运行 命令 makesudo make install。当然,Windows没有GNU make,所以我想用Windowsnmake as suggested here。但是在那里我找不到任何合适的 Makefile 来使用。我错过了什么吗?

这是build目录内容运行ning cmake ..命令后:

>dir
 Volume in drive C has no label.
 Volume Serial Number is 3874-53A8

 Directory of C:\Users\m3\repos\nlopt\build

10/06/2020  09:45 AM    <DIR>          .
10/06/2020  09:45 AM    <DIR>          ..
10/06/2020  09:45 AM            51,498 ALL_BUILD.vcxproj
10/06/2020  09:45 AM               278 ALL_BUILD.vcxproj.filters
10/06/2020  09:44 AM    <DIR>          build_fpclassify
10/06/2020  09:45 AM            24,269 CMakeCache.txt
10/06/2020  09:45 AM    <DIR>          CMakeFiles
10/06/2020  09:45 AM             7,196 cmake_install.cmake
10/06/2020  09:45 AM             3,449 CPackConfig.cmake
10/06/2020  09:45 AM             3,690 CPackSourceConfig.cmake
10/06/2020  09:45 AM               308 CTestTestfile.cmake
10/06/2020  09:44 AM                99 fpclassify.c
10/06/2020  09:45 AM            57,561 generate-cpp.vcxproj
10/06/2020  09:45 AM               964 generate-cpp.vcxproj.filters
10/06/2020  09:45 AM            57,576 generate-fortran.vcxproj
10/06/2020  09:45 AM               967 generate-fortran.vcxproj.filters
10/06/2020  09:45 AM            11,841 INSTALL.vcxproj
10/06/2020  09:45 AM               520 INSTALL.vcxproj.filters
10/06/2020  09:45 AM    <DIR>          Matlab
10/06/2020  09:45 AM            10,624 nlopt.sln
10/06/2020  09:45 AM            79,777 nlopt.vcxproj
10/06/2020  09:45 AM             9,916 nlopt.vcxproj.filters
10/06/2020  09:45 AM               904 NLoptConfig.cmake
10/06/2020  09:45 AM               388 NLoptConfigVersion.cmake
10/06/2020  09:45 AM             3,463 NLoptLibraryDepends.cmake
10/06/2020  09:45 AM             4,955 nlopt_config.h
10/06/2020  09:45 AM            12,073 PACKAGE.vcxproj
10/06/2020  09:45 AM               520 PACKAGE.vcxproj.filters
10/06/2020  09:45 AM            11,315 RUN_TESTS.vcxproj
10/06/2020  09:45 AM               522 RUN_TESTS.vcxproj.filters
10/06/2020  09:45 AM    <DIR>          src
10/06/2020  09:45 AM    <DIR>          test
10/06/2020  09:45 AM            50,952 ZERO_CHECK.vcxproj
10/06/2020  09:45 AM               521 ZERO_CHECK.vcxproj.filters
              27 File(s)        406,146 bytes
               7 Dir(s)  274,515,578,880 bytes free

好吧,我终于通过 Visual Studio 打开 build 目录中的 nlopt.sln Visual Studio 解决方案文件构建了它。然后,对调试和发布模式使用菜单 Build > Build Solution ...