Csound Csound-dev Csound-tekno Search About

[Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)

Date2023-10-22 20:08
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-22 20:51
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
So your problem is that you can't build

librtjack.dylib

and what else?

For this one you need Jack to be installed (e.g. Jack DMP). The others are

librtpa.dylib needs Portaudio (v19)

The other  (librtauhal) uses mac frameworks so no other deps are needed.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Oct 2023, at 20:18, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> *Warning*
>
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>
> Hi!
>
> I'm in the process of updating the audio/csound6 package in pkgsrc. My
> inital problem was, that the audio/csound6 package was out of date and
> wouldn't build on Darwin. With the help of pkgsrc-users@NetBSD.org I was
> able to update csound6 to 6.18.1 (residing in wip/csound6181). The next
> problem arose: if built with pkgsrc, csound doesn't build the .dylibs,
> necessary for, e.g. audio (librtjack.dylib). I've seen, that the .pkg in
> the .dmg of csound installs CsoundLib64.framework to
> "/Library/Frameworks".
>
> Now my question: do I need special compiler flags for cmake / have to
> edit CMakeLists.txt for the .dylibs?
>
> I'm at loss right now, and don't know how to proceed...
>
> Thank you in advance!
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-22 20:58
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
Also you can look at

installer/macosx/release-build.sh

to see how the installer is built. It assumes dependencies to be in /usr/local and does all the copying and editing of links that is needed for things to work.

There is a Custom.sh there as well which Cmake uses.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Oct 2023, at 20:52, Victor Lazzarini  wrote:
>
> So your problem is that you can't build
>
> librtjack.dylib
>
> and what else?
>
> For this one you need Jack to be installed (e.g. Jack DMP). The others are
>
> librtpa.dylib needs Portaudio (v19)
>
> The other  (librtauhal) uses mac frameworks so no other deps are needed.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 22 Oct 2023, at 20:18, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>>
>> *Warning*
>>
>> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>
>> Hi!
>>
>> I'm in the process of updating the audio/csound6 package in pkgsrc. My
>> inital problem was, that the audio/csound6 package was out of date and
>> wouldn't build on Darwin. With the help of pkgsrc-users@NetBSD.org I was
>> able to update csound6 to 6.18.1 (residing in wip/csound6181). The next
>> problem arose: if built with pkgsrc, csound doesn't build the .dylibs,
>> necessary for, e.g. audio (librtjack.dylib). I've seen, that the .pkg in
>> the .dmg of csound installs CsoundLib64.framework to
>> "/Library/Frameworks".
>>
>> Now my question: do I need special compiler flags for cmake / have to
>> edit CMakeLists.txt for the .dylibs?
>>
>> I'm at loss right now, and don't know how to proceed...
>>
>> Thank you in advance!
>>
>> Kind regards.
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-23 06:04
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-23 17:45
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
Attachmentscmake-favicon.ico  smime.p7s  
I think Jack is not being found because /opt/pkg is not in the search path for libraries in CMake. The
command is (InOut/CMakeLists.txt:57)

find_library(JACK_LIBRARY jack)

and the header is hard coded

set(JACK_HEADER  "jack/jack.h")

So the required dependencies are

check_deps(USE_JACK JACK_HEADER JACK_LIBRARY)

In the MacOS case JACK_HEADER is set already so I think the only thing that can fail is JACK_LIBRARY

In my build I have the message, 

-- USE_JACK is enabled.

can you check what you have?

If the problem is  find_library(JACK_LIBRARY jack), see


and maybe try adding PATHS

find_library(JACK_LIBRARY jack PATHS <path to libjack>)



Prof. Victor Lazzarini
Maynooth University
Ireland

On 23 Oct 2023, at 06:04, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:

Am Sonntag 22 Oktober 2023 um 19:51:53 +0000, schrieb Victor Lazzarini 2,5K:
So your problem is that you can't build

librtjack.dylib

and what else?

For this one you need Jack to be installed (e.g. Jack DMP). The others are

librtpa.dylib needs Portaudio (v19)

The other  (librtauhal) uses mac frameworks so no other deps are needed.

Exactly - jack is installed (/opt/pkg) but I'm only able to produce a
(librtjack|librtpa|librtauhal).so with pkgsrc.

With only the .so csound doesn't output sound on Darwin, no matter which
module I select (with -+rtaudio).

I'll take a closer look at "installer/macosx/release-build.sh", but at
the first glance, I couldn't spot that much differences to the Makefile
in pkgsrc...

Thank you for your time!

Kind regards.

Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb958b6ef480942d15a8508dbd38582ee%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638336342613324240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jQKjQ4wPG8MZKav2I2cEMEGdccyOKgUhHrDGuhqC%2BqY%3D&reserved=0
Send bugs reports to
       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb958b6ef480942d15a8508dbd38582ee%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638336342613324240%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=XUU6RiDftSlTn0CpHp3aGDrOoBEbvrbilkW2KtB51OU%3D&reserved=0
Discussions of bugs and features can be posted here

Date2023-10-23 18:36
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-23 19:07
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-23 19:21
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
This is MacOS and .so libs are being produced instead of .dylib?

That's really strange, but also probably Csound will not load these as plugins, because they are not .dylibs (I have to check the code but I think a .dylib extension is searched for).

I don't understand why .so libraries are being produced.

Can you print all the terminal output and attach it as a file? Please build with -DCMAKE_VERBOSE_MAKEFILE=1

I am really puzzled now. I've never seen this CMake behaviour before.





Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Oct 2023, at 18:36, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Montag 23 Oktober 2023 um 16:45:02 +0000, schrieb Victor Lazzarini 15K:
>> I think Jack is not being found because /opt/pkg is not in the search path for libraries in CMake. The
>> command is (InOut/CMakeLists.txt:57)
>>
>> find_library(JACK_LIBRARY jack)
>>
>> and the header is hard coded
>>
>> set(JACK_HEADER  "jack/jack.h")
>>
>> So the required dependencies are
>>
>> check_deps(USE_JACK JACK_HEADER JACK_LIBRARY)
>>
>> In the MacOS case JACK_HEADER is set already so I think the only thing that can fail is JACK_LIBRARY
>>
>> In my build I have the message,
>>
>> -- USE_JACK is enabled.
>>
>> can you check what you have?
>>
>> If the problem is  find_library(JACK_LIBRARY jack), see
>>
>> https://cmake.org/cmake/help/latest/command/find_library.html
>>
>> and maybe try adding PATHS
>>
>> find_library(JACK_LIBRARY jack PATHS )
>
> Hi!
>
> Thank you for your answer! I re-checked the Makefile and the logs: if I
> build csound (default options of pkgsrc enabled, this means jack) within
> pkgsrc, the following log can be observed:
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> -- ## REALTIME AUDIO AND MIDI ##
> -- Looking for jack/jack.h
> -- Looking for jack/jack.h - found
> -- USE_ALSA is disabled.
> -- USE_PULSEAUDIO is disabled.
> -- Not building Portaudio Driver...
> -- Portaudio v19 Found: .
> -- USE_JACK is enabled.
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> It doesn't matter which audio system I select - the *.so libraries are
> built, but no *.dylib for the selected audio module:
>
> Please let me re-phrase my problems into two questions:
>
> a) Are the *.dylibs necessary for csound to work on Darwin?
>
> As far as I can observe and understand, they are - since csound falls
> back to a dummy rtaudio module, if only the *.so are present.
>
> b) If the *.dylibs are necessary: how are they generated, i.e. for the
> .pkg installer of csound for Darwin from upstream?
> "installer/macosx/build-release.sh"?
>
> If necessary, I can re-check the Makefile and maybe pass the following
> arguments to cmake via options.mk:
> -DJACK_HEADER=
> -DJACK_LIBRARY=
>
> But I don't think that's where the problem lies...
>
> Thank you for your time!
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-23 20:08
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  None  build.log  

Date2023-10-24 08:58
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
Thanks. I see this:

[ 78%] Linking C shared module ../librtjack.so
cd /Users/mk/pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/InOut && /opt/pkg/bin/cmake -E cmake_link_script CMakeFiles/rtjack.dir/link.txt --verbose=1
/Users/mk/pkgsrc/wip/csound6181/work/.cwrapper/bin/clang -DHAVE_CLOCK_GETTIME -O2 -I/opt/pkg/include -I/opt/pkg/include/glib-2.0 -I/opt/pkg/include/gio-unix-2.0 -I/opt/pkg/lib/glib-2.0/include -I/opt/pkg/include/readline -I/opt/pkg/include/ncurses -I/opt/pkg/include/python3.11 -DLDAP_DEPRECATED -ffast-math -msse2 -fomit-frame-pointer -fvisibility=hidden -std=gnu99 -DHAVE_VECLIB -DSNDFILE_MP3 -DHAVE_ATOMIC_BUILTIN -DHAVE_CURL -DHAVE_PTHREAD -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=11.3 -bundle -Wl,-headerpad_max_install_names -L/opt/pkg/lib/csound6 -L/opt/pkg/lib -o ../librtjack.so CMakeFiles/rtjack.dir/rtjack.c.o CMakeFiles/rtjack.dir/alphanumcmp.c.o  /opt/pkg/lib/libjack.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libpthread.tbd

Note the -o ../librtjack.so 

This is what I get here:

[ 78%] Linking C shared library ../librtjack.dylib
cd /Users/victor/src/csound/debug/InOut && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/rtjack.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -DHAVE_CLOCK_GETTIME  -ffast-math -fomit-frame-pointer -g -Wno-error -Wno-missing-field-initializers -Wno-unused-parameter -DBETA -Wall -Werror -Wno-missing-field-initializers -fvisibility=hidden -std=gnu99 -DHAVE_VECLIB -DSNDFILE_MP3 -DHAVE_ATOMIC_BUILTIN -DHAVE_CURL -DHAVE_PTHREAD -g -arch arm64 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names -o ../librtjack.dylib -install_name @rpath/librtjack.dylib CMakeFiles/rtjack.dir/rtjack.c.o CMakeFiles/rtjack.dir/alphanumcmp.c.o  /usr/local/lib/libjack.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib/libpthread.tbd

and it is -o ../librtjack.dylib

I wonder if there is any difference in CMake options?
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 23 Oct 2023, at 20:08, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE> wrote:
>
> Am Montag 23 Oktober 2023 um 18:21:50 +0000, schrieb Victor Lazzarini 4,5K:
>> This is MacOS and .so libs are being produced instead of .dylib?
>>
>> That's really strange, but also probably Csound will not load these as plugins, because they are not .dylibs (I have to check the code but I think a .dylib extension is searched for).
>>
>> I don't understand why .so libraries are being produced.
>>
>> Can you print all the terminal output and attach it as a file? Please build with -DCMAKE_VERBOSE_MAKEFILE=1
>>
>> I am really puzzled now. I've never seen this CMake behaviour before.
>
> Hi!
>
> Yes, this is macOS and yes, only .so libraries are produced:
>
> Darwin Mac-mini-von-Manuel.local 23.0.0 Darwin Kernel Version 23.0.0:
> Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103
> arm64
>
> Build log is attached - let me know, if you need more information :-)
>
> As written earlier: thank you for your time!
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-24 10:04
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-24 14:03
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
You need -dynamiclib for all dylibs (including plugins) and have to name them with  .dylib extension.

