last day (23 days later) » 

6:42 PM
hei
 
Hello
I'm trying that ${OPENAL_LIBRARY}/Versions/A‌​/Headers/ path rn
 
It may just be a matter of getting the right env variable for CMake I'm guessing
 
Like, linker flags?
Same error with that path
 
set(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}")
 
CMAKE_CXX_FLAGS or CMAKE_C_FLAGS?
Oh, either way it gave more errors
 
6:47 PM
I think you can put that line exactly in the CMakeLists.txt
hmmm
 
clang: error: no such file or directory: 'CMakeFiles/sphinx_lmtools.dir/sphinx_lm_convert.c.o'
make[2]: *** [src/sphinx_lmtools/CMakeFiles/sphinx_lmtools.dir/sphinx_lm_convert.c.o] Error 1
make[1]: *** [src/sphinx_lmtools/CMakeFiles/sphinx_lmtools.dir/all] Error 2
 
It looks like it's messing up your other paths somehow by doing that
 
Yeah
 
Did you try using autotools?
 
For?
Building the library?
 
6:50 PM
Yes
It seemed to work for me other than the fact I don't have swig installed atm...
 
I'll do that, but the objective of all this is to try and get away from Autotools
 
it generated a ./configure file and everything
Yeah, I understand your reasoning also
 
Hm, weird... same error
I went into the pocketsphinx build folder to get at the sphinxbase lib it's trying to use and rebuilt it using autotools
Let's try a more fresh build
 
What if you just try using : set(CMAKE_OSX_SYSROOT ${SDKROOT})
 
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework
Same OpenAL location
 
6:56 PM
With autotools I had to do: libtoolize, autoreconf, aclocal, autoconf, automake --add-missing...
 
Ah, the Makefile was putting it in src/libsphinxbase/.libs/libsphinxbase.a
That's why it didn't overwrite
 
ahah
 
Undefined symbols for architecture x86_64:
  "_ad_open_dev", referenced from:
      _main in continuous.c.o
  "_ad_read", referenced from:
      _main in continuous.c.o
  "_ad_start_rec", referenced from:
      _main in continuous.c.o
ld: symbol(s) not found for architecture x86_64
Better
But that Makefile one still gives problems
 
When configuring or building it?
 
Linking C executable continuous in pocketsphinx
 
6:58 PM
oh I see.
As far as the CMake $(SDKROOT} path I'm curious about. In terminal what do you get when executing: xcrun --show-sdk-path
 
I'm going to see what happens if I just don't link at all to OpenAL
 
Yes, that's an idea
 
$ xcrun --show-sdk-path
2016-08-07 14:01:28.537 xcodebuild[47274:1738077] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-08-07 14:01:28.539 xcodebuild[47274:1738077] [MT] PluginLoading: Required plug-in compatibility UUID ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibility
 
I get some of those same errors as well... but it looks like your path is ok there
 
With no anything to the OpenAL libraries... I get the same error that the Makefile was giving me above
 
7:07 PM
I got CMake to configure using OpenAL
The only error I get now is about ALSA Library
 
@l'L'l ?
 
No build type selected, default to Release
Found PulseAudio: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenAL.framework
Could NOT find ALSA (missing: ALSA_LIBRARY ALSA_INCLUDE_DIR)
Configuring done
 
Oh, that's fine
That just means it won't use it
It would error otherwise
Are you trying to see what happens using other audio libraries?
 
For PULSEAUDIO_INCLUDE_DIR I used: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/‌​SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Header‌​s
For PULSEAUDIO_LIBRARY: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/‌​SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenAL.framework
 
You're specifying OpenAL frameworks for Pulseaudio stuff?
 
7:10 PM
Apparently... but it accepted the path
Oh I see what happened...
I got it confused with one below it in CMake
It should be:
... OPENAL_INCLUDE_DIR..
OPENAL_LIBRARY
 
Like I have?
if (OPENAL_FOUND)
	set(SOURCES ${SOURCES} ad_openal.c)
	set(LIBS ${OPENAL_LIBRARY} CACHE INTERNAL "libs")
	include_directories(${OPENAL_INCLUDE_DIR})
endif()
Hm, I get similar errors using PortAudio:
Undefined symbols for architecture x86_64:
  "_pa_simple_free", referenced from:
      _ad_close in libsphinxbase.a(ad_pulse.c.o)
  "_pa_simple_new", referenced from:
      _ad_open_dev in libsphinxbase.a(ad_pulse.c.o)
  "_pa_simple_read", referenced from:
      _ad_read in libsphinxbase.a(ad_pulse.c.o)
  "_pa_strerror", referenced from:
      _ad_open_dev in libsphinxbase.a(ad_pulse.c.o)
      _ad_read in libsphinxbase.a(ad_pulse.c.o)
