ronw@624
|
1 # CARFAC Open Source C++ Library
|
ronw@624
|
2 #
|
ronw@624
|
3 # This C++ file is part of an implementation of Lyon's cochlear model:
|
ronw@624
|
4 # "Cascade of Asymmetric Resonators with Fast-Acting Compression"
|
ronw@624
|
5 # to supplement Lyon's upcoming book "Human and Machine Hearing"
|
ronw@624
|
6 #
|
ronw@624
|
7 # Licensed under the Apache License, Version 2.0 (the "License");
|
ronw@624
|
8 # you may not use this file except in compliance with the License.
|
ronw@624
|
9 # You may obtain a copy of the License at
|
ronw@624
|
10 #
|
ronw@624
|
11 # http://www.apache.org/licenses/LICENSE-2.0
|
ronw@624
|
12 #
|
ronw@624
|
13 # Unless required by applicable law or agreed to in writing, software
|
ronw@624
|
14 # distributed under the License is distributed on an "AS IS" BASIS,
|
ronw@624
|
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
ronw@624
|
16 # See the License for the specific language governing permissions and
|
ronw@624
|
17 # limitations under the License.
|
ronw@624
|
18
|
ronw@624
|
19 ## @author Ron Weiss <ronw@google.com>
|
ronw@624
|
20 # @date created 2013/05/21
|
ronw@624
|
21 # @version \$Id$
|
ronw@624
|
22
|
ronw@624
|
23 """@package SConstruct
|
ronw@624
|
24 SConstruct file for the CARFAC Open Source C++ Library.
|
ronw@624
|
25
|
ronw@624
|
26 To install dependencies and build on Ubuntu, run:
|
ronw@624
|
27
|
ronw@625
|
28 sudo apt-get install libeigen3-dev scons \
|
ronw@625
|
29 cmake libgtest-dev libsndfile-dev # For testing.
|
ronw@624
|
30 export EIGEN_PATH=/usr/include/eigen3
|
ronw@625
|
31 export GTEST_SOURCE=/usr/src/gtest
|
ronw@624
|
32 scons
|
ronw@624
|
33 """
|
ronw@624
|
34
|
ronw@624
|
35 import os
|
ronw@624
|
36
|
ronw@624
|
37 carfac_sources = [
|
ronw@630
|
38 'agc_coeffs.cc',
|
ronw@624
|
39 'agc_params.cc',
|
ronw@630
|
40 'car_coeffs.cc',
|
ronw@624
|
41 'carfac.cc',
|
ronw@624
|
42 'carfac_common.cc',
|
ronw@624
|
43 'carfac_output.cc',
|
ronw@624
|
44 'car_params.cc',
|
ronw@624
|
45 'ear.cc',
|
ronw@624
|
46 'ear_output.cc',
|
ronw@630
|
47 'ihc_coeffs.cc',
|
ronw@624
|
48 'ihc_params.cc',
|
ronw@624
|
49 ]
|
ronw@624
|
50
|
ronw@624
|
51 env = Environment(CPPPATH=[os.environ['EIGEN_PATH']])
|
ronw@624
|
52 # Needed to support std::vector initialization lists.
|
ronw@624
|
53 env.MergeFlags(['-std=c++0x'])
|
ronw@624
|
54 env.Library(target = 'carfac', source = carfac_sources)
|
ronw@625
|
55
|
ronw@625
|
56 env.Command('tmp/libgtest.a', [],
|
ronw@625
|
57 [
|
ronw@625
|
58 Delete('tmp'),
|
ronw@625
|
59 Copy('tmp', os.environ['GTEST_SOURCE']),
|
ronw@625
|
60 'cd tmp && cmake . && make',
|
ronw@625
|
61 ])
|
ronw@625
|
62
|
ronw@630
|
63 env.Program(target = 'carfac_test',
|
ronw@630
|
64 source = ['carfac_test.cc'],
|
ronw@630
|
65 LIBS = ['carfac', 'gtest', 'gtest_main', 'pthread'],
|
ronw@625
|
66 LIBPATH = ['.', 'tmp'])
|