Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] Csound 5 status

Date2005-09-01 23:44
FromMichael Gogins
SubjectRe: [Cs-dev] Csound 5 status
You need to make sure the directory where _CsoundVST.so or whatever is located, is identified in your PYTHONPATH environment variable. I have a feeling this may do the job.

Regards,
Mike

-----Original Message-----
From: Graham Breed 
Sent: Sep 1, 2005 5:07 PM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] Csound 5 status

Michael Gogins wrote:
> It should be easy to deal with the undefined _CreateCsoundVST. Presumably, 
> you have now built _CsoundVST.so or .dylib or whatever. You now need to add 
> that library to your link line for csoundvst_main (and perhaps other 
> libraries as well, see the Linux link line for ideas).

You mean in SConstruct?  Ah, well, that gives the right solutions to 
some of the previous problems.  I now have a CsoundVST!  And it fails to 
run like this:

csound5 ./CsoundVST
Starting CsoundVST...
Localisation of messages is disabled, using default language.
time resolution is 1000.000 ns
BEGAN Shell::runScript()...
==============================================================================================================
==============================================================================================================
PyRun_SimpleString returned 0.
ENDED Shell::runScript().
BEGAN Shell::runScript()...
==============================================================================================================
Traceback (most recent call last):
   File "", line 1, in ?
ImportError: No module named CsoundVST
==============================================================================================================
PyRun_SimpleString returned -1.
ENDED Shell::runScript().
BEGAN Shell::runScript()...
==============================================================================================================
AttributeError: 'module' object has no attribute 'csound'
==============================================================================================================
PyRun_SimpleString returned -1.
ENDED Shell::runScript().
Csound tidy up: Segmentation fault


But the build still goes on to fail with

gcc -g -O2 -DCSOUND_WITH_API -DMACOSX -Wall -DPIPES -DHAVE_FCNTL_H 
-DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_MALLOC_H -DHAVE_SYS_TIME_H 
-DHAVE_SYS_TYPES_H -DHAVE_CTYPE_H -DHAVE_TERMIOS_H -DHAVE_STRING_H 
-DHAVE_DIRENT_H -DWINDOWS -DUSE_FLTK -fPIC -DBETA -I. -IH 
-I/usr/include/malloc -I/opt/local/include/boost-1_32 -c -o 
Opcodes/py/pythonopcodes.os Opcodes/py/pythonopcodes.c
Opcodes/py/pythonopcodes.c:20:20: Python.h: No such file or directory
In file included from Opcodes/py/pythonopcodes.c:21:
Opcodes/py/pythonopcodes.h:24:20: Python.h: No such file or directory
In file included from Opcodes/py/pythonopcodes.c:22:
Opcodes/py/pythonhelper.h:24:20: Python.h: No such file or directory

and so on, with screenfuls of errors.  I'll look a this in the morning.

As it happens, I can't build the DLL for csound either.

gcc -g -O2 -DCSOUND_WITH_API -DMACOSX -Wall -DPIPES -DHAVE_FCNTL_H 
-DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_MALLOC_H -DHAVE_SYS_TIME_H 
-DHAVE_SYS_TYPES_H -DHAVE_CTYPE_H -DHAVE_TERMIOS_H -DHAVE_STRING_H 
-DHAVE_DIRENT_H -D__BUILDING_LIBCSOUND -DWINDOWS -DUSE_FLTK -fPIC -DBETA 
-I. -IH -I/usr/include/malloc -I/opt/local/include/boost-1_32 -c -o 
InOut/window.os InOut/window.c
gcc -g -O2 -DCSOUND_WITH_API -DMACOSX -Wall -DPIPES -DHAVE_FCNTL_H 
-DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_MALLOC_H -DHAVE_SYS_TIME_H 
-DHAVE_SYS_TYPES_H -DHAVE_CTYPE_H -DHAVE_TERMIOS_H -DHAVE_STRING_H 
-DHAVE_DIRENT_H -D__BUILDING_LIBCSOUND -DWINDOWS -DUSE_FLTK -fPIC -DBETA 
-I. -IH -I/usr/include/malloc -I/opt/local/include/boost-1_32 -c -o 
OOps/aops.os OOps/aops.c
scons: *** Source file: InOut/FL_graph.o is static and is not compatible 
with shared target: libcsound.dylib

I just happened to try that.


              Graham








-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-09-02 13:50
FromGraham Breed
SubjectRe: [Cs-dev] Csound 5 status
Michael Gogins wrote:
> You need to make sure the directory where _CsoundVST.so or whatever is located, is identified in your PYTHONPATH environment variable. I have a feeling this may do the job.

