Commit 7c0f52cb authored by Dominik Bongartz's avatar Dominik Bongartz
Browse files

Update submodules and cmake

parent 5bbc36bf
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
message("Checking files for CLP.")
project(clp C CXX)
......@@ -6,8 +6,11 @@ project(clp C CXX)
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
if (BUILD_SHARED_LIBS)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} CACHE PATH "Single output directory for all binaries.")
endif()
endif()
set(CLP_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/Clp-1.17.0/Clp/src)
set(CLP_COINDIR ${CMAKE_CURRENT_SOURCE_DIR}/Clp-1.17.0/CoinUtils/src)
......@@ -16,20 +19,25 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/coinutilsSourceFiles.cmake)
add_library(clp ${CLP_SOURCES} ${COINUTILS_SOURCES})
target_include_directories(clp
target_include_directories(clp
PUBLIC
${CLP_SRCDIR}
${CLP_COINDIR}
)
set_target_properties(clp PROPERTIES DEBUG_POSTFIX d)
if(WIN32 AND BUILD_SHARED_LIBS)
set_target_properties(clp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
if(BUILD_SHARED_LIBS)
if(WIN32)
set_target_properties(clp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
if(MSVC)
set_target_properties(clp PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endif()
if(MSVC)
target_compile_options(clp PRIVATE /MP;/Qpar)
target_compile_options(clp PRIVATE /MP)
else()
target_compile_options(clp
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:Intel>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
$<$<C_COMPILER_ID:GNU>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
......@@ -37,7 +45,7 @@ else()
$<$<C_COMPILER_ID:Clang>: $<$<NOT:$<CONFIG:DEBUG>>:-O3> $<$<CONFIG:DEBUG>:-O0>>
)
endif()
target_compile_options(clp
target_compile_options(clp
PRIVATE
$<$<C_COMPILER_ID:MSVC>: /wd4141;/wd4068;/wd4018;/wd4244;/wd4267;/wd4065;/wd4102;/wd4101;/wd4805>
$<$<C_COMPILER_ID:Intel>: $<$<PLATFORM_ID:Windows>:/Qwd858> $<$<NOT:$<PLATFORM_ID:Windows>>:-wd858>>
......@@ -45,8 +53,8 @@ target_compile_options(clp
$<$<C_COMPILER_ID:AppleClang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
$<$<C_COMPILER_ID:Clang>: -Wno-constant-logical-operand -Wno-deprecated-register -Wno-parentheses-equality -Wno-constant-conversion>
)
target_compile_definitions(clp
PRIVATE
target_compile_definitions(clp
PRIVATE
__BYTE_ORDER
HAVE_CONFIG_H
CLP_BUILD
......@@ -54,12 +62,12 @@ target_compile_definitions(clp
$<$<C_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS>
)
if(WIN32)
target_compile_definitions(clp
target_compile_definitions(clp
PRIVATE
NDEBUG # Since there is a portion of CLP code (which is compiled if NDEBUG is not defined) that uses usleep (which does not exist for windows), so we need to disable it
)
endif()
target_link_libraries(clp
target_link_libraries(clp
PRIVATE
mumps
blas
......@@ -81,8 +89,8 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
${PROJECT_SOURCE_DIR}/test/test.cpp
)
target_link_libraries(clp-test clp)
target_compile_features(clp-test PRIVATE cxx_std_11)
target_compile_features(clp-test PRIVATE cxx_std_11)
endif()
# Determine Fortran-C name mangling
......@@ -91,7 +99,7 @@ if((${MUMPS_usePrecompiledDll}) AND (${BLAS_usePrecompiledDll}) AND (${LAPACK_us
set(MANGLINGFILE "lapackNameMangling.h")
set(MANGLINGMACRO FCLAPACK_GLOBAL)
set(MANGLINGMACRO_ FCLAPACK_GLOBAL_)
else()
set(MANGLINGFILE "lapackNameMangling.h")
......@@ -104,7 +112,8 @@ else()
FortranCInterface_HEADER(${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling/${MANGLINGFILE} MACRO_NAMESPACE "FCCLP_")
add_library(clpNameMangling INTERFACE)
target_include_directories(clp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/clpNameMangling)
endif()
# clpConfig.cmake needs MANGLINGFILE, therefore it is down here
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/clpConfig.cmake)
\ No newline at end of file
Subproject commit 2486e88e255ded159ebc1cada9a751083c76e2c1
Subproject commit d0c480a3feeeaae52a9e343436aa9d299dddfcb4
Subproject commit e8d43658f84459bab7dd1068702e089865087e9f
Subproject commit b522ceed43f889eaa9adda8f279325fcafd770b9
Subproject commit 7fe17c0042b9ff929c95c171c78c8a679eae06cb
Subproject commit 3af8eaea26459218bccd33d81836a8879aea4d4b
......@@ -137,9 +137,7 @@ int main(int argc, const char *argv[])
model.setOptimizationDirection(-1);
model.primal();
unsigned char * basis1 = model.statusCopy();
model.createStatus();
delete [] basis1;
model.dual();
cout<<endl<<"Obj: "<<model.objectiveValue()<<endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment