Changeset 9040:39dbf8fbdfab in orange


Ignore:
Timestamp:
09/28/11 14:24:11 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
c47a5b2fffff6698dae73af7b80151b476a885d7
Message:

Made setup.py script support linking with external blas, libsvm, liblinear, qhull libraries (not yet properly tested).
This also fixes a broken compilation of orangeom (missing qhull header file imports).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/setup.py

    r8983 r9040  
    3131    extra_compile_args = ["/EHsc"] 
    3232    extra_link_args = [] 
    33 elif sys.platform == "linux2": 
     33elif sys.platform.startswith("linux"): 
    3434    extra_compile_args = "-fPIC -fpermissive -w -DLINUX".split() 
    3535    extra_link_args = ["-Wl,-R$ORIGIN"]     
     
    357357include_ext = LibStatic("orange_include", get_source_files("source/include/"), include_dirs=include_dirs) 
    358358 
    359 if sys.platform == "win32": 
     359 
     360if sys.platform == "win32": # ?? mingw/cygwin 
    360361    libraries = ["orange_include"] 
    361362else: 
    362363    libraries = ["stdc++", "orange_include"] 
    363364 
    364 orange_ext = PyXtractSharedExtension("orange", get_source_files("source/orange/") + \ 
    365                                                get_source_files("source/orange/blas/", "c") + \ 
    366                                                get_source_files("source/orange/linpack/", "c") + \ 
    367                                                get_source_files("source/orange/liblinear/", "cpp") +\ 
    368                                                get_source_files("source/orange/libsvm/", "cpp"), 
    369                                       include_dirs=include_dirs + ["source/orange/liblinear"], 
     365 
     366import ConfigParser 
     367config = ConfigParser.RawConfigParser() 
     368config.read("setup-site.cfg") 
     369 
     370orange_sources = get_source_files("source/orange/") 
     371orange_include_dirs = list(include_dirs) 
     372orange_libraries = list(libraries) 
     373 
     374if config.has_option("blas", "library"): 
     375    # Link external blas library 
     376    orange_libraries += [config.get("blas", "library")] 
     377else: 
     378    orange_sources += get_source_files("source/orange/blas/", "c") 
     379     
     380if config.has_option("R", "library"): 
     381    # Link external R library (for linpack) 
     382    orange_libraries += [config.get("R", "library")] 
     383else: 
     384    orange_sources += get_source_files("source/orange/linpack/", "c") 
     385     
     386if config.has_option("liblinear", "library"): 
     387    # Link external LIBLINEAR library 
     388    orange_libraries += [config.get("liblinear", "library")] 
     389else: 
     390    orange_sources += get_source_files("source/orange/liblinear/", "cpp") 
     391    orange_include_dirs += ["source/orange/liblinear"] 
     392     
     393if config.has_option("libsvm", "library"): 
     394    # Link external LibSVM library 
     395    orange_libraries += [config.get("libsvm", "library")] 
     396else: 
     397    orange_sources += get_source_files("source/orange/libsvm/", "cpp") 
     398     
     399 
     400orange_ext = PyXtractSharedExtension("orange", orange_sources, 
     401                                      include_dirs=orange_include_dirs, 
    370402                                      extra_compile_args = extra_compile_args + ["-DORANGE_EXPORTS"], 
    371403                                      extra_link_args = extra_link_args, 
     
    384416    shared_libs = libraries + ["orange"] 
    385417     
    386 orangeom_ext = PyXtractExtension("orangeom", get_source_files("source/orangeom/", exclude=["lib_vectors.cpp"]) + get_source_files("source/orangeom/qhull/", "c"), 
    387                                   include_dirs=include_dirs + ["source/orange/"], 
     418orangeom_sources = get_source_files("source/orangeom/", exclude=["lib_vectors.cpp"]) 
     419orangeom_libraries = list(shared_libs) 
     420orangeom_include_dirs = list(include_dirs) 
     421 
     422if config.has_option("qhull", "library"): 
     423    # Link external qhull library 
     424    orangeom_libraries += [config.get("qhull", "library")] 
     425else: 
     426    orangeom_sources += get_source_files("source/orangeom/qhull/", "c") 
     427    orangeom_include_dirs += ["source/orangeom"] 
     428 
     429 
     430orangeom_ext = PyXtractExtension("orangeom", orangeom_sources, 
     431                                  include_dirs=orangeom_include_dirs + ["source/orange/"], 
    388432                                  extra_compile_args = extra_compile_args + ["-DORANGEOM_EXPORTS"], 
    389433                                  extra_link_args = extra_link_args, 
    390                                   libraries=shared_libs, 
     434                                  libraries=orangeom_libraries, 
    391435                                  ) 
    392436 
     
    451495                             "OrangeWidgets.Visualize", 
    452496                             "OrangeWidgets.Visualize Qt", 
     497                             "OrangeWidgets.plot", 
     498                             "OrangeWidgets.plot.primitives", 
    453499                             "doc", 
    454500                             ], 
     
    464510                      "OrangeWidgets.Unsupervised": ["icons/*.png"], 
    465511                      "OrangeWidgets.Visualize": ["icons/*.png"], 
     512                      "OrangeWidgets.plot": ["*.gs", "*.vs"], 
     513                      "OrangeWidgets.plot.primitives": ["*.obj"], 
    466514                      "doc": ["datasets/*.tab", ], 
    467515                      "": ["orangerc.cfg"]  
Note: See TracChangeset for help on using the changeset viewer.