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, 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 "", line 31, in ?
import orngCRS
File "", 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 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 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 (from the Oct 3 snapshot).

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


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

# 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")
        print "Compiling... this might take a while, logging into compiling.log...",
        make=self.makeCmd+"> ../compiling.log"
        retval = os.system(make)
        if retval != 0:
            print "Compiling Orange failed... exiting!"
        print "done"

# 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:
    for name in dirs:
   tmp = "orange."+root+"."+name
OrangeDirs += OrangeWidgetsDirs
packages =  OrangeDirs
package_dir = {"orange" : ""}

# generate list of libraries for one line install_data shots
OrangeLibList = ['','','','','']
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"),
              (os.path.join(OrangeInstallDir, "OrangeCanvas", "icons"),
         (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]),
    return tmpDataFiles

data_files += getDocDirFiles()

long_description = """Orange, data-mining software"""
setup (name = "orange",
       version = OrangeVer,
       maintainer = "Jure Menart",
       maintainer_email = "",
       description = "Orange Extension for Python",
       long_description = long_description,
       url = "",
       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 command.

Code: Select all
inherit eutils distutils
DESCRIPTION="Orange is a Python library for Data Mining"


src_compile() {
   python compile || die

src_install() {
   python 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.


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.


On the orngCRS problem

Postby Feanor76 » Fri Oct 28, 2005 17:17

Just a bit more information on this part,

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

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

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.



Postby Feanor76 » Tue Nov 01, 2005 1:49

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

This file is missing

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


Return to Bugs