Orange Forum • View topic - C4.5 compilation script and instructions

C4.5 compilation script and instructions

A place to ask questions about methods in Orange and how they are used and other general support.

C4.5 compilation script and instructions

Postby lefterav » Wed Jul 18, 2012 16:45

Hi,

I would like to report that the C4.5 installation script didn't work in my server, so I had to do some slight modifications of the "buildC45.py" script. Particularly:

    Code: Select all
    ensemble.c: In function ‘guarded_alloc’:
    ensemble.c:78:31: warning: incompatible implicit declaration of built-in function ‘malloc’ [enabled by default]
    ensemble.c:84:21: warning: incompatible implicit declaration of built-in function ‘realloc’ [enabled by default]
    ensemble.c:90:24: warning: incompatible implicit declaration of built-in function ‘calloc’ [enabled by default]
    ensemble.c:90:53: warning: incompatible implicit declaration of built-in function ‘malloc’ [enabled by default]
    ensemble.c: In function ‘guarded_free’:
    ensemble.c:116:3: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
    ensemble.c: In function ‘guarded_collect’:
    ensemble.c:125:7: warning: incompatible implicit declaration of built-in function ‘free’ [enabled by default]
    In file included from ensemble.c:160:0:
    prune.c: In function ‘Prune’:
    prune.c:58:3: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
    prune.c: In function ‘EstimateErrors’:
    prune.c:123:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    prune.c:235:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    prune.c: In function ‘CheckPossibleValues’:
    prune.c:289:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    In file included from ensemble.c:164:0:
    subset.c: In function ‘EvalSubset’:
    subset.c:86:5: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
    subset.c:282:6: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    subset.c: In function ‘SubsetTest’:
    subset.c:417:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    In file included from ensemble.c:165:0:
    trees.c: In function ‘ShowBranch’:
    trees.c:191:25: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
    trees.c: In function ‘MaxLine’:
    trees.c:243:33: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
    trees.c:256:12: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
    trees.c: In function ‘SaveTree’:
    trees.c:298:2: warning: incompatible implicit declaration of built-in function ‘strcpy’ [enabled by default]
    trees.c:299:2: warning: incompatible implicit declaration of built-in function ‘strcat’ [enabled by default]
    trees.c: In function ‘GetTree’:
    trees.c:386:2: warning: incompatible implicit declaration of built-in function ‘strcpy’ [enabled by default]
    trees.c:387:2: warning: incompatible implicit declaration of built-in function ‘strcat’ [enabled by default]
    trees.c: In function ‘Leaf’:
    trees.c:545:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    trees.c: In function ‘CopyTree’:
    trees.c:618:5: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
    trees.c: In function ‘SaveDiscreteNames’:
    trees.c:659:15: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
    /usr/bin/ld: /tmp/ccwFlzGc.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /tmp/ccwFlzGc.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    compiler/linker exited abnormally


    Code: Select all
    72:     ret = os.system('gcc ensemble.c -o %s/c45.so -shared -lstdc++' % orangedir)
    had to be rewritten as
    Code: Select all
    ret = os.system('gcc ensemble.c -o %s/c45.so -shared -lstdc++ -fPIC' % orangedir)

It would be kind of you to check whether this changes are necessary for the current version of orange, and whether they should be included in the script which is being offered

Re: C4.5 compilation script and instructions

Postby lefterav » Sat Jul 21, 2012 1:39

Unfortunately I just realize that although the module can be imported and the classifier seems to be compiled, when trying to classify new instances it throws a "Segmentation Fault".
This has started happening after I was forced to reinstall orange, on an updated Ubuntu 12.04 . I had no problem training C4.5 before the upgrade. Do you have any idea why this may be hapenning?

Re: C4.5 compilation script and instructions

Postby Ales » Mon Jul 30, 2012 10:32

I added the -fPIC flag to the compile command, and changed the links in the documentation to point to the latest versions of the files (this might take some time to propagate to the online reference documentation).

But I can't reproduce the segmentation fault. Can you provide a more detailed example?

Re: C4.5 compilation script and instructions

Postby lefterav » Mon Jul 30, 2012 15:50

Thanks for this. I will try with the latest version of the files, I wasn't sure if the wrapper was compatible with it. Maybe this solves the segmentation fault


Return to Questions & Support



cron