Install ffmpeg-light with cabal - c

I want to install the ffmpeg-light library from hackage via cabal on Windows 10 (64 bit). So I downloaded ffmpeg and extracted it to C:\FFmpeg.
At first pkg-config was complaining that it could not find various packages. I solved this problem with .pc files.
When I tried to use the command: cabal install ffmpeg-light cabal complained about missing C-libraries, being exactly those for which I created the .pc files.
Then I tried the command: cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib. Now I have a different error message, which says:
Enums.hsc:7:32: fatal error: libavcodec/avcodec.h: No such file or directory
Edit:
Then I tried the following command:
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib \
--extra-include-dirs=C:\FFmpeg\include
Now first the compiler gives some warnings about deprecated functions in ffmpeg and redundant imports in ffmpeg-light, but compiles 11 of 11. But the build is still not successfull.
In-place registering ffmpeg-light-0.11.1...
setup-Simple-Cabal-1.22.5.0-x86_64-windows-ghc-7.10.3.exe:
'C:\Haskell\bin\ghc-pkg.exe' exited with an error:
ffmpeg-light-0.11.1: Warning: haddock-interfaces:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light\ffmpeg-light.haddock
doesn't exist or isn't a file
ffmpeg-light-0.11.1: Warning: haddock-html:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light
doesn't exist or isn't a directory
ffmpeg-light-0.11.1: library-dirs: C:FFmpeglib is a relative path which makes
no sense (as there is nothing for it to be relative to). You can make paths
relative to the package database itself by using ${pkgroot}. (use --force to
override)
ffmpeg-light-0.11.1: include-dirs: C:FFmpeginclude is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cabal: Error: some packages failed to install:
ffmpeg-light-0.11.1 failed during the building phase. The exception was:
ExitFailure 1
Some additional information:
cabal version: cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
gcc version of my installed Haskell platform: 5.2.0
Example .pc file I used for pkg-config:
Name: libavcodec
Description: Library for ffmpeg
Version: 57
Cflags: -IC:\FFmpeg\include
Libs: -LC:\FFmpeg\lib -llibavcodec

OK. I figured it out. The --ghc-pkg-options="--force" option was needed.
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib --extra-include-dirs=C:\FFmpeg\include --ghc-pkg-options="--force"

Related

Compiling through macOS Terminal, fatal error: stdio.h: No such file or directory

So was trying to compile a c file (via a makefile) and got the "fatal error: stdio.h: No such file or directory" . This compiles on just fine via cygwin and a remote linux box just not my mac (so the files are okay).
I have installed the mac command line tools as mentioned in this question. When I do gcc --version I am getting 5.3 but if i do brew info gcc i get 8.2. When I do a find through terminal I can the file, so not sure what is up.
If you run:
which gcc
you will get /usr/bin/gcc which is the compiler supplied by Apple as part of macOS.
Presumably, since you mention homebrew, you mean to use the compiler installed by homebrew. So, you need to look in /usr/local/bin and see what homebrew has installed:
ls -l /usr/local/bin/gcc*
lrwxr-xr-x 1 mark admin 29 17 Sep 10:53 /usr/local/bin/gcc-8 -> ../Cellar/gcc/8.2.0/bin/gcc-8
So, the answer to your question is:
firstly, you need to have /usr/local/bin at the start of your PATH, and
secondly, you need to use the following command to compile:
gcc-8 main.c -o main
try running following:
xcode-select --install
See:
GCC fatal error: stdio.h: No such file or directory
for details.
With Mojave and XCODE 10, the problem is that the "include" folder is no longer automatically included when you install the command line tools. Instead, you need to do an "open" on /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
That solved the identical problem for me, anyway.
I ran into this issue and this is how I resolved it.
softwareupdate --all --install --force
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Basically developer framework is likely to be broken. But simply running xcode-select --install may not work because it will say the xcode developer tools are already installed (despite its broken status). So I had to completely wipe out any existing installation and install the developer framework again.
FYI if everything is installed correctly, the header files should be found at:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

Recipe for target 'graphite-clast-to-gimple.o' failed when I compile GCC Cross-Compiler

I would like to create a GCC cross-compiler and I follow the instruction here here But the problem is each time when I make gcc will have same error blow.
../../gcc-4.8.2/gcc/graphite-clast-to-gimple.c:897:24: error: ‘isl_lp_ok’
was not declared in this scope
assert (lp_result == isl_lp_ok);
^
../../gcc-4.8.2/gcc/graphite-clast-to-gimple.c:898:34: error:
‘isl_int_get_gmp’ was not declared in this scope
isl_int_get_gmp (isl_value, low); ^
../../gcc-4.8.2/gcc/graphite-clast-to-gimple.c:900:57: error: ‘isl_set_max’
was not declared in this scope
lp_result = isl_set_max (domain, dimension, &isl_value);
^
../../gcc-4.8.2/gcc/graphite-clast-to-gimple.c:904:27: error:
‘isl_int_clear’ was not declared in this scope
isl_int_clear (isl_value); ^
Makefile:1058: recipe for target 'graphite-clast-to-gimple.o' failed
make[1]: *** [graphite-clast-to-gimple.o] Error 1
make[1]: Leaving directory '/home/mike/src/build-gcc/gcc'
Makefile:3927: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
At first,I think it may caused by the version problem because the gcc on my openSUSE is 4.8.3,but nothing changed after I use version 4.8.2.
Thanks a lot!
There's a problem with the latest version (0.14?) of the ISL library - the API is not compatible with gcc as of 4.9.2. As for building CLooG, the ISL-0.12.1 version included with 0.18.2 doesn't get configured properly. So you need to build and install your own libraries, and then use those when configuring gcc.
1/. isl-0.12.2
> ./configure --prefix=$CROSSDIR --with-gmp-prefix=$GMPDIR
> make install # and rehash, etc.
where CROSSDIR is where you're installing your cross compiler toolchain, and GMPDIR is the root directory containing lib and include directories for GMP. Unfortunately, this means you will need to build GMP, MPFR, and MPC separately and install, or install them from a package system first. But you might not need this (see below).
2/. cloog-0.18.2
> ./configure --prefix=$CROSSDIR --with-isl-prefix=$CROSSDIR \
--with-gmp-prefix=$GMPDIR
There's a ridiculous issue where the Makefile has 'cmake' strings lying about. The solution (from clfs.org) :
> sed '/cmake/d' Makefile > Makefile.new
> mv Makefile.new Makefile
> make install # and rehash, etc.
When configuring gcc, use: --with-isl=$CROSSDIR --with-cloog=$CROSSDIR, and you will need options for: --with-gmp, --with-mpfr, --with-mpc
Alternatively - following the instructions you're using, it may be sufficient to move isl-0.12.2 & cloog-0.18.2 to the isl and cloog subtrees in the gcc source tree. After the configure, go into the cloog build subdirectory and edit the Makefile as above. I haven't tried this. I build and install the packages separately under CROSSDIR for other reasons.
If you are on Linux, you could probably get the development packages for your system. I know the commands for a Debian-based system such as Ubuntu and its variants.
sudo apt-get install libisl-dev
sudo apt-get install libcloog-isl-dev
After that, delete the isl and cloog directories in your gcc folder, then try to continue from:
make all-gcc
If you don't have a Debian-based system, some hunting around in Google Forest should help.

Package path error when trying to install lib package in C

I am trying to install libpackedobjects on my fedora 17. The path that I am trying to install it on is home/libpackedobjects. The steps that I am following are:
git clone git://gitorious.org/libpackedobjectsd/libpackedobjectsd.git
cd libpackedobjectsd
autoreconf -i
./configure
when I am trying to run the ./configure I am getting error:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBPACKEDOBJECTS_CFLAGS
and LIBPACKEDOBJECTS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I do understand that the path can not be found, but do not know how to repair the problem. Any suggestions?
As evident from your error report:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Hence, You have to install the packages libpackedobjects and libXml2to install the libpackedobjectsd.
If you still get this error after installing the depenedent packages, there might be a PATH issue or linking issue.

How to compile ffmpeg via Alchemy gcc?

