audiowaveform icon indicating copy to clipboard operation
audiowaveform copied to clipboard

Installing on AWS Linux?

Open bartwalczak opened this issue 9 years ago • 20 comments

I'm trying to install it on AWS EC2 Linux, and unfortunately yum shows that libsndfile and libsndfile-dev packages are not available. Is there another way to install these? I tried using brew, and supposedly it's installed, but cmake still fails with the following error:

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find LibSndFile (missing: LIBSNDFILE_LIBRARY
  LIBSNDFILE_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindLibSndFile.cmake:38 (find_package_handle_standard_args)
  CMakeLists.txt:71 (find_package)

Any help would be appreciated.

bartwalczak avatar Apr 27 '15 21:04 bartwalczak

@bartwalczak which AMI do you use, the Amazon one or another Ubuntu distribution?

thom4parisot avatar Apr 27 '15 21:04 thom4parisot

The Amazon one.

bartwalczak avatar Apr 27 '15 21:04 bartwalczak

@bartwalczak it is based on Red Hat I think — I will give it a go tomorrow (Tuesday).

thom4parisot avatar Apr 27 '15 22:04 thom4parisot

Thank you.

bartwalczak avatar Apr 27 '15 22:04 bartwalczak

Hi Bartlomiej,

Please let us know Linux distro and version you're using. Did you see the instructions for installing under Fedora in the ReadMe?

Note that we have binary packages available for Ubuntu on Launchpad here, but not RPMs at this stage.

Chris

chrisn avatar Apr 28 '15 05:04 chrisn

Hi chrisn,

This is Amazon Linux AMI 2015.03.

Yes, I was following the instructions, and while trying to install libsndfile, I get the error that the libsndfile package is not available through yum. I installed it using brew, but cmake fails to see it.

bartwalczak avatar Apr 28 '15 05:04 bartwalczak

@bartwalczak brew works for non-OSX machines? I was not aware of that :smiley:

I had a preliminar look and found a way to install it by enabling repoforge but libFLAC dependency is missing.

From repoforge.org/use:

sudo rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

# won't work due to libFLAC:
sudo yum install --enablerepo=rpmforge-extras libsndfile-devel

# will work but have not tried to go farther than that:
sudo yum install --enablerepo=rpmforge-extras --skip-broken libsndfile-devel

thom4parisot avatar Apr 28 '15 09:04 thom4parisot

There's the Linux version of brew called linuxbrew, and it does work :)

I'm still getting No package libsndfile-devel available. from yum. I think I'll try with Ubuntu EC2 machine... Darn, it was the last step...

bartwalczak avatar Apr 28 '15 09:04 bartwalczak

I'm using AWS Elastic Beanstalk which makes use of 64bit Amazon Linux 2015.03 v1.4.3 (the custom AMI ID is ami-6b50291c). There's nothing special about Elastic Beanstalk ... at the end of the day it uses EC2 instances (hence the AMI ID).

Running this ... 👇

$ sudo yum install git cmake libmad-devel libsndfile-devel gd-devel boost-devel

... successfully installs all except libmad-devel and libsndfile-devel. Below is the relevant output ...

Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/2015.03                                                             | 2.1 kB     00:00     
amzn-updates/2015.03                                                          | 2.3 kB     00:00     
Package git-2.1.0-1.38.amzn1.x86_64 already installed and latest version
Package cmake-2.8.12-2.20.amzn1.x86_64 already installed and latest version
No package libmad-devel available.
No package libsndfile-devel available.
Package gd-devel-2.0.35-11.10.amzn1.x86_64 already installed and latest version
Package boost-devel-1.53.0-14.21.amzn1.x86_64 already installed and latest version
Nothing to do

That said, this is not a problem with audiowaveform ... all this means is that the repositories enabled for Amazon Linux AMIs do not have libmad-devel and libsndfile-devel by default.

You might have to simply add your own sources I guess.

itskingori avatar Jul 07 '15 23:07 itskingori

For what it's worth ... I've posted this on StackOverflow here ... http://stackoverflow.com/questions/31287024/how-to-install-audio-waveform-program-on-aws-elastic-beanstalk

itskingori avatar Jul 08 '15 08:07 itskingori

@itsmrwave I am interested by what your findings – last time I tried I hardly managed to install libsndfile-devel and for what I remember, when I managed to, libflac put me in trouble. So I gave up.

If you or @bartwalczak make some progress, feel free to share them here or with a PR because it would be very helpful :-)

