diff --git a/.travis.yml b/.travis.yml index ef35b2b..611c123 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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()" @@ -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: diff --git a/ChangeLog b/ChangeLog index 3fd8d5d..06bbae9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/DESCRIPTION b/DESCRIPTION index 46ae928..d835bcd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "wccsnow@gmail.com"), @@ -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 @@ -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/ diff --git a/R/get_conf_zmq.r b/R/get_conf_zmq.r index 3e899ad..60f853c 100644 --- a/R/get_conf_zmq.r +++ b/R/get_conf_zmq.r @@ -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) @@ -65,7 +70,7 @@ 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)) @@ -73,12 +78,14 @@ get.zmq.ldflags <- function(arch = '', package = "pbdZMQ"){ 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]]) } } @@ -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) @@ -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]]) } } diff --git a/src/install.libs.R b/src/install.libs.R index e3eccee..2c7a983 100644 --- a/src/install.libs.R +++ b/src/install.libs.R @@ -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) diff --git a/src/zmqsrc/include/zmq_utils.h b/src/zmqsrc/include/zmq_utils.h new file mode 100644 index 0000000..2cf7286 --- /dev/null +++ b/src/zmqsrc/include/zmq_utils.h @@ -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 . +*/ + +/* 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