Home   Manual

Avogadro-libs-1.93.0 fails to build due to missing "archive.h"

Avogadro version
avogadro2-libs-1.90.0-12
Qt: 5.9.2

Desktop version
OS: Linux Scienfitic Linux (compatible with Redhat EL7)
Version: 7.6
Compiler: gcc-c+±4.8.5-39.el7.x86_64, cmake-2.8.12.2-2.el7.x86_64

Describe the bug
I am making a package of “avogadro2-libs-1.93.0-1.fc32” on the RHEL7 platform. But, the build fails in the part of “plugindownloader” due to missing “archive.h”.

The error message is the following. The cause of “la_int64_t” should be defined by “archive.h”. This header, “archive.h”, is defined in “zipextracter.h”.

Do you have any idea how to fix it?

In "avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.h"
#include “archive.h”
#include “archive_entry.h”

We use the following packages which were required by the build.

  • libarchive-3.1.2-14.el7_7.x86_64
  • msgpack-3.1.0-2.el7.x86_64
  • mmtf-cpp-devel-1.0.0-2.el7.x86_64

build.log

/tmp/avogadro2/BUILD/avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.cpp: In member function ‘int Avogadro::QtPlugins::ZipExtracter::copyData(archive*, archive*)’:
/tmp/avogadro2/BUILD/avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.cpp:38:3: error: ‘la_int64_t’ was not declared in this scope
la_int64_t offset;
^~~~~~~~~~
/tmp/avogadro2/BUILD/avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.cpp:38:3: note: suggested alternative: ‘u_int64_t’
la_int64_t offset;
^~~~~~~~~~
u_int64_t
/tmp/avogadro2/BUILD/avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.cpp:41:52: error: ‘offset’ was not declared in this scope
r = archive_read_data_block(ar, &buff, &size, &offset);
^~~~~~
/tmp/avogadro2/BUILD/avogadrolibs-1.93.0/avogadro/qtplugins/plugindownloader/zipextracter.cpp:41:52: note: suggested alternative: ‘off_t’
r = archive_read_data_block(ar, &buff, &size, &offset);
^~~~~~
off_t

Thank you in advance
Gen

Are you using a recent version of the openchemistry repository and/or USE_SYSTEM_LIBARCHIVE ?

The downloader uses libarchive which is clearly your missing header.

I’ll post this to the GitHub issue too;

I simply took an RPM source package of FedoraCore 32 and have migrated it for CentOS7/SL7.

It would be hard to explain all configurations only on this thread so that I made a configuration of docker container and its builder.

As you can see, the build logs are

It fails in the section of “plugindownloader”.

The source RPMs I put are
under avogadro2-docker/avogadro2-packages

In this build, this spec file is used.

under avogadro2-docker/avogadro2-packages/avogadro2-libs-1.93.0-1.fc32.src/avogadro2-libs.spec

In the section of ‘build’, it fails. In Fedora Core 32 which should build the original source RPM (avogadro2-libs-1.93.0-1.fc32.src), I still do not succeed its build.

If I need to put some other packages such as openchemistry, I’d put it in the SPEC file. Could you tell me which package we need?


export LDFLAGS="%{__global_ldflags} -Wl,–as-needed"

%cmake3 -DCMAKE_BUILD_TYPE:STRING=Release \

-DINSTALL_INCLUDE_DIR:PATH=include/avogadro2 -DINSTALL_LIBRARY_DIR:PATH=%{_lib} \

-Wno-dev \

-DENABLE_GLSL:BOOL=ON \

-DENABLE_PYTHON:BOOL=ON \

-DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \

-DPYTHON_VERSION:STRING=%{python3_version} \

%if 0%{?fedora}

-DUSE_BOOST_PYTHON:BOOL=ON \

%else

-DUSE_BOOST_PYTHON:BOOL=OFF \

%endif

-DENABLE_RPATH:BOOL=OFF \

-DENABLE_TESTING:BOOL=OFF \

-DUSE_MMTF:BOOL=ON \

-DUSE_QT:BOOL=ON \

-DUSE_MOLEQUEUE:BOOL=ON \

-DUSE_VTK:BOOL=OFF \

-DUSE_HDF5:BOOL=ON \

-DUSE_SPGLIB:BOOL=ON \

-DSPGLIB_LIBRARY:FILEPATH=%{_libdir}/libsymspg.so \

-DBUILD_GPL_PLUGINS:BOOL=ON \

-DBUILD_STATIC_PLUGINS:BOOL=ON \

-DBUILD_DOCUMENTATION:BOOL=ON \

-DUSE_LIBMSYM:BOOL=OFF …

%make_build


Thank you in advance,
Gen

P.s.
I tried also “-DUSE_SYSTEM_LIBARCHIVE=ON” and some other things (e.g. fixing variable definitions) in the code, but it did not improve the situation.

As far as I can see the spec file, the recent source RPM build (version 1.93.0-1 on 06.Feb.2020) was successful in the fedora build environments. If I cannot fix it, I would contact to the composer of the fedora project.

In any case, I would like to make a build environment of Avogadro2 in Docker, for ‘avogadro2’ and ‘avogadro2-libs’ of the latest master release in Avogadro2 GitHub.

The fedora packager Antonio answered. I could build the package after using the newer libarchive.

I update the “avogadro2-docker” as well.

It’s a compatibility issue with libarchive-3.1.2 provided on EPEL7.

libarchive needs to be updated to a recent version (Fedora 32 provides
libarchive-3.4.2).

Could you please point me at your docker? I’ve been looking through the GitHub action infrastructure and would love to have RH or other RPM builds automatically.