So I created ffmpeg configuration file that makes it pure C (platform independent, but only theoretically)
So my config is simple (0.6.1,0.6.3 tested):
./configure --disable-doc --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-pthreads --disable-everything --enable-muxer=flv --enable-encoder=flv --enable-encoder=h263 --disable-mmx --disable-shared --prefix=bin/ --disable-protocols --disable-network --disable-optimizations --disable-debug --disable-asm --disable-stripping
Compiling this on Linux will resolve in 4 libs with totall size of 1 mb.
But I need to compile ffmpeg with custom compiler (opensource gcc analog called Adobe Alchemy, lets us compile C/c++ into Flash)
It gives me errors on nearly each and every file during standart Make:
Array #ARGV missing the # in argument 1 of shift() at /home/rupert/Downloads/alchemy-ubuntu-v0.5a/achacks/gcc line 218.
cc1: error: unrecognized command line option "-Wtype-limits"
cc1: error: unrecognized command line option "-fno-signed-zeros"
So what shall I do - how to compile ffmpeg (at least smallest part of it) via alchemy?
Update
If we would fix that errors manually (2 in configure.mak and one in alchemy gcc) we would get a really messy and long output like:
> $ make -w install
make: Entering directory `/home/rupert/Downloads/ffmpeg-0.6.1'
AR libavformat/libavformat.a
llvm-ld: error opening 'avformat/libavformat.l.bc' for writing!
llvm-ranlib: Archive file does not exist
INSTALL libavformat/libavformat.a
install: cannot stat `libavformat/libavformat.a': No such file or directory
llvm-ranlib: Archive file does not exist
AR libavcodec/libavcodec.a
llvm-ld: error opening 'avcodec/libavcodec.l.bc' for writing!
llvm-ranlib: Archive file does not exist
INSTALL libavcodec/libavcodec.a
install: cannot stat `libavcodec/libavcodec.a': No such file or directory
llvm-ranlib: Archive file does not exist
AR libswscale/libswscale.a
llvm-ld: error opening 'swscale/libswscale.l.bc' for writing!
llvm-ranlib: Archive file does not exist
INSTALL libswscale/libswscale.a
install: cannot stat `libswscale/libswscale.a': No such file or directory
llvm-ranlib: Archive file does not exist
AR libavutil/libavutil.a
llvm-ld: error opening 'avutil/libavutil.l.bc' for writing!
llvm-ranlib: Archive file does not exist
INSTALL libavutil/libavutil.a
install: cannot stat `libavutil/libavutil.a': No such file or directory
llvm-ranlib: Archive file does not exist
INSTALL libavformat/avformat.h
INSTALL libavformat/avio.h
INSTALL libavformat/libavformat.pc
INSTALL libavcodec/avcodec.h
INSTALL libavcodec/avfft.h
INSTALL libavcodec/dxva2.h
INSTALL libavcodec/opt.h
INSTALL libavcodec/vaapi.h
INSTALL libavcodec/vdpau.h
INSTALL libavcodec/xvmc.h
INSTALL libavcodec/libavcodec.pc
INSTALL libswscale/swscale.h
INSTALL libswscale/libswscale.pc
INSTALL libavutil/adler32.h
INSTALL libavutil/attributes.h
INSTALL libavutil/avstring.h
INSTALL libavutil/avutil.h
INSTALL libavutil/base64.h
INSTALL libavutil/common.h
INSTALL libavutil/crc.h
INSTALL libavutil/error.h
INSTALL libavutil/fifo.h
INSTALL libavutil/intfloat_readwrite.h
INSTALL libavutil/log.h
INSTALL libavutil/lzo.h
INSTALL libavutil/mathematics.h
INSTALL libavutil/md5.h
INSTALL libavutil/mem.h
INSTALL libavutil/pixdesc.h
INSTALL libavutil/pixfmt.h
INSTALL libavutil/rational.h
INSTALL libavutil/sha1.h
INSTALL libavutil/avconfig.h
INSTALL libavutil/libavutil.pc
LD ffmpeg_g
WARNING: While resolving call to function 'main' arguments were dropped!
Cannot yet select: 0x8e707e8: i32 = ConstantPool < i64 6881500230622117888> 0
llc[0x86c7dec]
make: *** [ffmpeg_g] Error 6
make: Leaving directory `/home/rupert/Downloads/ffmpeg-0.6.1'
FlasCC(Alchemy 2) does compile ffmpeg fine - for anyone who is trying, basically you need to download ffmpeg source. Go to ffmpeg directory, do
PATH=/cygdrive/c/PATH_TO_FLASCC/sdk/usr/bin:$PATH ./configure --prefix=/cygdrive/c/PATH_TO_FLASCC/sdk/usr
Now it's good if you run configure with some restrictions so it doesn't include every codec or filter there is(takes ages). Additional configure params from my use case:
--disable-ffserver --disable-everything --enable-filter=scale --enable-demuxer=flv --enable-muxer=ogg --enable-protocol=file --disable-network --disable-debug --disable-yasm --disable-asm --disable-stripping --enable-memalign-hack --disable-shared --enable-decoder=flashsv --enable-encoder=mpeg1video --enable-encoder=libtheora --enable-encoder=libvorbis --enable-libtheora --enable-libvorbis
Important is to --disable-everything and then enable only what you need.
Then run ./make and ./make install (with the PATH in front of those commands), it should produce and install ffmpeg libs.
When I built a test swf, all seemed to work. I've used their (modified) sample where they encode 25 dummy mpeg frames. I'm tracing the encoding progress at least and seeing the frames being encoded.
SWC is a problem though, if you would want to use that. I'm getting strange errors - first it couldn't find codec(got NULL when using the find codec function), when I specified it by name, it can't allocate codec context(also got NULL). Then I compiled it in pure Flex and it got over this one, but couldn't open the codec (basically all of those are av_ something library functions). I really don't understand why SWC doesn't work with these as with emit-swf all works perfectly fine.
Maybe someone could enlighten on the SWC / SWF differences.
There was some discussion about this on the Adobe Forums here. It seems rather involved, though some folks seem to have made some progress.
Try it with the new flash c compiler Adobe Flash cc. I hope it may help you to compile ffmpeg in flash.

