add emsmallen (#697)
* add emsmallen * update armadillo * update hypre * add libdc1394pull/698/head
parent
99c11d48e6
commit
8e37d66eb6
4 changed files with 84 additions and 5 deletions
@ -0,0 +1,24 @@ |
|||||||
|
package("ensmallen") |
||||||
|
|
||||||
|
set_kind("library", {headeronly = true}) |
||||||
|
set_homepage("https://ensmallen.org/") |
||||||
|
set_description("flexible C++ library for efficient numerical optimization") |
||||||
|
set_license("BSD-3-Clause") |
||||||
|
|
||||||
|
add_urls("https://ensmallen.org/files/ensmallen-$(version).tar.gz") |
||||||
|
add_versions("2.18.0", "62f7db71105305c0754a5f2a02fb8d05a5294bafa82584172b50609aabf7ea44") |
||||||
|
|
||||||
|
add_deps("cmake", "armadillo") |
||||||
|
on_install("windows", "macosx", "linux", function (package) |
||||||
|
io.replace("CMakeLists.txt", "add_subdirectory(tests)", "", {plain = true}) |
||||||
|
import("package.tools.cmake").install(package) |
||||||
|
end) |
||||||
|
|
||||||
|
on_test(function (package) |
||||||
|
assert(package:check_cxxsnippets({test = [[ |
||||||
|
void test() { |
||||||
|
ens::L_BFGS opt; |
||||||
|
opt.MaxIterations() = 10; |
||||||
|
} |
||||||
|
]]}, {configs = {languages = "c++14"}, includes = "ensmallen.hpp"})) |
||||||
|
end) |
@ -0,0 +1,46 @@ |
|||||||
|
package("libdc1394") |
||||||
|
|
||||||
|
set_homepage("https://sourceforge.net/projects/libdc1394/") |
||||||
|
set_description("IIDC Camera Control Library") |
||||||
|
set_license("LGPL-2.1") |
||||||
|
|
||||||
|
add_urls("https://sourceforge.net/projects/libdc1394/files/libdc1394-2/$(version)/libdc1394-$(version).tar.gz") |
||||||
|
add_versions("2.2.6", "2b905fc9aa4eec6bdcf6a2ae5f5ba021232739f5be047dec8fe8dd6049c10fed") |
||||||
|
|
||||||
|
if is_plat("linux") then |
||||||
|
add_extsources("apt::libdc1394-22-dev") |
||||||
|
end |
||||||
|
|
||||||
|
add_deps("libusb") |
||||||
|
if is_plat("macosx") then |
||||||
|
add_frameworks("CoreFoundation", "CoreServices", "IOKit") |
||||||
|
end |
||||||
|
on_install("macosx", "linux", function (package) |
||||||
|
local configs = {"--disable-dependency-tracking"} |
||||||
|
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) |
||||||
|
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) |
||||||
|
if package:config("pic") then |
||||||
|
table.insert(configs, "--with-pic") |
||||||
|
end |
||||||
|
local cppflags = {} |
||||||
|
local ldflags = {} |
||||||
|
for _, dep in ipairs(package:orderdeps()) do |
||||||
|
local fetchinfo = dep:fetch() |
||||||
|
if fetchinfo then |
||||||
|
for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do |
||||||
|
table.insert(cppflags, "-I" .. includedir) |
||||||
|
end |
||||||
|
for _, linkdir in ipairs(fetchinfo.linkdirs) do |
||||||
|
table.insert(ldflags, "-L" .. linkdir) |
||||||
|
end |
||||||
|
for _, link in ipairs(fetchinfo.links) do |
||||||
|
table.insert(ldflags, "-l" .. link) |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
import("package.tools.autoconf").install(package, configs, {cppflags = cppflags, ldflags = ldflags}) |
||||||
|
end) |
||||||
|
|
||||||
|
on_test(function (package) |
||||||
|
assert(package:has_cfuncs("dc1394_new", {includes = "dc1394/dc1394.h"})) |
||||||
|
end) |
Loading…
Reference in new issue