|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
|
|
Help for preparing an FLTK plug-in opcode# Hi,
# I'm trying to make an oscilloscope using FLTK, because the display opcode works only on X11. # I successfully made a very simple (sinusoidal waveform calculating) plug-in opcode looking at the documentation: ugur2.c For this one, I have only one question. When I compiled it and made it a .so file and called its opcode from Csound etc. it said that "incompatible opcode" I understand that this is because of MYFLT is default a float and my Csound version is double. I added a line in the ugur2.c file "#define MYFLT double" to handle the situation, it works but I get always a warning which says MYFLT was defined twice. (It is defined in csound.h) How can I say to compiler that MYFLT is double without defining it twice. # I do not know the cause of my second question. I added some FLTK code for creating an FLTK window, which is the first example in the FLTK documentation. (same file with additional code from FTLK example: ugur4.cpp) But I do not know whether I made it correct. # The file compiled without errors. I copied the .so file under plugins64 folder but Csound gave this warning: WARNING: could not open library '/usr/lib/csound/plugins64/ugur4.so' (/usr/lib/csound/plugins64/ugur4.so: undefined symbol: _Znwj) # What may be the reason of this warning? # My system is Ubuntustudio 8.04 and csound 5.08 double version. # Thanks in advance! -ugur guney- Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" [ugur2.c] #include "csound/csdl.h" #include <math.h> #define MYFLT double typedef struct _newsaw { OPDS h; MYFLT *asaw;/* output pointer */ MYFLT *ifreq; /* input pointers */ long time; } newsaw; int newsaw_init(CSOUND *csound, newsaw *p){ p->time = 0; return OK; } int newsaw_process(CSOUND *csound, newsaw *p){ int i; int n = csound->ksmps; MYFLT *out = p->asaw; MYFLT freq = *p->ifreq; for(i=0; i<n; i++) { out[i] = sin(2*3.1415*freq*(p->time)/44100.0); p->time = p->time+1; } return OK; } static OENTRY localops[] = { {"newsaw", sizeof(newsaw), 5, "a", "i", (SUBR)newsaw_init, NULL, (SUBR)newsaw_process} }; LINKAGE [ugur4.cpp] #include "csound/csdl.h" #include <math.h> #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> #define MYFLT double typedef struct _newsaw { OPDS h; MYFLT *asin;/* output pointer */ MYFLT *ifreq; /* input pointers */ long time; } newsin; int newsin_init(CSOUND *csound, newsin *p){ Fl_Window *window = new Fl_Window(300,180); Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!"); box->box(FL_UP_BOX); box->labelsize(36); box->labelfont(FL_BOLD+FL_ITALIC); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show(); Fl::run(); p->time = 0; return OK; } int newsin_process(CSOUND *csound, newsin *p){ int i; int n = csound->ksmps; MYFLT *out = p->asin; MYFLT freq = *p->ifreq; for(i=0; i<n; i++) { out[i] = sin(2*3.1415*freq*(p->time)/44100.0); p->time = p->time+1; } return OK; } static OENTRY localops[] = { {"newsin", sizeof(newsin), 5, "a", "i", (SUBR)newsin_init, NULL, (SUBR)newsin_process} }; LINKAGE |
|
|
|
|
|
Re: Re: Help for preparing an FLTK plug-in opcode# Hi Victor,
# Thanks, _DUSE_DOUBLE solved the first problem. But unfortunately second one remains. # I compiled with: g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE `fltk-config --cxxflags` # and made the .so file with: ld -E --shared ugur4.o -o ugur4.so # but get the same error: WARNING: could not open library '/usr/lib/csound/plugins64/ugur4.so' (/usr/lib/csound/plugins64/ugur4.so: undefined symbol: _Znwj) # I searched google with the keyword "Undefined Symbol: _Znwj", saw a post and tried this one: g++ -shared -lstdc++ `fltk-config --cxxflags` -o ugur4.so ugur4.cpp -DUSE_DOUBLE # This time the warning message changed: WARNING: could not open library '/usr/lib/csound/plugins64/ugur4.so' (/usr/lib/csound/plugins64/ugur4.so: undefined symbol: _ZN9Fl_WindowC1EiiPKc) # I looked at the Synaptic Package Manager. It seems like that I have the development lib libraries. # Can there be a conflict between the compiler versions of my gcc and the gcc with which Csound is compiled or between versions of FLTK's? I have g++ 4.2 and FLTK 1.1.7 # Or did I made something wrong in the code? -ugur- On Wed, Apr 30, 2008 at 7:20 PM, Victor Lazzarini <Victor.Lazzarini@...> wrote: > 1) MYFLT: don't define it yourself, use -DUSE_DOUBLE > > 2)It's a link error, try building the C++ code with g++ instead of > gcc (If you have not done so). One of the default C++ libs seems > to be missing. Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Re: Help for preparing an FLTK plug-in opcodeOn Wednesday 30 April 2008 17:05:03 Uğur Güney wrote:
> # I compiled with: g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE > `fltk-config --cxxflags` > # and made the .so file with: ld -E --shared ugur4.o -o ugur4.so > # but get the same error: WARNING: could not open library Note that you need -fPIC to build shared libraries. I did this and succeeded: % g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE `fltk-config --cxxflags` -fPIC ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’ ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’ ugur4.cpp:47: warning: deprecated conversion from string constant to ‘char*’ % g++ -shared -o ugur4.so ugur4.o `fltk-config --ldflags` % -- Felipe Sateler |
|
|
Installing csound5 from source on fedora 8Here are my notes on installing csound5 from source on Fedora 8. I got a
segfault with the Linux binary installer hence the attempt to install from source. ---------------------------------------------------------------- Building csound 5.08 from source -------------------------------- 1. download Csound5.08.tgz from sourceforge 2. tar xzf Csound5.08.tgz 3. cd Csound5.08 4. run scons -h and work out what devel packages to install. I installed libsndfile-devel portaudio-devel fltk-devel fluidsynth-devel jack-audio-connection-kit-devel liblo-devel tcl-devel tk-devel 5. edit custom.py and modify the path to fltk as follows if sys.platform[:5] == 'linux': platform = 'linux' customCPPPATH.append('/usr/include/FL') customLIBPATH.append('/usr/lib') 6. try and run scons as follows scons useDouble=1 buildCsound5GUI=1 generatePDF=1 \ buildStkOpcodes=1 buildTclcsound=1 buildVirtual=1 \ useOSC=1 buildLoris=0 (note I couldn't use gcc4opt=1 as I got an error in config.log with an unrecognised option mtune=1) This failed as /usr/include/FL (the fltk include files) included a file math.h, which was used in preference to the system math.h I tried renaming /usr/include/FL/math.h to /usr/include/FL/fl_math.h The next failure was with dirent.h - I tried renaming /usr/include/FL/dirent.h to /usr/include/FL/fl_dirent.h A better solution with gcc would be to use -idirafter /usr/include/FL which would cause that directory to be searched *after* the system include paths, thus ensuring the correct version of math.h and dirent.h. However I don't know how to do that with scons. The next failure was the missing "fluid" command. To fix this: yum install fltk-fluid Finally building completed. 7. To install ./install.py 8. Edit your .cshrc or .bash_profile and set export OPCODEDIR64=/usr/local/lib/csound/plugins64 or setenv OPCODEDIR64 /usr/local/lib/csound/plugins64 9. set RAWWAVE_PATH /usr/local/share/csound/rawwaves in either .bash_profile or .cshrc -- Alan Fitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Re: Re: Help for preparing an FLTK plug-in opcode# Thank you very much Felipe and everyone! I both did not use the
`fltk-config --ldflags` in creating the .so file and did not used the -fPIC flag (I do not know what is it used for but will invesitage about its meaning) # Now I succeed to create an FLTK window from Csound without any errors. # Have a nice day! -uğur- On Thu, May 1, 2008 at 1:06 AM, Felipe Sateler <fsateler@...> wrote: > On Wednesday 30 April 2008 17:05:03 Uğur Güney wrote: > > # I compiled with: g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE > > `fltk-config --cxxflags` > > # and made the .so file with: ld -E --shared ugur4.o -o ugur4.so > > # but get the same error: WARNING: could not open library > > Note that you need -fPIC to build shared libraries. > I did this and succeeded: > % g++ -O2 -c ugur4.cpp -o ugur4.o -DUSE_DOUBLE `fltk-config --cxxflags` -fPIC > ugur4.cpp:47: warning: deprecated conversion from string constant to 'char*' > ugur4.cpp:47: warning: deprecated conversion from string constant to 'char*' > ugur4.cpp:47: warning: deprecated conversion from string constant to 'char*' > % g++ -shared -o ugur4.so ugur4.o `fltk-config --ldflags` > % > > > -- > Felipe Sateler > Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Installing csound5 from source on fedora 8gcc4opt take i386 or k8 or k6 or pentium or similar values.
==John ffitch > (note I couldn't use gcc4opt=1 as I got an error in config.log with > an unrecognised option mtune=1) Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Installing csound5 from source on fedora 8PS Setting that option is Well Worth It! I have been doing some
tracing/instruction counting etc and it takes trapped from 24 billion(US) instructions to 13 if I set gcc4opt=i386 Still working on it though ==John ffitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Installing csound5 from source on fedora 8Hi Alan,
Thank you for posting this guide. I've been building checkouts of Csound from CVS since long time using Fedora and always thought about starting some wiki or blog page where to post a guide for Linux users wanting to build Csound (I often see people in the list asking for instructions). The only step I found surprising in your guide was the one about changing the path to FLTK in custom.py. In all my builds (including the last one one month ago) using Fedora 8 I've never had to touch that file or had the problems with the math.h and dirent.h files. And I've been building with almost everything except for CsoundVST (and FLTK works). Did you try building without changing custom.py? I'm glad John answered the question regarding the value for gcc4opt, I've been trying to use that flag and getting the same error you got and since then forgot to try again. It might help with the performance. Is i686 the right value for a core2duo processor? Cheers, Hector On Wed, Apr 30, 2008 at 6:20 PM, Alan Peter Fitch <apfitch@...> wrote: > Here are my notes on installing csound5 from source on Fedora 8. I got a > segfault with the Linux binary installer hence the attempt to install > from source. > > > ---------------------------------------------------------------- > Building csound 5.08 from source > -------------------------------- > 1. download Csound5.08.tgz from sourceforge > > 2. tar xzf Csound5.08.tgz > > 3. cd Csound5.08 > > 4. run scons -h and work out what devel packages to install. I installed > > libsndfile-devel > portaudio-devel > fltk-devel > fluidsynth-devel > jack-audio-connection-kit-devel > liblo-devel > tcl-devel > tk-devel > > 5. edit custom.py and modify the path to fltk as follows > > if sys.platform[:5] == 'linux': > platform = 'linux' > customCPPPATH.append('/usr/include/FL') > customLIBPATH.append('/usr/lib') > > 6. try and run scons as follows > > scons useDouble=1 buildCsound5GUI=1 generatePDF=1 \ > buildStkOpcodes=1 buildTclcsound=1 buildVirtual=1 \ > useOSC=1 buildLoris=0 > > (note I couldn't use gcc4opt=1 as I got an error in config.log with > an unrecognised option mtune=1) > > This failed as /usr/include/FL (the fltk include files) included > a file math.h, which was used in preference to the system math.h > > I tried renaming /usr/include/FL/math.h to /usr/include/FL/fl_math.h > > The next failure was with dirent.h - I tried renaming > > /usr/include/FL/dirent.h to /usr/include/FL/fl_dirent.h > > A better solution with gcc would be to use -idirafter /usr/include/FL > which would cause that directory to be searched *after* the system > include paths, thus ensuring the correct version of math.h and dirent.h. > However I don't know how to do that with scons. > > The next failure was the missing "fluid" command. To fix this: > > yum install fltk-fluid > > Finally building completed. > > 7. To install > > ./install.py > > 8. Edit your .cshrc or .bash_profile and set > export OPCODEDIR64=/usr/local/lib/csound/plugins64 > > or > > setenv OPCODEDIR64 /usr/local/lib/csound/plugins64 > > 9. set > > RAWWAVE_PATH /usr/local/share/csound/rawwaves > > in either .bash_profile or .cshrc > > > -- > Alan Fitch > > > Send bugs reports to this list. > To unsubscribe, send email sympa@... with body "unsubscribe csound" > Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
|
|
|
Re: Re: Re: Installing csound5 from source on fedora 8Hi Mike,
Thanks for the information. I checked the gcc manual and there is also a core2 option: nocona Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support. core2 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3 instruction set support. This is gcc version 4.1 Cheers, Hector On Thu, May 1, 2008 at 10:32 AM, Michael Gogins <gogins@...> wrote: > Consult the gcc manual. > > The correct value for Core 2 Duo is nocona. > > Regards, > Mike > > > > -----Original Message----- > >From: Hector Centeno <hcengar@...> > >Sent: May 1, 2008 9:39 AM > >To: csound@... > >Subject: [Csnd] Re: Installing csound5 from source on fedora 8 > > > >Hi Alan, > > > >Thank you for posting this guide. I've been building checkouts of > >Csound from CVS since long time using Fedora and always thought about > >starting some wiki or blog page where to post a guide for Linux users > >wanting to build Csound (I often see people in the list asking for > >instructions). The only step I found surprising in your guide was the > >one about changing the path to FLTK in custom.py. In all my builds > >(including the last one one month ago) using Fedora 8 I've never had > >to touch that file or had the problems with the math.h and dirent.h > >files. And I've been building with almost everything except for > >CsoundVST (and FLTK works). Did you try building without changing > >custom.py? > > > >I'm glad John answered the question regarding the value for gcc4opt, > >I've been trying to use that flag and getting the same error you got > >and since then forgot to try again. It might help with the > >performance. Is i686 the right value for a core2duo processor? > > > >Cheers, > > > >Hector > > > > > >On Wed, Apr 30, 2008 at 6:20 PM, Alan Peter Fitch <apfitch@...> wrote: > >> Here are my notes on installing csound5 from source on Fedora 8. I got a > >> segfault with the Linux binary installer hence the attempt to install > >> from source. > >> > >> > >> ---------------------------------------------------------------- > >> Building csound 5.08 from source > >> -------------------------------- > >> 1. download Csound5.08.tgz from sourceforge > >> > >> 2. tar xzf Csound5.08.tgz > >> > >> 3. cd Csound5.08 > >> > >> 4. run scons -h and work out what devel packages to install. I installed > >> > >> libsndfile-devel > >> portaudio-devel > >> fltk-devel > >> fluidsynth-devel > >> jack-audio-connection-kit-devel > >> liblo-devel > >> tcl-devel > >> tk-devel > >> > >> 5. edit custom.py and modify the path to fltk as follows > >> > >> if sys.platform[:5] == 'linux': > >> platform = 'linux' > >> customCPPPATH.append('/usr/include/FL') > >> customLIBPATH.append('/usr/lib') > >> > >> 6. try and run scons as follows > >> > >> scons useDouble=1 buildCsound5GUI=1 generatePDF=1 \ > >> buildStkOpcodes=1 buildTclcsound=1 buildVirtual=1 \ > >> useOSC=1 buildLoris=0 > >> > >> (note I couldn't use gcc4opt=1 as I got an error in config.log with > >> an unrecognised option mtune=1) > >> > >> This failed as /usr/include/FL (the fltk include files) included > >> a file math.h, which was used in preference to the system math.h > >> > >> I tried renaming /usr/include/FL/math.h to /usr/include/FL/fl_math.h > >> > >> The next failure was with dirent.h - I tried renaming > >> > >> /usr/include/FL/dirent.h to /usr/include/FL/fl_dirent.h > >> > >> A better solution with gcc would be to use -idirafter /usr/include/FL > >> which would cause that directory to be searched *after* the system > >> include paths, thus ensuring the correct version of math.h and dirent.h. > >> However I don't know how to do that with scons. > >> > >> The next failure was the missing "fluid" command. To fix this: > >> > >> yum install fltk-fluid > >> > >> Finally building completed. > >> > >> 7. To install > >> > >> ./install.py > >> > >> 8. Edit your .cshrc or .bash_profile and set > >> export OPCODEDIR64=/usr/local/lib/csound/plugins64 > >> > >> or > >> > >> setenv OPCODEDIR64 /usr/local/lib/csound/plugins64 > >> > >> 9. set > >> > >> RAWWAVE_PATH /usr/local/share/csound/rawwaves > >> > >> in either .bash_profile or .cshrc > >> > >> > >> -- > >> Alan Fitch > >> > >> > >> Send bugs reports to this list. > >> To unsubscribe, send email sympa@... with body "unsubscribe csound" > >> > > > > > >Send bugs reports to this list. > >To unsubscribe, send email sympa@... with body "unsubscribe csound" > > > > > > Send bugs reports to this list. > To unsubscribe, send email sympa@... with body "unsubscribe csound" > Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Installing csound5 from source on fedora 8> I'm glad John answered the question regarding the value for gcc4opt,
> I've been trying to use that flag and getting the same error you got > and since then forgot to try again. It might help with the > performance. Is i686 the right value for a core2duo processor? I do not have a core2duo so am not sure wht it is i686 is safe and resonable. You nmight consider prescott Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support. nocona Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support. ==John ffitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Installing csound5 from source on fedora 8jpff wrote:
> gcc4opt take i386 or k8 or k6 or pentium or similar values. > ==John ffitch >> (note I couldn't use gcc4opt=1 as I got an error in config.log with >> an unrecognised option mtune=1) > OK thanks John, I'll try that, Alan -- Alan Fitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Installing csound5 from source on fedora 8Hector Centeno wrote:
> Hi Alan, > > Thank you for posting this guide. I've been building checkouts of > Csound from CVS since long time using Fedora and always thought about > starting some wiki or blog page where to post a guide for Linux users > wanting to build Csound (I often see people in the list asking for > instructions). That's why I posted it, I was hoping someone would tell me where I should put it. I'll have to have a look at csounds.com > The only step I found surprising in your guide was the > one about changing the path to FLTK in custom.py. In all my builds > (including the last one one month ago) using Fedora 8 I've never had > to touch that file or had the problems with the math.h and dirent.h > files. And I've been building with almost everything except for > CsoundVST (and FLTK works). Did you try building without changing > custom.py? > Yes, that didn't build. Here is the problem I was trying to solve http://www.nabble.com/Csound5.08-x86_64d-installer-td16328373.html regards Alan -- Alan Fitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Installing csound5 from source on fedora 8Hector Centeno wrote:
> Hi Alan, > <snip> > The only step I found surprising in your guide was the > one about changing the path to FLTK in custom.py. In all my builds > (including the last one one month ago) using Fedora 8 I've never had > to touch that file or had the problems with the math.h and dirent.h > files. And I've been building with almost everything except for > CsoundVST (and FLTK works). Did you try building without changing > custom.py? > <snip> Hi Hector, how did you install FLTK? I installed it using yum - I'm not sure if that means I've got enable-threads or not. Perhaps if you installed from source the headers end up in a different place? regards Alan -- Alan Fitch Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |
|
|
Re: Re: Re: Installing csound5 from source on fedora 8aah! I see.. I didn't realize you are building for 64-bits kernel,
that's why you might have the FLTK problems and I don't (I'm using a 32-bit kernel with a core2duo). Today I just rebuilt from CVS using gcc4opt=core2 and it seems to be working fine and I think I'm noticing a slight performance improvement, but still have to do more testing. Cheers, Hector On Thu, May 1, 2008 at 6:12 PM, Alan Peter Fitch <apfitch@...> wrote: > Hector Centeno wrote: > > Hi Alan, > > > > Thank you for posting this guide. I've been building checkouts of > > Csound from CVS since long time using Fedora and always thought about > > starting some wiki or blog page where to post a guide for Linux users > > wanting to build Csound (I often see people in the list asking for > > instructions). > > That's why I posted it, I was hoping someone would tell me where I > should put it. I'll have to have a look at csounds.com > > > > The only step I found surprising in your guide was the > > one about changing the path to FLTK in custom.py. In all my builds > > (including the last one one month ago) using Fedora 8 I've never had > > to touch that file or had the problems with the math.h and dirent.h > > files. And I've been building with almost everything except for > > CsoundVST (and FLTK works). Did you try building without changing > > custom.py? > > > > Yes, that didn't build. > > Here is the problem I was trying to solve > > http://www.nabble.com/Csound5.08-x86_64d-installer-td16328373.html > > regards > Alan > -- > > > Alan Fitch > > > Send bugs reports to this list. > To unsubscribe, send email sympa@... with body "unsubscribe csound" > Send bugs reports to this list. To unsubscribe, send email sympa@... with body "unsubscribe csound" |