{"id":172666,"date":"2020-10-26T07:54:04","date_gmt":"2020-10-25T23:54:04","guid":{"rendered":"http:\/\/4563.org\/?p=172666"},"modified":"2020-10-26T07:54:04","modified_gmt":"2020-10-25T23:54:04","slug":"xmake-v2-3-8-%e5%8f%91%e5%b8%83-%e6%96%b0%e5%a2%9e-intel-c-fortran-%e7%bc%96%e8%af%91%e5%99%a8%e6%94%af%e6%8c%81","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=172666","title":{"rendered":"xmake v2.3.8 \u53d1\u5e03, \u65b0\u589e Intel C++\/Fortran \u7f16\u8bd1\u5668\u652f\u6301"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  xmake v2.3.8 \u53d1\u5e03, \u65b0\u589e Intel C++\/Fortran \u7f16\u8bd1\u5668\u652f\u6301               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : waruqi <\/span>  <span><i><\/i> 8<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>xmake \u662f\u4e00\u4e2a\u57fa\u4e8e Lua \u7684\u8f7b\u91cf\u7ea7\u8de8\u5e73\u53f0\u6784\u5efa\u5de5\u5177\uff0c\u4f7f\u7528 xmake.lua \u7ef4\u62a4\u9879\u76ee\u6784\u5efa\uff0c\u76f8\u6bd4 makefile\/CMakeLists.txt \uff0c\u914d\u7f6e\u8bed\u6cd5\u66f4\u52a0\u7b80\u6d01\u76f4\u89c2\uff0c\u5bf9\u65b0\u624b\u975e\u5e38\u53cb\u597d\uff0c\u77ed\u65f6\u95f4\u5185\u5c31\u80fd\u5feb\u901f\u5165\u95e8\uff0c\u80fd\u591f\u8ba9\u7528\u6237\u628a\u66f4\u591a\u7684\u7cbe\u529b\u96c6\u4e2d\u5728\u5b9e\u9645\u7684\u9879\u76ee\u5f00\u53d1\u4e0a\u3002<\/p>\n<p>\u5728\u8fd9\u4e2a\u65b0\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u5bf9 Intel \u7cfb\u5217\u7684 C++ \u548c Fortran \u7f16\u8bd1\u5668\u505a\u4e86\u5168\u5e73\u53f0\u652f\u6301\uff0c\u5e76\u4e14\u6539\u8fdb\u4e86\u4e0a\u4e2a\u7248\u672c\u65b0\u52a0\u7684 Wasm \u5de5\u5177\u94fe\u652f\u6301\uff0c\u540c\u65f6\u5bf9 Qt SDK for Wasm \u4e5f\u8fdb\u884c\u4e86\u652f\u6301\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u4eec\u8fd8\u5c06 luajit \u5347\u7ea7\u5230\u6700\u65b0\u7684 v2.1 \u7248\u672c\uff0c\u5728\u8de8\u5e73\u53f0\u65b9\u9762\uff0cxmake \u4e5f\u505a\u4e86\u5f88\u5927\u7684\u5b8c\u5584\uff0c\u589e\u52a0\u4e86 mips64 \u67b6\u6784\u7684\u8fd0\u884c\u652f\u6301\u3002<\/p>\n<ul>\n<li>\u9879\u76ee\u6e90\u7801<\/li>\n<li>\u5b98\u65b9\u6587\u6863<\/li>\n<li>\u5165\u95e8\u8bfe\u7a0b<\/li>\n<\/ul>\n<h2>\u65b0\u7279\u6027\u4ecb\u7ecd<\/h2>\n<h3>Intel C++ \u7f16\u8bd1\u5668\u652f\u6301<\/h3>\n<p>\u8fd9\u4e2a\u7248\u672c\u4e0a\uff0c\u6211\u4eec\u5bf9 Intel \u7cfb\u5217\u7684 C++ \u7f16\u8bd1\u5668\u505a\u4e86\u5168\u5e73\u53f0\u652f\u6301\uff0c\u5305\u62ec windows \u4e0a\u7684 icl \u4ee5\u53ca linux\/macOS \u4e0b\u7684 icc\/icpc \u3002<\/p>\n<p>\u8981\u60f3\u542f\u7528 Intel C++ \u7f16\u8bd1\u5668\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u5b89\u88c5\u4e86\u7684 Intel \u7f16\u8bd1\u5668\u7684\u7cfb\u7edf\u4e0a\uff0c\u901a\u8fc7 <code>--toolchain=icc<\/code> \u53c2\u6570\u5207\u6362\u5230\u5bf9\u5e94\u7684\u5de5\u5177\u94fe\u5373\u53ef\u3002<\/p>\n<pre><code>$ xmake f --toolchain=icc $ xmake <\/code><\/pre>\n<h3>Intel Fortran \u7f16\u8bd1\u5668\u652f\u6301<\/h3>\n<p>\u4e4b\u524d\u7684\u7248\u672c\uff0cxmake \u4ec5\u4ec5\u652f\u6301 gfortran \u7f16\u8bd1\u5668\uff0c\u800c\u8fd9\u4e2a\u7248\u672c\uff0c\u6211\u4eec\u4e5f\u652f\u6301\u4e86 Intel Fortran \u7f16\u8bd1\u5668\uff0c\u4e5f\u5c31\u662f ifort\uff0c\u6211\u4eec\u4e5f\u53ea\u9700\u8981\u5207\u6362\u5230\u5bf9\u5e94\u7684 ifort \u5de5\u5177\u94fe\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<pre><code>$ xmake f --toolchain=ifort $ xmake <\/code><\/pre>\n<h3>Wasm \u5e73\u53f0\u548c Qt\/Wasm \u652f\u6301<\/h3>\n<p>\u4e0a\u4e2a\u7248\u672c\uff0c\u6211\u4eec\u65b0\u589e\u4e86 <code>--toolchain=emcc<\/code> \u5de5\u5177\u94fe\u6765\u652f\u6301 wasm \u7a0b\u5e8f\u7684\u7f16\u8bd1\uff0c\u4f46\u662f\u4ec5\u4ec5\u6307\u5b9a\u5de5\u5177\u94fe\uff0c\u5e76\u4e0d\u80fd\u5f88\u597d\u7684\u8c03\u6574\u76ee\u6807\u7a0b\u5e8f\u7684\u6269\u5c55\u540d\uff0c\u4f8b\u5982\u5bf9 <code>*.js<\/code> \u548c <code>*.wasm<\/code> \u7684\u6587\u4ef6\u751f\u6210\u3002<\/p>\n<p>\u800c\u65b0\u7248\u672c\uff0c\u6211\u4eec\u7ee7\u7eed\u65b0\u589e\u4e86 <code>xmake f -p wasm<\/code> \u5e73\u53f0\uff0c\u5185\u7f6e\u542f\u7528 emcc \u5de5\u5177\u94fe\uff0c\u5e76\u4e14\u518d\u6b21\u57fa\u7840\u4e0a\u5bf9\u5468\u8fb9\u7684\u914d\u7f6e\u505a\u4e86\u66f4\u597d\u7684\u5b8c\u5584\u3002<\/p>\n<p>\u53ea\u8981\u5207\u6362\u5230 wasm \u5e73\u53f0\uff0cxmake \u4f1a\u9ed8\u8ba4\u751f\u6210 <code>*.js<\/code> \u4ee5\u53ca\u5bf9\u5e94 <code>*.wasm<\/code> \u7b49\u76ee\u6807\u6587\u4ef6\uff0c\u8fd8\u4f1a\u989d\u5916\u751f\u6210\u53ef\u4ee5\u52a0\u8f7d js \u6765\u8fd0\u884c wasm \u7a0b\u5e8f\u7684 <code>*.html<\/code> \u9875\u9762\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u6211\u4eec\u8fd8\u5bf9 Qt SDK for Wasm \u4e5f\u505a\u4e86\u652f\u6301\uff0c\u6bd4\u5982\u6211\u4eec\u521b\u5efa\u4e00\u4e2a Qt QuickApp \u5de5\u7a0b\u3002<\/p>\n<pre><code>$ xmake create -t qt.quickapp_static quickapp <\/code><\/pre>\n<p>\u8fd9\u91cc\uff0c\u6211\u4eec\u6ce8\u610f\u5230\uff0c\u6211\u4eec\u521b\u5efa\u7684\u662f\u9700\u8981\u9759\u6001 link \u7684 Qt \u5de5\u7a0b\uff0c\u56e0\u4e3a wasm \u7248\u672c\u7684 Qt \u5e93\uff0c\u6211\u4eec\u9700\u8981\u5f3a\u5236\u9759\u6001\u94fe\u63a5\u5230\u7a0b\u5e8f\u624d\u80fd\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n<p>\u751f\u6210\u7684\u5de5\u7a0b\u6587\u4ef6 xmake.lua \u5185\u5bb9\u5927\u6982\u5982\u4e0b\uff1a<\/p>\n<pre><code>add_rules(\"mode.debug\", \"mode.release\")  includes(\"qt_add_static_plugins.lua\")  target(\"demo\")     add_rules(\"qt.quickapp_static\")     add_headerfiles(\"src\/*.h\")     add_files(\"src\/*.cpp\")     add_files(\"src\/qml.qrc\")     add_frameworks(\"QtQuickControls2\", \"QtQuickTemplates2\")     qt_add_static_plugins(\"QtQuick2Plugin\", {linkdirs = \"qml\/QtQuick.2\", links = \"qtquick2plugin\"})     qt_add_static_plugins(\"QtQuick2WindowPlugin\", {linkdirs = \"qml\/QtQuick\/Window.2\", links = \"windowplugin\"})     qt_add_static_plugins(\"QtQuickControls2Plugin\", {linkdirs = \"qml\/QtQuick\/Controls.2\", links = \"qtquickcontrols2plugin\"})     qt_add_static_plugins(\"QtQuickTemplates2Plugin\", {linkdirs = \"qml\/QtQuick\/Templates.2\", links = \"qtquicktemplates2plugin\"}) <\/code><\/pre>\n<p>\u4e0a\u9762\u7684\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u9664\u4e86\u542f\u7528 <code>qt.quickapp_static<\/code> \u7f16\u8bd1\u89c4\u5219\uff0c\u8fd8\u901a\u8fc7 <code>qt_add_static_plugins<\/code> \u914d\u7f6e\u4e86\u4e00\u4e9b\u5fc5\u987b\u7684 Qt \u63d2\u4ef6\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5207\u6362\u5230 wasm \u5e73\u53f0\uff0c\u5e76\u786e\u4fdd Qt SDK \u5df2\u8bbe\u7f6e\uff0c\u5373\u53ef\u5b8c\u6210\u7f16\u8bd1\u3002<\/p>\n<pre><code>$ xmake f -p wasm [--qt=~\/Qt] $ xmake <\/code><\/pre>\n<p>\u5b8c\u6210\u7f16\u8bd1\u540e\uff0cxmake \u4f1a\u5728 build \u76ee\u5f55\u4e0b\u751f\u6210 demo.html \u4ee5\u53ca\u5bf9\u5e94\u7684 demo.js\/demo.wasm \u7a0b\u5e8f\uff0c\u6211\u4eec\u6253\u5f00 demo.html \u9875\u9762\u5373\u53ef\u8fd0\u884c\u6211\u4eec\u7f16\u8bd1\u7684 Qt \u7a0b\u5e8f\uff0c\u663e\u793a\u6548\u679c\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/10\/20201026_5f971b21baae3.png\" alt=\"xmake v2.3.8 \u53d1\u5e03, \u65b0\u589e Intel C++\/Fortran \u7f16\u8bd1\u5668\u652f\u6301\" \/><\/p>\n<p>\u5173\u4e8e Qt\/Wasm \u66f4\u52a0\u8be6\u7ec6\u7684\u8bf4\u660e\uff0c\u89c1\uff1aIssue #956<\/p>\n<h3>\u65b0\u589e Math\/Float-point \u7f16\u8bd1\u4f18\u5316\u8bbe\u7f6e<\/h3>\n<p>\u6211\u4eec\u65b0\u589e\u4e86\u4e00\u4e2a <code>set_fpmodels()<\/code> \u8bbe\u7f6e\u63a5\u53e3\uff0c\u7528\u4e8e\u8bbe\u7f6e\u6d6e\u70b9\u7684\u7f16\u8bd1\u6a21\u5f0f\uff0c\u5bf9\u6570\u5b66\u8ba1\u7b97\u76f8\u5173\u4f18\u5316\u7684\u7f16\u8bd1\u62bd\u8c61\u8bbe\u7f6e\uff0c\u63d0\u4f9b\uff1afast, strict, except, precise \u7b49\u51e0\u79cd\u5e38\u7528\u7684\u7ea7\u522b\uff0c\u6709\u4e9b\u53ef\u540c\u65f6\u8bbe\u7f6e\uff0c\u6709\u4e9b\u662f\u6709\u51b2\u7a81\u7684\uff0c\u6700\u540e\u8bbe\u7f6e\u7684\u751f\u6548\u3002<\/p>\n<p>\u5173\u4e8e\u8fd9\u4e9b\u7ea7\u522b\u7684\u8bf4\u660e\uff0c\u53ef\u4ee5\u53c2\u8003\u4e0b\u5fae\u8f6f\u7684\u6587\u6863\uff1aSpecify floating-point behavior<\/p>\n<p>\u5f53\u7136\uff0c\u5bf9\u5e94 gcc\/icc \u7b49\u5176\u4ed6\u7f16\u8bd1\u5668\uff0cxmake \u4f1a\u6620\u5c04\u5230\u4e0d\u540c\u7684\u7f16\u8bd1 flags \u3002<\/p>\n<pre><code>set_fpmodels(\"fast\") set_fpmodels(\"strict\") set_fpmodels(\"fast\", \"except\") set_fpmodels(\"precise\") -- default <\/code><\/pre>\n<p>\u5173\u4e8e\u8fd9\u5757\u8be6\u60c5\u89c1\uff1aIssue #981<\/p>\n<h3>OpenMP \u652f\u6301<\/h3>\n<p>\u4e3a\u4e86\u66f4\u52a0\u62bd\u8c61\u7b80\u5355\u7684\u542f\u7528 openmp \u7279\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u65b0\u589e\u7684 <code>c.openmp<\/code> \u548c <code>c++.openmp<\/code> \u8fd9\u4e24\u4e2a\u89c4\u5219\u6765\u8bbe\u7f6e\uff0c\u53e6\u5916 linux \u3001macOS \u4e0a\u6211\u4eec\u9700\u8981\u989d\u5916\u7684 libomp \u5e93\u624d\u884c\uff0c\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7 <code>add_requires(\"libomp\")<\/code> \u6765\u5feb\u901f\u5f15\u7528\u548c\u96c6\u6210\u3002<\/p>\n<pre><code>add_requires(\"libomp\", {optional = true}) target(\"loop\")     set_kind(\"binary\")     add_files(\"src\/*.cpp\")     add_rules(\"c++.openmp\")     add_packages(\"libomp\") <\/code><\/pre>\n<p>\u5982\u679c\u662f c \u4ee3\u7801\uff0c\u9700\u8981\u542f\u7528 <code>add_rules(\"c.openmp\")<\/code>\uff0c\u5982\u679c\u662f c\/c++ \u6df7\u5408\u7f16\u8bd1\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u89c4\u5219\u90fd\u8981\u8bbe\u7f6e\u3002<\/p>\n<h3>c11\/c17 \u7684\u652f\u6301<\/h3>\n<p>\u65b0\u7248\u672c\u4e2d\uff0cxmake \u5bf9 <code>set_languages<\/code> \u4e5f\u505a\u4e86\u6539\u8fdb\uff0c\u589e\u52a0\u4e86\u65b0\u7684 c11\/c17 \u8bbe\u7f6e\u9879\uff0c\u540c\u65f6\u5bf9\u6700\u65b0\u7248\u672c msvc \u63d0\u4f9b\u7684 <code>\/std:c11<\/code> \u548c <code>\/std:c17<\/code> \u4e5f\u505a\u4e86\u9002\u914d\u548c\u652f\u6301\u3002<\/p>\n<p>\u6211\u4eec\u53ea\u9700\u8981\u7b80\u5355\u7684\u8bbe\u7f6e\uff1a<\/p>\n<pre><code>set_languages(\"c17\") <\/code><\/pre>\n<p>\u5373\u53ef\u542f\u7528 c17 \u6807\u51c6\u6765\u7f16\u8bd1\uff0c\u5373\u4f7f\u4f4e\u7248\u672c msvc \u7b49\u7f16\u8bd1\u5668\u4e0d\u652f\u6301\uff0cxmake \u4e5f\u4f1a\u81ea\u52a8\u5ffd\u7565\u8bbe\u7f6e\u3002<\/p>\n<h3>\u66f4\u597d\u7684 Mingw \u652f\u6301<\/h3>\n<p>\u5173\u4e8e\u8fd9\u5757\u7684\u6539\u8fdb\uff0c\u6d89\u53ca\u51e0\u4e2a\u65b9\u9762\uff0c\u9996\u5148\u662f Windows \u4e0b Mingw SDK \u6839\u76ee\u5f55\u7684\u81ea\u52a8\u63a2\u6d4b\u7684\u6539\u8fdb\uff0c\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u90fd\u4e0d\u9700\u8981\u989d\u5916\u914d\u7f6e <code>--mingw=<\/code> \u53c2\u6570\u663e\u5f0f\u6307\u5b9a\u8def\u5f84\uff0c\u4e5f\u80fd\u591f\u81ea\u52a8\u68c0\u6d4b\u5230\u4e86\u3002<\/p>\n<p>\u5173\u4e8e\u8fd9\u5757\u8be6\u60c5\uff0c\u89c1\uff1aIssue #977<\/p>\n<p>\u53e6\u5916\uff0c\u9664\u4e86 Msys2\/Mingw \u8fd8\u6709 macOS,linux\/Mingw\uff0c\u6211\u4eec\u5728\u65b0\u7248\u672c\u4e2d\u8fd8\u989d\u5916\u652f\u6301\u4e86 llvm-mingw \u8fd9\u4e2a SDK\uff0c\u4f7f\u5f97\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 mingw \u6765\u7f16\u8bd1 arm\/arm64 \u67b6\u6784\u7684\u7a0b\u5e8f\u3002<\/p>\n<pre><code>$ xmake f -p mingw -a arm64 $ xmake <\/code><\/pre>\n<p>\u53e6\u5916\uff0c\u5728\u8fdc\u7a0b\u4f9d\u8d56\u5305\u7684\u81ea\u52a8\u7f16\u8bd1\u96c6\u6210\u4e0a\uff0c\u73b0\u5728\u5e26\u6709 cmakelists \u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u5373\u4f7f\u662f mingw \u5e73\u53f0\uff0cxmake \u4e5f\u80fd\u81ea\u52a8\u7f16\u8bd1\u96c6\u6210\u8fdb\u6765\u76f4\u63a5\u4f7f\u7528\uff0c\u975e\u5e38\u7684\u5feb\u901f\u65b9\u4fbf\u3002<\/p>\n<p>\u800c\u6700\u8fd1 xmake-repo \u5b98\u65b9 C\/C++ \u5305\u4ed3\u5e93\u4e2d\uff0c\u6211\u4eec\u4e5f\u65b0\u589e\u6536\u5165\u4e86\u4e0d\u5c11\u652f\u6301 mingw \u5e73\u53f0\u7684\u65b0\u5e93\uff0c\u53ef\u76f4\u63a5\u4f7f\u7528\u3002<\/p>\n<h3>\u66f4\u597d\u7684\u8de8\u5e73\u53f0\u8fd0\u884c<\/h3>\n<p>\u6211\u4eec\u65b0\u589e\u4e86\u5bf9 mips64 \u67b6\u6784\u7684 linux \u7cfb\u7edf\u8fd0\u884c\u652f\u6301\uff0c\u53e6\u5916\u6539\u8fdb\u4e86 arm\/arm64 \u4e0b xmake \u7684\u8fd0\u884c\u7a33\u5b9a\u6027\uff0c\u901a\u8fc7\u5408\u5165\u6700\u65b0\u7684 luajit v2.1\uff0c\u89e3\u51b3\u4e86\u5f88\u591a luajit \u9057\u7559\u7684\u95ee\u9898\uff0c\u6bd4\u5982 arm64 \u4e0b lightuserdata \u7684 bad pointer \u7b49\u95ee\u9898\u3002<\/p>\n<h3>\u65b0\u589e macOS Sierra for arm64 \u652f\u6301<\/h3>\n<p>xmake \u8fd8\u5bf9\u6700\u65b0\u7684 Xcode-beta \u8fdb\u884c\u4e86\u9002\u914d\uff0c\u65b0\u589e\u4e86 macOs for arm64 \u7684\u76ee\u6807\u7a0b\u5e8f\u7f16\u8bd1\u652f\u6301\uff0c\u53ea\u9700\u8981\u5207\u5230 arm64 \u67b6\u6784\u7f16\u8bd1\u5373\u53ef\u3002<\/p>\n<pre><code>$ xmake f -a arm64 [--xcode=Applications\/Xcode-beta.app\/] $ xmake <\/code><\/pre>\n<p>\u5f53\u7136\uff0c\u524d\u63d0\u662f\u5728 macOS \u4e0b\u8fd0\u884c\uff0c\u5e76\u4e14\u4f7f\u7528\u6700\u65b0\u652f\u6301 Developer Transition Kit (DTK) \u7684 Xcode-beta \u7248\u672c\u624d\u884c\u3002<\/p>\n<h3>\u5b98\u65b9\u4ed3\u5e93\u6536\u5f55\u66f4\u591a\u7684 C\/C++ \u5e93<\/h3>\n<p>\u5728 xmake \u7684\u5b98\u65b9 C\/C++ \u4ed3\u5e93 xmake-repo \u4e2d\uff0c\u6211\u4eec\u6700\u8fd1\u65b0\u589e\u4e86\u51e0\u5341\u4e2a\u5e38\u7528\u7684 C\/C++ \u5e93\uff0c\u5e76\u4e14\u8fd8\u5bf9 libx11 \u7cfb\u5217\u7684\u5e93\u90fd\u5168\u90e8\u8fdb\u884c\u4e86\u6536\u5f55\u3002<\/p>\n<p>\u867d\u7136\uff0c\u4ed3\u5e93\u7684\u5305\u7ef4\u62a4\u5de5\u4f5c\u91cf\u5de8\u5927\uff0c\u4f46\u662f\u76ee\u524d\u7684\u53d1\u5c55\u8d8b\u52bf\u4e5f\u65e5\u8d8b\u6d3b\u8dc3\uff0c\u6211\u4eec\u6536\u5230\u4e86\u8d8a\u6765\u8d8a\u591a\u7684\u7528\u6237\u5bf9\u4ed3\u5e93\u5305\u7684\u8d21\u732e\u548c\u6539\u8fdb\u7ef4\u62a4\u3002<\/p>\n<p>\u5e76\u4e14\uff0c\u73b0\u5728\u6211\u4eec\u7684\u5b98\u65b9\u4ed3\u5e93\u5df2\u7ecf\u53ef\u4ee5\u5feb\u901f\u96c6\u6210\uff1alinux, macOS, windows, mingw, bsd, msys, iphoneos, android \u7b49\u516b\u5927\u5e38\u7528\u5e73\u53f0\u7684\u5e93\uff0c\u5b9e\u73b0\u771f\u6b63\u7684\u8de8\u5e73\u53f0 C\/C++ \u8fdc\u7a0b\u4f9d\u8d56\u5e93\u96c6\u6210\u548c\u4f7f\u7528\u652f\u6301\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/10\/20201026_5f971b222499c.png\" alt=\"xmake v2.3.8 \u53d1\u5e03, \u65b0\u589e Intel C++\/Fortran \u7f16\u8bd1\u5668\u652f\u6301\" \/><\/p>\n<p>\u76ee\u524d\u6211\u4eec\u6536\u5f55\u7684\u4e00\u4e9b\u5305\u5217\u8868\u548c\u652f\u6301\u5e73\u53f0\uff0c\u53ef\u4ee5\u4ece\u8fd9\u91cc\u67e5\u770b\uff1aPKGLIST.md<\/p>\n<p>\u6211\u4eec\u4e00\u76f4\u5728\u52aa\u529b\u89e3\u51b3 C\/C++ \u5e93\u751f\u6001\u7684\u6742\u4e71\u3001\u96c6\u6210\u4f7f\u7528\u7e41\u7410\u7b49\u95ee\u9898\uff0c\u63d0\u4f9b\u5feb\u901f\u4e00\u81f4\u7684\u81ea\u52a8\u96c6\u6210\u548c\u7f16\u8bd1\u65b9\u6848\uff0cxmake \u4e0d\u4ec5\u652f\u6301 vcpkg\/conan\/clib\/homebrew \u7b49\u7b2c\u4e09\u65b9\u5b98\u65b9\u4ed3\u5e93\u5305\u7684\u96c6\u6210\uff0c\u5e76\u4e14\u4e5f\u5728\u52aa\u529b\u5b8c\u5584\u81ea\u5efa\u7684\u5b98\u65b9\u4ed3\u5e93\uff0c\u5b9e\u73b0\u66f4\u597d\u7684\u96c6\u6210\u4f53\u9a8c\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre><code>add_requires(\"tbox &gt;1.6.1\", \"libuv master\", \"vcpkg::ffmpeg\", \"brew::pcre2\/libpcre2-8\") add_requires(\"conan::openssl\/1.1.1g\", {alias = \"openssl\", optional = true, debug = true}) target(\"test\")     set_kind(\"binary\")     add_files(\"src\/*.c\")     add_packages(\"tbox\", \"libuv\", \"vcpkg::ffmpeg\", \"brew::pcre2\/libpcre2-8\", \"openssl\") <\/code><\/pre>\n<p>\u5e26\u6709 <code>vcpkg::<\/code>\uff0c<code>brew::<\/code> \u548c <code>conan::<\/code> \u7b49\u547d\u540d\u7a7a\u95f4\u7684\u5305\uff0c\u4f1a\u81ea\u52a8\u5207\u6362\u5230\u5bf9\u5e94\u7684\u7b2c\u4e09\u65b9\u5305\u4ed3\u5e93\u53bb\u4e0b\u8f7d\u96c6\u6210\uff0c\u800c\u9ed8\u8ba4\u7684 <code>tbox &gt;1.6.1<\/code> \u7b49\u5e93\uff0c\u5219\u4f1a\u9ed8\u8ba4\u4f7f\u7528 xmake-repo \u5b98\u65b9\u4ed3\u5e93\u4e2d\u63d0\u4f9b\u7684\u5305\u3002<\/p>\n<p>\u4f7f\u7528\u548c\u96c6\u6210\u65b9\u5f0f\u5b8c\u5168\u4e00\u81f4\uff0cxmake \u4f1a\u81ea\u52a8\u4e0b\u8f7d\u3001\u7f16\u8bd1\u3001\u96c6\u6210\u548c\u94fe\u63a5\u3002<\/p>\n<p>\u5173\u4e8e\u8fdc\u7a0b\u5305\u7684\u4f9d\u8d56\u96c6\u6210\u7684\u66f4\u591a\u8be6\u7ec6\u8bf4\u660e\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u4e0b\u76f8\u5173\u7684\u6587\u6863\u8bf4\u660e\uff1a\u8fdc\u7a0b\u4f9d\u8d56\u5e93\u96c6\u6210\u548c\u4f7f\u7528<\/p>\n<p>\u540c\u65f6\uff0c\u6211\u4eec\u4e5f\u6b22\u8fce\u66f4\u591a\u7684\u4eba\u53c2\u4e0e\u8fdb\u6765\uff0c\u5e2e\u5fd9\u4e00\u8d77\u6539\u5584 C\/C++ \u7684\u5e93\u751f\u6001\u7684\u5efa\u8bbe\uff0c\u63d0\u4f9b\u7b80\u6d01\u4e00\u81f4\u7684\u5e93\u4f7f\u7528\u4f53\u9a8c\uff0c\u6211\u76f8\u4fe1 C\/C++ \u5305\u7ba1\u7406\u548c\u5e93\u751f\u6001\u5e76\u4e0d\u6bd4 Rust\/Go \u5dee\u3002<\/p>\n<h3>\u66f4\u591a\u7684\u53d1\u884c\u7248\u5b89\u88c5\u652f\u6301<\/h3>\n<p>\u5728\u65b0\u7248\u672c\u4e2d\uff0c\u6211\u4eec\u5c06 xmake \u63d0\u4ea4\u4e86 Ubuntu PPA \u6e90\uff0c\u56e0\u6b64\u9664\u4e86\u73b0\u6709\u7684\u811a\u672c\u5b89\u88c5\u65b9\u5f0f\u5916\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 apt \u53bb\u5feb\u901f\u5b89\u88c5 xmake \u3002<\/p>\n<pre><code>sudo add-apt-repository ppa:xmake-io\/xmake sudo apt update sudo apt install xmake <\/code><\/pre>\n<p>\u540c\u65f6\uff0c\u6211\u4eec\u4e5f\u5c06\u5305\u63d0\u4ea4\u5230\u4e86 Copr \u5305\u7ba1\u7406\u4ed3\u5e93\uff0c\u4f7f\u5f97\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728 Fedora, RHEL\uff0cOpenSUSE\uff0cCentOS \u7b49\u53d1\u884c\u7248\u4e2d\uff0c\u901a\u8fc7 dnf \u6765\u5feb\u901f\u5b89\u88c5 xmake \u3002<\/p>\n<pre><code>sudo dnf copr enable waruqi\/xmake sudo dnf install xmake <\/code><\/pre>\n<h3>\u5165\u95e8\u8bfe\u7a0b<\/h3>\n<p>\u8fd1\u671f\uff0c\u6211\u4eec\u4e5f\u4e0a\u7ebf\u4e86\u5b98\u65b9\u7684 xmake \u5165\u95e8\u8bfe\u7a0b\uff0cXmake \u5e26\u4f60\u8f7b\u677e\u6784\u5efa C\/C++ \u9879\u76ee \u4ee5\u8fb9\u5b66\u8fb9\u505a\u5b9e\u9a8c\u7684\u65b9\u5f0f\u5feb\u901f\u5b66\u4e60 xmake \u7684\u4f7f\u7528\u3002<\/p>\n<h2>\u66f4\u65b0\u5185\u5bb9<\/h2>\n<h3>\u65b0\u7279\u6027<\/h3>\n<ul>\n<li>#955: \u6dfb\u52a0 Zig \u7a7a\u5de5\u7a0b\u6a21\u677f<\/li>\n<li>#956: \u6dfb\u52a0 Wasm \u7f16\u8bd1\u5e73\u53f0\uff0c\u5e76\u4e14\u652f\u6301 Qt\/Wasm SDK<\/li>\n<li>\u5347\u7ea7 luajit \u5230 v2.1 \u6700\u65b0\u5206\u652f\u7248\u672c\uff0c\u5e76\u4e14\u652f\u6301 mips64 \u4e0a\u8fd0\u884c xmake<\/li>\n<li>#972: \u6dfb\u52a0<code>depend.on_changed()<\/code>\u53bb\u7b80\u5316\u4f9d\u8d56\u6587\u4ef6\u7684\u5904\u7406<\/li>\n<li>#981: \u6dfb\u52a0<code>set_fpmodels()<\/code>\u53bb\u62bd\u8c61\u5316\u8bbe\u7f6e math\/float-point \u7f16\u8bd1\u4f18\u5316\u6a21\u5f0f<\/li>\n<li>#980: \u6dfb\u52a0\u5bf9 Intel C\/C++ \u548c Fortran \u7f16\u8bd1\u5668\u7684\u5168\u5e73\u53f0\u652f\u6301<\/li>\n<li>#986: \u5bf9 16.8 \u4ee5\u4e0a msvc \u7f16\u8bd1\u5668\u589e\u52a0 <code>c11<\/code>\/<code>c17<\/code> \u652f\u6301<\/li>\n<li>#979: \u6dfb\u52a0\u5bf9 OpenMP \u7684\u8de8\u5e73\u53f0\u62bd\u8c61\u914d\u7f6e\u3002<code>add_rules(\"c++.openmp\")<\/code><\/li>\n<\/ul>\n<h3>\u6539\u8fdb<\/h3>\n<ul>\n<li>#958: \u6539\u8fdb mingw \u5e73\u53f0\uff0c\u589e\u52a0\u5bf9 llvm-mingw \u5de5\u5177\u94fe\u7684\u652f\u6301\uff0c\u4ee5\u53ca arm64\/arm \u67b6\u6784\u7684\u652f\u6301<\/li>\n<li>\u589e\u52a0 <code>add_requires(\"zlib~xxx\")<\/code> \u6a21\u5f0f\u4f7f\u5f97\u80fd\u591f\u652f\u6301\u540c\u65f6\u5b89\u88c5\u5e26\u6709\u591a\u79cd\u914d\u7f6e\u7684\u540c\u4e00\u4e2a\u5305\uff0c\u4f5c\u4e3a\u72ec\u7acb\u5305\u5b58\u5728<\/li>\n<li>#977: \u6539\u8fdb find_mingw \u5728 windows \u4e0a\u7684\u63a2\u6d4b<\/li>\n<li>#978: \u6539\u8fdb\u5de5\u5177\u94fe\u7684 flags \u987a\u5e8f<\/li>\n<li>\u6539\u8fdb XCode \u5de5\u5177\u94fe\uff0c\u652f\u6301 macOS\/arm64<\/li>\n<\/ul>\n<h3>Bugs \u4fee\u590d<\/h3>\n<ul>\n<li>#951: \u4fee\u590d emcc (WebAssembly) \u5de5\u5177\u94fe\u5728 windows \u4e0a\u7684\u652f\u6301<\/li>\n<li>#992: \u4fee\u590d\u6587\u4ef6\u9501\u5076\u5c14\u6253\u5f00\u5931\u8d25\u95ee\u9898<\/li>\n<\/ul><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>2<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3799363\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nieyujiang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             xcode \u73b0\u5728\u7f16\u8bd1 arm \u7248\u672c macos \u5e94\u7528\u5df2\u7ecf\u4e0d\u9700\u8981 beta \u7248\u672c\u4e86\uff0c12 \u7684\u6b63\u5f0f\u7248\u5df2\u7ecf\u53d1\u5e03\u4e86\u5f88\u4e45\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3799364\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : waruqi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nieyujiang \u55ef\u55ef\uff0c\u90a3\u5c31\u76f4\u63a5\u6267\u884c xmake f -a arm64;xmake \u5c31\u884c\u4e86\uff0c\u66f4\u7701\u4e8b\uff0c\u90fd\u4e0d\u7528\u989d\u5916\u6307\u5b9a xcode \u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>xmake v2.3.8 \u53d1\u5e03, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/172666"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172666"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/172666\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172666"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}