Yes, it's _CsoundVST.so.  There I was trying to be clever and changing 
it to .dylib!  It runs happily with this command:

env OPCODEDIR=`pwd` PYTHONPATH=`pwd` ./CsoundVST

Here's the patch:


Index: SConstruct
===================================================================
RCS file: /cvsroot/csound/csound5/SConstruct,v
retrieving revision 1.282
diff -u -p -r1.282 SConstruct
--- SConstruct  1 Sep 2005 22:04:46 -0000       1.282
+++ SConstruct  2 Sep 2005 12:35:24 -0000
@@ -1042,6 +1042,17 @@ else:
          vstEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
          vstEnvironment.Append(SHLINKFLAGS = '--add-stdcall-alias')
          guiProgramEnvironment.Prepend(LINKFLAGS = ['-mwindows', 
'_CsoundVST.so'])
+    elif getPlatform() == 'darwin':
+        vstEnvironment.Append(LIBS = ['python2.3', 'dl', 'm'])
+        vstEnvironment.Append(CPPPATH = ['/usr/include/python2.3'])
+        vstEnvironment.Append(cxxflags = ['-fabi-version=0']) # if gcc3.2-3
+        if commonEnvironment['Word64']=='1':
+            vstEnvironment.Append(LIBPATH = 
['/usr/lib64/python2.3/config'])
+        else:
+            vstEnvironment.Append(LIBPATH = ['/usr/lib/python2.3/config'])
+        vstEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
+        vstEnvironment.Append(SHLINKFLAGS = '--add-stdcall-alias')
+        guiProgramEnvironment.Prepend(LINKFLAGS = ['_CsoundVST.so'])
      elif getPlatform() == 'cygwin' or getPlatform() == 'mingw':
          pythonImportLibrary = 
vstEnvironment.Command('/usr/local/lib/libpython23.a',
          '$SYSTEMROOT/System32/python23.dll',
@@ -1216,6 +1227,15 @@ Opcodes/stk/src/Thread.cpp
              pyEnvironment.Append(LIBPATH = 
['/usr/local/lib/python2.3/config'])
          pyEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
          pyEnvironment.Append(SHLINKFLAGS = '--add-stdcall-alias')
+    elif getPlatform() == 'darwin':
+        pyEnvironment.Append(LIBS = ['python2.3', 'dl', 'm'])
+        pyEnvironment.Append(CPPPATH = ['/usr/include/python2.3'])
+        if commonEnvironment['Word64']=='1':
+            pyEnvironment.Append(LIBPATH = ['/usr/lib64/python2.3/config'])
+        else:
+            pyEnvironment.Append(LIBPATH = ['/usr/lib/python2.3/config'])
+        pyEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
+        pyEnvironment.Append(SHLINKFLAGS = '--add-stdcall-alias')
      elif getPlatform() == 'cygwin' or getPlatform() == 'mingw':
          pyEnvironment['ENV']['PATH'] = os.environ['PATH']
          pyEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
Index: custom.py
===================================================================
RCS file: /cvsroot/csound/csound5/custom.py,v
retrieving revision 1.22
diff -u -p -r1.22 custom.py
--- custom.py   26 Jun 2005 01:23:15 -0000      1.22
+++ custom.py   2 Sep 2005 12:35:24 -0000
@@ -22,6 +22,12 @@ if sys.platform[:5] == 'linux':
  elif sys.platform == 'cygwin':
      platform = 'cygwin'
      customCPPPATH.append('c:/utah/usr/Python23/include')
+elif sys.platform == 'darwin':
+    platform = 'darwin'
+    customCPPPATH.append('/usr/include/malloc')
+    customCPPPATH.append('/opt/local/include/boost-1_32/')
+    customCPPPATH.append('/usr/include/python2.3')
+    customCXXFLAGS.append('-fabi-version=0')
  elif sys.platform[:3] == 'win':
      # For the basic build you need MinGW, MSys, and libsndfile.
      # Add them here:
Index: frontends/CsoundVST/CsoundVSTMain.cpp
===================================================================
RCS file: /cvsroot/csound/csound5/frontends/CsoundVST/CsoundVSTMain.cpp,v
retrieving revision 1.6
diff -u -p -r1.6 CsoundVSTMain.cpp
--- frontends/CsoundVST/CsoundVSTMain.cpp       28 May 2005 13:00:07 
-0000      1.6
+++ frontends/CsoundVST/CsoundVSTMain.cpp       2 Sep 2005 12:35:24 -0000
@@ -36,7 +36,7 @@ bool oome = false;
  #if defined(__GNUC__) && defined(WIN32)
  #define main main_plugin
  extern "C" __declspec(dllexport) AEffect *main_plugin 
(audioMasterCallback audioMaster)
-#elif defined(LINUX)
+#elif defined(LINUX) || defined(MACOSX)
  AEffect *main_plugin (audioMasterCallback audioMaster)
  #else
  AEffect *main(audioMasterCallback audioMaster)
Index: frontends/CsoundVST/AEffect.h
===================================================================
RCS file: /cvsroot/csound/csound5/frontends/CsoundVST/AEffect.h,v
retrieving revision 1.5
diff -u -p -r1.5 AEffect.h
--- frontends/CsoundVST/AEffect.h       28 May 2005 13:00:07 -0000      1.5
+++ frontends/CsoundVST/AEffect.h       2 Sep 2005 12:35:26 -0000
@@ -20,7 +20,7 @@
                  long value, void *ptr, float opt));
  */

