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

"libsodium is required" appeared even libsodium is correctly installed #1

Open
anguschiu1 opened this issue Aug 12, 2018 · 7 comments

Comments

@anguschiu1
Copy link

When running make ., the error keep coming

-- Could NOT find sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG) 
CMake Error at CMakeLists.txt:9 (MESSAGE):
  libsodium is required


-- Configuring incomplete, errors occurred!
See also "/Users/anguschiu/Documents/Dev/segvan/CMakeFiles/CMakeOutput.log".

It happened no matter I installed libsodium by brew install libsodium or by tar ball provided by official website

(I am using Mac OSX High Sierra 10.13.6)

Thank you!

@tobixen
Copy link

tobixen commented Apr 3, 2019

Same here, on archlinux

$ sudo pacman -S libsodium
warning: libsodium-1.0.17-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) libsodium-1.0.17-1

Total Download Size:   0.15 MiB
Total Installed Size:  0.48 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 libsodium-1.0.17-1-x86_64                               155.1 KiB   257K/s 00:01 [###############################################] 100%
(1/1) checking keys in keyring                                                    [###############################################] 100%
(1/1) checking package integrity                                                  [###############################################] 100%
(1/1) loading package files                                                       [###############################################] 100%
(1/1) checking for file conflicts                                                 [###############################################] 100%
(1/1) checking available disk space                                               [###############################################] 100%
:: Processing package changes...
(1/1) reinstalling libsodium                                                      [###############################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

$ cat /var/lib/pacman/local/libsodium-1.0.17-1/files 
%FILES%
usr/
usr/include/
usr/include/sodium.h
usr/include/sodium/
usr/include/sodium/core.h
usr/include/sodium/crypto_aead_aes256gcm.h
usr/include/sodium/crypto_aead_chacha20poly1305.h
usr/include/sodium/crypto_aead_xchacha20poly1305.h
usr/include/sodium/crypto_auth.h
usr/include/sodium/crypto_auth_hmacsha256.h
usr/include/sodium/crypto_auth_hmacsha512.h
usr/include/sodium/crypto_auth_hmacsha512256.h
usr/include/sodium/crypto_box.h
usr/include/sodium/crypto_box_curve25519xchacha20poly1305.h
usr/include/sodium/crypto_box_curve25519xsalsa20poly1305.h
usr/include/sodium/crypto_core_ed25519.h
usr/include/sodium/crypto_core_hchacha20.h
usr/include/sodium/crypto_core_hsalsa20.h
usr/include/sodium/crypto_core_salsa20.h
usr/include/sodium/crypto_core_salsa2012.h
usr/include/sodium/crypto_core_salsa208.h
usr/include/sodium/crypto_generichash.h
usr/include/sodium/crypto_generichash_blake2b.h
usr/include/sodium/crypto_hash.h
usr/include/sodium/crypto_hash_sha256.h
usr/include/sodium/crypto_hash_sha512.h
usr/include/sodium/crypto_kdf.h
usr/include/sodium/crypto_kdf_blake2b.h
usr/include/sodium/crypto_kx.h
usr/include/sodium/crypto_onetimeauth.h
usr/include/sodium/crypto_onetimeauth_poly1305.h
usr/include/sodium/crypto_pwhash.h
usr/include/sodium/crypto_pwhash_argon2i.h
usr/include/sodium/crypto_pwhash_argon2id.h
usr/include/sodium/crypto_pwhash_scryptsalsa208sha256.h
usr/include/sodium/crypto_scalarmult.h
usr/include/sodium/crypto_scalarmult_curve25519.h
usr/include/sodium/crypto_scalarmult_ed25519.h
usr/include/sodium/crypto_secretbox.h
usr/include/sodium/crypto_secretbox_xchacha20poly1305.h
usr/include/sodium/crypto_secretbox_xsalsa20poly1305.h
usr/include/sodium/crypto_secretstream_xchacha20poly1305.h
usr/include/sodium/crypto_shorthash.h
usr/include/sodium/crypto_shorthash_siphash24.h
usr/include/sodium/crypto_sign.h
usr/include/sodium/crypto_sign_ed25519.h
usr/include/sodium/crypto_sign_edwards25519sha512batch.h
usr/include/sodium/crypto_stream.h
usr/include/sodium/crypto_stream_chacha20.h
usr/include/sodium/crypto_stream_salsa20.h
usr/include/sodium/crypto_stream_salsa2012.h
usr/include/sodium/crypto_stream_salsa208.h
usr/include/sodium/crypto_stream_xchacha20.h
usr/include/sodium/crypto_stream_xsalsa20.h
usr/include/sodium/crypto_verify_16.h
usr/include/sodium/crypto_verify_32.h
usr/include/sodium/crypto_verify_64.h
usr/include/sodium/export.h
usr/include/sodium/randombytes.h
usr/include/sodium/randombytes_salsa20_random.h
usr/include/sodium/randombytes_sysrandom.h
usr/include/sodium/runtime.h
usr/include/sodium/utils.h
usr/include/sodium/version.h
usr/lib/
usr/lib/libsodium.so
usr/lib/libsodium.so.23
usr/lib/libsodium.so.23.2.0
usr/lib/pkgconfig/
usr/lib/pkgconfig/libsodium.pc
usr/share/
usr/share/licenses/
usr/share/licenses/libsodium/
usr/share/licenses/libsodium/LICENSE

$ md5sum /usr/lib/libsodium.so.23.2.0
cdcef12e7026d945a10c00353c4276fa  /usr/lib/libsodium.so.23.2.0

$ ls -al /usr/lib/libsodium.so.23.2.0
-rwxr-xr-x 1 root root 350688 Jan  7 21:44 /usr/lib/libsodium.so.23.2.0

$ ls -al /usr/lib/libsodium.so
lrwxrwxrwx 1 root root 19 Jan  7 21:44 /usr/lib/libsodium.so -> libsodium.so.23.2.0

$ cmake .
-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/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: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG) 
CMake Error at CMakeLists.txt:9 (MESSAGE):
  libsodium is required


-- Configuring incomplete, errors occurred!
See also "/home/tobias/segvan/CMakeFiles/CMakeOutput.log".

$ grep -c -i sodium /home/tobias/segvan/CMakeFiles/CMakeOutput.log
0

I have no clue about CMake, but I tried hardcoding the sodium include dir. Then I got the error that sodium_LIBRARY_RELEASE was not defined. Not sure if this should be set to the version number of sodium ... anyway, at that point I decided I've been wasting enough time on this :-)

@tobixen
Copy link

tobixen commented Apr 3, 2019

I downloaded the latest version of Findsodium.cmake from https://github.com/jedisct1/libsodium/blob/master/contrib/Findsodium.cmake but still no success.

@tobixen
Copy link

tobixen commented Apr 3, 2019

It's obviously an error of the upstream Findsodium.cmake, though since it's "just" a file in a contrib directory under libsodium, I'm not sure the issue tracker at the libsodium github is the proper place for it.

@ghost
Copy link

ghost commented Apr 8, 2019

Worked with the latest libsodium installation guide https://libsodium.gitbook.io/doc/installation

@tobixen
Copy link

tobixen commented Apr 8, 2019

I should try to check that up ... if I only could find some time for it.

Since the original reporter had problems when installing it from the official tarball as well as through brew, and I can't get it to work with libsodium installed through archlinux/pacman, I would guess Findsodium fails due to other reasons, i.e. some other missing dependency. I wish I had the skills to debug it.

@kristapsk
Copy link
Owner

This has been only tested by myself on Gentoo, where I haven't got any issues with finding libsodium. If some changes in Findsodium.cmake or elsewhere helps, I open to pull requests.

@trurebel
Copy link

I've got the latest MacOS betas of everything, loads of system warning for early unsupported software, but libsodium "works". The CMake file though seems to be incomplete:

`CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.`

However, this is probably not related to my next, and perhaps final, error:

Scanning dependencies of target segvan [ 50%] Building CXX object CMakeFiles/segvan.dir/segvan.cpp.o [100%] Linking CXX executable segvan ld: library not found for -lboost_chrono-mt clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [segvan] Error 1 make[1]: *** [CMakeFiles/segvan.dir/all] Error 2 make: *** [all] Error 2

This was fixed by export LDFLAGS='-L/usr/local/lib/' , but it does make me wonder how come CMake does not do that automatically, I thought that was the entire point of cmake.

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

4 participants