[Cs-dev] opcodedir on OSX?
Date | 2012-09-06 16:02 |
From | Rory Walsh |
Subject | [Cs-dev] opcodedir on OSX? |
I get nothing when I run $OPCODEDIR or $OPCODEDIR64 from my OSX terminal. Is this not set on OSX? My frontends check this variable to make sure Csound is installed. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2012-09-06 16:11 |
From | Justin Smith |
Subject | Re: [Cs-dev] opcodedir on OSX? |
I assume you mean 'echo $OPCODEDIR' because that should not be set to a runnable command anyway. On my mountain lion machine, at least, I can run csound just fine but those variables are not defined in the environment. On Thu, Sep 6, 2012 at 8:02 AM, Rory Walsh |
Date | 2012-09-06 16:16 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
Yes, sorry, that's what I mean. So I assume it's not set. Perhaps it can be in the future, as this would mean one simple solution for all platforms in terms of checking if Csound is installed correctly. I hate having to write platform specific code for cross platform applications. > I assume you mean 'echo $OPCODEDIR' because that should not be set to > a runnable command anyway. > > On my mountain lion machine, at least, I can run csound just fine but ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2012-09-06 16:18 |
From | Justin Smith |
Subject | Re: [Cs-dev] opcodedir on OSX? |
csound is installed and working on my primary machine (debian stable) as well, and OPCODEDIR is not set in my environment, sounds like that var may be a windows only thing at the moment? On Thu, Sep 6, 2012 at 8:16 AM, Rory Walsh |
Date | 2012-09-06 16:24 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
It's also set on Linux. It's a simple thing to have the installer set it, if it doesn't mess things up that is. Currently my frontends do this on start up: if(OPCODEDIR is not valid) print "Please install Csound before using this software" Works fine for Windows and Linux. Victor looks after the OSX installer. Let's see what he thinks. On 6 September 2012 16:18, Justin Smith |
Date | 2012-09-06 16:31 |
From | Justin Smith |
Subject | Re: [Cs-dev] opcodedir on OSX? |
it isn't set on debian stable, and csound runs just fine On Thu, Sep 6, 2012 at 8:24 AM, Rory Walsh |
Date | 2012-09-06 16:36 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] opcodedir on OSX? |
OPCODEDIR is not necessary to run csound. So don't check for it. Csound has a pre-compiled default OPCODEDIR, so it doesn't need it. You should really be checking for the stuff you really need, which is (I presume) the csound library. On Thu, Sep 6, 2012 at 12:31 PM, Justin Smith |
Date | 2012-09-06 16:36 |
From | Steven Yi |
Subject | Re: [Cs-dev] opcodedir on OSX? |
Csound loads from a default of OPCODEDIR is not set. The code is in Top/csmodule.c: /* default directory to load plugins from if environment variable is not set */ #if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__))) # define ENABLE_OPCODEDIR_WARNINGS 1 # ifdef CS_DEFAULT_PLUGINDIR # undef CS_DEFAULT_PLUGINDIR # endif # define CS_DEFAULT_PLUGINDIR "." #else # define ENABLE_OPCODEDIR_WARNINGS 0 # ifndef CS_DEFAULT_PLUGINDIR # ifndef USE_DOUBLE # define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins" # else # define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins64" # endif # endif #endif It's also passed in during build from SCons in csound5: SConstruct:898: s = '-DCS_DEFAULT_PLUGINDIR=\\"%s\\"' % tmp SConstruct:905: s = '-DCS_DEFAULT_PLUGINDIR=\\"%s\\"' % tmp On Thu, Sep 6, 2012 at 4:31 PM, Justin Smith |
Date | 2012-09-06 16:39 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
You beat me to it, I was just going through the sources myself. Ok, so I guess I need to use another check. Can anyone think of a simple way to check if Csound is installed? Cross-platform would be nice? On 6 September 2012 16:36, Steven Yi |
Date | 2012-09-06 16:57 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] opcodedir on OSX? |
What language are you developing in? On Thu, Sep 6, 2012 at 12:39 PM, Rory Walsh |
Date | 2012-09-06 16:59 |
From | Justin Smith |
Subject | Re: [Cs-dev] opcodedir on OSX? |
one approach would be to make an array of common install locations (ie. the defaults of the various installers) and check them one by one for the files you need if OPCODEDIR/OPCODEDIR64 are not set then, anyone who has csound in a nonstandard place just has to make sure and set OPCODEDIR (which they would have to do anyway), and it would just work On Thu, Sep 6, 2012 at 8:39 AM, Rory Walsh |
Date | 2012-09-06 18:08 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
I'm working in C++. (Sorry Steven, no smart ass answer this time!) Anyone know of a way to check the existence of a particular library? Of course I could just do a web search! ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2012-09-06 18:35 |
From | Steven Yi |
Subject | Re: [Cs-dev] opcodedir on OSX? |
You could try doing a dynamic load, like how the opcode libraries are loaded. dlopen should search LD_LIBRARY_PATH on *nix systems. LoadLibrary on Windows is documented to search paths if just the library name is given. Maybe try those? On Thu, Sep 6, 2012 at 6:08 PM, Rory Walsh |
Date | 2012-09-06 18:37 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
Thanks Steven. I'll look into that. I guess there's no one size fits all here.. On 6 September 2012 18:35, Steven Yi |
Date | 2012-09-06 19:48 |
From | Justin Smith |
Subject | Re: [Cs-dev] opcodedir on OSX? |
why not check if one of the files exists in each default location? something like this (untested code, more of a mockup) #include |
Date | 2012-09-06 19:52 |
From | Rory Walsh |
Subject | Re: [Cs-dev] opcodedir on OSX? |
Yeah, that might be the easiest. It's easy to check the existence of files. Cheers. On 6 September 2012 19:48, Justin Smith |