speex icon indicating copy to clipboard operation
speex copied to clipboard

Add CMake build script

Open evpobr opened this issue 7 years ago • 7 comments

Description

This patch adds support of CMake meta build system, so you can generate Unix makefiles, VS 6.0-2017 projects and many more.

Features

  • Win32 and Linux tested
  • Travis CI test added
  • Generates working Visual Studio 6.0-2017 solutions
  • Generates working Unix Makefile
  • Supported options (option - default value):
    • ENABLE_FLOATING_POINT - on
    • ENABLE_FIXED_POINT - off
    • ENABLE_FIXED_POINT_DEBUG - off
    • USE_GPL_FFTW3 - off
    • DISABLE_FLOAT_API - off
    • DISABLE_VBR - off
    • ENABLE_VORBIS_PSY - off
    • ENABLE_SSE - on if supported
    • ENABLE_ARM4_ASM - off
    • ENABLE_ARM5E_ASM - off
    • ENABLE_BLACKFIN_ASM - off
    • ENABLE_TI_C55X - off
    • USE_SPEEXDSP - on if library found
    • DISABLE_BINARIES - off
    • ENABLE_PACKAGE_CONFIG - on, CMake specific
  • Configured conditionals (config.h):
    • WORDS_BIGENDIAN
    • FLOATING_POINT
    • FIXED_POINT
    • FIXED_POINT_DEBUG
    • DISABLE_FLOAT_API
    • _USE_SSE
    • ARM4_ASM
    • ARM5E_ASM
    • BFIN_ASM
    • TI_C55X
    • DISABLE_VBR
    • USE_SPEEXDSP
    • VORBIS_PSYCHO
    • HAVE_GETOPT_H
    • HAVE_GETOPT_LONG
    • VAR_ARRAYS
    • USE_ALLOCA
    • HAVE_ALLOCA_H
    • USE_SMALLFT
    • USE_KISS_FFT
    • USE_GPL_FFTW3
    • EXPORT
  • Installation supported
  • Package config mode supported

How to use

Required tools and libraries:

  • CMake >= 3.1
  • Ogg, SpeexDSP packages (headers and import libraries), recommended
  • FFTW3 package, optional

Type commands:

mkdir cmake-build
cd cmake-build
cmake ..
cmake . --build

or use CMake GUI.

evpobr avatar May 20 '17 14:05 evpobr

I tried it with Visual Studio 2015 and worked nicely - I cannot really test anything though for the time being ;)

Two question:

  • which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...
  • is SpeexDSP important? If yes, how would one build that on Windows?

Thanks!

bagong avatar May 20 '17 22:05 bagong

Thanks.

which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...

CMake only searches fftw3.h header and fftw3 library, i don't know how to distinguish between single/double float version. Check FFTW_INCLUDE_DIR and FFTW_LIBRARY to see what is found. You can set them manually of course.

is SpeexDSP important? If yes, how would one build that on Windows?

It is used in speexenc utility only to make optional preprocessing, it is not required by libspeex. I don't have Win32 build, tested under Linux.

evpobr avatar May 21 '17 05:05 evpobr

which precision-version of fftw3 is used/needed? double? I built with single, and it built, but...

CMake only searches fftw3.h header and fftw3 library, i don't know how to distinguish between single/double float version. Check FFTW_INCLUDE_DIR and FFTW_LIBRARY to see what is found. You can set them manually of course.

Typically the versions are distinguished with a suffixed letter: double: no suffix, single: f, double-long: l. So if cmake looks for the base-name, it will find double. I built with single, because I need it in another project, and the build succeeded. I wonder now if speex can work with different versions, or if it won't work (background is that the vcpkg for fftw only allows a single version and doesn't output different names, as opposed to established package mangers like homebrew. I am considering trying to change that). Maybe somebody knows if a specific precision version is needed?

bagong avatar May 21 '17 08:05 bagong

FFTW is optional, without it speex uses internal FFT routines with ASM optimizations. For Win32 there is SSE optimized code, configured and enabled automatically if supported. I don't think it is much slower then FFTW code.

evpobr avatar May 21 '17 08:05 evpobr

https://github.com/Microsoft/vcpkg/pull/1357

bagong avatar Jun 27 '17 06:06 bagong

Failing with:

CMake Error at cmake_install.cmake:136 (file):

  file INSTALL cannot find

  "/Users/travis/build/xiph/speex/cmake/speex-config.cmake".

make: *** [install] Error 1

The command "if [ "$CMAKE" == "1" ]; then mkdir cmake-build; cd cmake-build; cmake .. $CONFIG -DBUILD_SHARED_LIBS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=$HOME/cmake-check; make install; fi" exited with 2.

0.01s$ if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi

The command "if [ "$AUTOTOOLS" == "1" ]; then ./autogen.sh; ./configure $CONFIG; make distcheck; fi" exited with 0.

Done. Your build exited with 1.

See the Travis links.

tmatth avatar Nov 13 '19 14:11 tmatth

Any updates on this?

1480c1 avatar Apr 30 '21 22:04 1480c1