Skip to content

Commit

Permalink
Merge pull request #15 from snoweye/master
Browse files Browse the repository at this point in the history
v0.3-1
  • Loading branch information
snoweye authored Jan 11, 2018
2 parents 07540e0 + 44ff2f4 commit 926260b
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 24 deletions.
33 changes: 25 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,39 @@

language: c

branches:
only:
- master
- osx_static

### For Linux
# os:
# - linux
### Use external static library
# before_install:
# - sudo apt-get install -qq libzmq3-dev

### For osx
os:
#- linux
- osx

### Use external static library
before_install:
#- sudo apt-get install -qq libzmq3-dev
# - git clone git://github.com/zeromq/libzmq.git
# - curl -OL http://raw.github.com/snoweye/libzmq_osx/master/make_libzmq_osx.sh
# - chmod 755 make_libzmq_osx.sh
# - ./make_libzmq_osx.sh


install:
- curl -OL http://raw.github.com/craigcitro/r-travis/master/scripts/travis-tool.sh
- chmod 755 ./travis-tool.sh
- ./travis-tool.sh bootstrap

install:
- ./travis-tool.sh install_deps
# - ./travis-tool.sh install_deps

script:
# - ./travis-tool.sh run_tests
- ./travis-tool.sh install_github snoweye/pbdZMQ@pbdZMQ_0.3-0
# - ./travis-tool.sh install_github snoweye/pbdZMQ
- R CMD INSTALL .
- Rscript -e "pbdZMQ::get.zmq.cppflags()"
- Rscript -e "pbdZMQ::get.zmq.ldflags()"
- Rscript -e "pbdZMQ::get.pbdZMQ.ldflags()"
Expand All @@ -30,7 +47,7 @@ script:
- otool -L /Library/Frameworks/R.framework/Versions/3.4/Resources/library/pbdZMQ/libs/libzmq.5.dylib

after_failure:
- ./travis-tool.sh dump_logs
# - ./travis-tool.sh dump_logs

notifications:
email:
Expand Down
9 changes: 8 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
2018-01-07: Ver 0.3-1
* Test with JuniperKernel.

2018-01-06: Ver 0.3-1
* Fix uses of osx external static library.
* Fix get.zmq.conf().

2018-01-03: Ver 0.3-0
* Remove "zmq_utils.h" because #pragma diagnostics is not needed at all.
* Disable "zmq_utils.h" because #pragma diagnostics is not needed at all.

2017-12-30: Ver 0.3-0
* Fix windows conf spacing problems.
Expand Down
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pbdZMQ
Version: 0.3-0
Date: 2017-12-30
Version: 0.3-1
Date: 2018-01-05
Title: Programming with Big Data -- Interface to ZeroMQ
Authors@R: c(person("Wei-Chen", "Chen", role = c("aut", "cre"), email =
"[email protected]"),
Expand All @@ -21,8 +21,8 @@ Depends: R (>= 3.2.0)
LazyLoad: yes
LazyData: yes
Copyright: See files AUTHORS, COPYING, COPYING.LESSER, and MAINTAINERS
in pbdZMQ/inst/zmq_copyright/ for the ZeroMQ source files in
src/zmq_src/ which are under GPL-3.
in 'pbdZMQ/inst/zmq_copyright/' for the ZeroMQ source files in
'src/zmq_src/' which are under GPL-3.
Description: 'ZeroMQ' is a well-known library for high-performance
asynchronous messaging in scalable, distributed applications. This
package provides high level R wrapper functions to easily utilize
Expand All @@ -31,8 +31,8 @@ Description: 'ZeroMQ' is a well-known library for high-performance
is shipped with 'pbdZMQ', which can be used if no system installation
of 'ZeroMQ' is available. A few wrapper functions compatible with
'rzmq' are also provided.
SystemRequirements: Linux, Mac OSX, and Windows, or ZeroMQ library >=
4.0.4. Solaris 10 needs ZeroMQ library 4.0.7 and OpenCSW.
SystemRequirements: Linux, Mac OSX, and Windows, or 'ZeroMQ' library >=
4.0.4. Solaris 10 needs 'ZeroMQ' library 4.0.7 and 'OpenCSW'.
License: GPL-3
URL: http://r-pbd.org/
BugReports: http://group.r-pbd.org/
Expand Down
28 changes: 21 additions & 7 deletions R/get_conf_zmq.r
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ get.zmq.ldflags <- function(arch = '', package = "pbdZMQ"){
system.file(file.name, package = package))
ret <- scan(file.path, what = character(), sep = "\n", quiet = TRUE)

### Check if system zmq is used.
arg <- "SYSTEM_ZMQ_LIBDIR"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
sys.zmq.ld <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])

### Check if external zmq is used.
arg <- "EXTERNAL_ZMQ_LDFLAGS"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
Expand All @@ -65,20 +70,22 @@ get.zmq.ldflags <- function(arch = '', package = "pbdZMQ"){
en.int.zmq <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])

