can't not install Distribute, zlib - zlib

At first, I only want to use install feedparser with python3.2, while it need Distribute. When I install Distribute with
python3.2 setup.py install
I got
File "/usr/local/lib/python3.2/zipfile.py", line 687, in __init__
"Compression requires the (missing) zlib module")
RuntimeError: Compression requires the (missing) zlib module
Then I downloaded zlib and installed it with
./configure --prefix=/usr/local/python3.2
make
sudo make install
After the installation, and tried to install Distribute, I got the same error.

Finally, I solved it by re-install python3.2 with zlib.
1 Of course, you need to install zlib first. and you can find zlib.h in /usr/include
2
./configure -with-zlib=/usr/include
make
sudo make install
from http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/

Related

How can you search for, install and include/link C libraries on a mac?

I already have brew and xcode installed.
I'm trying to install the lz4 C library.
On Ubuntu I'd use:
apt search lz4
sudo apt install liblz4-dev
On Windows I'd use vcpkg.
How do you do it on a MacOs (v 11.3.1)?
I've tried:
brew install lz4
But my IDE isn't detecting the installed library or header file, so I'm assuming that's just the command line version.
Edit: CLion does not automatically detect libraries from your usr sub-directories, adding include targets using Cmake found the headers and libraries that brew did indeed install.
You might have to add -I /opt/homebrew/include -L /opt/homebrew/lib -llz4 to your compiler flags in the project settings. /opt/homebrew is for m1 macs, replace that with /usr/local if you're on intel.

how do i compile the sshfs file system on a mac?

I downloaded and installed FUSE for osx package.
I downloaded sshfs for mac and successfully installed it on my mac running OSX 10.6.8.
However, at some point, I would like to make some changes to sshfs the source code.
Following is what I tried to build sshfs:
git clone https://github.com/osxfuse/sshfs.git
cd sshfs
autoconf
chmod +x configure
./configure
configure: error: cannot find install-sh or install.sh in "." "./.." "./../.."
I am stuck and not sure how to fix this. Looking at the git repository there is no find that is install-sh or install.sh
I don't know much about autotools, but I think you need to run more commands than just autoconf. Try this sequence:
aclocal
autoconf
autoheader
automake --foreign --add-missing --copy
./configure
make
sudo make install

sql.h header file missing though unixODBC is installed

I am on an up-to-date Ubuntu 12.04 system. I have unixodbc (v2.2.14 from ubuntu repos), MySQL and its relevant drivers installed. Also connected to a valid DSN. Verified by issuing isql DBName UName passwd.
I am trying to compile a C application that interacts with the database using ODBC. Almost everywhere I searched seemed to indicate that I should have "sql.h" installed somewhere. A find / -iname sql.h -print showed I don't have it.
So my question is: where is it? Did something go wrong with the install (no errors were reported though)? And what steps do you recommend? Reinstallation? Compilation from source code (the latest version?)?
You need to install the unixodbc-dev package to get the development header files.
sudo apt-get install unixodbc-dev
The -dev packages contain the require header files required to compile and build programs using these headers to make calls to the library. The library files themselves would be part of the regular package i.e. unixodbc in your case.
If you want to know which package provides a certain file, you could use apt-file:
sudo apt-file update
sudo apt-file find sql.h

opencv install folder on ubuntu

I installed opencv2.3 on ubuntu by first adding the ppa and the doing apt-get install
$ sudo add-apt-repository ppa:gijzelaar/cuda
$ sudo add-apt-repository ppa:gijzelaar/opencv2.3
$ sudo apt-get update
$ sudo apt-get install libopencv-dev
I am developing on Eclipse and my programs work. I have this one problem though, while following an ebook. I cannot find the /opencv/samples folder in my system. I did a unix directory search to no avail.
Also, in Synaptic Package Manager I find that the opencv packages are not marked green, ie they're not installed. However I have written and executed opencv codes on my machine.
What is the reason for this?
It seems you have installed binary OpenCV package while the samples are (most likely) included only to source package.

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.

Resources