Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] linking with csound framework

Date2008-03-11 08:56
Fromvictor
SubjectRe: [Cs-dev] linking with csound framework
libcsnd.dylib is the 'interfaces' library. You need to link 
to the CsoundLib framework (compile() is there).

-framework CsoundLib


----- Original Message ----- 
From: "Jonatan Liljedahl" 
To: "Developer discussions" 
Sent: Tuesday, March 11, 2008 3:48 AM
Subject: [Cs-dev] linking with csound framework


> I'm trying to link to the csound framework from my app, building it
> under MacPorts... I'm using autoconf and automake.
> 
> I see that libcsnd.dylib is present in /usr/local/lib but for some
> reason this doesn't find it:
> 
> AC_SEARCH_LIBS(csoundCompile, [csound csnd], \
>  AC_DEFINE([HAVE_CSOUND],[],[csound])])
> 
> config.log says there isn't any _csoundCompile symbol in the lib...
> 
> passing -lcsnd in CFLAGS manually _does_ make the app link to csound,
> but then my configure script doesn't know about it and since I have
> conditional compile of csound support it won't be built.
> 
> any ideas?
> 
> -- 
> /Jonatan         [ http://kymatica.com ]
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-11 12:18
FromJonatan Liljedahl
SubjectRe: [Cs-dev] linking with csound framework
Ok, thanks!
Does anyone have any tips on how I could construct my configure.in so
that it can find and link with the CsoundLib framework if
AC_SEARCH_LIBS() did not find it as a library?

victor wrote:
> libcsnd.dylib is the 'interfaces' library. You need to link 
> to the CsoundLib framework (compile() is there).
> 
> -framework CsoundLib
> 
> 
> ----- Original Message ----- 
> From: "Jonatan Liljedahl" 
> To: "Developer discussions" 
> Sent: Tuesday, March 11, 2008 3:48 AM
> Subject: [Cs-dev] linking with csound framework
> 
> 
>> I'm trying to link to the csound framework from my app, building it
>> under MacPorts... I'm using autoconf and automake.
>>
>> I see that libcsnd.dylib is present in /usr/local/lib but for some
>> reason this doesn't find it:
>>
>> AC_SEARCH_LIBS(csoundCompile, [csound csnd], \
>>  AC_DEFINE([HAVE_CSOUND],[],[csound])])
>>
>> config.log says there isn't any _csoundCompile symbol in the lib...
>>
>> passing -lcsnd in CFLAGS manually _does_ make the app link to csound,
>> but then my configure script doesn't know about it and since I have
>> conditional compile of csound support it won't be built.
>>
>> any ideas?

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-11 12:26
FromVictor Lazzarini
SubjectRe: [Cs-dev] linking with csound framework
Can try to look for
/Library/Frameworks/CsoundLib.framework/CsoundLib

At 12:18 11/03/2008, you wrote:
>Ok, thanks!
>Does anyone have any tips on how I could construct my configure.in so
>that it can find and link with the CsoundLib framework if
>AC_SEARCH_LIBS() did not find it as a library?
>
>victor wrote:
> > libcsnd.dylib is the 'interfaces' library. You need to link
> > to the CsoundLib framework (compile() is there).
> >
> > -framework CsoundLib
> >
> >
> > ----- Original Message -----
> > From: "Jonatan Liljedahl" 
> > To: "Developer discussions" 
> > Sent: Tuesday, March 11, 2008 3:48 AM
> > Subject: [Cs-dev] linking with csound framework
> >
> >
> >> I'm trying to link to the csound framework from my app, building it
> >> under MacPorts... I'm using autoconf and automake.
> >>
> >> I see that libcsnd.dylib is present in /usr/local/lib but for some
> >> reason this doesn't find it:
> >>
> >> AC_SEARCH_LIBS(csoundCompile, [csound csnd], \
> >>  AC_DEFINE([HAVE_CSOUND],[],[csound])])
> >>
> >> config.log says there isn't any _csoundCompile symbol in the lib...
> >>
> >> passing -lcsnd in CFLAGS manually _does_ make the app link to csound,
> >> but then my configure script doesn't know about it and since I have
> >> conditional compile of csound support it won't be built.
> >>
> >> any ideas?
>
>--
>/Jonatan         [ http://kymatica.com ]
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-11 13:15
FromJonatan Liljedahl
SubjectRe: [Cs-dev] linking with csound framework
But -framework CsoundLib doesn't need setting -L or -I to find libs and
headers? I just found this macro on google:

dnl Function to check for Mac OS X frameworks (stolen from Basilisk)
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
AC_DEFUN([AC_CHECK_FRAMEWORK], [
  AS_VAR_PUSHDEF([ac_Framework], [have_framework_$1])dnl
  AC_CACHE_CHECK([whether compiler supports framework $1],
    ac_Framework, [
    saved_LIBS="$LIBS"
    LIBS="$LIBS -framework $1"
    AC_TRY_LINK(
      [$2], [],
      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework,
no); LIBS="$saved_LIBS"]
    )
  ])
  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework
$1 is available.])]
  )
  AS_VAR_POPDEF([ac_Framework])dnl
])

