<commit_before>
#--------------------------------------------------------------
# Include Directories
#--------------------------------------------------------------
find_package(NUMPY)
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
	 ${PYTHON_INCLUDE_DIRS}
	 ${PYTHON_NUMPY_INCLUDE_DIR}
    ${Boost_INCLUDE_DIR}
    ${Boost_PYTHON_INCLUDE_DIR}
)





#--------------------------------------------------------------
# Add opengmcore library
#--------------------------------------------------------------
if(APPLE)
    add_library(_inference MODULE 
    inference.cpp
    pyInference.cxx
    pyIcm.cxx
    pyGraphcut.cxx
    pyBp.cxx
    pyTrbp.cxx
    pyLoc.cxx
    pyAstar.cxx
    pyDualDecompositionSubGradient.cxx
    pyReducedInference.cxx
#pyDualDecompositionBundle.cxx
#pyDualDecompositionMerit.cxx
    pyGibbs.cxx
    pyBruteforce.cxx
    pyLazyflipper.cxx
    pyAeFusion.cxx
    pyAe.cxx
    pyAbSwap.cxx
    pyDynp.cxx
    pyCplex.cxx
    pyTrws.cxx
    pyQpbo.cxx
    pyMQpbo.cxx
    pyLibdai.cxx
    pyMrf.cxx
    pyFastPD.cxx
    pyPartitionMove.cxx
    pyMultiCut.cxx
    )
else()
    add_library(_inference SHARED  
    inference.cpp
    pyInference.cxx
    pyIcm.cxx
    pyGraphcut.cxx
    pyBp.cxx
    pyTrbp.cxx
    pyLoc.cxx
    pyAstar.cxx
    pyDualDecompositionSubGradient.cxx
    pyReducedInference.cxx
#pyDualDecompositionBundle.cxx
#pyDualDecompositionMerit.cxx
    pyGibbs.cxx
    pyBruteforce.cxx
    pyLazyflipper.cxx
    pyAeFusion.cxx
    pyAe.cxx
    pyAbSwap.cxx
    pyDynp.cxx
    pyCplex.cxx
    pyLpInference.cxx
    pyTrws.cxx
    pyQpbo.cxx
    pyMQpbo.cxx
    pyLibdai.cxx
    pyMrf.cxx
    pyFastPD.cxx
    pyPartitionMove.cxx
    pyMultiCut.cxx
    )
endif(APPLE)
#pySwendsenWang.cxx


#--------------------------------------------------------------
# Link libraries
#--------------------------------------------------------------
if(LINK_RT)
    find_library(RT rt)
    target_link_libraries(_inference ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARIES} rt)
else()
    target_link_libraries(_inference ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARIES})
endif(LINK_RT)

set_target_properties(_inference PROPERTIES PREFIX "")

if(WITH_LIBDAI)
  target_link_libraries(_inference ${LIBDAI_LIBRARY})
  target_link_libraries(_inference ${GMPXX_LIBRARY})
  target_link_libraries(_inference ${GMP_LIBRARY}) 
endif()

if(WITH_QPBO)
   target_link_libraries(_inference external-library-qpbo-shared)
endif()

if(WITH_MAXFLOW)
   target_link_libraries(_inference external-library-maxflow-shared)
endif()

if(WITH_MAXFLOW_IBFS)
  target_link_libraries(_inference external-library-maxflow-ibfs-shared)
endif()

if(WITH_TRWS)
   target_link_libraries(_inference external-library-trws-shared)
endif()


if(WITH_FASTPD)
   target_link_libraries(_inference external-library-fastpd-shared)
endif()

#SET(LINK_FLAGS "${LINK_FLAGS} -PIC")
#SET_TARGET_PROPERTIES(_inference PROPERTIES LINK_FLAGS   "-fPIC")
#add_definitions(-fPIC)

if(WITH_CONICBUNDLE)
  #target_link_libraries(_inference ${CONICBUNDLE_LIBRARY})
endif()

if(WITH_MRF)
   target_link_libraries(_inference external-library-mrf-shared)
endif()

if(WITH_CPLEX)
  if(WIN32)
      target_link_libraries(_inference wsock32.lib ${ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CONCERT_LIBRARY})
   else()
      target_link_libraries(_inference ${CMAKE_THREAD_LIBS_INIT} ${ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CONCERT_LIBRARY} )
    endif()
endif()


if(WITH_GUROBI)
  target_link_libraries(test-lpgurobi ${CMAKE_THREAD_LIBS_INIT} 
    ${GUROBI_LIBRARIES}
    #${GUOBI_CXX_LIBRARY}  
    #${GUROBI_LIBRARY}
    ${CMAKE_THREAD_LIBS_INIT}
    #${GUROBI_LIBRARIES}
    #
  )
endif()

IF(PYTHON_PLATFORM MATCHES "^windows$")
        SET_TARGET_PROPERTIES(_inference PROPERTIES OUTPUT_NAME "inference"  PREFIX "" SUFFIX  ".pyd")
ELSEIF(APPLE)<commit_msg>added generic interface for lp solvers<commit_after>
#--------------------------------------------------------------
# Include Directories
#--------------------------------------------------------------
find_package(NUMPY)
include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}
	 ${PYTHON_INCLUDE_DIRS}
	 ${PYTHON_NUMPY_INCLUDE_DIR}
    ${Boost_INCLUDE_DIR}
    ${Boost_PYTHON_INCLUDE_DIR}
)





