keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.22k stars 1.47k forks source link

CentOS7: make -j8 retuns an error #897

Closed drew1kun closed 7 years ago

drew1kun commented 7 years ago

Hi! I am building keepassxc on CentOS7. Prepared my environment as suggested at https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux

sudo yum install libXi-devel libXtst-devel qt5-qtbase-devel \
    qt5-linguist qt5-qtx11extras qt5-qtx11extras-devel qt5-qttools \
    libgcrypt-devel zlib-devel libyubikey-devel ykpers-devel

Installed latest Cmake:

$ /usr/local/bin/cmake --version
cmake version 3.9.1

I do:

$ mkdir build
$ cd build
$ /usr/local/bin/cmake -DWITH_XC_AUTOTYPE=ON -DWITH_XC_HTTP=ON -DWITH_XC_YUBIKEY=ON -DCMAKE_BUILD_TYPE=Release ..

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test WERROR_C_AVAILABLE
-- Performing Test WERROR_C_AVAILABLE - Success
-- Performing Test WERROR_CXX_AVAILABLE
-- Performing Test WERROR_CXX_AVAILABLE - Success
-- Found LibGPGError: /usr/lib64/libgpg-error.so  
-- Found Gcrypt: /usr/lib64/libgcrypt.so (Required is at least version "1.6.0") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7") 
-- Performing Test ZLIB_SUPPORTS_GZIP
-- Performing Test ZLIB_SUPPORTS_GZIP - Success
-- Found YubiKey: /usr/lib64/libyubikey.so;/usr/lib64/libykpers-1.so  
-- Performing Test HAVE_PR_SET_DUMPABLE
-- Performing Test HAVE_PR_SET_DUMPABLE - Success
-- Performing Test HAVE_RLIMIT_CORE
-- Performing Test HAVE_RLIMIT_CORE - Success
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
-- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib64/libX11.so
-- /home/drew/keepassxc/share/translations/keepassx_cs.ts;/home/drew/keepassxc/share/translations/keepassx_da.ts;/home/drew/keepassxc/share/translations/keepassx_de.ts;/home/drew/keepassxc/share/translations/keepassx_el.ts;/home/drew/keepassxc/share/translations/keepassx_en_plurals.ts;/home/drew/keepassxc/share/translations/keepassx_es.ts;/home/drew/keepassxc/share/translations/keepassx_fi.ts;/home/drew/keepassxc/share/translations/keepassx_fr.ts;/home/drew/keepassxc/share/translations/keepassx_id.ts;/home/drew/keepassxc/share/translations/keepassx_it.ts;/home/drew/keepassxc/share/translations/keepassx_ja.ts;/home/drew/keepassxc/share/translations/keepassx_kk.ts;/home/drew/keepassxc/share/translations/keepassx_ko.ts;/home/drew/keepassxc/share/translations/keepassx_lt.ts;/home/drew/keepassxc/share/translations/keepassx_nl_NL.ts;/home/drew/keepassxc/share/translations/keepassx_pl.ts;/home/drew/keepassxc/share/translations/keepassx_pt_BR.ts;/home/drew/keepassxc/share/translations/keepassx_pt_PT.ts;/home/drew/keepassxc/share/translations/keepassx_ru.ts;/home/drew/keepassxc/share/translations/keepassx_sl_SI.ts;/home/drew/keepassxc/share/translations/keepassx_sv.ts;/home/drew/keepassxc/share/translations/keepassx_uk.ts;/home/drew/keepassxc/share/translations/keepassx_zh_CN.ts;/home/drew/keepassxc/share/translations/keepassx_zh_TW.ts
-- Enabled features:
 * AutoType, Automatic password typing
 * KeePassHTTP, Browser integration compatible with ChromeIPass and PassIFox
 * YubiKey, YubiKey HMAC-SHA1 challenge-response

-- Disabled features:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/drew/keepassxc/build

Which looks good.

but then:

$ make -j8
...
[ 36%] Building CXX object src/CMakeFiles/keepassx_core.dir/crypto/Crypto.cpp.o
[ 37%] Building CXX object src/CMakeFiles/keepassx_core.dir/crypto/CryptoHash.cpp.o
[ 37%] Building CXX object src/CMakeFiles/keepassx_core.dir/crypto/Random.cpp.o
/home/drew/keepassxc/src/crypto/Crypto.cpp: In static member function ‘static bool Crypto::checkAlgorithms()’:
/home/drew/keepassxc/src/crypto/Crypto.cpp:93:31: error: ‘GCRY_CIPHER_SALSA20’ was not declared in this scope
     if (gcry_cipher_algo_info(GCRY_CIPHER_SALSA20, GCRYCTL_TEST_ALGO, nullptr, nullptr) != 0) {
                               ^
make[2]: *** [src/CMakeFiles/keepassx_core.dir/crypto/Crypto.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 37%] Building CXX object src/CMakeFiles/keepassx_core.dir/crypto/SymmetricCipher.cpp.o
make[1]: *** [src/CMakeFiles/keepassx_core.dir/all] Error 2
make: *** [all] Error 2

What am I missing?

phoerious commented 7 years ago

Your libgcrypt is too old and you need to install a newer version first.

drew1kun commented 7 years ago

Thank you fro quick reply! I've already found this out... Any ideas how to install it on CentOS?

phoerious commented 7 years ago

Besides compiling a custom libgcrypt? Not really.

drew1kun commented 7 years ago

Tried to compile the libgcrypt-1.8.0 I've compilled libgpg-error-1.27 (dependency)

Now trying to compile the libgcrpit and getting this:

$ cd libgcrypt-1.8.0
$ ./configure --prefix=/usr && make

[...]

gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -fvisibility=hidden -Wall -MT dumpsexp-dumpsexp.o -MD -MP -MF .deps/dumpsexp-dumpsexp.Tpo -c -o dumpsexp-dumpsexp.o `test -f 'dumpsexp.c' || echo './'`dumpsexp.c
mv -f .deps/dumpsexp-dumpsexp.Tpo .deps/dumpsexp-dumpsexp.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -fvisibility=hidden -Wall   -o dumpsexp dumpsexp-dumpsexp.o  
libtool: link: gcc -g -O2 -fvisibility=hidden -Wall -o dumpsexp dumpsexp-dumpsexp.o 
gcc -DHAVE_CONFIG_H -I. -I..    -DSTANDALONE  -g -O2 -fvisibility=hidden -Wall -MT hmac256-hmac256.o -MD -MP -MF .deps/hmac256-hmac256.Tpo -c -o hmac256-hmac256.o `test -f 'hmac256.c' || echo './'`hmac256.c
mv -f .deps/hmac256-hmac256.Tpo .deps/hmac256-hmac256.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc -DSTANDALONE  -g -O2 -fvisibility=hidden -Wall   -o hmac256 hmac256-hmac256.o  
libtool: link: gcc -DSTANDALONE -g -O2 -fvisibility=hidden -Wall -o hmac256 hmac256-hmac256.o 
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -fvisibility=hidden -Wall -MT mpicalc-mpicalc.o -MD -MP -MF .deps/mpicalc-mpicalc.Tpo -c -o mpicalc-mpicalc.o `test -f 'mpicalc.c' || echo './'`mpicalc.c
mv -f .deps/mpicalc-mpicalc.Tpo .deps/mpicalc-mpicalc.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -fvisibility=hidden -Wall   -o mpicalc mpicalc-mpicalc.o libgcrypt.la  -lgpg-error 
libtool: link: gcc -g -O2 -fvisibility=hidden -Wall -o .libs/mpicalc mpicalc-mpicalc.o  ./.libs/libgcrypt.so -lgpg-error
./.libs/libgcrypt.so: undefined reference to `gpgrt_rewind'
./.libs/libgcrypt.so: undefined reference to `gpgrt_fclose_snatch'
./.libs/libgcrypt.so: undefined reference to `gpgrt_lock_lock'
./.libs/libgcrypt.so: undefined reference to `gpgrt_ferror'
./.libs/libgcrypt.so: undefined reference to `gpgrt_lock_init'
./.libs/libgcrypt.so: undefined reference to `gpgrt_fopenmem'
./.libs/libgcrypt.so: undefined reference to `gpgrt_fprintf'
./.libs/libgcrypt.so: undefined reference to `gpgrt_lock_destroy'
./.libs/libgcrypt.so: undefined reference to `gpgrt_fclose'
./.libs/libgcrypt.so: undefined reference to `gpgrt_lock_unlock'
./.libs/libgcrypt.so: undefined reference to `gpgrt_get_syscall_clamp'
collect2: error: ld returned 1 exit status
make[2]: *** [mpicalc] Error 1
make[2]: Leaving directory `/home/drew/libgcrypt-1.8.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/drew/libgcrypt-1.8.0'
make: *** [all] Error 2

Any ideas what can this mean? I'm starting to feel like it's impossible to get keepassxc work on CentOS.

phoerious commented 7 years ago

Appears that you need some dependencies. Those symbols seem to be defined by libgpg.

hifi commented 7 years ago

@Drewshg312 This repository has pre-built CentOS packages: https://copr.fedorainfracloud.org/coprs/bugzy/keepassxc/

It also has a libgcrypt16 package that's specifically built for CentOS 7. You can pull the source RPM packages if you want to recompile yourself.

drew1kun commented 7 years ago

Thanks. It would be nice to add this to a README.md and add instructions.

droidmonkey commented 7 years ago

I added it to the wiki!

https://github.com/keepassxreboot/keepassxc/wiki/Set-up-Build-Environment-on-Linux