ld: symbol(s) not found for architecture x86_64
 
Yes the vars are like you have, let me check the actual CMakeLists.txt
 
Undefined symbols for architecture x86_64:
  "_ad_open_dev", referenced from:
      _main in continuous.c.o
  "_ad_read", referenced from:
      _main in continuous.c.o
  "_ad_start_rec", referenced from:
      _main in continuous.c.o
ld: symbol(s) not found for architecture x86_64
It looks like the problem has shifted from linking external frameworks to something within libsphinxad
 
7:27 PM
I just tried the CMake pocketsphinx again and it didn't complain about anything
 
Hm?
 
Just to be sure let me delete the cache
 
Are you running make after cmake?
Or just the cmake?
 
I was just running configure then generate in CMake
I'll try running make though
 
CMake should run fine
The issues are at the end of running make, when it's linking
 
7:30 PM
What's the difference between liblibpocketsphinx.a and libpocketsphinx.a?
 
Uh, I didn't know there was a liblibpocketsphinx.a
What's the path?
 
heheh... I get both of those generated
 
When building pocketsphinx?
Whut
 
The XCode project it generates creates that at : pocketsphinx-master/build/src/libpocketsphinx/pocketsphinx.build/Debug/libpocket‌​sphinx.build/Objects-normal/
 
You're using a XCode generator?
$ find . -name "*pocketsphinx*"
./CMakeFiles/pocketsphinx.dir
./libpocketsphinx.a
./src/libpocketsphinx
./src/libpocketsphinx/CMakeFiles/libpocketsphinx.dir
./src/libpocketsphinx/CMakeFiles/libpocketsphinx.dir/pocketsphinx.c.o
No liblibpocketsphinx.a for me
 
7:33 PM
Yes, that's how I had it set to generate
Strange...
 
Hm, I'm not sure it'll ever succeed with that... I was using the Unix Makefiles generator
But let me try
Hm, doing a command line build with the XCode generator fails
 
It built the liblib library without issue... i suppose the name just got mangled somehow
 
Oh, I see the liblibpocketsphinx now...
Weird
 
It builds though!
 
It does?
How'd you get it to build?
 
7:37 PM
yes, did for me...
 
Are you using the Xcode GUI?
I'm hitting the play button and it's erroring
 
Yes, I generated the project from CMake and then opened the XCode project it created and pressed Build ... no errors
 
Well, at least someone can do it haha
What happens if you do cmake --build . on the command line?
 
One minute, let me try it
 
That also errors for me... but I'm curious if you'll succeed
 
7:42 PM
Are you doing just 'unix' makefiles as type
 
Well I just do cmake .. and it does it with that automatically
 
oh i see...
 
Maybe you need to do cmake -G "Unix Makefiles" ..
 
building...
Scanning dependencies of target pocketsphinx
[100%] Linking C static library libpocketsphinx.a
[100%] Built target pocketsphinx
 
..
Huh
Now I'm more confused than before lol
 
7:46 PM
Now that's not to say that me screwing around with things didn't get it working somehow. So I'm going to git clone another and see what the result is...
Yeah the new one worked just fine as well...
 
Flabbergasting
 
$ git clone https://github.com/syb0rg/pocketsphinx.git
$ cd pocketsphinx
$ cmake -G "Unix Makefiles"
$ make
[100%] Built target pocketsphinx
 
Hm
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make
Could you see if the out-of-source build is affecting it somehow?
 
Sure
 
That's how I'm building mine
I dunno why that would affect it, but maybe
 
7:51 PM
It worked fine
I had to cd .. back into the parent directory first
then did make clean, make
built fine
 
A developer can't get his own software working... but his users can
 
ahaha I feel your pain
You still are getting the same error?
 
I'm trying an in-source build real quick, with no jobs parameter to the makefile
Undefined symbols for architecture x86_64:
  "_pa_simple_free", referenced from:
      _ad_close in libsphinxbase.a(ad_pulse.c.o)
  "_pa_simple_new", referenced from:
      _ad_open_dev in libsphinxbase.a(ad_pulse.c.o)
  "_pa_simple_read", referenced from:
      _ad_read in libsphinxbase.a(ad_pulse.c.o)
  "_pa_strerror", referenced from:
      _ad_open_dev in libsphinxbase.a(ad_pulse.c.o)
      _ad_read in libsphinxbase.a(ad_pulse.c.o)
ld: symbol(s) not found for architecture x86_64
 
Those seem like puiseaudio errors there
 
Yep, I'll try OpenAL now
 
