spotify / echoprint-codegen

Codegen for Echoprint
http://echoprint.me/codegen
Other
959 stars 291 forks source link

Unable to compile on Mac OS X 10.6.8 #17

Closed daFish closed 13 years ago

daFish commented 13 years ago

I'm unable to compile codegen on Mac OS X 10.6.8 using Boost 1.46, TagLib 1.7 & ffmpeg 0.6.3

I get the following error running the make command:

g++ -Wall -I/usr/local/include/boost-1_35 `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o AudioBufferInput.o AudioBufferInput.cxx
g++ -Wall -I/usr/local/include/boost-1_35 `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o AudioStreamInput.o AudioStreamInput.cxx
g++ -Wall -I/usr/local/include/boost-1_35 `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o Base64.o Base64.cxx
g++ -Wall -I/usr/local/include/boost-1_35 `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o Codegen.o Codegen.cxx
In file included from SubbandAnalysis.h:11,
                 from Codegen.h:18,
                 from Codegen.cxx:10:
MatrixUtility.h:12:43: error: boost/numeric/ublas/matrix.hpp: No such file or directory
MatrixUtility.h:13:48: error: boost/numeric/ublas/matrix_proxy.hpp: No such file or directory
In file included from SubbandAnalysis.h:11,
                 from Codegen.h:18,
                 from Codegen.cxx:10:
MatrixUtility.h:15: error: ‘boost’ has not been declared
MatrixUtility.h:15: error: ‘ublas’ is not a namespace-name
MatrixUtility.h:15: error: expected namespace-name before ‘;’ token
MatrixUtility.h:17: error: ‘ublas’ has not been declared
MatrixUtility.h:17: error: expected initializer before ‘<’ token
MatrixUtility.h:18: error: ‘ublas’ has not been declared
MatrixUtility.h:18: error: expected initializer before ‘<’ token
MatrixUtility.h:20: error: ‘ublas’ has not been declared
MatrixUtility.h:20: error: expected initializer before ‘<’ token
MatrixUtility.h:21: error: ‘ublas’ has not been declared
MatrixUtility.h:21: error: expected initializer before ‘<’ token
MatrixUtility.h:22: error: ‘ublas’ has not been declared
MatrixUtility.h:22: error: expected initializer before ‘<’ token
MatrixUtility.h:23: error: ‘ublas’ has not been declared
MatrixUtility.h:23: error: expected initializer before ‘<’ token
MatrixUtility.h:26: error: ‘MatrixUtility::rows’ declared as an ‘inline’ variable
MatrixUtility.h:26: error: ‘matrix_f’ was not declared in this scope
MatrixUtility.h:26: error: expected ‘,’ or ‘;’ before ‘{’ token
MatrixUtility.h:27: error: ‘MatrixUtility::cols’ declared as an ‘inline’ variable
MatrixUtility.h:27: error: ‘matrix_f’ was not declared in this scope
MatrixUtility.h:27: error: expected ‘,’ or ‘;’ before ‘{’ token
MatrixUtility.h:28: error: expected ‘,’ or ‘...’ before ‘&’ token
MatrixUtility.h:28: error: ISO C++ forbids declaration of ‘matrix_f’ with no type
MatrixUtility.h:29: error: expected ‘,’ or ‘...’ before ‘&’ token
MatrixUtility.h:29: error: ISO C++ forbids declaration of ‘matrix_f’ with no type
MatrixUtility.h:30: error: variable or field ‘clear’ declared void
MatrixUtility.h:30: error: ‘matrix_f’ was not declared in this scope
In file included from Codegen.h:18,
                 from Codegen.cxx:10:
SubbandAnalysis.h:51: error: ISO C++ forbids declaration of ‘matrix_f’ with no type
SubbandAnalysis.h:51: error: expected ‘;’ before ‘&’ token
SubbandAnalysis.h:53: error: expected `;' before ‘protected’
SubbandAnalysis.h:57: error: ‘matrix_f’ does not name a type
SubbandAnalysis.h:58: error: ‘matrix_f’ does not name a type
SubbandAnalysis.h:59: error: ‘matrix_f’ does not name a type
In file included from Codegen.h:19,
                 from Codegen.cxx:10:
Fingerprint.h:37: error: ‘matrix_u’ has not been declared
Codegen.cxx: In constructor ‘Codegen::Codegen(const float*, uint, int)’:
Codegen.cxx:20: error: ‘runtime_error’ is not a member of ‘std’
make: *** [Codegen.o] Error 1

Any suggestions about fixing this?

bwhitman commented 13 years ago

All the errors indicate your boost install is not right. How did you install boost?

daFish commented 13 years ago

I used port to install it.

bwhitman commented 13 years ago

find out where your boost is installed and change this line of the Makefile CXXFLAGS=-Wall -I/usr/local/include/boost-1_35 -fPIC $(OPTFLAGS)

To yours -- it's probably /opt/local/include/boost-1_46

daFish commented 13 years ago

So, after some fiddling I got it. I wasn't sure if there is any problem with taglib so I recompiled it from the sources and changed the Makefile this way:

diff --git a/src/Makefile b/src/Makefile
index 8a8bba7..faebc92 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,7 +4,7 @@ CC=gcc
 ARCH=`uname -m`
 #OPTFLAGS=-g -O0
 OPTFLAGS=-O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG
-CXXFLAGS=-Wall -I/usr/local/include/boost-1_35 `taglib-config --cflags` -fPIC $(OPTFLAGS)
+CXXFLAGS=-Wall -I/opt/local/var/macports/software/boost/1.46.1_0/opt/local/include -I/opt/local/include -fPIC $(OPTFLAGS)
 CFLAGS=-Wall -fPIC $(OPTFLAGS)
 LDFLAGS=`taglib-config --libs` -lz -lpthread $(OPTFLAGS)

I adjusted the paths to match my configuration and this did the trick.

bwhitman commented 13 years ago

great