thom4parisot avatar Jul 08 '15 10:07 thom4parisot

I gave up trying to install it on Amazon Linux AMI, and chose Ubuntu from their list. I had no issues there.

bartwalczak avatar Jul 08 '15 10:07 bartwalczak

@oncletom Sure. Will do ... maybe someone on SO might have some insight. Unlike @bartwalczak I don't have the luxury of using Ubuntu. Seems Elastic Beanstalk uses Amazon Linux (see supported platforms).

itskingori avatar Jul 08 '15 11:07 itskingori

@oncletom Seems @bartwalczak's use case was slightly different since I was kinda using Elastic Beanstalk (which only has Amazon Linux AMI's on the list. And so settling for Ubuntu wasn't an option. In summary there was no solution in sight ... so I settled with a Docker solution.

In a nutshell Docker let's you package your app into a Linux container which will run on the kernel of the host (completely isolated). In the host you can pretty much do whatever you want without affecting the host one bit.

It's worked for me.

So I'm running a docker container still on Elastic Beanstalk (still with Amazon Linux) ... in the container I'm running Ubuntu 14.04. @chrisn mentioned that there are Ubuntu packages already so that makes it a breeze! :-) :-) :-)

itskingori avatar Jul 21 '15 11:07 itskingori

@itsmrwave Great to hear that you have this working!

chrisn avatar Jul 23 '15 10:07 chrisn

I have just managed to make audiowaveform work on Amazon AWS (Amazon Linux). What I did was:

  1. Installed audiowaveform debian dependencies via yum
  2. Manually installed libsndfile from source via this tutorial
  3. Manually installed libmad from source via this tutorial. Here the trick was to tweak some parameters on Makefile as per this other page
  4. Followed audiowaveform install instructions
  5. Set this env variable export LD_LIBRARY_PATH=/usr/lib so audiowaveform could find libsndfile library properly
  6. Made sure I had proper locale set: export LC_ALL="en_US.UTF-8"
  7. Tested audiowaveform with success and generated few .png for testing!

Now my goal is to run audiowaveform on Amazon Lambda! Any hints? Can I just copy some of the files into the .zip I upload to Lambda and have it work properly? How can I create a single executable file (or at least which files must I copy to Lambda)? I think this should work because Lambda also runs on Amazon Linux!

renatoargh avatar Nov 13 '15 15:11 renatoargh

I also needed to install libid3tag:

wget http://sourceforge.net/projects/mad/files/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz
tar xf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b
./configure --prefix=/usr 
make 
sudo make install

Thanks for the excellent instructions, @renatoargh 👍

holmesal avatar Jan 26 '17 07:01 holmesal

If you need to install audiowaveform on Elastic Beanstalk here is the config I'm using: https://gist.github.com/dmongeau/467a11fd0d200c7839d3aa6d35d0f209

dmongeau avatar May 22 '18 14:05 dmongeau

Any success on deploying this to Lambda? Are there other alternatives?

amrfaisal avatar Jun 07 '18 14:06 amrfaisal

wget https://github.com/libsndfile/libsndfile/releases/download/1.0.31/libsndfile-1.0.31.tar.bz2`
tar -xf libsndfile-1.0.31.tar.bz2
cd libsndfile-1.0.31
./configure
make
sudo make install

Worked for me. I needed libsndfile with fastaudio.

madeeldevops avatar Nov 21 '21 14:11 madeeldevops