diasurgical / devilutionX

Diablo build for modern operating systems
Other
7.97k stars 778 forks source link

Could NOT find Sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG) #225

Closed Polynomial-C closed 4 years ago

Polynomial-C commented 5 years ago

Since commit 1f7f5bf3dccee957e23bdf4d976883b155d5e81 I cannot build the game anymore on Linux. Reverting this commit "fixes" the issue.

ghost commented 5 years ago

Can you tell more about your setup?

Polynomial-C commented 5 years ago

What information do you want to know? It's a 64bit Gentoo Linux but I'm trying to build a 32bit executable and all dependencies have the 32bit parts installed as well.

Polynomial-C commented 5 years ago

Alright, here's some information about this system:

# emerge --info libsodium libsdl2 sdl2-mixer sdl2-ttf 
Portage 2.3.71 (python 3.6.9-final-0, default/linux/amd64/17.1/desktop/plasma, gcc-8.3.0, glibc-2.29-r2, 4.19.65 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.65-x86_64-AMD_Opteron-tm-_Processor_6328-with-gentoo-2.6
KiB Mem:   131999304 total, 100710164 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 08 Aug 2019 06:00:01 +0000
Head commit of repository gentoo: 7330a6332370d71843f98b290e166f2294958257
Timestamp of repository poly-c: Thu, 08 Aug 2019 11:05:02 +0000
sh dash 0.5.10.2
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          5.0_p7::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.0::gentoo
dev-lang/python:          2.7.16::gentoo, 3.6.9::gentoo, 3.7.4-r1::gentoo
dev-util/cmake:           3.15.1::gentoo
sys-apps/baselayout:      2.6-r1::poly-c
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /var/portage
    sync-type: rsync
    sync-uri: rsync://192.168.0.254/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: --new-compress

poly-c
    location: /usr/local/portage
    masters: gentoo
    priority: 0

Installed sets: @system
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-3.0"
CONFIG_PROTECT_MASK="/etc/X11/Sessions /etc/X11/app-defaults /etc/X11/xinit /etc/bonobo-activation /etc/ca-certificates /etc/ca-certificates.conf /etc/dbus-1 /etc/dconf /etc/env.d /etc/fonts /etc/fonts/fonts.conf /etc/foomatic /etc/games /etc/gconf /etc/gentoo-release /etc/gimp /etc/gnome-vfs-2.0 /etc/gre.d /etc/gtk-2.0 /etc/hp /etc/hsqldb /etc/htdig /etc/init.d /etc/iproute2 /etc/java-config-2 /etc/lftp /etc/logrotate.d /etc/ntop /etc/opt /etc/pango /etc/profile.d /etc/qt4 /etc/revdep-rebuild /etc/sandbox.d /etc/sasl2 /etc/sensors.d /etc/sgml /etc/sound /etc/ssl /etc/ssmtp /etc/t1lib /etc/terminfo /etc/vbox /etc/xdg /etc/xinetd.d /etc/xml"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=y --misspell-suggestions=n --autounmask=n --quiet-build=n --verbose-slot-rebuilds=n --fuzzy-search=n --dynamic-deps=n --changed-deps-report=y"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
INSTALL_MASK="/etc/systemd /home/ftp /lib/systemd /lib32/systemd /lib64/systemd /usr/lib/systemd /usr/lib32/systemd /usr/lib64/systemd /etc/init.d/functions.sh /usr/lib/modules-load.d/virtualbox.conf /usr/lib64/firefox/browser/features/firefox@getpocket.com.xpi"
LANG="C.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -Wl,--as-needed"
LINGUAS="de de@1901 en"
MAKEOPTS="-j16"
PKGDIR="/opt/portage/packages"
PORTAGE_BZIP2_COMMAND="lbzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--new-compress"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="3dnow 3dnowext X a52 aac aacs acl acpi activities alsa amd64 berkdb bluetooth bluray branding brotli bzip2 c++0x cairo caps cdda cdr cli crypt css cups cxx dbus declarative dri dts dvd dvdr elogind emboss encode exif faac ffmpeg flac gcrypt gdbm gif glamor gmp gnutls gstreamer gtk iconv icu idn imagemagick inotify jpeg jpeg2k kde kipi kwallet lame lcms libcanberra libnotify libtirpc linguas_de lzma mac mad matroska midi mmap mmx mmxext mng mp3 mp4 mpeg mpfr multilib ncurses nls nptl nsplugin ogg openal opengl openmp opus pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 quicktime readline rtmp sdl seccomp slang speex spell split-usr sse sse2 ssl startup-notification svg theora threads tiff truetype twolame udev udisks unicode upower usb vaapi vcd vdpau vorbis vpx vulkan webp widgets wxwidgets x264 x265 xattr xcb xcomposite xinerama xml xv xvid xvmc zlib zsh-completion zstd" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="access_compat alias auth_basic auth_digest authn_anon authn_core authn_default authn_file authz_core authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dir env file_cache filter headers http2 include info log_config mime mime_magic rewrite socache_shmcb status unique_id unixd userdir vhost_alias" CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" CURL_SSL="gnutls" ELIBC="glibc" GRUB_PLATFORMS="pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="de de-1901 en" LIBREOFFICE_EXTENSIONS="pdfimport presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python3_6 python3_7" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

dev-libs/libsodium-1.0.18::gentoo was built with the following:
USE="asm -minimal -static-libs urandom" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="aes sse4_1"

media-libs/libsdl2-2.0.10::gentoo was built with the following:
USE="X alsa (-altivec) (-aqua) (-custom-cflags) dbus -gles haptic joystick kms -libsamplerate -nas opengl -oss pulseaudio sound -static-libs threads -tslib udev video vulkan -wayland xinerama -xscreensaver" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="-3dnow mmx sse sse2" VIDEO_CARDS="(-vc4)"

media-libs/sdl2-mixer-2.0.4::gentoo was built with the following:
USE="flac -fluidsynth -mad -midi mikmod mod -modplug mp3 opus -playtools -static-libs -timidity -tremor vorbis wav" ABI_X86="32 (64) (-x32)"

media-libs/sdl2-ttf-2.0.15::gentoo was built with the following:
USE="X -static-libs" ABI_X86="32 (64) (-x32)"
cain05 commented 5 years ago

I get the same error on Manjaro, but only when I do a release build setting -DBINARY_RELEASE=ON and -DDEBUG=OFF. A debug build has no issues.

AJenbo commented 5 years ago

I have tried looking in to this issue but since I don't have one of the affected systems (Mac or Linux), can you test on a fresh system and detail the process so that I can better replicate it (I normally run Debian and Ubuntu)

cain05 commented 5 years ago

I just tested on another Manjaro install that was set up last week, so it's pretty fresh. It has SDL2 and libsodium installed on it already. I followed the build instructions in README.md for a release build:

  1. linux32 cmake -DBINARY_RELEASE=ON -DDEBUG=OFF -DCMAKE_TOOLCHAIN_FILE=../CMake/32bit.cmake ..
  2. linux32 make -j$(nproc)

The -DBINARY_RELEASE=ON is what's breaking it. If I remove that, then it builds the debug version no problem. On my system I have lib32-libsodium 1.0.18-1 and libsodium 1.0.18-1. The files listed in the packages can be found here:

https://www.archlinux.org/packages/community/x86_64/libsodium/ https://www.archlinux.org/packages/multilib/x86_64/lib32-libsodium/

Unfortunately I'm very new to this stuff, so if you think there's anything else I should include, let me know.

AJenbo commented 5 years ago

ok thianks, i will see what i can figure out

krant commented 5 years ago

Commenting out this line set(sodium_USE_STATIC_LIBS ON) in CMakeLists.txt resolves the issue.

AJenbo commented 5 years ago

except then libsodium isn't statically linked :)

cain05 commented 5 years ago

There's an AUR package for a libsodium-static, which 1) doesn't install because sha512 of the tarball doesn't match what the PKGBUILD expects, and 2) is for a 64bit build so the linker isn't happy with it even if you work around the validation issue. So I guess the solution (for now) for Manjaro/Arch is don't statically link libsodium, or build a static lib yourself and use that.

AJenbo commented 4 years ago

@Polynomial-C we have updated findsodium.cmake, could you try and see if this is still and issue? @krant @cain05 your offcause also wellcome to give it a shot :)

cain05 commented 4 years ago

I just grabbed the changes and it seems to be building fine for me now on Linux. Thanks.

tomkidd commented 3 years ago

I'm having basically this same issue on macOS. I went through and hammered out the homebrew stuff (had to do some updating and unlinking before the brew bundle install thing worked without issue) but I'm getting essentially this same issue where it's complaining about not finding it but also finding 1.0.18

CMake Error at /usr/local/Cellar/cmake/3.19.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find sodium (missing: sodium_LIBRARY_RELEASE
  sodium_LIBRARY_DEBUG) (found version "1.0.18")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.19.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
  CMake/Findsodium.cmake:227 (find_package_handle_standard_args)
  CMakeLists.txt:137 (find_package)

-- Configuring incomplete, errors occurred!
See also "/Users/tomkidd/Documents/GitHub/devilutionX/build/CMakeFiles/CMakeOutput.log".
See also "/Users/tomkidd/Documents/GitHub/devilutionX/build/CMakeFiles/CMakeError.log".

Let me know if anyone can spot something I'm doing wrong or if you need more info.

This is on Big Sur 11.2.1 so the latest OS, latest Xcode, all 64-bit, etc. Not sure if that's relevant, but the built release from the main page runs fine,

AJenbo commented 3 years ago

Is it x86_64 or Aarch64?