7:55 PM
If you have an example project to add the library into I'll try that for you too
Also any build logs you think might be helpful on this end just let me know...
You could likely diff between yours and find something perhaps
 
The library builds for me... where did the programs go?
 
In the top pocketsphinx directory
The one thing i noticed about the cmake build vs the xcode one was the size of the generated .a file
 
You have a "continuous" program binary?
 
I don't have any continuous integration tool installed atm
 
No, the build should have made a program called "continuous"
 
8:00 PM
oh... let me see
 
I think I accidentally pushed a build disabling program building
I just pushed out a commit reenabling them
 
find . -name "continous" yields nada
maybe i spelled it wrong.
same
i'll clone the new one...
 
I don't know when I pushed that... must have been when I was fixing sphinxbase stuff
And I mixed up what tab I was in with terminal
 
I just cloned this one a couple mins ago:
and it built fine, although i'm not finding any file specifically named "continuous"
 
8:08 PM
yeah pretty sure... cloning it again
okay that one came up with an error
 
Woo, back on the same page
 
`Undefined symbols for architecture x86_64:
"_alcCaptureCloseDevice", referenced from:
_ad_close in libsphinxbase.a(ad_openal.c.o)
"_alcCaptureOpenDevice", referenced from:
_ad_open_dev in libsphinxbase.a(ad_openal.c.o)
"_alcCaptureSamples", referenced from:
_ad_read in libsphinxbase.a(ad_openal.c.o)
"_alcCaptureStart", referenced from:
_ad_start_rec in libsphinxbase.a(ad_openal.c.o)
"_alcCaptureStop", referenced from:
_ad_stop_rec in libsphinxbase.a(ad_openal.c.o)
"_alcGetIntegerv", referenced from:
 
Yeah, that continuous program is the one generating all the problems
 
ah okay...
 
Also, it's not saying "undefined reference"... which is the typical linking error I'm used to
 
8:11 PM
What's the difference between the continuous and the other one?
 
Another weird thing is that building with both of these libraries here is fine on Mac: travis-ci.org/syb0rg/Khronos
@l'L'l Erm... dunno exactly lol
It's a fork, I didn't write either of them
 
I just tried using autotools again
 
And?
 
and it seemed to build without issue there ...
generated a libpocketsphinx.a
 
And the executable?
 
8:20 PM
where is that built?
 
With the makefile? I'll have to do a find on it
 
i see a continuous.c.o in /pocketsphinx/src/programs/CMakeFiles/continuous.dir/
 
Hm, nothing
 
continuous.c.o is 20 KB
 
$ find . -name "*continuous*"
$
@l'L'l It's a pretty large source file
 
8:22 PM
$ find . -name "*continuous*"
./doc/pocketsphinx_continuous.1
./doc/pocketsphinx_continuous.1.in
./src/programs/CMakeFiles/continuous.dir
./src/programs/CMakeFiles/continuous.dir/continuous.c.o
./src/programs/continuous.c
./swig/python/test/continuous_test.py
./win32/pocketsphinx_continuous
./win32/pocketsphinx_continuous/pocketsphinx_continuous.vcxproj
 
If you do a make check with sphinxbase, do all the checks pass?
 
let me see...
 
I have 5 that fail:
FAIL: test_lm_read
FAIL: test_lm_score
PASS: test_lm_add
PASS: test_lm_casefold
FAIL: test_lm_class
FAIL: test_lm_set
FAIL: test_lm_write
 
are you referring to the sphinxbase downloaded within the continuous project?
 
pocketsphinx project, yeah
 
8:30 PM
I get :
60% tests passed, 2 tests failed out of 5

Total Test time (real) = 1.31 sec

The following tests FAILED:
2 - test_ckd_alloc_abort (OTHER_FAULT)
4 - test_ckd_alloc_fail (Failed)
Errors while running CTest
make[3]: *** [test/unit/test_alloc/CMakeFiles/check] Error 8
make[2]: *** [test/unit/test_alloc/CMakeFiles/check.dir/all] Error 2
make[1]: *** [test/unit/test_alloc/CMakeFiles/check.dir/rule] Error 2
make: *** [check] Error 2
 
Oh, you did it within cmake...
 
yeah
 
Nvm, I expected that to happen
When you build sphinxbase with autotools, run make check right after
 
yeah i get those same two errors
 
Where are you running the make check from?
 
8:39 PM
the /lib/sphinxbase directory
 
And that's after building with autotools?
 
yep
 
Weird
Cause those are the CMake tests I've been working to build in
 
i wonder if ad_close(ad_rec_t * handle), etc. has anything to do with it vs ad_close(ad_rec_t * r)? ... probably not - just throwing it out there
using handle vs r rather...
 
What file?
 
8:44 PM
lib/sphinxbase/src/libsphinxad/ad_alsa.c:234:ad_close(ad_rec_t * handle)
lib/sphinxbase/src/libsphinxad/ad_base.c:106:ad_close(ad_rec_t * r)
lib/sphinxbase/src/libsphinxad/ad_openal.c:116:ad_close(ad_rec_t * r)
lib/sphinxbase/src/libsphinxad/ad_oss.c:301:ad_close(ad_rec_t * handle)
lib/sphinxbase/src/libsphinxad/ad_pulse.c:148:ad_close(ad_rec_t * r)
lib/sphinxbase/src/libsphinxad/ad_win32.c:371:ad_close(ad_rec_t * r)
 
int32
ad_close(ad_rec_t * r)
{
    ALCboolean isClosed;

    isClosed = alcCaptureCloseDevice(r -> device);

    if (isClosed) {
        return 0;
    } else {
        return -1;
    }
}
 
the error i get is :
Undefined symbols for architecture x86_64:
"_alcCaptureCloseDevice", referenced from:
_ad_close in libsphinxbase.a(ad_openal.c.o)
 
What a horribly written function...
int32 ad_close(ad_rec_t *r)
{
    ALCboolean isClosed = alcCaptureCloseDevice(r -> device);

    return isClosed ? 0 : -1;
}
Better
Still should give the same results
 
okay... here's something interesting
$ file libsphinxbase.a
libsphinxbase.a: current ar archive random library
 
Didn't fix it, but I didn't expect it to
What info are you trying to find out with that?
 
8:50 PM
should it be a library ?
 
Yeah
$ lipo -info lib/sphinxbase/libsphinxbase.a
input file lib/sphinxbase/libsphinxbase.a is not a fat file
Non-fat file: lib/sphinxbase/libsphinxbase.a is architecture: x86_64
 
okay.. nvm
 
What did you think it should be?
 
I guess I was expecting it to be a mach-o lib or something
 
What would the difference be?
I'm just trying to link to the static library
Maybe I should link to a shared library?
 
8:54 PM
i think static is better really
 
I do too
But when I tried building a shared library, I'm uncovering more errors
duplicate symbol _main in:
    src/sphinx_adtools/CMakeFiles/sphinx_adtools.dir/cont_seg.c.o
    src/sphinx_adtools/CMakeFiles/sphinx_adtools.dir/sphinx_pitch.c.o
duplicate symbol _main in:
    src/sphinx_adtools/CMakeFiles/sphinx_adtools.dir/cont_seg.c.o
    src/sphinx_cepview/CMakeFiles/sphinx_cepview.dir/main_cepview.c.o
duplicate symbol _main in:
    src/sphinx_adtools/CMakeFiles/sphinx_adtools.dir/cont_seg.c.o
    src/sphinx_fe/CMakeFiles/sphinx_fe.dir/sphinx_fe.c.o
duplicate symbol _main in:
 
i'm looking through the source seeing if I can find anything obvious with those symbols
 
It looks like those should be executables I'm making, not libraries
For those few directories
 
9:12 PM
Well, fixing those to be executables instead didn't help the broad issue
@l'L'l Linking to the library dynamically fixes it
But why fail with the static library?
I would like to link statically, so I'll just update the question and see what people say
 
That's a good question for sure...
If you have the particular linker command that you changed paste it here.
 
9:28 PM
Nah, I just changed this link in my CMakeLists.txt:
SET(SPHINXBASE_LIBRARIES ${SPHINXBASE_SOURCE_DIR}/libsphinxbase.dylib)
 
ah i see
 
Can frameworks not be linked statically?
 
frameworks are essentially dylibs
 
That could be part of the problem then
 
they work pretty much the same way... they have to be included alongside the exec
indeed, although those frameworks i would've expected to be natively included. maybe not
if the os has the frameworks in the system frameworks then usually you can simply link it without including the actual framework.
 
9:32 PM
Would that fix anything?
 
I'm not sure — it might... It seems possible that if you included the frameworks and that's what it can't find then maybe it would resolve the problem
seems though that it should find those within the SDK and utilize them
This is interesting:
and notice the last example they happen to show
 
Maybe I should mark as advanced?
I do the find library calls
 
It's worth a shot definitely...
 
Nope, did nothing
 
10:13 PM
I just cloned pocketsphinx again and it built
is that the one using the dynamic libs?
also one thing i just thought of ... try using this OpenAL:
/System/Library/Frameworks/OpenAL.framework/OpenAL
it might solve the issue with undefined symbols
...looks like you must have gotten it to completely work though...
 

  last day (23 days later) »