Opened 20 months ago

Closed 6 weeks ago

Last modified 6 weeks ago

#57294 closed defect (fixed)

libkdegames @4.14.3: 'al.h' file not found

Reported by: rlhamil Owned by: NicosPavlov
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: mojave Cc: mopihopi
Port: libkdegames

Description

include file <al.h> isn't found. openal-soft is installed (regular openal won't build, there was already a ticket for that), so why isn't it finding it?

Attachments (2)

main.log-libkdegames.txt (468.2 KB) - added by rlhamil 20 months ago.
libkdegames_main.log (478.4 KB) - added by LenoreHorner 6 weeks ago.
another log file in case it helps (18 months later so it's probaby a different version of Mojave)

Download all attachments as: .zip

Change History (26)

Changed 20 months ago by rlhamil

Attachment: main.log-libkdegames.txt added

comment:1 Changed 20 months ago by ryandesign (Ryan Schmidt)

Keywords: mojave added; mojaveProblems removed
Owner: set to NicosPavlov
Status: newassigned
Summary: libkdegames build fails on mojavelibkdegames @4.14.3: 'al.h' file not found

libkdegames doesn't declare a dependency on openal or openal-soft, so either it shouldn't be using them, or it needs to declare a dependency one of them and have this build failure fixed.

comment:2 Changed 20 months ago by ryandesign (Ryan Schmidt)

Port: libkdegames added; port removed

comment:3 Changed 20 months ago by stanimura

I had the same error, but, in my case, it seems to solve on Mojave without openal-soft/openal as adding the following in Portfile.

pre-configure {
    configure.cppflags-append "-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers"
    configure.cflags-append "-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers"
    configure.cxxflags-append "-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers"
}

The missing al.h is possibly located in

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers/al.h

However, I am not sure if the al.h is right al.h.

comment:4 Changed 20 months ago by rlhamil

Wow, you may have the answer there! Not only did libkdegames build, but with that in place, all the ports brought in by kdegames4 built just fine.

While I doubt those options would hurt anything even if the directory did not exist on an older OS version, can those directives be made conditional on the OS version (e.g. os.version 18.0.0 or later)? If possible, that would IMO be highest confidence that no older versions where it works now would be affected.

comment:5 Changed 20 months ago by kencu (Ken)

That's not the right fix, but it's a good clue as to what the right fix should be.

Does this port not use -framework OpenAL.framework anywhere?

Ken

comment:6 Changed 20 months ago by NicosPavlov

It seems that builds on previous versions have been detecting the framework automatically. I don't have Mojave installed to test the issue, but on High Sierra, the configure stage shows that it is properly found:

[...]
-- Found automoc4: /opt/local/bin/automoc4
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework  
-- Found SndFile: /opt/local/lib/libsndfile.dylib  
[...]
-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
-----------------------------------------------------------------------------
   * OpenAL - OpenAL (Open Audio Library) is a free software cross-platform audio API.
   * SndFile - libsndfile is a C library written by Erik de Castro Lopo for reading and writing audio files.
   * KDeclarative - KDeclarative is a KDE library for KDE specific QML support.

comment:7 Changed 20 months ago by rlhamil

On Mojave with unmodified Portfile, it says the following, except that it's NOT finding the right thing because the al.h header is NOT there. So it fails later on.

-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework  
-- Found SndFile: /opt/local/lib/libsndfile.dylib  
-- Checking libsndfile capabilities
-- INCLUDES FOR SOUND:  /System/Library/Frameworks/OpenAL.framework/Headers /opt/local/include
-- LIBRARIES FOR SOUND: /System/Library/Frameworks/OpenAL.framework /opt/local/lib/libsndfile.dylib

If you need -framework OpenAL.framework, then I guess you need a -F /path/to/frameworks_directory option too, but if I try a trivial

clang -v -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks  -framework OpenAL.framework

it fails with can't find framework long before it notices that I didn't even give it anything to compile or link. :-) So there's some missing magic still needed, I suppose.

comment:8 Changed 20 months ago by kencu (Ken)

Getting there. You should not need to pass in the System frameworks directory.

Maybe this port is having issues with the -isysroot thing. Do you have the command-line tools installed? If not, this port might need some fixing to use the SDK rather than "/".

comment:9 Changed 9 months ago by mopihopi

Cc: mopihopi added

comment:10 Changed 2 months ago by yaseppochi (Stephen J. Turnbull)