Did you try the previous findsodium.cmake file?

tomkidd commented 3 years ago

If by that you mean do I have an Intel processor or Apple Silicon, it's an Intel processor (MBP from 2014)

I haven't done anything other than the build instructions for macOS

brew bundle install
cd build
cmake ..
cmake --build . -j $(sysctl -n hw.physicalcpu)

where it's dying on the first cmake step

I haven't tried the previous findsodium.cmake file, I can try it.

tomkidd commented 3 years ago

ok CMake succeeds with the version from commit 1f7f5bf3dccee957e23bdf4d976883b155d5e81a

https://github.com/diasurgical/devilutionX/blob/1f7f5bf3dccee957e23bdf4d976883b155d5e81a/CMake/Findsodium.cmake

Which looks to predate a major reformatting.

the actual build then is failing for a different reason, but I can either troubleshoot it or start a new issue

/Users/tomkidd/Documents/GitHub/devilutionX/Source/diablo.cpp:422:13: error: static declaration of 'LoadOptions' follows non-static declaration
static void LoadOptions()
            ^
/Users/tomkidd/Documents/GitHub/devilutionX/Source/diablo.h:60:6: note: previous declaration is here
void LoadOptions();
     ^
1 error generated.
qndel commented 3 years ago

I actually fixed it like 1h ago, update ;)

tomkidd commented 3 years ago

ah, I see that now. Like 14 commits between me messing with this and now. Builds and works, thanks

AJenbo commented 3 years ago

If by that you mean do I have an Intel processor or Apple Silicon, it's an Intel processor (MBP from 2014)

Sorry, marketing is a second language for me :)

AJenbo commented 3 years ago

It's a little hard to test as we need to have two systems that are affected differently so that we can test both cases.

You mentioned having some issues with Brew and this issue seems to mostly affect people that do not have a clean installation so I wonder what change it is that causes this issue and why the old version workers for them but not others.

craldaz commented 3 years ago

I can also confirm that reverting to commit 1f7f5bf works for Apple Silicon M1. I'm here from https://www.reddit.com/r/macgaming/comments/lz0loy/playing_diablo_again_on_my_mac_m1_d/?utm_source=share&utm_medium=web2x&context=3 Thanks for the awesome package by the way!

AJenbo commented 3 years ago

if you can figure out what specific line changes it we can do some thing about it, dont want to break it for one group to fix it for others

covex commented 2 years ago

Still have this issue on latest git with RELEASE build on Fedora. Have to modify the CMakeLists.txt and switch the sodium options to OFF.

andrewschott commented 2 years ago

@covex I just built from source on F34 just fine. Here are my sodium packages:

rpm -qa | grep sodium libsodium-1.0.18-7.fc34.x86_64 libsodium-devel-1.0.18-7.fc34.x86_64 libsodium-1.0.18-7.fc34.i686 libsodium-devel-1.0.18-7.fc34.i686 libsodium-static-1.0.18-7.fc34.x86_64 libsodium-static-1.0.18-7.fc34.i686

Are you missing one? I was and once installed things went great. Mingw builds however are another story for me right now.

covex commented 2 years ago

hm. did you build a release version? I have only libsodium + devel, maybe the release build needs the static (as it tries to build a static build).

andrewschott commented 2 years ago

@covex those are the packages I was missing and once added allowed for everything to compile nicely.

AJenbo commented 2 years ago

Are the packages missing from the build docs? sudo dnf install cmake gcc-c++ glibc-devel SDL2-devel libsodium-devel libpng-devel bzip2-devel libasan libubsan

covex commented 2 years ago

Yes, they are missing, for release build you need then libsodium-static, debug build works without it.

I think there are even more missing, I think I had to install additionaly also

SDL2_mixer gmock-devel gtest gtest-devel SDL2-static SDL2_ttf-devel

glebm commented 2 years ago

SDL2_mixer is not needed for v1.3.0 (it was for v1.2.1)

StephenCWills commented 2 years ago

Are the packages missing from the build docs? sudo dnf install cmake gcc-c++ glibc-devel SDL2-devel libsodium-devel libpng-devel bzip2-devel libasan libubsan

Should we allow release builds without DIST=ON?

https://github.com/diasurgical/devilutionX/blob/8104432db46fcfb859003017bac106b0d407653f/CMakeLists.txt#L52-L57

https://github.com/diasurgical/devilutionX/blob/8104432db46fcfb859003017bac106b0d407653f/CMakeLists.txt#L89-L90

glebm commented 2 years ago

Should we allow release builds without DIST=ON?

I think so, since distributions generally do not want to link things statically. And we should probably get rid of BINARY_RELEASE and NIGHTLY_BUILD which are synonyms to CMAKE_BUILD_TYPE.