Skip to content

Commit 2e49d4c

Browse files
committed
Make APA Octave pkg installable
1 parent 0204d94 commit 2e49d4c

File tree

4 files changed

+36
-21
lines changed

4 files changed

+36
-21
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: apa
2-
version: 0.0.1
3-
date: 2021-07-01
2+
version: 0.1.1
3+
date: 2021-08-10
44
author: Kai T. Ohlhus <[email protected]>
55
maintainer: Kai T. Ohlhus <[email protected]>
66
title: Octave/Matlab arbitrary precision arithmetic.

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
## Installation
44

5-
From the Octave/Matlab command-line run:
5+
From the Octave command-line run:
6+
7+
```octave
8+
pkg install 'https://github.com/gnu-octave/apa/releases/download/v0.1.1/apa-0.1.1.zip'
9+
pkg load apa
10+
install_apa
11+
test_apa
12+
```
13+
14+
From the Matlab command-line run (also works for Octave):
615

716
```matlab
8-
urlwrite ('https://github.com/gnu-octave/apa/releases/download/v0.1.0/apa-0.1.0.zip', ...
9-
'apa-0.1.0.zip');
10-
unzip ('apa-0.1.0.zip');
11-
cd (fullfile ('apa-0.1.0', 'inst'))
17+
urlwrite ('https://github.com/gnu-octave/apa/releases/download/v0.1.1/apa-0.1.1.zip', ...
18+
'apa-0.1.1.zip');
19+
unzip ('apa-0.1.1.zip');
20+
cd (fullfile ('apa-0.1.1', 'inst'))
1221
install_apa
1322
test_apa
1423
```

doc/MEX_INTERFACE.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@ and UNIX (Linux).
77

88
If those pre-compiled libraries are missing or not working, please read below.
99

10-
From Octave call:
11-
12-
```octave
13-
pkg load apa
14-
install_apa
15-
test_apa
16-
```
17-
18-
From Matlab call:
10+
From the Octave/Matlab command-line run:
1911

2012
```matlab
21-
cd /path/to/apa/inst
13+
urlwrite ('https://github.com/gnu-octave/apa/releases/download/v0.1.1/apa-0.1.1.zip', ...
14+
'apa-0.1.1.zip');
15+
unzip ('apa-0.1.1.zip');
16+
cd (fullfile ('apa-0.1.1', 'inst'))
2217
install_apa
2318
test_apa
2419
```
@@ -59,7 +54,8 @@ The APA MEX interface is known to work and tested for
5954
For macOS and UNIX/Linux systems (Octave or Matlab) this can be conveniently
6055
done by calling:
6156
```matlab
62-
cd apa/inst/mex
57+
cd (fileparts (which ('install_apa.m'))); % 'apa/inst'
58+
cd mex
6359
system ('make')
6460
```
6561

inst/mex/Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,31 @@ BUILD_DIR := ${INST_DIR}/.build
88
ENSURE_BUILD_DIR := $(shell mkdir -p ${BUILD_DIR})
99

1010
GMP_DIR = gmp-${GMP_VER}
11-
GMP_TAR = ${GMP_DIR}.tar.gz
11+
GMP_TAR = ${GMP_DIR}.tar.bz2
12+
GMP_URL = https://gmplib.org/download/gmp/${GMP_TAR}
1213
GMP_PATH = ${BUILD_DIR}/${GMP_DIR}
1314

1415
MPFR_DIR = mpfr-${MPFR_VER}
1516
MPFR_TAR = ${MPFR_DIR}.tar.gz
17+
MPFR_URL = https://www.mpfr.org/mpfr-4.1.0/${MPFR_TAR}
1618
MPFR_PATH = ${BUILD_DIR}/${MPFR_DIR}
1719

20+
CURL_OPTS = --fail --location --silent --show-error --output
21+
1822
HEADER = gmp.h mpfr.h mpf2mpfr.h
1923
STATIC_LIBS = libgmp.a libmpfr.a
2024

2125
all: $(patsubst %,${BUILD_DIR}/lib/%,${STATIC_LIBS})
2226
cp $(patsubst %,${BUILD_DIR}/lib/%,${STATIC_LIBS}) ${INST_DIR}
2327
cp $(patsubst %,${BUILD_DIR}/include/%,${HEADER}) ${INST_DIR}
2428

25-
${BUILD_DIR}/lib/libgmp.a: ${INST_DIR}/src/${GMP_TAR}
29+
${BUILD_DIR}/${GMP_TAR}:
30+
curl ${CURL_OPTS} ${BUILD_DIR}/${GMP_TAR} ${GMP_URL}
31+
32+
${BUILD_DIR}/${MPFR_TAR}:
33+
curl ${CURL_OPTS} ${BUILD_DIR}/${MPFR_TAR} ${MPFR_URL}
34+
35+
${BUILD_DIR}/lib/libgmp.a: ${BUILD_DIR}/${GMP_TAR}
2636
$(RM) -R ${GMP_PATH}
2737
cd ${BUILD_DIR} && tar -xf $<
2838
cd ${GMP_PATH} && ./configure \
@@ -33,7 +43,7 @@ ${BUILD_DIR}/lib/libgmp.a: ${INST_DIR}/src/${GMP_TAR}
3343
cd ${GMP_PATH} && $(MAKE) check
3444
cd ${GMP_PATH} && $(MAKE) install
3545

36-
${BUILD_DIR}/lib/libmpfr.a: ${INST_DIR}/src/${MPFR_TAR} ${BUILD_DIR}/lib/libgmp.a
46+
${BUILD_DIR}/lib/libmpfr.a: ${BUILD_DIR}/${MPFR_TAR} ${BUILD_DIR}/lib/libgmp.a
3747
$(RM) -R ${MPFR_PATH}
3848
cd ${BUILD_DIR} && tar -xf $<
3949
cd ${MPFR_PATH} && ./configure \

0 commit comments

Comments
 (0)