-
Notifications
You must be signed in to change notification settings - Fork 0
/
armadillo.mk
44 lines (39 loc) · 1.59 KB
/
armadillo.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := armadillo
$(PKG)_WEBSITE := https://arma.sourceforge.io/
$(PKG)_DESCR := Armadillo C++ linear algebra library
$(PKG)_IGNORE :=
$(PKG)_VERSION := 11.4.3
$(PKG)_CHECKSUM := 87603263664988af41da2ca4f36205e36ea47a9281fa6cfd463115f3797a1da2
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/arma/$($(PKG)_FILE)
$(PKG)_DEPS := cc hdf5 openblas lapack
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://sourceforge.net/projects/arma/files/' | \
$(SED) -n 's,.*/armadillo-\([0-9.]*\)[.]tar.*".*,\1,p' | \
head -1
endef
define $(PKG)_BUILD
# build and install the library
cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \
-DARMA_HDF5_INCLUDE_DIR=$(PREFIX)/$(TARGET)/include \
-DDETECT_HDF5=OFF \
-DARMA_USE_WRAPPER=ON \
-DBUILD_SMOKE_TEST=OFF
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1
# create pkg-config file
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
(echo 'Name: $(PKG)'; \
echo 'Version: $($(PKG)_VERSION)'; \
echo 'Description: $($(PKG)_DESCR)'; \
echo 'Requires: hdf5 openblas'; \
echo 'Libs: -larmadillo'; \
) > '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
# compile test
'$(TARGET)-g++' \
-W -Wall -Werror -fopenmp \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`'$(TARGET)-pkg-config' $(PKG) --cflags --libs` -lgomp
endef