ports/153299: [patch] ports/py-mlpy doesn't run because of lacking cpow() function in FreeBSD.

Kawaguti Ginga ginga-freebsd at ginganet.org
Mon Dec 20 02:40:06 UTC 2010


>Number:         153299
>Category:       ports
>Synopsis:       [patch] ports/py-mlpy doesn't run because of lacking cpow() function in FreeBSD.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 20 02:40:05 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Kawaguti Ginga
>Release:        FreeBSD 8.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD 8.1-STABLE FreeBSD 8.1-STABLE #4: Mon Nov 15 17:59:38 JST 2010     /usr/obj/usr/src/sys/GENERIC  amd64

	
>Description:
	Doing ports/py-mlpy "make install" seems to work successfully,
	but when running, it fails. (can't import mlpy-library from python)

	Since FreeBSD lacks C99 spec's cpow(), some alternative function/library 
	needs to be assigned.
	
>How-To-Repeat:

 	As described above, just "import" from python interpreter fails.

% python
Python 2.6.4 (r264:75706, May  7 2010, 09:17:16) 
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>Fix:

	Apply the following patch. I'm not sure if this is a true final solution,
	but at the least it solves the "cannot import problem".

	(gsl's function is used instead of the lacking cpow().
	GNU gsl is already installed by dependency)

diff -urN py-mlpy/files/patch-cwt-cwb.c /usr/ports/science/py-mlpy/files/patch-cwt-cwb.c
--- py-mlpy/files/patch-cwt-cwb.c	1970-01-01 09:00:00.000000000 +0900
+++ ports/science/py-mlpy/files/patch-cwt-cwb.c	2010-12-17 17:57:19.591933004 +0900
@@ -0,0 +1,14 @@
+--- ./mlpy/cwt/cwb.c.dist	2010-01-15 19:00:43.000000000 +0900
++++ ./mlpy/cwt/cwb.c	2010-12-17 17:54:36.032731532 +0900
+@@ -143,7 +143,11 @@
+   double sw, norm = 1.0;
+   
+   
++#ifndef __STD_IEC_559_COMPLEX__  /* FreeBSD lacks C99 cpow() */
++  p = - gsl_complex_pow(0.0 + 1.0I, order) / sqrt(gsl_sf_gamma(order + 0.5));
++#else
+   p = - cpow(0.0 + 1.0I, order) / sqrt(gsl_sf_gamma(order + 0.5));
++#endif /* __STD_IEC_559_COMPLEX__ */
+   
+   for (i=0; i<n; i++)
+     {

>Release-Note:
>Audit-Trail:
>Unformatted:
 >>> import mlpy
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/local/lib/python2.6/site-packages/mlpy/__init__.py", line 31, in <module>
     from _cwt import *
   File "/usr/local/lib/python2.6/site-packages/mlpy/_cwt.py", line 21, in <module>
     import cwb as waveletb # wb for pure python functions
 ImportError: /usr/local/lib/python2.6/site-packages/mlpy/cwb.so: Undefined symbol "cpow"
 >>> 
 
 



More information about the freebsd-ports-bugs mailing list