Csound Csound-dev Csound-tekno Search About

[Cs-dev] [ csound-Bugs-3277921 ] Issues compiling CSound on Fedora 15 and 16

Date2011-04-27 12:06
From"SourceForge.net"
Subject[Cs-dev] [ csound-Bugs-3277921 ] Issues compiling CSound on Fedora 15 and 16
Bugs item #3277921, was opened at 2011-04-06 21:44
Message generated for change (Comment added) made by veplaini
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=564599&aid=3277921&group_id=81968

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: language bindings
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Peter Robinson (ribbo)
Assigned to: Victor Lazzarini (veplaini)
Summary: Issues compiling CSound on Fedora 15 and 16

Initial Comment:
CScound doesn't compile on Fedora 15 or rawhide (what will become Fedora 16). The excerpt that fails is:

Language subdirectory: python
Search paths:
   ./
   ./
   ./H/
   /usr/include/fltk-1.1/
   /usr/include/
   /usr/X11R6/include/
   interfaces/
   ./swig_lib/python/
   /usr/share/swig/2.0.2/python/
   ./swig_lib/
   /usr/share/swig/2.0.2/
Preprocessing...
Starting language-specific parse...
./H/csound.h:453: Warning 451: Setting a const char * variable may leak memory.
interfaces/cs_glue.hpp:507: Warning 473: Returning a pointer or reference in a director method is not recommended.
interfaces/CppSound.hpp:36: Warning 453: Can't apply (std::vector< double > *INPUT). No typemaps are defined.
Processing types...
C++ analysis...
Generating wrappers...
g++ -o interfaces/python_interface_wrap.os -c -fexceptions -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -fno-strict-aliasing -fno-strict-aliasing -Wno-format -DGNU_GETTEXT -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -g -fomit-frame-pointer -freorder-blocks -DLINUX -DPIPES -fno-strict-aliasing -fno-strict-aliasing -fPIC -DHAVE_LIBSNDFILE=1016 -DHAVE_FLTK -DBETA -DHAVE_SOCKETS -DHAVE_PTHREAD_BARRIER_INIT -DHAVE_SYNC_LOCK_TEST_AND_SET -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H -DHAVE_VALUES_H -DHAVE_SOCKETS -DHAV
 E_DIRENT_H -D__BUILDING_LIBCSOUND -D__BUILDING_CSOUND_INTERFACES -I. -IH -I/usr/include/fltk-1.1 -I/usr/include -I/usr/X11R6/include -Iinterfaces -I/usr/include/lua5.1 -I/usr/include/python2.7 interfaces/python_interface_wrap.cc