-#if CARBON
+#if CARBON || MACOSX
  #if PRAGMA_STRUCT_ALIGN || __MWERKS__
          #pragma options align=mac68k
  #endif
@@ -178,7 +178,7 @@ enum
 
   // will always return true.
  };

-#if CARBON
+#if CARBON || MACOSX
  #if PRAGMA_STRUCT_ALIGN || __MWERKS__
          #pragma options align=reset
  #endif
Index: frontends/CsoundVST/System.cpp
===================================================================
RCS file: /cvsroot/csound/csound5/frontends/CsoundVST/System.cpp,v
retrieving revision 1.16
diff -u -p -r1.16 System.cpp
--- frontends/CsoundVST/System.cpp      26 Aug 2005 17:47:54 -0000      1.16
+++ frontends/CsoundVST/System.cpp      2 Sep 2005 12:35:29 -0000
@@ -698,7 +698,7 @@ namespace csound
      beep();
    }

-#elif defined(LINUX)
+#elif defined(LINUX) || defined(MACOSX)

  #include 
  #include 
Index: InOut/window.c
===================================================================
RCS file: /cvsroot/csound/csound5/InOut/window.c,v
retrieving revision 1.14
diff -u -p -r1.14 window.c
--- InOut/window.c      12 Aug 2005 19:01:23 -0000      1.14
+++ InOut/window.c      2 Sep 2005 12:35:31 -0000
@@ -40,11 +40,13 @@ static void (*killFn)(CSOUND *, WINDAT *
  extern void KillAscii(CSOUND *, WINDAT *);
  extern void KillGraph(CSOUND *, WINDAT *);
  /* pointer to xyinput window creator */
-       void (*mkxyFn)(CSOUND *, XYINDAT *, MYFLT, MYFLT);
+/* globals must have a value assigned in OSX */
+/* c.f. http://wiki.tcl.tk/2923 */
+       void (*mkxyFn)(CSOUND *, XYINDAT *, MYFLT, MYFLT) = NULL;
  static void MkXYDummy(CSOUND *, XYINDAT *, MYFLT, MYFLT);
  extern void MakeXYin(CSOUND *, XYINDAT *, MYFLT, MYFLT);
  /* pointer to xyinput window reader */
-       void (*rdxyFn)(CSOUND *, XYINDAT *);
+       void (*rdxyFn)(CSOUND *, XYINDAT *) = NULL;
  static void RdXYDummy(CSOUND *, XYINDAT *);
  extern void ReadXYin(CSOUND *, XYINDAT *);

Index: OOps/aops.c
===================================================================
RCS file: /cvsroot/csound/csound5/OOps/aops.c,v
retrieving revision 1.43
diff -u -p -r1.43 aops.c
--- OOps/aops.c 26 Aug 2005 17:47:53 -0000      1.43
+++ OOps/aops.c 2 Sep 2005 12:35:35 -0000
@@ -33,7 +33,8 @@
  #define ONEdLOG2    (1.4426950408889634074)

  /* static lookup tables, initialised once at start-up */
-        MYFLT   cpsocfrc[OCTRES];
+/* dummy initialization for OSX, c.f. http://wiki.tcl.tk/2923 */
+        MYFLT   cpsocfrc[OCTRES] = {};
  static  MYFLT   powerof2[4096];

  /* initialise the tables, called by csoundInitialize() */


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net