[CM] Grace: realtime audio with Csound5

M. Edward (Ed) Borasky znmeb at cesmail.net
Fri, 29 Feb 2008 21:14:15 -0800


This is a multi-part message in MIME format.
--------------000909090808000707030609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Heinrich Taube wrote:
> On Feb 29, 2008, at 3:00 PM, M. Edward (Ed) Borasky wrote:
> 
>> Rick Taube wrote:
>>> On Feb 29, 2008, at 9:28 AM, M. Edward (Ed) Borasky wrote:
>>>> It is 3.0.0, both in the Gentoo distro and what I used to build 
>>>> Grace. I couldn't figure out why the premake step wasn't finding the 
>>>> installed Chicken, so I just made a copy of it.
>>> it will look for ../../../chicken  or /usr/local/{bin/lib}
>>> you can specify some other place doing
>>>   premake ... --chickendir /path/to/chicken
>>> _______________________________________________
>>> Cmdist mailing list
>>> Cmdist@ccrma.stanford.edu
>>> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>> Ah ... so then I should use "/usr"
> 
> chicken's install normally puts it in /usr/local/bin, /usr/local/lib and 
> /usr/local/include...if its in /usr/bin, /usr/lib and /usr/include then 
> im not sure what do to other than edit my premake.lua (because its not 
> there now) and change this:
> 
> package.includepaths = {juce_dir, "/usr/local/include" }
> 
> to
> 
> package.includepaths = {juce_dir, "/usr/local/include", "/usr/include" }
> 
> and then generate the Makefiles and see if that fixes it.
> if it works let me know and ill check the fix into svn
> 
> 
It turns out that there are two "includepaths", one for GraceCL and one 
for Grace. I changed both of them and both GraceCL and Grace now build 
with the "native" apps.

Next question: now that I have a successful build, how do I "install" 
Grace? When I just start

"/grace/build/linux/build/Release/Grace/bin/grace", it complains that 
the application resource directory does not exist. Is there some way to 
get the whole tree into something under "/usr/local" with an 
"application resource directory" in my home directory?

--------------000909090808000707030609
Content-Type: text/plain;
 name="premake.lua"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="premake.lua"

addoption("release", "optional release number nnn (printed n.n.n)")
addoption("revision", "optional source revision number")
addoption("jucedir", "optional location of juce directory")
addoption("chickendir", "optional location of chicken directory")
addoption("csound", "build with csound support")

if (options["jucedir"]) then
   juce_dir = options["jucedir"]
else
   juce_dir = "../../../juce"
end

if (options["chickendir"]) then
   chicken_dir = options["chickendir"]
else
   chicken_dir = "../../../chicken"
end

source_dir = "../../src/"

gracecl_files = {"Buffer", "Console", "Editor", "Grace", 
		 "Layer", "Lisp", "Help", "Resources",
		 "Plotter", "Points", "Syntab", "Syntax"}

grace_files = {"Buffer", "ChickenBridge", "Console", 
	       "Csound",
	       "Editor", "Grace", 
	       "Help", "Layer", "Midi", "MidiReceiveComponent", "Resources",
	       "Plotter", "Points", "Scheme", "Syntab", "Syntax", "Toolbox"
	    }

function source_files(files)
   local relative = {}
   for i,f in files do
      table.insert(relative, source_dir .. f .. ".h")
      table.insert(relative, source_dir .. f .. ".cpp")
   end
   return relative
end

function add_release_options()
   if (options["release"]) then
      table.insert(package.defines, "RELEASE=" .. options["release"] )
   end
   if (options["revision"]) then
      table.insert(package.defines, "REVISION=" .. options["revision"] )
   end
end

project.name = "GRACE"
project.bindir = "build"
-- hack: reorder configurations to make Release the default
project.configs = {"Release", "Debug"}

------------------------------------------------------------------------------
------------------------------- GraceCL Package ------------------------------
------------------------------------------------------------------------------

package = newpackage()
package.name = "GraceCL"
package.language = "c++"
package.kind = "exe"
package.files = { source_files( gracecl_files ) }
package.includepaths = {juce_dir, "/usr/local/include", "/usr/include" }
package.libpaths = {juce_dir .. "/bin", "/usr/local/lib", "/usr/lib" }
package.objdir = "build/gracecl.obj"

if (macosx) then
   package.config["Release"].target = "Release/GraceCL.app/Contents/MacOS/GraceCL"
   package.config["Debug"].target = "Debug/GraceCL.app/Contents/MacOS/GraceCL"
   package.defines = { "MACOSX=1" }
   package.links = {"juce -framework Carbon -framework CoreServices -framework CoreAudio -framework CoreMidi -framework ApplicationServices -framework OpenGL -framework AGL -framework QuickTime -framework IOKIT"}
elseif ( linux ) then
   package.config["Release"].target = "Release/GraceCL/bin/gracecl"
   package.config["Debug"].target = "Debug/GraceCL/bin/gracecl"
   package.defines = { "LINUX=1" }
   package.links = {"juce", "freetype", "GLU", "GL", "asound"}
elseif ( windows ) then
   package.config["Release"].target = "Release/GraceCL/GraceCL"
   package.config["Debug"].target = "Debug/GraceCL/GraceCL"
   package.defines = { "WINDOWS=1" }
end

add_release_options()

------------------------------------------------------------------------------
-------------------------------  Grace Package  ------------------------------
------------------------------------------------------------------------------

package = newpackage()
package.name = "Grace"
package.language = "c++"
package.kind = "exe"

--if ( options["csound"] ) then
---   table.insert(grace_files, "Csound")
--end

package.files = { source_files( grace_files ) }
package.includepaths = {chicken_dir, juce_dir, "/usr/local/include", "/usr/include" }
package.libpaths = {chicken_dir, juce_dir .. "/bin", "/usr/local/lib" }
package.objdir = "build/grace.obj"

if (macosx) then
   package.config["Release"].target = "Release/Grace.app/Contents/MacOS/Grace"
   package.config["Debug"].target = "Debug/Grace.app/Contents/MacOS/Grace"
   package.defines = { "MACOSX=1", "SCHEME=1" }
   frameworks = " -framework Carbon -framework CoreServices -framework CoreAudio -framework CoreMidi -framework ApplicationServices -framework OpenGL -framework AGL -framework QuickTime -framework IOKIT"
   if ( options["csound"] ) then
      frameworks = frameworks .. " -framework CsoundLib"
   end
   package.links = {"uchicken", "juce" .. frameworks}
elseif ( linux ) then
   package.config["Release"].target = "Release/Grace/bin/grace"
   package.config["Debug"].target = "Debug/Grace/bin/grace"
   package.defines = { "LINUX=1", "SCHEME=1"}
   package.links = {"chicken", "juce", "freetype", "GLU", "GL", "asound"}
   if ( options["csound"] ) then
      table.insert(package.links, "csound")
      table.insert(package.links, "sndfile")
   end
elseif ( windows ) then
   package.config["Release"].target = "Release/Grace/Grace"
   package.config["Debug"].target = "Debug/Grace/Grace"
   package.defines = { "WINDOWS=1", "SCHEME=1" }
end

if ( options["csound"] ) then
   table.insert(package.defines, "PORTCSOUND=1")
end

add_release_options()

-- EOF

--------------000909090808000707030609--