interfaces/python_interface_wrap.cc:3436:13: error: 'ptrdiff_t' does not name a type
interfaces/python_interface_wrap.cc:3473:21: error: expected ';' at end of member declaration
interfaces/python_interface_wrap.cc:3473:39: error: expected ')' before 'n'
interfaces/python_interface_wrap.cc:3488:34: error: declaration of 'operator+=' as non-function
interfaces/python_interface_wrap.cc:3488:30: error: expected ';' at end of member declaration
interfaces/python_interface_wrap.cc:3488:44: error: expected ')' before 'n'
interfaces/python_interface_wrap.cc:3493:34: error: declaration of 'operator-=' as non-function
interfaces/python_interface_wrap.cc:3493:30: error: expected ';' at end of member declaration
interfaces/python_interface_wrap.cc:3493:44: error: expected ')' before 'n'
interfaces/python_interface_wrap.cc:3498:33: error: declaration of 'operator+' as non-function
interfaces/python_interface_wrap.cc:3498:30: error: expected ';' at end of member declaration
interfaces/python_interface_wrap.cc:3498:43: error: expected ')' before 'n'
interfaces/python_interface_wrap.cc:3503:33: error: declaration of 'operator-' as non-function
interfaces/python_interface_wrap.cc:3503:30: error: expected ';' at end of member declaration
interfaces/python_interface_wrap.cc:3503:43: error: expected ')' before 'n'
interfaces/python_interface_wrap.cc:3508:5: error: 'ptrdiff_t' does not name a type
interfaces/python_interface_wrap.cc:3664:23: error: 'SWIG_From_ptrdiff_t' declared as an 'inline' variable
interfaces/python_interface_wrap.cc:3664:23: error: 'ptrdiff_t' was not declared in this scope
interfaces/python_interface_wrap.cc:3664:23: note: suggested alternatives:
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
interfaces/python_interface_wrap.cc:3665:1: error: expected ',' or ';' before '{' token
interfaces/python_interface_wrap.cc:3717:39: error: 'ptrdiff_t' has not been declared
interfaces/python_interface_wrap.cc: In function 'int SWIG_AsVal_ptrdiff_t(PyObject*, int*)':
interfaces/python_interface_wrap.cc:3721:50: error: expected type-specifier before 'ptrdiff_t'
interfaces/python_interface_wrap.cc:3721:50: error: expected '>' before 'ptrdiff_t'
interfaces/python_interface_wrap.cc:3721:50: error: expected '(' before 'ptrdiff_t'
interfaces/python_interface_wrap.cc:3721:50: error: 'ptrdiff_t' was not declared in this scope
interfaces/python_interface_wrap.cc:3721:50: note: suggested alternatives:
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
interfaces/python_interface_wrap.cc:3721:64: error: expected ')' before ';' token
interfaces/python_interface_wrap.cc: In function 'void PythonMessageCallback(CSOUND*, int, const char*, va_list)':
interfaces/python_interface_wrap.cc:3925:48: warning: unused variable 'ch' [-Wunused-variable]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetMessageCallback(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4329:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetInputValueCallback(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4339:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetOutputValueCallback(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4349:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetExternalMidiInOpenCallback__SWIG_1(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4359:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetExternalMidiInCloseCallback(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4369:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: In function 'void Csound_SetExternalMidiReadCallback(Csound*, PyObject*)':
interfaces/python_interface_wrap.cc:4379:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
interfaces/python_interface_wrap.cc: At global scope:
interfaces/python_interface_wrap.cc:4768:15: error: 'swig::check_index' declared as an 'inline' variable
interfaces/python_interface_wrap.cc:4768:15: error: 'ptrdiff_t' was not declared in this scope
interfaces/python_interface_wrap.cc:4768:15: note: suggested alternatives:
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
/usr/lib/gcc/i686-redhat-linux/4.6.0/../../../../include/c++/4.6.0/i686-redhat-linux/bits/c++config.h:156:28: note:   'std::ptrdiff_t'
interfaces/python_interface_wrap.cc:4768:35: error: expected primary-expression before 'size'
interfaces/python_interface_wrap.cc:4768:41: error: expected primary-expression before 'bool'
interfaces/python_interface_wrap.cc:4768:60: error: expression list treated as compound expression in initializer [-fpermissive]
interfaces/python_interface_wrap.cc:4768:62: error: expected ',' or ';' before '{' token
interfaces/python_interface_wrap.cc:38078:1: error: expected '}' at end of input
interfaces/python_interface_wrap.cc:3735:15: warning: 'int* new_intp(size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3739:15: warning: 'void delete_intp(int*)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3743:14: warning: 'int intp_getitem(int*, size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3746:15: warning: 'void intp_setitem(int*, size_t, int)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3784:17: warning: 'float* new_floatp(size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3788:15: warning: 'void delete_floatp(float*)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3792:16: warning: 'float floatp_getitem(float*, size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3795:15: warning: 'void floatp_setitem(float*, size_t, float)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3826:18: warning: 'double* new_doublep(size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3830:15: warning: 'void delete_doublep(double*)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3834:17: warning: 'double doublep_getitem(double*, size_t)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:3837:15: warning: 'void doublep_setitem(double*, size_t, double)' defined but not used [-Wunused-function]
interfaces/python_interface_wrap.cc:4040:13: warning: 'void pythonMessageCallback(CSOUND*, int, const char*, va_list)' defined but not used [-Wunused-function]
scons: *** [interfaces/python_interface_wrap.os] Error 1
scons: building terminated because of errors.
error: Bad exit status from /var/tmp/rpm-tmp.22Z0Cm (%build)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.22Z0Cm (%build)
Child returncode was: 1
EXCEPTION: Command failed. See logs for output.
 # ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/csound.spec']
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/mock/trace_decorator.py", line 70, in trace
    result = func(*args, **kw)
  File "/usr/lib/python2.6/site-packages/mock/util.py", line 325, in do
    raise mock.exception.Error, ("Command failed. See logs for output.\n # %s" % (command,), child.returncode)
Error: Command failed. See logs for output.
 # ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/csound.spec']
LEAVE do --> EXCEPTION RAISED

Full logs can be seen at:
http://koji.fedoraproject.org/koji/getfile?taskID=2979919&name=build.log

----------------------------------------------------------------------

>Comment By: Victor Lazzarini (veplaini)
Date: 2011-04-27 12:06

Message:
I am closing this bug; it looks like Steven's diagnostics are correct and I
have included the 
include  line on interfaces/python_interfaces.i .

If the issue reappears, we can open another ticket.

----------------------------------------------------------------------

Comment By: Steven Yi (kunstmusik)
Date: 2011-04-08 18:01

Message:
Another note about the issue, I saw on this mailing list message:

http://lists.fedoraproject.org/pipermail/devel/2011-February/148523.html

this:

STL headers not including  any longer
	If you see errors like

	'ptrdiff_t' does not name a type
	'size_t' does not name a type
	'NULL' was not declared in this scope
	'size_t' has not been declared
	'offsetof' was not declared in this scope
	there are no arguments to 'offsetof' that depend on a template parameter,
so a declaration of 'offsetof' must be available

	or warnings like

	perhaps the 'offsetof' macro was used incorrectly

	then most likely you have C++ code that includes some
	STL headers and relied on them bringing in 
	and is using ::ptrdiff_t, ::size_t, offsetof or NULL
	macros.  The STL headers now just declare std::ptrdiff_t
	and std::size_t itself when needed, and no longer bring
	in , so if you use the global namespace types
	from stddef.h or offsetof/NULL, just include 
	explicitly.

It looks like the issue is specifically related to GCC 4.6.  I don't know
also though if it's a SWIG issue, like it may be generating code that no
longer works with 4.6 out of the box.  Adding the cstddef though seems to
be the solution, and should hopefully work for you. 

----------------------------------------------------------------------

Comment By: Peter Robinson (ribbo)
Date: 2011-04-08 15:27

Message:
Will try that shortly. In the mean time:

gcc-4.6.0-2.fc15.x86_64
gcc-c++-4.6.0-2.fc15.x86_64
swig-2.0.2-2.fc15.x86_64
python-2.7.1-6.fc15.x86_64


----------------------------------------------------------------------

Comment By: Steven Yi (kunstmusik)
Date: 2011-04-08 15:24

Message:
I was unable to install x86_864 F15 Alpha into a virtual machine here. 
However, I did a grep for ptrdiff_t and there's only one usage in the
codebase in Engine/rdorch.c, and I think the issue is in the generated
code. 

I did find a related issue that was filed against Chromium here:

http://code.google.com/p/chromium/issues/detail?id=70746

One note mentioned adding:

#include 

to files.  Could you try adding:

%include 

in the interfaces/python_interface.i file?

Also, could you tell us what version of g++ and swig you are using?


----------------------------------------------------------------------

Comment By: Peter Robinson (ribbo)
Date: 2011-04-08 15:16

Message:
Yes, it is x86-64 but the same failure happens on x86-32 too. Logs for that
one are here 
http://koji.fedoraproject.org/koji/getfile?taskID=2983978&name=build.log

----------------------------------------------------------------------

Comment By: Steven Yi (kunstmusik)
Date: 2011-04-08 14:55

Message:
I noticed from the build log that this was done on an x86_64 system. My
guess is that it may be related to the ptrdiff_t error message in the build
log, and it's giving info about namespaces.  I'm downloading Fedora 15
alpha x86_64 and will install in a virtual machine to see if I can
reproduce the issue.

----------------------------------------------------------------------

Comment By: Victor Lazzarini (veplaini)
Date: 2011-04-08 11:55

Message:
I think this is because SWIG does not work with Python 2.7. I'll have to
check, but I am quite sure it is a SWIG problem.

----------------------------------------------------------------------

Comment By: Peter Robinson (ribbo)
Date: 2011-04-07 14:23

Message:
That was a 5.12.1 build. Same issues with 5.13.0.

Full logs for that  build are at
http://koji.fedoraproject.org/koji/getfile?taskID=2981559&name=build.log

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=564599&aid=3277921&group_id=81968

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net