macOS Catalina 10.15.3 on MacBook Pro port 2.6.2 openal-soft @1.20.1_1 (active) I have no idea whether this is correct or if the port even works, but it builds. (I'm in the middle of a complete system reinstall following Mojave -> Catalina upgrade, so not able to really test, and not sure this will complete any time soon.) Following stanimura (comment3) I added

pre-configure {
    configure.cppflags-append "-I/opt/local/include/AL"
    configure.cflags-append "-I/opt/local/include/AL"
    configure.cxxflags-append "-I/opt/local/include/AL"
}

to the Portfile for libkdegames.

comment:11 Changed 2 months ago by yaseppochi (Stephen J. Turnbull)

Following up to comment:10, both kmahjongg and kmines crash on startup. I'm removing those ports and libkdegames, too.

comment:12 Changed 6 weeks ago by LenoreHorner

18 months later this failure is still present on Mojave. Kencu, you've said twice the proposed fixes aren't right. Do you actually know how to fix this? Command line tools are installed for me. Log attached. Well, I was going to attach the log, but I can't find a button for doing so either before or after submitting text.

Last edited 6 weeks ago by LenoreHorner (previous) (diff)

Changed 6 weeks ago by LenoreHorner

Attachment: libkdegames_main.log added

another log file in case it helps (18 months later so it's probaby a different version of Mojave)

comment:13 Changed 6 weeks ago by NicosPavlov

Sorry, I somewhat left that ticket as is as I was not on Mojave at the time it was submitted, and then forgot to look at it in details after I upgraded.

It seems that a rather easy fix can take care of the issue. Just patching the problematic file with:

-#include <al.h>
-#include <alc.h>
+#include <OpenAL/al.h>
+#include <OpenAL/alc.h>

seems to do the trick. I am just not sure if this patch then causes issues with older OS versions.

comment:14 Changed 6 weeks ago by kencu (Ken)

something is setting

-DOPENAL_INCLUDE_DIR=/System/Library/Frameworks/OpenAL.framework/Headers
-DOPENAL_LIBRARY=/System/Library/Frameworks/OpenAL.framework

instead of using the proper sdkroot

On 10.14 and up, there is no sdk at "/".

comment:15 Changed 6 weeks ago by NicosPavlov

Yes, it is in the kde4 PortGroup file.

I tried to remove these lines from the PortGroup, but it did not change anything on the error. Fixing the include statements did.

comment:16 Changed 6 weeks ago by kencu (Ken)

I wonder what are the modified include ststements now finding? /opt/local/include/OpenAL/?

Have to fix the PortGroup file, imho. I can look later, if you like -- Happy Easter!

Last edited 6 weeks ago by kencu (Ken) (previous) (diff)

comment:17 Changed 6 weeks ago by NicosPavlov

Good point, but I don't have OpenAL in Macports (not installed), and I do have a framework at

/System/Library/Frameworks/OpenAL.framework

but no

/System/Library/Frameworks/OpenAL.framework/Headers

As the only other OpenAL frameworks I have are in the Command Line tools or embedded in the XCode app, I suppose it links to the one in System.

So there might be things to fix, but I am not sure all the statements in the PortGroup should be thrown away.

comment:18 Changed 6 weeks ago by kencu (Ken)

assuming you want to use OpenAL from the SDK instead of from the port (do you?), you'd have to use {configure.sdkroot} instead of just always assuming "/".

There is a "bug" in base in that {configure.sdkroot} can be "" so you have to test for that.

Last edited 6 weeks ago by kencu (Ken) (previous) (diff)

comment:19 Changed 6 weeks ago by kencu (Ken)

there is also a {frameworks_dir} I recall that might in fact be the thing you really should use to get right to it. I would have to check the exact spelling on that, but it should be the full path to the current frameworks directory in the selected sdk, if I understand properly what it is referencing.

Edit: No, frameworks_dir is where MP should install frameworks, not where it finds them in the SDK. K

Last edited 6 weeks ago by kencu (Ken) (previous) (diff)

comment:20 Changed 6 weeks ago by kencu (Ken)

This same issue is being discussed on multiple mailing lists, with everyone coming to the same conclusion in different places :>

comment:21 Changed 6 weeks ago by NicosPavlov

Alright, so I checked again, and I don't know what happened the first time, but removing the -DOPENAL_INCLUDE_DIR and -DOPENAL_LIBRARY variable from the PortGroup works.

In that case, it finds the proper SDK:

Found OpenAL: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenAL.framework  

based on configure.sdk.

So the solution would be to suppress the paths in the PortGroup, and check for configure.sdkroot, and set it to "/" if it is empty.

I just need to check which ports in the KDE PortGroup would be affected by that change.

Last edited 6 weeks ago by NicosPavlov (previous) (diff)

comment:22 Changed 6 weeks ago by kencu (Ken)

configure.sdkroot

comment:23 Changed 6 weeks ago by Nicolas Pavillon <pavillon.nicolas@…>

Resolution: fixed
Status: assignedclosed

In 241bf4d1464bb281f57a67b4e0a24350513b60ee/macports-ports (master):

Kde4 PortGroup: remove hardcoded OpenAL path to use standard SDK one (fixes #57294)

comment:24 Changed 6 weeks ago by kencu (Ken)

I'm sure you know that Apple has deprecated OpenAL in Catalina, and so we'll likely need to switch to use MacPorts' version of openal once 10.16 comes out.

Note: See TracTickets for help on using tickets.