Git Product home page Git Product logo

Comments (6)

sd-stephan avatar sd-stephan commented on August 17, 2024

I had the same problem (next time I'll look here first), but your suggestion would not solve the problem IMO, since ZeroMQ might be installed a different location (it is on my machine) and the point of pkgconfig is exactly to enable that.

I think it would be sufficient to include it in the README file that prior to building the PKG_CONFIG_PATH variable has point to where ZeroMQ is installed.

from zeromq.node.

nponeccop avatar nponeccop commented on August 17, 2024

No! PKG_CONFIG_PATH should point to where pkgconfig database is installed, not to where ZeroMQ is installed. The problem is that pkgconfig database is located at /usr/local/lib/pkgconfig/ on many systems (see other tickets mentioning pkgconfig), and pkgconfig itself assumes a different location for its database (/usr/lib/pkgconfig/ folder if I remember correctly).

I vote for setting PKG_CONFIG_PATH within wscript, not for setting library search paths and duplicating what pkgconfig is for.

README is not a solution because the preferred way of installing the library is through NPM. What if a user installs a library and zmq is installed as a dependency? Resolving issues by downloading the broken library and reading README is a great PITA. If pain can avoided, why not?

NPM uses node-waf to build binary node.js extensions such as zmq, and node-waf seems to be powerful enough to set such search paths and enable a fully automated configuration and compilation.

from zeromq.node.

sd-stephan avatar sd-stephan commented on August 17, 2024

You got it wrong. I was not setting the library search path via pkg-config, which would not work since that's done via ldconfig or LD_LIBRARY_PATH. pkg-config informs the configure procedure whether a library is installed and where the necessary header files are.

If you install zeromq in a non-default path (i.e. I installed it in /opt/local/zeromq) under ./lib/pkgconfig you find the corresponding pkgconfig database. If you read the man page it clearly states that pgk-config
"will additionally look in the colon-separated ... list of directories specified by the PKG_CONFIG_PATH environment variable".

As for the README. What I suggested was to include a note to set the PKG_CONFIG_PATH before executing nmp.
Should look something like this:

export PKG_CONFIG_PATH=/path/to/zeromq/prefix/lib/pkgconfig
npm install zeromq

Where "/path/to/zeromq/prefix/" is the prefix that you used when you installed zeromq from source.
That worked for me. My understanding is that npm downloads the sources and uses pkg-config (and subsequently PKG_CONFIG_PATH) to figure out where zeromq is installed. You still have to make sure that your system finds the zeromq library at runtime. There are at least two ways that I know of either using ldconfig or LD_LIBRARY_PATH.

Hard coding a specific path into the install script seems to defeat the whole purpose of pkg-config IMO since it's meant to be a generic mechanism to set such paths.

from zeromq.node.

dvv avatar dvv commented on August 17, 2024

Related: it's impossible to npm install this repo unless you already have system wide libzmq-dev installed (debian-ly speaking) or you've root privileges to install libzmq. While it's easy to override libzmq headers location by running PKG_CONFIG_PATH=/path/of/your/local/libzmq/build/src CXXFLAGS="-I/path/of/your/local/libzmq/build/include" node-waf configure build, node-waf seems to not honor passed LINKFLAGS=/path/of/your/local/libzmq/build/src/.libs which results in not finding -lzmq.

Please, consider adding maybe a special target which could download and use libzmq sources locally.

TIA,
--Vladimir

from zeromq.node.

nponeccop avatar nponeccop commented on August 17, 2024

Are you asking to add support for local libzmq installations (without root privileges)? If so, it's better to create a special ticket

from zeromq.node.

dvv avatar dvv commented on August 17, 2024

Sure -- #53

from zeromq.node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.