### Check which zmq should be used.
if(ext.zmq.ld == "" || en.int.zmq == "yes"){
if((sys.zmq.ld == "" && ext.zmq.ld == "") || en.int.zmq == "yes"){
file.name <- paste("./libs", arch, "/", sep = "")
dir.path <- tools::file_path_as_absolute(
system.file(file.name, package = package))
if(Sys.info()[['sysname']] == "Darwin"){
lib.osx <- list.files(dir.path, pattern = "libzmq\\.(.*)\\.dylib")
i.ver <- gsub("libzmq\\.(.*)\\.dylib", "\\1", lib.osx)
i.ver <- max(as.integer(i.ver))
zmq.ldflags <- paste("-L", dir.path, " -lzmq.", i.ver, sep = "")
zmq.ldflags <- paste("-L\"", dir.path, "\" -lzmq.", i.ver, sep = "")
} else{
zmq.ldflags <- paste("-L", dir.path, " -lzmq", sep = "")
zmq.ldflags <- paste("-L\"", dir.path, "\" -lzmq", sep = "")
}
} else{
zmq.ldflags <- ext.zmq.ld
arg <- "ZMQ_LDFLAGS"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
zmq.ldflags <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])
}
}

Expand All @@ -105,6 +112,11 @@ get.zmq.cppflags <- function(arch = '', package = "pbdZMQ"){
system.file(file.name, package = package))
ret <- scan(file.path, what = character(), sep = "\n", quiet = TRUE)

### Check if system zmq is used.
arg <- "SYSTEM_ZMQ_INCLUDEDIR"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
sys.zmq.inc <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])

### Check if external zmq is used.
arg <- "EXTERNAL_ZMQ_INCLUDE"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
Expand All @@ -116,13 +128,15 @@ get.zmq.cppflags <- function(arch = '', package = "pbdZMQ"){
en.int.zmq <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])

### Check which zmq should be used.
if(ext.zmq.inc == "" || en.int.zmq == "yes"){
if((sys.zmq.inc == "" && ext.zmq.inc == "") || en.int.zmq == "yes"){
file.name <- paste("./zmq", arch, "/include/", sep = "")
dir.path <- tools::file_path_as_absolute(
system.file(file.name, package = package))
zmq.cppflags <- paste("-I", dir.path, sep = "")
zmq.cppflags <- paste("-I\"", dir.path, "\"", sep = "")
} else{
zmq.cppflags <- ext.zmq.inc
arg <- "ZMQ_INCLUDE"
id <- grep(paste("^", arg, " = ", sep = ""), ret)
zmq.cppflags <- gsub(paste("^", arg, " = (.*)", sep = ""), "\\1", ret[id[1]])
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ if(length(files) > 0){

### For Mac OSX and when "internal ZMQ" is asked.
### Overwrite RPATH from the shared library installed to the destination.
if(Sys.info()[['sysname']] == "Darwin"){
if(Sys.info()[['sysname']] == "Darwin" && length(lib.osx) > 0){
cmd.int <- system("which install_name_tool", intern = TRUE)
cmd.ot <- system("which otool", intern = TRUE)
fn.pbdZMQ.so <- file.path(dest, "pbdZMQ.so")

if(length(lib.osx) != 1){
print(lib.osx)
stop("None or more than one libzmq.*.dylib are found.")
stop("More than one libzmq.*.dylib are found.")
} else{
fn.libzmq.dylib <- file.path(dest, lib.osx)

Expand Down
48 changes: 48 additions & 0 deletions src/zmqsrc/include/zmq_utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
This file is part of libzmq, the ZeroMQ core engine in C++.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
As a special exception, the Contributors give you permission to link
this library with independent modules to produce an executable,
regardless of the license terms of these independent modules, and to
copy and distribute the resulting executable under terms of your choice,
provided that you also meet, for each linked independent module, the
terms and conditions of the license of that module. An independent
module is a module which is not derived from or based on this library.
If you modify this library, you must extend this exception to your
version of the library.
libzmq is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/* This file is deprecated, and all its functionality provided by zmq.h */
/* Note that -Wpedantic compilation requires GCC to avoid using its custom
extensions such as #warning, hence the trick below. Also, pragmas for
warnings or other messages are not standard, not portable, and not all
compilers even have an equivalent concept.
So in the worst case, this include file is treated as silently empty. */

#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) || defined(_MSC_VER)
#if defined(__GNUC__) || defined(__GNUG__)
//WCC #pragma GCC diagnostic push
//WCC #pragma GCC diagnostic warning "-Wcpp"
//WCC #pragma GCC diagnostic ignored "-Werror"
//WCC #pragma GCC diagnostic ignored "-Wall"
#endif
//WCC #pragma message("Warning: zmq_utils.h is deprecated. All its functionality is provided by zmq.h.")
#if defined(__GNUC__) || defined(__GNUG__)
//WCC #pragma GCC diagnostic pop
#endif
#endif

0 comments on commit 926260b

Please sign in to comment.