add vc, gmsh and dune-common (#664)

* add vc

* add gmsh

* add dune-common

* improve vc to be only static
pull/665/head
Hoildkv 3 years ago committed by GitHub
parent 838dc380a5
commit 1e74ec6eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 35
      packages/d/dune-common/xmake.lua
  2. 46
      packages/g/gmsh/xmake.lua
  3. 24
      packages/v/vc/xmake.lua

@ -0,0 +1,35 @@
package("dune-common")
set_homepage("https://dune-project.org/")
set_description("DUNE, the Distributed and Unified Numerics Environment is a modular toolbox for solving partial differential equations with grid-based methods.")
set_license("GPL-2.0")
add_urls("https://dune-project.org/download/$(version)/dune-common-$(version).tar.gz")
add_versions("2.8.0", "c9110b3fa350547c5e962c961905c6c67680471199ca41ed680489a0f30ffce9")
add_configs("python", {description = "Enable the python interface.", default = false, type = "boolean"})
add_deps("cmake")
add_links("dunecommon")
on_load("macosx", "linux", function (package)
if package:config("python") then
package:add("deps", "python 3.x")
end
end)
on_install("macosx", "linux", function (package)
local configs = {"-DBUILD_TESTING=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DDUNE_ENABLE_PYTHONBINDINGS=" .. (package:config("python") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <dune/common/std/make_array.hh>
void test() {
auto array = Dune::Std::make_array(1, 2);
}
]]}, {configs = {languages = "c++14"}}))
end)

@ -0,0 +1,46 @@
package("gmsh")
set_homepage("http://gmsh.info/")
set_description("Gmsh is an open source 3D finite element mesh generator with a built-in CAD engine and post-processor.")
set_license("GPL-2.0")
add_urls("http://gmsh.info/src/gmsh-$(version)-source.tgz")
add_versions("4.8.4", "760dbdc072eaa3c82d066c5ba3b06eacdd3304eb2a97373fe4ada9509f0b6ace")
add_deps("cmake")
if is_plat("windows") then
add_syslinks("shell32", "ws2_32", "winmm")
end
on_load("windows", function (package)
if package:config("shared") then
package:add("defines", "GMSH_DLL")
end
end)
on_install("windows", "macosx", "linux", function (package)
local configs = {"-DENABLE_TESTS=OFF", "-DENABLE_GMP=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DENABLE_BUILD_LIB=" .. (package:config("shared") and "OFF" or "ON"))
table.insert(configs, "-DENABLE_BUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DENABLE_BUILD_DYNAMIC=" .. (package:config("shared") and "ON" or "OFF"))
if package:is_plat("windows") then
table.insert(configs, "-DENABLE_MSVC_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs)
if package:is_plat("windows") and package:config("shared") then
os.mv(path.join(package:installdir("lib"), "gmsh.dll"), package:installdir("bin"))
end
package:addenv("PATH", "bin")
end)
on_test(function (package)
os.vrun("gmsh -version")
assert(package:check_cxxsnippets({test = [[
void test() {
gmsh::initialize();
gmsh::model::add("square");
int square = gmsh::model::occ::addRectangle(0, 0, 0, 1, 1);
gmsh::model::occ::synchronize();
}
]]}, {configs = {languages = "c++11"}, includes = "gmsh.h"}))
end)

@ -0,0 +1,24 @@
package("vc")
set_homepage("https://github.com/VcDevel/Vc")
set_description("SIMD Vector Classes for C++")
set_license("BSD-3-Clause")
add_urls("https://github.com/VcDevel/Vc/releases/download/$(version)/Vc-$(version).tar.gz")
add_versions("1.4.2", "50d3f151e40b0718666935aa71d299d6370fafa67411f0a9e249fbce3e6e3952")
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
add_deps("cmake")
on_install("windows", "macosx", "linux", function (package)
import("package.tools.cmake").install(package)
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
Vc::Memory<Vc::float_v, 1000> x_mem;
x_mem.vector(0) = Vc::float_v::Random() * 2.f - 1.f;
}
]]}, {configs = {languages = "c++17"}, includes = "Vc/Vc"}))
end)
Loading…
Cancel
Save