Skip to content

Commit

Permalink
Add windows dll symbols to library build
Browse files Browse the repository at this point in the history
  • Loading branch information
mckib2 committed Jul 29, 2020
1 parent 1ab96ff commit 0db0de2
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 3 deletions.
234 changes: 234 additions & 0 deletions glpk-4.65/w64/glpk_4_65.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
LIBRARY glpk_4_65
VERSION 4.65
DESCRIPTION "GNU Linear Programming Kit"
EXPORTS
glp_create_prob
glp_set_prob_name
glp_set_obj_name
glp_set_obj_dir
glp_add_rows
glp_add_cols
glp_set_row_name
glp_set_col_name
glp_set_row_bnds
glp_set_col_bnds
glp_set_obj_coef
glp_set_mat_row
glp_set_mat_col
glp_load_matrix
glp_check_dup
glp_sort_matrix
glp_del_rows
glp_del_cols
glp_copy_prob
glp_erase_prob
glp_delete_prob
glp_get_prob_name
glp_get_obj_name
glp_get_obj_dir
glp_get_num_rows
glp_get_num_cols
glp_get_row_name
glp_get_col_name
glp_get_row_type
glp_get_row_lb
glp_get_row_ub
glp_get_col_type
glp_get_col_lb
glp_get_col_ub
glp_get_obj_coef
glp_get_num_nz
glp_get_mat_row
glp_get_mat_col
glp_create_index
glp_find_row
glp_find_col
glp_delete_index
glp_set_rii
glp_set_sjj
glp_get_rii
glp_get_sjj
glp_scale_prob
glp_unscale_prob
glp_set_row_stat
glp_set_col_stat
glp_std_basis
glp_adv_basis
glp_cpx_basis
glp_simplex
glp_exact
glp_init_smcp
glp_get_status
glp_get_prim_stat
glp_get_dual_stat
glp_get_obj_val
glp_get_row_stat
glp_get_row_prim
glp_get_row_dual
glp_get_col_stat
glp_get_col_prim
glp_get_col_dual
glp_get_unbnd_ray
glp_get_it_cnt
glp_set_it_cnt
glp_interior
glp_init_iptcp
glp_ipt_status
glp_ipt_obj_val
glp_ipt_row_prim
glp_ipt_row_dual
glp_ipt_col_prim
glp_ipt_col_dual
glp_set_col_kind
glp_get_col_kind
glp_get_num_int
glp_get_num_bin
glp_intopt
glp_init_iocp
glp_mip_status
glp_mip_obj_val
glp_mip_row_val
glp_mip_col_val
glp_check_kkt
glp_print_sol
glp_read_sol
glp_write_sol
glp_print_ranges
glp_print_ipt
glp_read_ipt
glp_write_ipt
glp_print_mip
glp_read_mip
glp_write_mip
glp_bf_exists
glp_factorize
glp_bf_updated
glp_get_bfcp
glp_set_bfcp
glp_get_bhead
glp_get_row_bind
glp_get_col_bind
glp_ftran
glp_btran
glp_warm_up
glp_eval_tab_row
glp_eval_tab_col
glp_transform_row
glp_transform_col
glp_prim_rtest
glp_dual_rtest
glp_analyze_bound
glp_analyze_coef
glp_npp_alloc_wksp
glp_npp_load_prob
glp_npp_preprocess1
glp_npp_build_prob
glp_npp_postprocess
glp_npp_obtain_sol
glp_npp_free_wksp
glp_ios_reason
glp_ios_get_prob
glp_ios_tree_size
glp_ios_curr_node
glp_ios_next_node
glp_ios_prev_node
glp_ios_up_node
glp_ios_node_level
glp_ios_node_bound
glp_ios_best_node
glp_ios_mip_gap
glp_ios_node_data
glp_ios_row_attr
glp_ios_pool_size
glp_ios_add_row
glp_ios_del_row
glp_ios_clear_pool
glp_ios_can_branch
glp_ios_branch_upon
glp_ios_select_node
glp_ios_heur_sol
glp_ios_terminate
glp_init_mpscp
glp_read_mps
glp_write_mps
glp_init_cpxcp
glp_read_lp
glp_write_lp
glp_read_prob
glp_write_prob
glp_mpl_alloc_wksp
glp_mpl_init_rand
glp_mpl_read_model
glp_mpl_read_data
glp_mpl_generate
glp_mpl_build_prob
glp_mpl_postsolve
glp_mpl_free_wksp
glp_read_cnfsat
glp_check_cnfsat
glp_write_cnfsat
glp_minisat1
glp_intfeas1
glp_init_env
glp_version
glp_config
glp_free_env
glp_puts
glp_printf
glp_vprintf
glp_term_out
glp_term_hook
glp_open_tee
glp_close_tee
glp_error_
glp_at_error
glp_assert_
glp_error_hook
glp_alloc
glp_realloc
glp_free
glp_mem_limit
glp_mem_usage
glp_time
glp_difftime
glp_create_graph
glp_set_graph_name
glp_add_vertices
glp_set_vertex_name
glp_add_arc
glp_del_vertices
glp_del_arc
glp_erase_graph
glp_delete_graph
glp_create_v_index
glp_find_vertex
glp_delete_v_index
glp_read_graph
glp_write_graph
glp_mincost_lp
glp_mincost_okalg
glp_mincost_relax4
glp_maxflow_lp
glp_maxflow_ffalg
glp_check_asnprob
glp_asnprob_lp
glp_asnprob_okalg
glp_asnprob_hall
glp_cpp
glp_read_mincost
glp_write_mincost
glp_read_maxflow
glp_write_maxflow
glp_read_asnprob
glp_write_asnprob
glp_read_ccdata
glp_write_ccdata
glp_netgen
glp_netgen_prob
glp_gridgen
glp_rmfgen
glp_weak_comp
glp_strong_comp
glp_top_sort
glp_wclique_exact
;; end of file ;;
17 changes: 14 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'''Install scikit-glpk bindings.'''

from setuptools import find_packages, setup
from distutils.core import Extension
from setuptools import find_packages
from distutils.core import Extension, setup
from distutils.command.build_ext import build_ext as _build_ext
import pathlib

GLPK_SRC_DIR = pathlib.Path('glpk-4.65/src')
Expand All @@ -14,6 +15,15 @@ def scrape_makefile_list(filename, START_TOKEN, END_TOKEN):
lines = _contents[sidx+len(START_TOKEN):eidx].splitlines()
return [str(_l.replace('\\', '').strip()) for _l in lines]

class build_ext(_build_ext):
def get_export_symbols(self, ext):
'''Only for generating Windows DLL.'''
def_file = GLPK_SRC_DIR / '../w64/glpk_4_65.def'
_symbols = scrape_makefile_list(def_file, 'EXPORTS\n', ';; end of file ;;')
print(_symbols)
assert False
return _symbols

# Get sources for GLPK
makefile = GLPK_SRC_DIR / 'Makefile.am'
sources = scrape_makefile_list(makefile, 'libglpk_la_SOURCES = \\\n', '\n## eof ##')
Expand All @@ -26,7 +36,7 @@ def scrape_makefile_list(filename, START_TOKEN, END_TOKEN):

setup(
name='scikit-glpk',
version='0.1.1',
version='0.1.2',
author='Nicholas McKibben',
author_email='[email protected]',
url='https://github.com/mckib2/scikit-glpk',
Expand All @@ -46,4 +56,5 @@ def scrape_makefile_list(filename, START_TOKEN, END_TOKEN):
language='c',
)
],
cmdclass={'build_ext': build_ext},
)

0 comments on commit 0db0de2

Please sign in to comment.