Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Trouble installing on Mac OS Big Sur 11.0.1 "fatal error: 'al.h' file not found" #67

Closed
ngulya opened this issue Dec 9, 2020 · 11 comments

Comments

@ngulya
Copy link

ngulya commented Dec 9, 2020

Some trouble with installation on new Mac OS version
python3 -m pip install --upgrade pocketsphinx
and get:
........
deps/sphinxbase/src/libsphinxad/ad_openal.c:43:10: fatal error: 'al.h' file not found
#include <al.h>
^~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1

and if install from GitHub directly (Install with distutils) with changing al.h to OpenAL/al.h (and same for alc) get this
........
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/swig/sphinxbase/ad_openal_wrap.o build/temp.macosx-10.9-x86_64-3.7/deps/sphinxbase/src/libsphinxad/ad_openal.o /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL -o build/lib.macosx-10.9-x86_64-3.7/sphinxbase/_ad_openal.cpython-37m-darwin.so
clang: error: no such file or directory: '/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL'
error: command 'gcc' failed with exit status 1

@ShivanshRakesh
Copy link

ShivanshRakesh commented Jan 11, 2021

Hey, I'm facing the same issue. I'm running MacOS 11.0.1 (Darwin 20.1.0). I tried the fix mentioned at #28 (comment) but it didn't help.

Apparently, there is no file/directory: /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.


[EDIT] I fixed the issue by making these changes:

Followed the steps mentioned at #28 (comment).

Made the following changes in <project_root>/setup.py:

  • Changed line 235: sb_include_dirs.append('/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers') to
sb_include_dirs.append('/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers')
  • Changed line 242: extra_objects=['/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL'], to
extra_objects=['/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.tbd'],

@ddogfoodd
Copy link

@ShivanshRakesh Thank you, this finally did the trick for me!

@xrisk
Copy link

xrisk commented Jan 25, 2021

For anyone who isn’t using Xcode but only the CLT, the appropriate path to use is: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A

(Tested on macOS 11.1, CLT version 12.3.0.0.1.1607026830)

@ddogfoodd
Copy link

@xrisk That didn't work for me. How did you install OpenAL?

@xrisk
Copy link

xrisk commented Jan 26, 2021

@jalemann what I meant is that you have to modify the paths in @ShivanshRakesh's comment in case you don't have the entire Xcode (but only the CLT). In addition, you have to implement the changes in #28, there are two modifications to be made in the source code. (Specifically in pocketsphinx-python/deps/sphinxbase/src/libsphinxad/ad_openal.c <al.h> and <alc.h> to <OpenAL/al.h. and <OpenAL/alc.h>)

As for, the CLT itself -- you can get it from https://developer.apple.com/downloads/index.action (please note: you don't need this if you have Xcode installed).

@ddogfoodd
Copy link

@xrisk Nvm did something wrong on the first attempt, did work now (same macOS and CLT versions). Thank you.

@victorC97
Copy link

victorC97 commented May 31, 2021

Hi everyone,

I'm on Big Sur and of course I encounter some issues while using pocketsphinx with Python... I followed your previous advices (changing al.h to OpenAL/al.h and Xcode trick to have Headers and openAL.tbd) and manage to install the package.

However I have while executing a really simple program :
ImportError: dlopen(/usr/local/lib/python3.9/site-packages/sphinxbase/_ad_openal.cpython-39-darwin.so, 2): Symbol not found: _alcCaptureCloseDevice Referenced from: /usr/local/lib/python3.9/site-packages/sphinxbase/_ad_openal.cpython-39-darwin.so Expected in: flat namespace in /usr/local/lib/python3.9/site-packages/sphinxbase/_ad_openal.cpython-39-darwin.so

I don't know what is it refering to, probably a library link ?

Can someone help me with this please ? Thank you.


EDIT :

My problem was fixed by using this post https://github.com/bambocher/pocketsphinx-python/issues/28#issuecomment-849265015 (comment from Im-Fran)

@TirtharajPramanik
Copy link

Hey, I'm facing the same issue. I'm running MacOS 11.0.1 (Darwin 20.1.0). I tried the fix mentioned at #28 (comment) but it didn't help.

Apparently, there is no file/directory: /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.

[EDIT] I fixed the issue by making these changes:

Followed the steps mentioned at #28 (comment).

Made the following changes in <project_root>/setup.py:

  • Changed line 235: sb_include_dirs.append('/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers') to
sb_include_dirs.append('/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers')
  • Changed line 242: extra_objects=['/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL'], to
extra_objects=['/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.tbd'],

Thank you so much bro.
I was scratching my head for hours.

@jonahpearl
Copy link

For anyone who isn’t using Xcode but only the CLT, the appropriate path to use is: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A

(Tested on macOS 11.1, CLT version 12.3.0.0.1.1607026830)

Worked on macOS 12.0.1, thank you!

@LOTEAT
Copy link

LOTEAT commented Apr 24, 2022

Very useful, thank you very much!

@huanmit
Copy link

huanmit commented Apr 25, 2022

Hey, I'm facing the same issue. I'm running MacOS 11.0.1 (Darwin 20.1.0). I tried the fix mentioned at #28 (comment) but it didn't help.

Apparently, there is no file/directory: /System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.

[EDIT] I fixed the issue by making these changes:

Followed the steps mentioned at #28 (comment).

Made the following changes in <project_root>/setup.py:

  • Changed line 235: sb_include_dirs.append('/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers') to
sb_include_dirs.append('/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers')
  • Changed line 242: extra_objects=['/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL'], to
extra_objects=['/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/OpenAL.tbd'],

OMG this worked! Thank you a lot!!!

@ngulya ngulya closed this as completed Apr 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants