Orange Forum • View topic - Linux Build Bugs

Linux Build Bugs

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Linux Build Bugs

Postby Guest » Sat Oct 22, 2005 15:41

Hey all,

It's been awhile since I've talked with you ... hope things are well with you all. I have been lurking in the shadows, watching orange's development ... and I must continue to say ... well done!

Anyone, on to business, for the linux build there are at least three bugs right now:

1) When you run setup.py, the binary files need to be recompiled. This has two sub issues. First, the source code snapshot probably shouldn't include any binaries (so the make files won't find them and hence, they will be built). Second, even if the binaries are present, they should probably be rebuilt.

2) The orngSVM module is not in sync with the orngCRS binary module.

This results in the following error:
>>> import orange
>>> import orngSVM
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "orngSVM.py", line 31, in ?
import orngCRS
File "orngCRS.py", line 34, in ?
SVMLearnS = _orngCRS.SVMLearnS
AttributeError: 'module' object has no attribute 'SVMLearnS'

The second part of the problem is that the source needed to produce orngCRS.pyd (or orngCRS.so) is not included in the snapshot (if it is, I missed it ... sorry!).

3) Finally, the way that the "system wide" install directly sets links in /usr/lib is incompatible with some package distribution systems (for example, Gentoo). Everything else is better b/c it is done relative to some root. However, the linking is done with absolute pathnames and this causes a problem.

Not sure if this will help or not, but here's the setup.py file I made while working on making a Gentoo package for orange. It doesn't handle the "uninstall" case, but it is quite a bit shorter and doesn't do the "rogue linking". It was based off of Tomaz and Jure's original setup.py (from the Oct 3 snapshot).

Code: Select all
#!/usr/bin/env python
# To use:
#       python setup.py install

OrangeVer="Orange-2005-08-11"

try:
    import sys,commands,traceback,os
    from distutils import sysconfig
    from distutils.core import setup,Extension
    from glob import glob
    from stat import *
    import pprint
except:
    traceback.print_exc()
    print "Unable to import python distutils."
    print "You may want to install the python-dev package on your distribution."
    sys.exit(1)

#
# creating custom commands
#
from distutils.core import Command
from distutils.command.install import install
from distutils.command.install_data import install_data

#
# compile goes to orange/source directory and compiles orange
#

class compile(Command):
    # add Different make programs support"
    description = "compiles Orange"

    user_options = [('coptions=', None, "special compiling options")]

    def initialize_options(self):
        self.coptions = None
        self.makeCmd = None

    def finalize_options(self):
        if self.coptions is None:
            print "Default compiler options are taken..."
   self.makeCmd = "make"
           
    def run(self):
        #compile Orange with make files
        SourceDir = os.path.join("source")
        os.chdir(SourceDir)
        print "Compiling... this might take a while, logging into compiling.log...",
   sys.stdout.flush()
        make=self.makeCmd+"> ../compiling.log"
        retval = os.system(make)
        if retval != 0:
            print "Compiling Orange failed... exiting!"
            sys.exit(1)
        print "done"
        os.chdir(BaseDir)


#
# preparing data for Distutils
#


PythonVer = "python"+sys.version[:3]



#
# Get all the top level packages
#
BaseDir = os.getcwd()
OrangeDirs = ["orange", "orange.OrangeCanvas", "orange.OrangeWidgets"]
OrangeWidgetsDirs = []
for root,dirs,files in os.walk(os.path.join("OrangeWidgets"), topdown=False):
    if 'CVS' in dirs:
        dirs.remove('CVS')
    for name in dirs:
   tmp = "orange."+root+"."+name
        OrangeWidgetsDirs.append(tmp.replace('/','.'))
OrangeDirs += OrangeWidgetsDirs
packages =  OrangeDirs
package_dir = {"orange" : ""}

#
# generate list of libraries for one line install_data shots
#
OrangeLibList = ['orange.so','orangene.so','orangeom.so','statc.so','corn.so']
OrangeLibs = []
for currentLib in OrangeLibList:
    OrangeLibs += [os.path.join(currentLib)]

#
# generate lists of icons for (two) one line install_data shots
#
OrangeWidgetIcons = glob(os.path.join("OrangeWidgets", "icons", "*.png"))
OrangeCanvasIcons = glob(os.path.join("OrangeCanvas",  "icons", "*.png"))
OrangeCanvasPyw   = glob(os.path.join("OrangeCanvas", "orngCanvas.pyw"));

#
# these don't account for any input parameters like --root --prefix --home, etc
#
# actually, as long as they are not absolute, they will account for other
# factors, but it is not well documented __HOW__ they will accout for them
# *** distutils needs better docs!
#
OrangeInstallDir = os.path.join("lib", PythonVer, "site-packages", "orange")
OrangeInstallDoc = os.path.join("share", "doc","orange")
OrangeInstallLib = os.path.join("lib")

#
# these tuples are (dir, (file1, file2, ... filen))
#
data_files = [(OrangeInstallDir, OrangeLibs),
              (os.path.join(OrangeInstallDir, "OrangeWidgets", "icons"),
               OrangeWidgetIcons),
              (os.path.join(OrangeInstallDir, "OrangeCanvas", "icons"),
               OrangeCanvasIcons),
         (os.path.join(OrangeInstallDir, "OrangeCanvas"), OrangeCanvasPyw)]


#
#
#
def getDocDirFiles():
    tmpDataFiles = []
    for root, dirs, files in os.walk(os.path.join("doc")):
   OrangeDocs = glob(os.path.join("", "")) # Create a Docs file list
   if 'CVS' in dirs:
       dirs.remove('CVS')  # don't visit CVS directories
   for name in files:
       OrangeDocs += glob(os.path.join(root,name))
   if(root.split('doc/')[-1] == 'doc/'):
       root = ''
   tmpDataFiles += [(os.path.join(OrangeInstallDoc,root.split('doc/')[-1]),
                 OrangeDocs)]
    return tmpDataFiles

data_files += getDocDirFiles()

long_description = """Orange, data-mining software"""
setup (name = "orange",
       version = OrangeVer,
       maintainer = "Jure Menart",
       maintainer_email = "jurem@najdi.si",
       description = "Orange Extension for Python",
       long_description = long_description,
       url = "http://www.ailab.si/orange",
       packages = packages,
       package_dir = package_dir,
       data_files = data_files,
       cmdclass = {'compile':compile,}
       )


For completeness (and since I'm in the middle of finishing my dissertation writing and I have limited time to spend on this .... have at it someone else!), here's the ebuild file that went with that setup.py command.


Code: Select all
inherit eutils distutils
DESCRIPTION="Orange is a Python library for Data Mining"
HOMEPAGE="http://www.ailab.si/orange"
SRC_URI=http://www.ailab.si/orange/download/${P}.tgz
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE=""
DEPEND=""

S=${WORKDIR}/${PN}

src_compile() {
   python setup.py compile || die
}

src_install() {
   python setup.py install --prefix=${D}
}




All this stuff is "pre-alpha" level. It basically amounts to "working notes" for how I was doing an orange install on my gentoo system.

Regards,
Mark

Forgot to Login --> Who am I?

Postby Feanor76 » Sat Oct 22, 2005 15:45

Ah, not that it really matter, but I'm Mark Fenner who has helped on getting orange -> linux before.

Regards,
Mark

On the orngCRS problem

Postby Feanor76 » Fri Oct 28, 2005 17:17

Just a bit more information on this part,

The orngCRS.py file included in the current snapshot (for example, orange-snap-oct-28) is not the same as the orngCRS.py file included with orngExtn (ver 1_8_2). Here's the proof:

mfenner [519] % ls -l ../../orange-extension/orngExtn-1_8_2_py23/orngCRS.py ../.
./orange-snap-oct-28/orange/orngCRS.py
-rw-r--r-- 1 mfenner users 1374 Sep 20 2003 ../../orange-extension/orngExtn-1_8_2_py23/orngCRS.py
-rw-r--r-- 1 mfenner users 2592 May 21 12:19 ../../orange-snap-oct-28/orange/orngCRS.py


It seems that the orng-snapshot is built with a more recent version of orngExtn (and hence a newer orngCRS). Getting the newer source for orngExtn distributed with orng-snapshot would be a good idea. As it stands, building orngCRS with the older orngExtn requires deleting the various *.py files that are part of orngExtn and included in orng-snapshot and replace them with equivalent the old orngExtn files.

Regards,
Mark

Missing setup.py

Postby Feanor76 » Tue Nov 01, 2005 1:49

The most recent "stable" build on the Download page is linked to by:

http://www.ailab.si/orange/download/orange-source-0.9.61.zip

This file is missing setup.py.

I thought that 0.9.61 came out sometime ago. Should this link be to 0.9.62 or higher?

Regards,
Mark


Return to Bugs