I hope it means I can just do something like this:

AC_CHECK_FRAMEWORK([CsoundLib],[])
if test "x$have_framework_CsoundLib" = xyes
then
  AC_DEFINE([HAVE_CSOUND],[],[csound])
else
  AC_SEARCH_LIBS(csoundCompile, [csound], \
    AC_DEFINE([HAVE_CSOUND],[],[csound])
fi

Too bad I don't have a Mac here to try it out...

Victor Lazzarini wrote:
> Can try to look for
> /Library/Frameworks/CsoundLib.framework/CsoundLib
> 
> At 12:18 11/03/2008, you wrote:
>> Ok, thanks!
>> Does anyone have any tips on how I could construct my configure.in so
>> that it can find and link with the CsoundLib framework if
>> AC_SEARCH_LIBS() did not find it as a library?
>>
>> victor wrote:
>>> libcsnd.dylib is the 'interfaces' library. You need to link
>>> to the CsoundLib framework (compile() is there).
>>>
>>> -framework CsoundLib
>>>
>>>
>>> ----- Original Message -----
>>> From: "Jonatan Liljedahl" 
>>> To: "Developer discussions" 
>>> Sent: Tuesday, March 11, 2008 3:48 AM
>>> Subject: [Cs-dev] linking with csound framework
>>>
>>>
>>>> I'm trying to link to the csound framework from my app, building it
>>>> under MacPorts... I'm using autoconf and automake.
>>>>
>>>> I see that libcsnd.dylib is present in /usr/local/lib but for some
>>>> reason this doesn't find it:
>>>>
>>>> AC_SEARCH_LIBS(csoundCompile, [csound csnd], \
>>>>  AC_DEFINE([HAVE_CSOUND],[],[csound])])
>>>>
>>>> config.log says there isn't any _csoundCompile symbol in the lib...
>>>>
>>>> passing -lcsnd in CFLAGS manually _does_ make the app link to csound,
>>>> but then my configure script doesn't know about it and since I have
>>>> conditional compile of csound support it won't be built.
>>>>
>>>> any ideas?
>> --
>> /Jonatan         [ http://kymatica.com ]
-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-11 14:25
FromVictor Lazzarini
SubjectRe: [Cs-dev] linking with csound framework
This configure stuff is Greek to me. So I'm probably not the
person to ask...

At 13:15 11/03/2008, you wrote:

>But -framework CsoundLib doesn't need setting -L or -I to find libs and
>headers? I just found this macro on google:
>
>dnl Function to check for Mac OS X frameworks (stolen from Basilisk)
>dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
>AC_DEFUN([AC_CHECK_FRAMEWORK], [
>   AS_VAR_PUSHDEF([ac_Framework], [have_framework_$1])dnl
>   AC_CACHE_CHECK([whether compiler supports framework $1],
>     ac_Framework, [
>     saved_LIBS="$LIBS"
>     LIBS="$LIBS -framework $1"
>     AC_TRY_LINK(
>       [$2], [],
>       [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework,
>no); LIBS="$saved_LIBS"]
>     )
>   ])
>   AS_IF([test AS_VAR_GET(ac_Framework) = yes],
>     [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework
>$1 is available.])]
>   )
>   AS_VAR_POPDEF([ac_Framework])dnl
>])
>
>I hope it means I can just do something like this:
>
>AC_CHECK_FRAMEWORK([CsoundLib],[])
>if test "x$have_framework_CsoundLib" = xyes
>then
>   AC_DEFINE([HAVE_CSOUND],[],[csound])
>else
>   AC_SEARCH_LIBS(csoundCompile, [csound], \
>     AC_DEFINE([HAVE_CSOUND],[],[csound])
>fi
>
>Too bad I don't have a Mac here to try it out...
>
>Victor Lazzarini wrote:
> > Can try to look for
> > /Library/Frameworks/CsoundLib.framework/CsoundLib
> >
> > At 12:18 11/03/2008, you wrote:
> >> Ok, thanks!
> >> Does anyone have any tips on how I could construct my configure.in so
> >> that it can find and link with the CsoundLib framework if
> >> AC_SEARCH_LIBS() did not find it as a library?
> >>
> >> victor wrote:
> >>> libcsnd.dylib is the 'interfaces' library. You need to link
> >>> to the CsoundLib framework (compile() is there).
> >>>
> >>> -framework CsoundLib
> >>>
> >>>
> >>> ----- Original Message -----
> >>> From: "Jonatan Liljedahl" 
> >>> To: "Developer discussions" 
> >>> Sent: Tuesday, March 11, 2008 3:48 AM
> >>> Subject: [Cs-dev] linking with csound framework
> >>>
> >>>
> >>>> I'm trying to link to the csound framework from my app, building it
> >>>> under MacPorts... I'm using autoconf and automake.
> >>>>
> >>>> I see that libcsnd.dylib is present in /usr/local/lib but for some
> >>>> reason this doesn't find it:
> >>>>
> >>>> AC_SEARCH_LIBS(csoundCompile, [csound csnd], \
> >>>>  AC_DEFINE([HAVE_CSOUND],[],[csound])])
> >>>>
> >>>> config.log says there isn't any _csoundCompile symbol in the lib...
> >>>>
> >>>> passing -lcsnd in CFLAGS manually _does_ make the app link to csound,
> >>>> but then my configure script doesn't know about it and since I have
> >>>> conditional compile of csound support it won't be built.
> >>>>
> >>>> any ideas?
> >> --
> >> /Jonatan         [ http://kymatica.com ]
>--
>/Jonatan         [ http://kymatica.com ]
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-11 15:01
FromJonatan Liljedahl
SubjectRe: [Cs-dev] linking with csound framework
Victor Lazzarini wrote:
> This configure stuff is Greek to me. So I'm probably not the
> person to ask...

It's greek to me too... :)
But I have now gave it a try, hopefully this new configure script will
find both Csound and Jack as frameworks. One problem is the version
check of Jack, so it needs to be given manually if MIDI support is wanted:

  ./configure HAVE_STABLE_JACK_MIDI=yes

or

  ./configure HAVE_OLD_JACK_MIDI=yes

The source is available here:

  http://kymatica.com/uploads/Software/AlgoScore-080311.tar.bz2

Build instructions for Mac OS X is here under 'building from source':

  http://kymatica.com/uploads/Software/algoscore-manual.html

It would be very nice if someone could give it a try and report back! :)

-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2008-03-16 18:14
FromJonatan Liljedahl
SubjectRe: [Cs-dev] linking with csound framework
victor wrote:
> libcsnd.dylib is the 'interfaces' library. You need to link 
> to the CsoundLib framework (compile() is there).
> 
> -framework CsoundLib

I tried the AC_CHECK_FRAMEWORK autoconf macro I found, which checks for
a framework and adds "-framework " to $LIBS. This worked fine for
configure, but when running make I got this (see below).
As you see, the frameworks are not passed to the final linking step of
gcc. Doing 'make CFLAGS="-framework CsoundLib"' didn't work either, but
'make CFLAGS="-Wl,-framework,CsoundLib"' worked. Is this the way one
should link to a framework or should -framework work?

/bin/sh ./libtool --tag=CC --mode=link gcc -O2 -g -O2 -DXTHREADS
-D_REENTRANT -I/opt/local/include/gtk-2.0
-I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0
-I/opt/local/include/cairo -I/opt/local/include/pango-1.0
-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include
-I/opt/local/include -I/opt/local/include/freetype2
-I/opt/local/include/libpng12 -I/usr/X11R6/include     -o algoscore
algoscore.o playbuslib.o utils.o mathxlib.o csoundlib.o
nasal/libnasal.la -ldl -lpthread  -framework CsoundLib
-Wl,-framework,CoreServices,-framework,ApplicationServices
-L/opt/local/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lSM -lICE
-lgobject-2.0 -lgmodule-2.0 -lfreetype -lz -lfontconfig -lexpat -lpng12
-lXrender -lX11 -lgthread-2.0 -lglib-2.0 -lintl -liconv   -framework Jack

gcc -O2 -g -O2 -DXTHREADS -D_REENTRANT -I/opt/local/include/gtk-2.0
-I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0
-I/opt/local/include/cairo -I/opt/local/include/pango-1.0
-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include
-I/opt/local/include -I/opt/local/include/freetype2
-I/opt/local/include/libpng12 -I/usr/X11R6/include -o algoscore
algoscore.o playbuslib.o utils.o mathxlib.o csoundlib.o -Wl,-framework
-Wl,CoreServices -Wl,-framework -Wl,ApplicationServices
nasal/.libs/libnasal.a -L/opt/local/lib -L/usr/X11R6/lib -ldl -lpthread
/opt/local/lib/libgtk-x11-2.0.dylib /opt/local/lib/libgdk-x11-2.0.dylib
/opt/local/lib/libatk-1.0.dylib /opt/local/lib/libgdk_pixbuf-2.0.dylib
/opt/local/lib/libtiff.dylib /opt/local/lib/libjpeg.dylib
/opt/local/lib/libpangocairo-1.0.dylib
/opt/local/lib/libpangoft2-1.0.dylib /opt/local/lib/libpango-1.0.dylib
-lm /opt/local/lib/libcairo.dylib -lSM -lICE
/opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib
/opt/local/lib/libfontconfig.dylib /opt/local/lib/libfreetype.dylib
/opt/local/lib/libexpat.dylib /opt/local/lib/libpng12.dylib -lz
/opt/local/lib/libXrender.dylib -lX11
/opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libglib-2.0.dylib
/opt/local/lib/libintl.dylib -lc /opt/local/lib/libiconv.dylib
/usr/bin/ld: Undefined symbols:

..all used symbols of jack, libsndfile and csound...


-- 
/Jonatan         [ http://kymatica.com ]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net