forked from snoweye/pbdZMQ
-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL
136 lines (101 loc) · 4.78 KB
/
INSTALL
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
### Read pbdZMQ vignettes "pbdZMQ-guide.pdf" first at
### "https://cran.r-project.org/package=pbdZMQ".
###
### pbdZMQ can be installed with/without external ZeroMQ 4.2.2 library
### since pbdZMQ includes a minimum requirement of ZeroMQ 4.2.2 library.
###
### pbdZMQ is also tested mainly on Linux (XUbuntu-14.04.1), Windows 7, and
### Mac OSX 10.7 systems.
###
### Solaris needs ZeroMQ 4.0.7 library with GNU Make 4.1 (OpenCSW).
### See Section for Solaris in next for installation steps and read pbdZMQ
--- 'pbdZMQ' installation:
0. 'pkg-config' and system ZeroMQ library (libzmq, libzmq-dev) are requrired.
1. Default installation:
> R CMD INSTALL pbdZMQ_*.*-*.tar.gz
--- 'pbdZMQ' installation with internal ZeroMQ library:
1. Enable internal ZeroMQ:
This should work with most platforms.
> R CMD INSTALL pbdZMQ_0.*-*.tar.gz \
--configure-args="--enable-internal-zmq"
--- 'pbdZMQ' installation with external ZeroMQ library such as version 4.2.2:
0. Minimum steps for installing ZeroMQ 4.2.2 shared library
> ./configure \
--prefix=/usr/local/zmq \
--enable-static=no \
--enable-shared=yes \
--with-poller=select \
--without-documentation \
--without-libsodium
> make -j 4; make install
or ZeroMQ 4.2.2 static library
> ./configure \
--prefix=/usr/local/zmq \
--with-pic=yes \
--enable-static=yes \
--enable-shared=no \
--with-poller=select \
--without-documentation \
--without-libsodium
> make -j 4; make install
1. Steps for pbdZMQ with the external ZeroMQ shared library
> R CMD INSTALL pbdZMQ_*.*-*.tar.gz \
--configure-vars="ZMQ_INCLUDE='-I/usr/local/zmq/include' \
ZMQ_LDFLAGS='-L/usr/local/zmq/lib -lzmq'"
or with the external ZeroMQ static library
> R CMD INSTALL pbdZMQ_*.*-*.tar.gz \
--configure-vars="ZMQ_INCLUDE='-I/usr/local/zmq/include' \
ZMQ_LDFLAGS='/usr/local/zmq/lib/libzmq.a'"
provided the external library is installed at "/usr/local/zmq" where
"include/" subdirectory contains "zmq.h" and "lib/" subdirectory contains
the shared library such as "libzmq.so" or the static library such as
"libzmq.a".
--- Testing:
Suppose 'pbdZMQ' is installed correctly. I can run the next from one
terminal.
> Rscript -e "demo(hwserver,'pbdZMQ',ask=F,echo=F)" &
> Rscript -e "demo(hwclient,'pbdZMQ',ask=F,echo=F)"
--- Installation with different polling system:
By default 'select' method is used in 'pbdZMQ' for Linux, Windows, and
Mac OSX. However, users may want to use 'autodetect' or try others for
better polling. Currently, the options as given by ZeroMQ may be 'kqueue',
'epoll', 'devpoll', 'poll', or 'select' depending on libraries and system.
> R CMD INSTALL pbdZMQ_*.*-*.tar.gz \
--configure-vars="ZMQ_POLLER='autodetect'"
### Section for Solaris
--- Install OpenCSW and 'ZeroMQ 4.0.7' library:
0. Make sure GNU tools are installed including gmake, gcc, g++, autoconf,
automake, gtar, etc. Usually, OpenCSW hase them at
"https://www.opencsw.org/get-it/packages/" and can be installed
by "pkgutil". For example, "gcc4core" can be installed by
> pkgadd -d https://get.opencsw.org/now
> /opt/csw/bin/pkgutil -U
> /opt/csw/bin/pkgutil -y -i gcc4core
> /usr/sbin/pkgchk -L CSWgcc4core # list files
1. Make sure gmake, gcc, g++, autoconf, automake are in the PATH and export
it to environment. For example, I have
PATH=/opt/csw/gnu:/opt/csw/bin:/opt/csw/i386-pc-solaris2.10/bin:/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb
export PATH
I also have a symbolic link "make" to "gmake" to avoid configuration
problems. If not, use "ln -s" to make one.
2. Download 'zeromq-4.0.7.tar.gz' from "https://download.zeromq.org".
3. Untar, configure, make, and make install as next:
> gtar zxvf zeromq-4.0.7.tar.gz
> cd zeromq-4.0.7
> ./configure --prefix=/work-my/local/zmq
> make
> make install
where I install the ZeroMQ library to "/work-my/local/zmq".
--- 'pbdZMQ' installation with external ZeroMQ library such as version 4.0.7:
1. Steps for pbdZMQ with the external ZeroMQ library.
> R CMD INSTALL pbdZMQ_*.*-*.tar.gz \
--configure-vars="ZMQ_INCLUDE='-I/work-my/local/zmq/include' \
ZMQ_LDFLAGS='-L/work-my/local/zmq/lib -lzmq'"
provided the external library is installed at "/work-my/local/zmq" where
"include/" subdirectory contains "zmq.h" and "lib/" subdirectory contains
the shared library such as "libzmq.so".
--- Testing:
Suppose 'pbdZMQ' is installed correctly. I can run the next from one
terminal.
> Rscript -e "demo(hwserver,'pbdZMQ',ask=F,echo=F)" &
> Rscript -e "demo(hwclient,'pbdZMQ',ask=F,echo=F)"