Skip to content

Commit

Permalink
- simple bug fix
Browse files Browse the repository at this point in the history
- improved error handling in cmake

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24160 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Marcus Walther committed Jan 23, 2015
1 parent ba9308a commit ba453bf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
34 changes: 23 additions & 11 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -32,6 +32,7 @@ OPTION(ANALYZATION_MODE "ANALYZATION_MODE" OFF)
OPTION(USE_PARALLEL_OUTPUT "USE_PARALLEL_OUTPUT" OFF)
OPTION(USE_SCOREP "USE_SCOREP" OFF)
OPTION(RUNTIME_PROFILING "RUNTIME_PROFILING" OFF)
OPTION(SUNDIALS_ROOT "SUNDIALS ROOT" "")


#Set Variables
Expand Down Expand Up @@ -201,6 +202,7 @@ ENDIF(PAPI_FOUND)
# - The optional boost libraries must be searched separately, otherwise no library is found if just one is missing.
# - Additionaly the Boost_LIBRARIES variable is overwritten each time find_package(Boost ...) is called, thus it must be rescued
FIND_PACKAGE(Boost COMPONENTS log log_setup)

SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
IF(Boost_LOG_FOUND AND Boost_LOG_SETUP_FOUND)
ADD_DEFINITIONS(-DUSE_BOOST_LOG)
Expand All @@ -221,7 +223,7 @@ ELSE(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
MESSAGE(STATUS "Boost thread disabled")
ENDIF(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)

FIND_PACKAGE(Boost COMPONENTS filesystem system serialization program_options REQUIRED)
FIND_PACKAGE(Boost REQUIRED COMPONENTS filesystem system serialization program_options)
SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
SET(Boost_LIBRARIES ${Boost_LIBRARIES_TMP})
MESSAGE(STATUS "Boost Libraries")
Expand Down Expand Up @@ -256,18 +258,28 @@ MESSAGE(STATUS ${LAPACK_LIBRARIES})

# Find Sundials solvers
IF(USE_SUNDIALS)
FIND_PATH(SUNDIALS_INCLUDE_DIR cvode/cvode.h
PATHS ${SUNDIALS_INLCUDE_HOME})
FIND_PATH(SUNDIALS_INCLUDE_DIR cvode/cvode.h PATHS ${SUNDIALS_INLCUDE_HOME} $ENV{SUNDIALS_ROOT}/include)
if (NOT SUNDIALS_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "Could not find Sundials, specify environment variable SUNDIALS_ROOT")
ENDIF()
MESSAGE(STATUS ${SUNDIALS_INCLUDE_DIR})

FIND_LIBRARY(SUNDIALS_NVECSERIAL_LIB "sundials_nvecserial"
PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME})
FIND_LIBRARY(SUNDIALS_CVODES_LIB "sundials_cvodes"
PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} )
FIND_LIBRARY(SUNDIALS_IDA_LIB "sundials_ida"
PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} )
FIND_LIBRARY(SUNDIALS_KINSOL_LIB "sundials_kinsol"
PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} )
FIND_LIBRARY(SUNDIALS_NVECSERIAL_LIB "sundials_nvecserial" PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} $ENV{SUNDIALS_ROOT}/lib)
IF(NOT SUNDIALS_NVECSERIAL_LIB)
MESSAGE(FATAL_ERROR "Could not find libsundials_nvecserial!")
ENDIF()
FIND_LIBRARY(SUNDIALS_CVODES_LIB "sundials_cvodes" PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} $ENV{SUNDIALS_ROOT}/lib)
IF(NOT SUNDIALS_CVODES_LIB)
MESSAGE(FATAL_ERROR "Could not find libsundials_cvodes!")
ENDIF()
FIND_LIBRARY(SUNDIALS_IDA_LIB "sundials_ida" PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} $ENV{SUNDIALS_ROOT}/lib)
IF(NOT SUNDIALS_IDA_LIB)
MESSAGE(FATAL_ERROR "Could not find libsundials_ida!")
ENDIF()
FIND_LIBRARY(SUNDIALS_KINSOL_LIB "sundials_kinsol" PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} $ENV{SUNDIALS_ROOT}/lib)
IF(NOT SUNDIALS_KINSOL_LIB)
MESSAGE(FATAL_ERROR "Could not find libsundials_kinsol!")
ENDIF()
#FIND_LIBRARY(SUNDIALS_IDAS_LIB "sundials_idas"
# PATHS ${SUNDIALS_LIBRARY_RELEASE_HOME} )

Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Include/Core/Solver/ISolver.h
Expand Up @@ -61,7 +61,7 @@ class ISolver
virtual void solve(const SOLVERCALL command = UNDEF_CALL) = 0;

/// Provides the status of the solver after returning
virtual const SOLVERSTATUS getSolverStatus() = 0;
virtual SOLVERSTATUS getSolverStatus() = 0;
virtual void setTimeOut(unsigned int time_out) = 0;
virtual void stop() = 0;

Expand Down

0 comments on commit ba453bf

Please sign in to comment.