From e7804e93e901c9e92970948bd29ca6cfba6a3f31 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Jul 2024 00:37:28 +0800 Subject: [PATCH 1/2] improve openmp --- packages/o/openmp/xmake.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/o/openmp/xmake.lua b/packages/o/openmp/xmake.lua index 65b54f4a6bb..5261180c263 100644 --- a/packages/o/openmp/xmake.lua +++ b/packages/o/openmp/xmake.lua @@ -56,13 +56,15 @@ package("openmp") elseif package:has_tool(toolkind, "icl") then result[flagname] = "-Qopenmp" end + end + for _, toolkind in ipairs({"ld", "fcld"}) do if package:config("runtime") == "default" then if package:has_tool(toolkind, "clang", "clangxx") then if not package:is_plat("macosx") then result.ldflags = "-fopenmp" result.shflags = "-fopenmp" end - elseif package:has_tool(toolkind, "gcc", "gxx", "gfortran") then + elseif package:has_tool(toolkind, "gcc", "gxx") then result.ldflags = "-fopenmp" result.shflags = "-fopenmp" elseif package:has_tool(toolkind, "icc", "icpc") then @@ -71,10 +73,13 @@ package("openmp") elseif package:has_tool(toolkind, "icl") then result.ldflags = "-Qopenmp" result.shflags = "-Qopenmp" + elseif package:has_tool(toolkind, "gfortran") then + result.fcldflags = "-fopenmp" + result.fcshflags = "-fopenmp" end end if package:config("runtime") == "custom" then - if package:has_tool(toolkind, "cl") then + if package:has_tool(toolkind, "link") then result.ldflags = "/nodefaultlib:vcomp" result.shflags = "/nodefaultlib:vcomp" end From a3acb42e957524ef07d8feef95233042836e1a3b Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 16 Jul 2024 00:45:13 +0800 Subject: [PATCH 2/2] enable headeronly for openmp --- packages/o/openmp/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/o/openmp/xmake.lua b/packages/o/openmp/xmake.lua index 5261180c263..9242d220fa5 100644 --- a/packages/o/openmp/xmake.lua +++ b/packages/o/openmp/xmake.lua @@ -1,5 +1,5 @@ package("openmp") - + set_kind("library", {headeronly = true}) set_homepage("https://openmp.org/") set_description("The OpenMP API specification for parallel programming")