themattman / mongodb-raspberrypi-binaries

Unofficial MongoDB Community Edition Binaries for Raspberry Pi
Other
108 stars 10 forks source link

Link for 6.0.10 version is not working ? #3

Closed mcury1985 closed 9 months ago

mcury1985 commented 9 months ago

Hello Themattman, thanks again for the good work.

I think there is a problem with the links provided.

Link for 6.0.10 version is not working ? .tar.gz and .zip files are 15Kbytes only ?

Thanks

themattman commented 9 months ago

Hi @mcury1985, I have been setting up automation for building as new community versions are made available. My script had an issue that led to the release getting created without an asset being uploaded. Earlier today and not too long after you raised this issue I uploaded a tarball for 6.0.10. Let me know if this binary release doesn't work for you.

mcury1985 commented 9 months ago

Thanks themattman, the link is now working perfectly but it seems that there is a problem when starting the service.

System: Raspberry PI 4b 4G running Ubuntu 20.04.6 LTS 64 bits - up to date Linux rpi4 5.4.0-1093-raspi #104-Ubuntu SMP PREEMPT Thu Aug 24 08:54:40 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

Errors: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found

/lib/aarch64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found

I'll be reverting to 6.0.8 for the time being.

themattman commented 9 months ago

Aha, check the release notes for 7.x releases for how to address this. Thanks for the report that this affects 6.0.10.

mcury1985 commented 9 months ago

Thanks once again

mcury1985 commented 9 months ago

Hi, sorry to reopen this issue.

Downloaded the file https://ftp.wayne.edu/gnu/gcc/gcc-11.1.0/gcc-11.1.0.tar.gz Built it for the following language: c,c++,fortran and --with-cpu=cortex-a72

This created the following files:

ubuntu@rpi4:~/gcc-11.1.0/obj$ find -name libstdc++.so.6 ./aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6 ./stage1-aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6 ./prev-aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6

Created the symlink:

ubuntu@rpi4:~$ sudo rm /lib/aarch64-linux-gnu/libstdc++.so.6 ubuntu@rpi4:~$ cd ~/gcc-11.1.0/obj/aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs ubuntu@rpi4:~/gcc-11.1.0/obj/aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs$ sudo ln -s libstdc++.so.6.0.29 /lib/aarch64-linux-gnu/libstdc++.so.6

And now I'm getting the following error:

Sep 24 10:57:11 rpi4 systemd[1]: Starting mongod 6 start... Sep 24 10:57:11 rpi4 mongod[386742]: /home/ubuntu/mdb-binaries/./mongod: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Sep 24 10:57:11 rpi4 systemd[1]: mongod_6.service: Control process exited, code=exited, status=127/n/a

Can you point me in the right direction ?

themattman commented 9 months ago

Oops, looks like my instructions were wrong. But it's an easy fix.

Flip the arguments to ln. You want to create a symlink called libstdc++.so.6 in /lib/aarch64-linux-gnu/ that points to the custom-built libstdc++.so.29.

Confirm this worked with:

$ ldd mongod
...
    libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000007f8083c000)
...
mcury1985 commented 9 months ago

That worked perfectly, now the service is UP and running.

ubuntu@rpi4:~/gcc-11.1.0/obj/aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs$ sudo ln libstdc++.so.6.0.29 /lib/aarch64-linux-gnu/libstdc++.so.6

ubuntu@rpi4:~/mdb-binaries$ ldd mongod | grep libstdc++.so.6
    libstdc++.so.6 => /lib/aarch64-linux-gnu/libstdc++.so.6 (0x0000ffff81533000)

When Graylog starts to use mongodb 7, I'll be ready :)

Really thanks themattman, saved me again.

mcury1985 commented 9 months ago

By the way, I used this script to build gcc-11.1.0:

#!/bin/bash

# see: https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=6201&start=1150#p1779273

# REMEMBER TO UNCOMMENT THE CONFIGURE LINE FOR YOUR TARGET PLATFORM.
# ... and comment out the default of course.

#
#  This is the new GCC version to install.
#
VERSION=11.1.0

#
#  These are the languages the new compiler should support.
#
LANG=c,c++,fortran

#
#  For any computer with less than 2GB of memory.
#
#if [ -f /etc/dphys-swapfile ]; then
#  sudo sed -i 's/^CONF_SWAPSIZE=[0-9]*$/CONF_SWAPSIZE=1792/' /etc/dphys-swapfile
#  sudo /etc/init.d/dphys-swapfile restart
#fi

if [ -d gcc-$VERSION ]; then
  cd gcc-$VERSION
  rm -rf obj
else
  #wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$VERSION/gcc-$VERSION.tar.xz
  wget https://ftp.wayne.edu/gnu/gcc/gcc-$VERSION/gcc-$VERSION.tar.xz
  tar xf gcc-$VERSION.tar.xz
  rm -f gcc-$VERSION.tar.xz
  cd gcc-$VERSION
    echo "Now sleeping to check the `pwd`/contrib/Download_prerequisites file..."
    sleep 300 
  contrib/download_prerequisites
fi
mkdir -p obj
cd obj

#
#  Now run the ./configure which must be checked/edited beforehand.
#  Uncomment the sections below depending on your platform.  You may build
#  on a Pi3 for a target Pi Zero by uncommenting the Pi Zero section.
#  To alter the target directory set --prefix=<dir>
#  For a very quick build try: --disable-bootstrap
#

# x86_64
#../configure --disable-multilib --enable-languages=$LANG

# AArch64 Pi4 in 64-bit mode
../configure --enable-languages=$LANG --with-cpu=cortex-a72

# Pi Zero
#../configure --enable-languages=$LANG --with-cpu=arm1176jzf-s \
#  --with-fpu=vfp --with-float=hard --build=arm-linux-gnueabihf \
#  --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

# Pi3+, Pi3, Pi4 in 32-bit mode
#../configure --enable-languages=$LANG --with-cpu=cortex-a53 \
#  --with-fpu=neon-fp-armv8 --with-float=hard --build=arm-linux-gnueabihf \
#  --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

# Old Pi2
#../configure --enable-languages=$LANG --with-cpu=cortex-a7 \
#  --with-fpu=neon-vfpv4 --with-float=hard --build=arm-linux-gnueabihf \
#  --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf

#
#  Now build GCC which will take a long time.  This could range from
#  3.5 hours on a 4GB Pi4 up to about 50 hours on a Pi Zero.  It can be
#  left to complete overnight (or over the weekend for a Pi Zero :-)
#  The most likely causes of failure are lack of disk space, lack of
#  swap space or memory, or the wrong configure section uncommented.
#  The new compiler is placed in /usr/local/bin, the existing compiler remains
#  in /usr/bin and may be used by giving its version gcc-6 (say).
#
if make -j `nproc`
then
  echo
  echo read -p "Do you wish to install the new GCC (y/n)? " yn
#   case $yn in
#    [Yy]* ) sudo make install ;;
#    * ) exit ;;
#   esac
fi

Found it at https://forums.raspberrypi.com/viewtopic.php?p=2137768#p2137768 Perhaps this script can help others in the future.

themattman commented 8 months ago

I realized this week that production binaries statically link against libstdc++. I hope to eventually ship binaries with this dependency included. I think there's something in the build system that is excluding libstdc++ from static linking when I target a different platform versus targeting a supported platform. The release notes will reflect when this dependency is no longer a dynamically-linked dependency.