OpenChemistry / openchemistry

Supermodule containing submodules and external project to build all components
http://openchemistry.org/
BSD 3-Clause "New" or "Revised" License
80 stars 59 forks source link

libarchive fails to build on Tumbleweed with gcc 8.1.1 #41

Closed fusion809 closed 3 years ago

fusion809 commented 6 years ago

Hi,

I just tried to build this project, I will confess I did manually bump the submodules (avogadroapp, avogadrolib, avogadrodata, molequeue) to their latest master commit, but given that this build failure is in a thirdparty library I don't think that is relevant. The exact error is:

-- Build files have been written to: /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src
[ 57%] Performing build step for 'libarchive'
Scanning dependencies of target archive_static
[  0%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_acl.c.o
[  0%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_check_magic.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_cmdline.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_cryptor.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_digest.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_copy_stat.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_link_resolver.c.o
[  1%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_sparse.c.o
[  2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_stat.c.o
[  2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_strmode.c.o
[  2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_entry_xattr.c.o
[  2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_getdate.c.o
[  2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_hmac.c.o
In file included from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac_private.h:73,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac.c:32:
/home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_openssl_hmac_private.h:34:25: error: static declaration of ‘HMAC_CTX_new’ follows non-static declaration
 static inline HMAC_CTX *HMAC_CTX_new(void)
                         ^~~~~~~~~~~~
In file included from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_openssl_hmac_private.h:28,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac_private.h:73,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac.c:32:
/usr/include/openssl/hmac.h:86:11: note: previous declaration of ‘HMAC_CTX_new’ was here
 HMAC_CTX *HMAC_CTX_new(void);
           ^~~~~~~~~~~~
In file included from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac_private.h:73,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac.c:32:
/home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_openssl_hmac_private.h:40:20: error: static declaration of ‘HMAC_CTX_free’ follows non-static declaration
 static inline void HMAC_CTX_free(HMAC_CTX *ctx)
                    ^~~~~~~~~~~~~
In file included from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_openssl_hmac_private.h:28,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac_private.h:73,
                 from /home/fusion809/GitHub/others/openchemistry-build/thirdparty/libarchive-src/libarchive/archive_hmac.c:32:
/usr/include/openssl/hmac.h:87:6: note: previous declaration of ‘HMAC_CTX_free’ was here
 void HMAC_CTX_free(HMAC_CTX *ctx);
      ^~~~~~~~~~~~~
gmake[5]: *** [libarchive/CMakeFiles/archive_static.dir/build.make:232: libarchive/CMakeFiles/archive_static.dir/archive_hmac.c.o] Error 1
gmake[4]: *** [CMakeFiles/Makefile2:1021: libarchive/CMakeFiles/archive_static.dir/all] Error 2
gmake[3]: *** [Makefile:141: all] Error 2
gmake[2]: *** [thirdparty/CMakeFiles/libarchive.dir/build.make:114: thirdparty/libarchive-prefix/src/libarchive-stamp/libarchive-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:288: thirdparty/CMakeFiles/libarchive.dir/all] Error 2
gmake: *** [Makefile:84: all] Error 2

openssl version is 1.1.0h-fips. Kernel version, if it somehow relevant is 4.17.3-1-default. cmake version is 3.11.4. My openSUSE Tumbleweed version is 20180707. If there's any other bits of information you need feel free to ask and I'll be more than happy to provide it.

Thanks for your time, Brenton

fusion809 commented 6 years ago

I should probably say how I went about building this, I simply followed the build guide (http://wiki.openchemistry.org/Build#Cloning_Repositories). So I ran:

 mkdir openchemistry-build
 cd openchemistry-build
 cmake ../openchemistry
 cmake --build . --config Release

I decided to reboot (as I did a distribution upgrade before running cmake the first time, so I was still running the old kernel and the other pieces of software I was using before the distro upgrade), remove the contents of openchemistry-build and remove the git repo copy, openchemistry, and re-clone it with:

 git clone --recursive git://github.com/OpenChemistry/openchemistry.git

per the build guide, no manual submodule updating (with running git checkout master ; git pull origin master in them). Then I did a clean rebuild and log the output for you's. I got the same error, here are the logs:

first.log second.log

(first.log is the output of the first build command cmake ../openchemistry, second.log is the output of the second command cmake --build . --config Release).

fusion809 commented 6 years ago

This seems to be the only issue though. I managed to create a package for Avogadro 2 in my openSUSE Build Service (OBS) home project, it builds and runs fine on Tumbleweed.

cryos commented 6 years ago

The last line is, [ 2%] Building C object libarchive/CMakeFiles/archive_static.dir/archive_hmac.c.o so I can't see where things failed for you. I am surprised by libarchive failing, it is a pretty simple library. The openchemistry module should be pretty up to date, I can take a look for a newer libarchive, I am not sure what you are aiming for, but you could potentially use system libraries (I haven't checked, but I thought libarchive could just use system too).

fusion809 commented 6 years ago

Well at the moment I'm happy enough, as I managed to create a functioning package for it using the OBS. Just thought you's would like to get this fixed, after all it might surface on other platforms later (after all Tumbleweed is a bleeding-edge distro, with time other distros will get similar software versions and hence this bug may resurface) and otherwise come back to bite users in the future.

cryos commented 6 years ago

I run Arch Linux here, and have GCC 8.1.1 and am able to build libarchive. I just verified as much a moment ago, so I am a little confused. I will keep an eye out, but without an actual error, or ability to reproduce I will bear it in mind.

ezavod commented 5 years ago

Same problem here. Could be fixed by bumping libarchive version:

diff --git a/cmake/projects.cmake b/cmake/projects.cmake
index ea5c12d..6cd17f5 100644
--- a/cmake/projects.cmake
+++ b/cmake/projects.cmake
@@ -72,9 +72,9 @@ set(spglib_md5 "df49ddccecfe82e50ade640d6547571b")

 # libarchive
 list(APPEND projects libarchive)
-set(libarchive_version "3.3.2")
+set(libarchive_version "3.3.3")
 set(libarchive_url "https://github.com/libarchive/libarchive/archive/v${libarchive_version}.tar.gz")
-set(libarchive_md5 "a3acebe237f89d7f31c5bb1da5e843c7")
+set(libarchive_md5 "c591a2781609e7d0c47049a0f061ce99")

 # msgpackc
 list(APPEND projects msgpackc)

See https://github.com/libarchive/libarchive/pull/1005.