Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2.2. tarball install fails #2621

Closed
ax3l opened this issue Jul 12, 2017 · 12 comments
Closed

4.2.2. tarball install fails #2621

ax3l opened this issue Jul 12, 2017 · 12 comments

Comments

@ax3l
Copy link

ax3l commented Jul 12, 2017

Hi,

I currently found no way to install the official tarball of release 4.2.2 under https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz .

It always fails on

CMake Error: File /zeromq-4.2.2/ZeroMQConfig.cmake.in does not exist.
CMake Error at /usr/share/cmake-3.5/Modules/CMakePackageConfigHelpers.cmake:323 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:920 (configure_package_config_file)

If I use the git tag v4.2.2 instead it works.

Here are two Dockerfiles to reproduce the issue:

Tar Install

FROM       ubuntu:16.04

ENV        DEBIAN_FRONTEND noninteractive

# install minimal spack dependencies
RUN        apt-get update \
           && apt-get install -y --no-install-recommends \
              autoconf \
              autogen \
              autotools-dev \
              automake \
              bash-completion \
              ca-certificates \
              cmake \
              git \
              build-essential \
              libtool \
              pkg-config \
              unzip \
              wget \
           && rm -rf /var/lib/apt/lists/*

RUN        g++ --version

ENV        ZMQ_VERSION 4.2.2
RUN        wget -q https://github.com/zeromq/libzmq/releases/download/v$ZMQ_VERSION/zeromq-$ZMQ_VERSION.tar.gz

RUN        tar -xzf zeromq-$ZMQ_VERSION.tar.gz
RUN        cd /zeromq-$ZMQ_VERSION/ && ./autogen.sh

RUN        mkdir build \
           && cd build \
           && cmake ../zeromq-$ZMQ_VERSION -DCMAKE_INSTALL_PREFIX=/usr \
           && make -j4 install

Git Tag Install

FROM       ubuntu:16.04

ENV        DEBIAN_FRONTEND noninteractive

# install minimal spack dependencies
RUN        apt-get update \
           && apt-get install -y --no-install-recommends \
              autoconf \
              autogen \
              autotools-dev \
              automake \
              bash-completion \
              ca-certificates \
              cmake \
              git \
              build-essential \
              libtool \
              pkg-config \
              unzip \
              wget \
           && rm -rf /var/lib/apt/lists/*

RUN        g++ --version

ENV        ZMQ_VERSION 4.2.2
RUN        git clone --depth=50 https://github.com/zeromq/libzmq.git --branch=v$ZMQ_VERSION \
           && mv libzmq zeromq-$ZMQ_VERSION

RUN        cd /zeromq-$ZMQ_VERSION/ && ./autogen.sh

RUN        mkdir build \
           && cd build \
           && cmake ../zeromq-$ZMQ_VERSION -DCMAKE_INSTALL_PREFIX=/usr \
           && make -j4 install
@bluca
Copy link
Member

bluca commented Jul 12, 2017

There were issues with cmake that have since been fixed.

In general it makes sense to use the distributable tarball if you intend to use the provided and generated autoconf script (eg: ./configure; make; make install).

For CMake use there's nothing different from the tarball of the repository snapshot (eg: https://github.com/zeromq/libzmq/archive/v4.2.2.tar.gz ).

@ax3l
Copy link
Author

ax3l commented Jul 12, 2017

Thanks for the quick response!

Isn't that the same .tar.gz I am using?

There were issues with cmake that have since been fixed.

Are you referring to post the 4.2.2 release?

In general it makes sense to use the distributable tarball if you intend to use the provided and generated autoconf script (eg: ./configure; make; make install).

I tried, but I need the CMake install since the autotools/configure install does is not found by cppzmq due to a lack of installing a CMake module or other hint for CMake (which requires a CMake based libzmq install).

@bluca
Copy link
Member

bluca commented Jul 12, 2017

Yes, the missing files were added to the dist tarball in git, no release yet.

For each release, there are 2 sets of tarballs: https://github.com/zeromq/libzmq/releases/tag/v4.2.2
One is the automatically zipped/tarred git repository created by github, and the other one is the distributable tarball that we create and deploy.
That link is for the tarred up git repository, and has everything you need for use with cmake.

@ax3l
Copy link
Author

ax3l commented Jul 12, 2017

all right, I probably clicked the wrong tarball link 🤦‍

looking forward to the next release with the fixed cmake parts then.

@ax3l
Copy link
Author

ax3l commented Jul 12, 2017

any plans to make the autotools install find-able with cppzmq's CMake scripts, too?

it causes a bit of trouble for packaging scripts if one build method of libzmq can be the dependency of cppzmq and the other can't: spack/spack#4737 :)

@bluca
Copy link
Member

bluca commented Jul 12, 2017

If the files required are generated by CMake then we can't, as that's an autotools build.

@ax3l
Copy link
Author

ax3l commented Jul 14, 2017

The files in question are the package hints you install in <prefix>/share/cmake/ which are

  • ZeroMQConfigVersion.cmake (just copy, you take the default created by cmake)
  • ZeroMQConfig.cmake (just copy, you take the default created by cmake)
  • ZeroMQTargets.cmake (also rather static)
  • ZeroMQTargets-release.cmake (just replace the version)

In principle one can also copy and fill those with the autotools install or just install a single, less sophisticated ZeroMQConfig.cmake to be found at all.

The autotools install can probably avoid adding those files and still be found by CMake find_package if the pkg-config file you install exposes the same name (ZeroMQ) for the project as CMake. Unfortunately, the project is called libzmq in the pkg-config name (lib/pkgconfig/libzmq.pc) and ZeroMQ in the CMake name (share/cmake/ZeroMQ/ZeroMQ*.cmake) which is a mismatch.

@ax3l
Copy link
Author

ax3l commented Jul 14, 2017

Again alternatively, you could patch the cppzmq repo to not require a cmake install but to piggy-back on your always installed pkg-config libzmq: https://cmake.org/Wiki/CMake:How_To_Find_Libraries

@bluca
Copy link
Member

bluca commented Jul 14, 2017

The problem with those CMake files is that again they are created by CMake, but it might not be available everywhere where autotools needs to be able to run, eg: embedded devices, or a new bootstrapping architecture.
So we can't just add a CMake build step in the autotools chain unfortunately.

And we also can't change the name of the pkg-config file as it would break backware compatibility, IIRC aliases can't be defined.

So I think the best solution would be your suggestion of using pkgconfig in cppzmq - would be best as a fallback if the cmake stuff cannot be found.
Could you please send a PR to fix it?

@ax3l
Copy link
Author

ax3l commented Jul 14, 2017

yes seems like the only reasonable solution to me, too.

So for the original thread topic:

  • I used the wrong tarball link (git tag instead of uploaded source artifact)
  • still, 4.2.2 CMake installs are still broken with some versions of CMake

I will report the pkg-config support downstream in cppzmq

@ax3l ax3l closed this as completed Jul 14, 2017
@bluca
Copy link
Member

bluca commented Jul 14, 2017

Thanks!

@DanielKoohmarey
Copy link

Note to anyone finding this thread now, the correct tarball to grab for cmake is https://github.com/zeromq/libzmq/archive/v4.2.2.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants