pbdZMQ icon indicating copy to clipboard operation
pbdZMQ copied to clipboard

Check if using "internal ZMQ" before messing with RPATH

Open mingwandroid opened this issue 7 years ago • 10 comments

We check this via the Autotool's determined ENABLE_INTERNAL_ZMQ variable which requires AC_SUBSTing which requires generating src/install.libs.R from src/install.libs.R.in

Without this, when building this package for the Anaconda Distribution we run into:

installing via 'install.libs.R' to /opt/conda/conda-bld/r-pbdzmq_1516748012741/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/R/library/pbdZMQ
character(0)
Error in eval(ei, envir) :
  None or more than one libzmq.*.dylib are found.

mingwandroid avatar Jan 24 '18 00:01 mingwandroid

Seems I may have broken Windows here, suggestions welcome.

mingwandroid avatar Jan 24 '18 00:01 mingwandroid

No, you should not do that. If ENABLE_INTERNAL_ZMQ were asked and set, then a libzmq.*.dylib should be built and found by install.libs.R. Otherwise, there must have something wrong during producing the libzmq.*.dylib.

It will be helpful to have more information about Anaconda Distribution, where to start it, and how it works.

snoweye avatar Jan 24 '18 02:01 snoweye

The issue here is the opposite of what you say. I do not set and do not want ENABLE_INTERNAL_ZMQ. The Anaconda Distribution builds its own shared libraries for such things.

mingwandroid avatar Jan 24 '18 09:01 mingwandroid

You can read more about The Anaconda Distribution here: https://www.anaconda.com

mingwandroid avatar Jan 24 '18 09:01 mingwandroid

I am not sure what the opposite means.

ENABLE_INTERNAL_ZMQ will only be turned on manually when you have an external ZMQ library but you want to use the one shipped with pbdZMQ.

  • "do not set and do not want". In that case, you need to provide an external zmq library, then you will not reach that error because no dylib file (length(lib.odx) == 0) will be there or found. This seems not to be your error case, so I am not sure about this.
  • If you don't have the external zmq library, then the internal one will be built even you "do not set and do not want" regardless ENABLE_INTERNAL_ZMQ is true or not.

Which one is your case? If you don't have an external ZMQ library and "do not set and do not want", then I don't know a way to have pbdZMQ run.

snoweye avatar Jan 25 '18 01:01 snoweye

We have an external libzmq.dylib but it is not where this code is looking for it and we do not need this code to run install_name_tool since our build system does that correctly for our required layout.

mingwandroid avatar Jan 25 '18 10:01 mingwandroid

  • If you need to specify the external libraries, you can do these flags to pass them into pbdZMQ and skip the internal shipped one.
  • install.lib.R does not do install_name_tool to external libraries regardless what cases. It only applies to the one shipped within pbdZMQ when a libzmq*.dylib is built.
  • Unless you copy any libzmq* from outside of pbdZMQ, length(lib.osx) will be 0 when external libraries are provided, because lib.osx <- list.files(pattern = "libzmq\\.(.*)\\.dylib") at line 7 of install.lib.R will not have anything.

What is your case?

snoweye avatar Jan 26 '18 02:01 snoweye

I don't think this is needed, so I close this one. Let me know if there are other problems.

snoweye avatar Feb 11 '18 18:02 snoweye

OK thanks. I tried your suggestion and other than needing to replace --configure-vars with --configure-args it seems to work fine. Do you want a bug report or a PR to fix the docs here?

mingwandroid avatar May 04 '18 09:05 mingwandroid

Either one is fine. I will alter any of them if the changes don't upset CRAN.

snoweye avatar May 05 '18 17:05 snoweye