#--------------------------------------------------------------
# Add opengmcore library
#--------------------------------------------------------------
if(APPLE)
    add_library(_inference MODULE 
    inference.cpp
    pyInference.cxx
    pyIcm.cxx
    pyGraphcut.cxx
    pyBp.cxx
    pyTrbp.cxx
    pyLoc.cxx
    pyAstar.cxx
    pyDualDecompositionSubGradient.cxx
    pyReducedInference.cxx
#pyDualDecompositionBundle.cxx
#pyDualDecompositionMerit.cxx
    pyGibbs.cxx
    pyBruteforce.cxx
    pyLazyflipper.cxx
    pyAeFusion.cxx
    pyAe.cxx
    pyAbSwap.cxx
    pyDynp.cxx
    pyCplex.cxx
    pyTrws.cxx
    pyQpbo.cxx
    pyMQpbo.cxx
    pyLibdai.cxx
    pyMrf.cxx
    pyFastPD.cxx
    pyPartitionMove.cxx
    pyMultiCut.cxx
    )
else()
    add_library(_inference SHARED  
    inference.cpp
    pyInference.cxx
    pyIcm.cxx
    pyGraphcut.cxx
    pyBp.cxx
    pyTrbp.cxx
    pyLoc.cxx
    pyAstar.cxx
    pyDualDecompositionSubGradient.cxx
    pyReducedInference.cxx
#pyDualDecompositionBundle.cxx
#pyDualDecompositionMerit.cxx
    pyGibbs.cxx
    pyBruteforce.cxx
    pyLazyflipper.cxx
    pyAeFusion.cxx
    pyAe.cxx
    pyAbSwap.cxx
    pyDynp.cxx
    pyCplex.cxx
    pyLpInference.cxx
    pyTrws.cxx
    pyQpbo.cxx
    pyMQpbo.cxx
    pyLibdai.cxx
    pyMrf.cxx
    pyFastPD.cxx
    pyPartitionMove.cxx
    pyMultiCut.cxx
    )
endif(APPLE)
#pySwendsenWang.cxx


#--------------------------------------------------------------
# Link libraries
#--------------------------------------------------------------
if(LINK_RT)
    find_library(RT rt)
    target_link_libraries(_inference ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARIES} rt)
else()
    target_link_libraries(_inference ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARIES})
endif(LINK_RT)

set_target_properties(_inference PROPERTIES PREFIX "")

if(WITH_LIBDAI)
  target_link_libraries(_inference ${LIBDAI_LIBRARY})
  target_link_libraries(_inference ${GMPXX_LIBRARY})
  target_link_libraries(_inference ${GMP_LIBRARY}) 
endif()

if(WITH_QPBO)
   target_link_libraries(_inference external-library-qpbo-shared)
endif()

if(WITH_MAXFLOW)
   target_link_libraries(_inference external-library-maxflow-shared)
endif()

if(WITH_MAXFLOW_IBFS)
  target_link_libraries(_inference external-library-maxflow-ibfs-shared)
endif()

if(WITH_TRWS)
   target_link_libraries(_inference external-library-trws-shared)
endif()


if(WITH_FASTPD)
   target_link_libraries(_inference external-library-fastpd-shared)
endif()

#SET(LINK_FLAGS "${LINK_FLAGS} -PIC")
#SET_TARGET_PROPERTIES(_inference PROPERTIES LINK_FLAGS   "-fPIC")
#add_definitions(-fPIC)

if(WITH_CONICBUNDLE)
  #target_link_libraries(_inference ${CONICBUNDLE_LIBRARY})
endif()

if(WITH_MRF)
   target_link_libraries(_inference external-library-mrf-shared)
endif()

if(WITH_CPLEX)
  if(WIN32)
      target_link_libraries(_inference wsock32.lib ${ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CONCERT_LIBRARY})
   else()
      target_link_libraries(_inference ${CMAKE_THREAD_LIBS_INIT} ${ILOCPLEX_LIBRARY} ${CPLEX_LIBRARY} ${CONCERT_LIBRARY} )
    endif()
endif()



if(WITH_GUROBI)
  target_link_libraries(test-lpgurobi ${CMAKE_THREAD_LIBS_INIT} 
    ${GUROBI_LIBRARIES}
    #${GUOBI_CXX_LIBRARY}  
    #${GUROBI_LIBRARY}
    ${CMAKE_THREAD_LIBS_INIT}
    #${GUROBI_LIBRARIES}
    #
  )
endif()

IF(PYTHON_PLATFORM MATCHES "^windows$")
        SET_TARGET_PROPERTIES(_inference PROPERTIES OUTPUT_NAME "inference"  PREFIX "" SUFFIX  ".pyd")
ELSEIF(APPLE)
{'fraction_non_alphanumeric': 0.18008363826450602, 'fraction_numerical': 0.0010454783063251437, 'mean_word_length': 2.7533104462972045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '822563', 'n_tokens_mistral': 2994, 'n_tokens_neox': 2867, 'n_words': 352}