AIX Package Install Issues

I want to install gettext but i cannot because my AIX says that gettext is dependent on glib and when i try to install glib it says that I cannot because glib is in turn dependent on gettext.
Please let me know how I could get past this situation?
root [rover]% rpm -i gettext-0.17-1.aix5.1.ppc.rpm
error: failed dependencies: libglib-2.0.a(libglib-2.0.so.0) is needed by gettext-0.17-1
libxlsmp.a(smprt.o) is needed by gettext-0.17-1
root [rover]% rpm -i glib2-2.22.5-2.aix5.1.ppc.rpm
error: failed dependencies: gettext is needed by glib2-2.22.5-2
You really have 2 problems:
error: failed dependencies: libglib-2.0.a(libglib-2.0.so.0) is needed by gettext-0.17-1
libxlsmp.a(smprt.o) is needed by gettext-0.17-1
The first error is indeed solved by what is said above (DO NOT use the --nodeps option in this case, it can cause really bad things to happen): use rpm -i (or -U for upgrade) to install both gettext and glib2 at the same time. If you have both in the same directory you can just use rpm -ihv (or -Uhv) *.rpm to install all of the RPM's at once, and it will resolve interdependencies that way.
HOWEVER, you still will not likely be able to install gettext due to #2: libxlsmp.a is a SECOND library/dependency that you need to solve.
It's my understanding that this library comes from a base AIX package (NOT an RPM/Open Source package) that will need to be installed from your AIX installation Media by installp. According to other web research it's the "xlsmp" package.
You have to pass in both files at once for dependency resolution to work: rpm -U gettext.rpm glib2.rpm.
I am not sure this will work or not, but install one of the package ignoring the dependencies.
use --nodeps flag of rpm to do this. Once it is installed, then go ahead with the other package.
root [rover]% rpm --nodeps -i gettext-0.17-1.aix5.1.ppc.rpm
Make sure to resolve other dependencies (if any) later if you are following this.

Resources