Is this a hand written makefile? Or is it generated by CMake?

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 24 Oct 2023, at 10:05, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Dienstag 24 Oktober 2023 um 7:58:29 +0000, schrieb Victor Lazzarini 3,9K:
>> Thanks. I see this:
>>
>> [ 78%] Linking C shared module ../librtjack.so
>> cd /Users/mk/pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/InOut && /opt/pkg/bin/cmake -E cmake_link_script CMakeFiles/rtjack.dir/link.txt --verbose=1
>> /Users/mk/pkgsrc/wip/csound6181/work/.cwrapper/bin/clang -DHAVE_CLOCK_GETTIME -O2 -I/opt/pkg/include -I/opt/pkg/include/glib-2.0 -I/opt/pkg/include/gio-unix-2.0 -I/opt/pkg/lib/glib-2.0/include -I/opt/pkg/include/readline -I/opt/pkg/include/ncurses -I/opt/pkg/include/python3.11 -DLDAP_DEPRECATED -ffast-math -msse2 -fomit-frame-pointer -fvisibility=hidden -std=gnu99 -DHAVE_VECLIB -DSNDFILE_MP3 -DHAVE_ATOMIC_BUILTIN -DHAVE_CURL -DHAVE_PTHREAD -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -mmacosx-version-min=11.3 -bundle -Wl,-headerpad_max_install_names -L/opt/pkg/lib/csound6 -L/opt/pkg/lib -o ../librtjack.so CMakeFiles/rtjack.dir/rtjack.c.o CMakeFiles/rtjack.dir/alphanumcmp.c.o  /opt/pkg/lib/libjack.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/libpthread.tbd
>>
>> Note the -o ../librtjack.so 
>>
>> This is what I get here:
>>
>> [ 78%] Linking C shared library ../librtjack.dylib
>> cd /Users/victor/src/csound/debug/InOut && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/rtjack.dir/link.txt --verbose=1
>> /Library/Developer/CommandLineTools/usr/bin/cc -DHAVE_CLOCK_GETTIME  -ffast-math -fomit-frame-pointer -g -Wno-error -Wno-missing-field-initializers -Wno-unused-parameter -DBETA -Wall -Werror -Wno-missing-field-initializers -fvisibility=hidden -std=gnu99 -DHAVE_VECLIB -DSNDFILE_MP3 -DHAVE_ATOMIC_BUILTIN -DHAVE_CURL -DHAVE_PTHREAD -g -arch arm64 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names -o ../librtjack.dylib -install_name @rpath/librtjack.dylib CMakeFiles/rtjack.dir/rtjack.c.o CMakeFiles/rtjack.dir/alphanumcmp.c.o  /usr/local/lib/libjack.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk/usr/lib/libpthread.tbd
>>
>> and it is -o ../librtjack.dylib
>>
>> I wonder if there is any difference in CMake options?
>
> Hi!
>
> The Makefile currently includes these arguments:
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> CFLAGS+=            -g -DBETA
> CFLAGS+=            -DCS_DEFAULT_PLUGINDIR=\"${PREFIX}/lib/csound/plugins64-6.0\"
> USE_CMAKE=          yes
> CMAKE_ARGS+=        -DBUILD_RELEASE=1
> CMAKE_ARGS+=        -DCMAKE_BUILD_TYPE=Release
> CMAKE_ARGS+=        -DCMAKE_VERBOSE_MAKEFILE=1
>
> #CMAKE_INSTALL_RPATH doesn't work for some reason, so do it here.
> LDFLAGS+=           ${COMPILER_RPATH_FLAG}${PREFIX}/lib/csound6
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> These options were taken from audio/csound6 and can be changed /
> removed. I'm not 99,9% confident, that these are the necessary
> arguments, especially the CFLAGS...
>
> options.mk includes these arguments:
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> PKG_OPTIONS_VAR=    PKG_OPTIONS.csound6
> PKG_SUPPORTED_OPTIONS=  jack portaudio pulseaudio
>
> .include "../../mk/bsd.fast.prefs.mk"
>
> .if ${OPSYS} == "Linux"
> PKG_SUPPORTED_OPTIONS+= alsa
> PKG_SUGGESTED_OPTIONS+= alsa
> .elif ${OPSYS} != "Darwin" && ${OPSYS} != "Haiku"
> PKG_SUGGESTED_OPTIONS+= portaudio
> .endif
>
> .include "../../mk/bsd.options.mk"
>
> PLIST_VARS+=        alsa
> .if !empty(PKG_OPTIONS:Malsa)
> .include "../../audio/alsa-lib/buildlink3.mk"
> CMAKE_ARGS+=        -DUSE_ALSA=ON
> PLIST.alsa=         yes
> .else
> CMAKE_ARGS+=        -DUSE_ALSA=OFF
> .endif
>
> PLIST_VARS+=        jack
> .if !empty(PKG_OPTIONS:Mjack)
> .include "../../audio/jack/buildlink3.mk"
> CMAKE_ARGS+=        -DUSE_JACK=ON
> PLIST.jack=         yes
> .else
> CMAKE_ARGS+=        -DUSE_JACK=OFF
> .endif
>
> PLIST_VARS+=        portaudio
> .if !empty(PKG_OPTIONS:Mportaudio)
> .include "../../audio/portaudio/buildlink3.mk"
> CMAKE_ARGS+=        -DUSE_PORTAUDIO=ON
> CMAKE_ARGS+=        -DCMAKE_INCLUDE_PATH=${BUILDLINK_PREFIX.portaudio}/include/portaudio2
> CMAKE_ARGS+=        -DCMAKE_LIBRARY_PATH=${BUILDLINK_PREFIX.portaudio}/lib/portaudio2
> PLIST.portaudio=    yes
> .else
> CMAKE_ARGS+=        -DUSE_PORTAUDIO=OFF
> .endif
>
> PLIST_VARS+=        pulseaudio
> .if !empty(PKG_OPTIONS:Mpulseaudio)
> .include "../../audio/pulseaudio/buildlink3.mk"
> CMAKE_ARGS+=        -DUSE_PULSEAUDIO=ON
> PLIST.pulseaudio=   yes
> .else
> CMAKE_ARGS+=        -DUSE_PULSEAUDIO=OFF
> .endif
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> options.mk is mainly for the audio backend; the default setting is jack
> (doesn't matter if the system is Darwin).
>
> I tried setting in the Makefile:
>
> CMAKE_ARGS+=        -DBUILD_SHARED_LIBS=1
>
> The reason was, that I spotted the "-dynamiclib" compiler flag in your
> logs. But no change...
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-24 15:34
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-24 16:14
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-24 17:53
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-24 19:05
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
Ok, it's not a bundle, that's a different type of dynamic lib (we don't use). So

1. You need to find where -bundle is being added

2. You need to use -dynamiclib

3. the plugin libs need to have the extension .dylib in their names.

So here's a command line example for building a Csound plugin (with no dependencies)

cc  -dynamiclib mysrc.c -o myplug.dylib  -I

This command compiles and links the opcode. If you are using object files then you just replace the .c by a .o file.

Basically the solution is to fix the makefiles so you use -dynamiclib to build the libraries.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 24 Oct 2023, at 17:54, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Dienstag 24 Oktober 2023 um 13:03:16 +0000, schrieb Victor Lazzarini 7,9K:
>> You need -dynamiclib for all dylibs (including plugins) and have to name them with  .dylib extension.
>
> I had a quick try with:
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> $NetBSD$
>
> --- Custom.cmake.ex.orig    2022-11-23 19:53:55.000000000 +0000
> +++ Custom.cmake.ex
> @@ -6,6 +6,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
> set(BUILD_STATIC_LIBRARY ON)
> set(TCL_VERSION 8.5)
> set(PYTHON_INCLUDE_DIRS "/usr/include/python2.7")
> +set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
>
> #### NOTE the processor type needs setting
> #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W -Wall -mtune=core2")
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> But no luck - somehow cmake falls back to "-bundle", at least the cmake,
> installed via pkgsrc. I guess we are on the right track - but if it's
> related to pkgsrc's cmake or the invocation of cmake is beyond my
> knowledge...
>
> FWIW: I'm not the first one to stumble upon this problem:
>
> * https://www.wireshark.org/lists/wireshark-dev/201009/msg00231.html
> * https://trac.macports.org/ticket/44232
> * https://public.kitware.com/Bug/view.php?id=15126
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-25 05:23
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-25 06:14
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-25 06:45
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-25 09:33
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
You can also see the Custom.cmake used in the installer build

installer/macosx/Custom_10.9.cmake

The script copies it and renames as Custom.cmake before building.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 25 Oct 2023, at 06:45, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Mittwoch 25 Oktober 2023 um 7:14:47 +0200, schrieb Manuel Kuklinski 2,6K:
>> I'm in need of a hint again :-(
>
> Nevermind the bollocks - I have to write pkgsrc-users@NetBSD.org again,
> since it is an error within pkgsrc (pthread is linked, but not found).
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-26 04:17
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-26 04:34
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-26 06:40
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
We've been using plugins as dylibs since the start, they were never created as bundles. We don't know if the mechanism we have in the code would work with bundles. We never tried it. Also since Csound 6.x is in bugfix mode (we're working on 7.), we would not entertain exploring that change now.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Oct 2023, at 04:17, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Dienstag 24 Oktober 2023 um 18:05:34 +0000, schrieb Victor Lazzarini 3,3K:
>> Ok, it's not a bundle, that's a different type of dynamic lib (we don't use). So
>>
>> 1. You need to find where -bundle is being added
>>
>> 2. You need to use -dynamiclib
>>
>> 3. the plugin libs need to have the extension .dylib in their names.
>>
>> So here's a command line example for building a Csound plugin (with no dependencies)
>>
>> cc  -dynamiclib mysrc.c -o myplug.dylib  -I
>>
>> This command compiles and links the opcode. If you are using object files then you just replace the .c by a .o file.
>>
>> Basically the solution is to fix the makefiles so you use -dynamiclib to build the libraries.
>
> Hi!
>
> I wrote pkgsrc-users@NetBSD and tech-pkg@NetBSD.org, describing the
> problem; I'm partially quoting the second answer here (the first answer
> was, that "-bundle" gets added via pkgsrc's cmake - without pkgsrc
> csound compiles normally and the results are the expected .dylibs):
>
>> Another possibility to consider is that pkgsrc is right and upstream is wrong.
>> Perhaps it actually *should* generate .so files rather than .dylib for
>> loadable modules?  It might be easier to patch the code to look for .so,
>> rather than patch the build to generate .dylib.  I'm not saying this is the
>> case, just that I would investigate it.
>
> -- https://mail-index.netbsd.org/pkgsrc-users/2023/10/25/msg038344.html
>
> I'm searching high and low, to find proof for the needed compilation of
> .dylibs with "-dynamiclib". But in the meantime, I'd be happy about
> considering the possibility that pkgsrc *could* be right - if not, I'd
> be thankful about a precise explanation, why .dylibs are needed on
> Darwin, instead of a .so... I'll forward the answer to @NetBSD.org.
>
> This article suggests, that .so can be used (in special cases):
>
> https://stackoverflow.com/questions/2339679/what-are-the-differences-between-so-and-dylib-on-macos
>
> It's not clear for me, as a casual users, when .so and when .dylibs
> should be used...
>
> Thank you for your time!
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-26 06:49
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
It may work with bundles, but they need to have the extension .dylib because Csound would not open them otherwise, see
top/csmodule.c:707.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Oct 2023, at 04:34, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@listserv.heanet.ie> wrote:
>
> Am Donnerstag 26 Oktober 2023 um 5:17:04 +0200, schrieb Manuel Kuklinski 2,2K:
>> It's not clear for me, as a casual users, when .so and when .dylibs
>> should be used...
>
> This seems to be difference between the generated .so and dylibs - one
> is a dylib, the other is a bundle:
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> mk ~ $ otool -hv pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/libcsound64.dylib
> pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/libcsound64.dylib:
> Mach header
>      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
> MH_MAGIC_64    ARM64        ALL  0x00       DYLIB    19       2056   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS
> mk ~ $ otool -hv pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/librtjack.so
> pkgsrc/wip/csound6181/work/csound-6.18.1/cmake-pkgsrc-build/librtjack.so:
> Mach header
>      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
> MH_MAGIC_64    ARM64        ALL  0x00      BUNDLE    15       1400   NOUNDEFS DYLDLINK TWOLEVEL
>
> - - - - - - - - - - %< - - - - - - - - - -
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2023-10-26 09:12
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-26 09:13
FromManuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
AttachmentsNone  

Date2023-10-26 13:35
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] pkgsrc: audio/csound6, .dylib, Darwin (macOS)
Thanks. We will consider this change for Csound 7. It is probably a simple case of allowing the search to be either .dylib or .so as
both dynamiclibs and bundles work. Then any type of plugin can be built.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 26 Oct 2023, at 09:13, Manuel Kuklinski <00000f74a28c4e28-dmarc-request@LISTSERV.HEANET.IE> wrote:
>
> Am Donnerstag 26 Oktober 2023 um 5:40:12 +0000, schrieb Victor Lazzarini 4,1K:
>> We've been using plugins as dylibs since the start, they were never created as bundles. We don't know if the mechanism we have in the code would work with bundles. We never tried it. Also since Csound 6.x is in bugfix mode (we're working on 7.), we would not entertain exploring that change now.
>
> I wasn't aware, that csound 7. is in the making - thank you for that; as
> written in my other e-mail, it seems it's working with bundles...
>
> Kind regards.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here