Python Class Library for Numbers package.

David Nicholls david at
Mon Apr 26 19:40:23 PDT 2010

Ryan Schmidt wrote:
> On Apr 26, 2010, at 03:22, David Nicholls wrote:
>> OK, I've worked on this a bit further.
>> I have installed the MacPorts 'cln' package - it installs the cln/
>> directory in /opt/local/include/
>> With that in place, the calcrpn-py package installs OK. (It is
>> needed by clnum).
>> The next step is to install the clnum module, as per 
>>  I can't get it
>> to find the numerous .h files that need to be included, because of
>> a path problem.
>> I'm pretty sure that the problem lies in the command as given on
>> the above web page (run from within ipython run via sudo):
>> run install --prefix=/usr/local
>> The various '.h' files have a whole bunch of #include statements
>> with files named like 'cln/xxx.h'
>> A typical line is:
>> #include "cln/types.h"
>> and the install process cannot find any of the "cln/xxx.h" files.
>> Hoping that there was some sort of global prefix process I could
>> use, I have tried a variety of "--prefix=..." variants without any
>> luck.  (eg --prefix=/opt/local/include)
>> I could replace all the 'cln/' strings in the .h files and in
>> clnum.cpp with '/opt/local/include/cln/' (and there are dozens of
>> them in a lot of files) but that's pretty crude and I'm sure
>> there's a more elegant way.
>> Any suggestions?
> Need more specifics. If you have an in-progress portfile you're
> working on, can you send it to us? If you're building by hand, can
> you show us the exact commands you're typing and the exact error
> messages you get back?

OK, let's take a step backward.  The CLN Macports package.  My first 
step was the usual 'sudo port install cln'

I tried to install the universal variant but it failed.  The default was 
the test variant and that appeared to work.  When I type 'port installed 
cln' I see:

The following ports are currently installed:
   cln @1.2.2_0+test (active)

But in Python (the Macports version 2.6.5) when I try "from cln import 
*" I get 'no module named cln'

I presume this just means that I can't call it that way, and that the 
files it installs are what's important for other Python package 
installers to find.

My next step was to install the rpncalc python package from, using:  'python 
install --prefix=/opt/local'

That appeared to work, but when importing rpncalc into Python, it said 
it needed clnum.

So the next step I took was to attempt to install clnum, as per, using: 'python install --prefix=/opt/local'

This is where the problems happen.  I get numerous error messages of the 
type: 'clnum/src/clnum.cpp:30:17: error: cln.h: No such file or directory'

The file cln.h and all the other 'missing' .h files were indeed 
installed using the MacPorts cln package, but they are not being found 
by the python setup process.

Any advice appreciated.


ANU RSAA Mt Stromlo

More information about the macports-users mailing list