Skip to content

Commit

Permalink
Make building lp_solve optional.
Browse files Browse the repository at this point in the history
    - lp_solve needs bison and flex. These are not available in our
    build-dep packages or docker files we distribute. So make this optional
    for now.
  • Loading branch information
mahge committed Nov 16, 2020
1 parent c2ca162 commit 7f7b5f6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
7 changes: 6 additions & 1 deletion OMCompiler/.cmake/omc_utils.cmake
Expand Up @@ -11,4 +11,9 @@ macro(omc_add_subdirectory var)
list(APPEND CMAKE_MESSAGE_CONTEXT ${var})
add_subdirectory(${var})
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
endmacro(omc_add_subdirectory)
endmacro(omc_add_subdirectory)

macro(omc_option var help_text value)
option(${var} ${help_text} ${value})
omc_add_to_report(${var})
endmacro(omc_option)
2 changes: 1 addition & 1 deletion OMCompiler/3rdParty
Submodule 3rdParty updated 1 files
+4 −2 CMakeLists.txt
6 changes: 5 additions & 1 deletion OMCompiler/CMakeLists.txt
Expand Up @@ -61,7 +61,6 @@ option(OMC_USE_CCACHE "Use ccache to speedup compilations." ON)
omc_add_to_report(OMC_USE_CCACHE)



find_program(CCACHE_PROGRAM ccache)
if(OMC_USE_CCACHE AND CCACHE_PROGRAM)
message(STATUS "Found ccache. It will be used for compilation C/C++ sources")
Expand All @@ -72,6 +71,11 @@ endif()



omc_option(OMC_USE_LPSOLVE "Should we use lpsolve." OFF)
omc_option(OMC_BUILD_LPSOLVE "Should we build our own 3rdParty/lpsolve." OFF)




omc_add_subdirectory(3rdParty)

Expand Down
14 changes: 12 additions & 2 deletions OMCompiler/Compiler/runtime/CMakeLists.txt
Expand Up @@ -63,10 +63,15 @@ target_link_libraries(omcruntime PUBLIC ${Intl_LIBRARIES})
target_link_libraries(omcruntime PUBLIC Iconv::Iconv)
target_link_libraries(omcruntime PUBLIC ${LAPACK_LIBRARIES})
target_link_libraries(omcruntime PUBLIC omc::simrt::runtime)
target_link_libraries(omcruntime PUBLIC omc::3rd::lpsolve55)
target_link_libraries(omcruntime PUBLIC omc::3rd::libzmq)
target_link_libraries(omcruntime PUBLIC omc::3rd::FMIL::minizip) # We use the minizip lib from 3rdParty/FMIL

if(OMC_USE_LPSOLVE)
target_link_libraries(omcruntime PUBLIC omc::3rd::lpsolve55)
else()
target_compile_definitions(omcruntime PRIVATE NO_LPLIB)
endif()

target_include_directories(omcruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(omcruntime PRIVATE ${OMCompiler_SOURCE_DIR}) # for revision.h

Expand Down Expand Up @@ -125,10 +130,15 @@ target_link_libraries(omcruntime-boot PUBLIC ${Intl_LIBRARIES})
target_link_libraries(omcruntime-boot PUBLIC Iconv::Iconv)
target_link_libraries(omcruntime-boot PUBLIC ${LAPACK_LIBRARIES})
target_link_libraries(omcruntime-boot PUBLIC omc::simrt::runtime)
target_link_libraries(omcruntime-boot PUBLIC omc::3rd::lpsolve55)
target_link_libraries(omcruntime-boot PUBLIC omc::3rd::libzmq)
target_link_libraries(omcruntime-boot PUBLIC omc::3rd::FMIL::minizip) # We use the minizip lib from 3rdParty/FMIL

if(OMC_USE_LPSOLVE)
target_link_libraries(omcruntime-boot PUBLIC omc::3rd::lpsolve55)
else()
target_compile_definitions(omcruntime-boot PRIVATE NO_LPLIB)
endif()

target_include_directories(omcruntime-boot PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(omcruntime-boot PRIVATE ${OMCompiler_SOURCE_DIR}) # for revision.h

Expand Down

0 comments on commit 7f7b5f6

Please sign in to comment.