Orange Forum • View topic - C4.5 on linux x86_64

C4.5 on linux x86_64

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.

C4.5 on linux x86_64

Postby Tobu » Mon Jan 05, 2009 23:27

Hello,
Here are two unrelated fixes for C4.5.

The first is required for building on x86_64; gcc needs the -fPIC flag.

The second is required for dlopen on a recent linux. dlopen needs the RTLD_LAZY flag.

Code: Select all
diff --git a/orange/buildC45.py b/orange/buildC45.py
index b30b73b..dbee415 100644
--- a/orange/buildC45.py
+++ b/orange/buildC45.py
@@ -69,7 +69,7 @@ if sys.platform == "win32":
     
 
 elif sys.platform == "linux2":
-    ret = os.system('gcc ensemble.c -o %s/c45.so -shared -lstdc++' % orangedir)
+    ret = os.system('gcc -fPIC ensemble.c -o %s/c45.so -shared -lstdc++' % oran
     if ret:
         print "compiler/linker exited abnormally"
 
diff --git a/source/orange/c4.5.cpp b/source/orange/c4.5.cpp
index 0e05a75..e1b4fe3 100644
--- a/source/orange/c4.5.cpp
+++ b/source/orange/c4.5.cpp
@@ -126,7 +126,7 @@ void *getsym(void *handle, const char *name)
 
 void dynloadC45(char pathname[])
 {
-  void *handle = dlopen(pathname, 0 /*dlopenflags*/);
+  void *handle = dlopen(pathname, RTLD_LAZY);
   if (handle == NULL)
     raiseErrorWho("C45Loader", dlerror());

Thanks

Postby neuroman » Sun Jan 11, 2009 15:04

Thanks for this, I was just working on this issue myself. The second patch (c4.5.cpp) failed against the current SVN, but I edited the file manually to make the change.
This should be fixed in SVN for us 64 bit linux users.


Return to Bugs