parent
fc9b07c8f4
commit
fcf6b12aa8
4 changed files with 68 additions and 13 deletions
@ -0,0 +1,29 @@ |
||||
package("embree") |
||||
|
||||
set_homepage("https://www.embree.org/") |
||||
set_description("Intel® Embree is a collection of high-performance ray tracing kernels, developed at Intel.") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/embree/embree/archive/v$(version).tar.gz") |
||||
add_versions("3.12.1", "0c9e760b06e178197dd29c9a54f08ff7b184b0487b5ba8b8be058e219e23336e") |
||||
|
||||
add_deps("cmake", "tbb") |
||||
|
||||
on_install("macosx", "linux", "windows", function (package) |
||||
local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF", "-DEMBREE_TUTORIALS=OFF", "-DEMBREE_ISPC_SUPPORT=OFF"} |
||||
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
||||
if package:is_plat("windows") then |
||||
table.insert(configs, "-DUSE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
#include <cassert> |
||||
void test() { |
||||
RTCDevice device = rtcNewDevice(NULL); |
||||
assert(device != NULL); |
||||
} |
||||
]]}, {configs = {languages = "c++11"}, includes = "embree3/rtcore.h"})) |
||||
end) |
@ -0,0 +1,28 @@ |
||||
package("metis") |
||||
|
||||
set_homepage("http://glaros.dtc.umn.edu/gkhome/metis/metis/overview") |
||||
set_description("Serial Graph Partitioning and Fill-reducing Matrix Ordering") |
||||
|
||||
add_urls("https://github.com/xq114/METIS/archive/v$(version).tar.gz") |
||||
add_versions("5.1.1", "945d381d3b50ca70ac93f0daf32c80e6f16f11514879d5ff1438aa82c20a0ba5") |
||||
|
||||
add_deps("cmake") |
||||
add_configs("long_index", {description = "Use 64-bit uint as index.", default = false, type = "boolean"}) |
||||
add_configs("double", {description = "Use double precision floats.", default = true, type = "boolean"}) |
||||
|
||||
on_install("windows", "macosx", "linux", function (package) |
||||
if package:config("long_index") then |
||||
io.gsub(path.join("include", "metis.h"), "define IDXTYPEWIDTH %d+", "define IDXTYPEWIDTH 64") |
||||
end |
||||
if package:config("double") then |
||||
io.gsub(path.join("include", "metis.h"), "define REALTYPEWIDTH %d+", "define REALTYPEWIDTH 64") |
||||
end |
||||
local configs = {} |
||||
table.insert(configs, "-DSHARED=" .. (package:config("shared") and "ON" or "OFF")) |
||||
table.insert(configs, "-DDEBUG=" .. (package:debug() and "ON" or "OFF")) |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cxxfuncs("METIS_SetDefaultOptions", {includes = "metis.h"})) |
||||
end) |
Loading…
Reference in new issue