Commit f2ebc879 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'update_finders' into 'master'

Update IPOPT related finders

See merge request !167
parents 13d4d19a 94ee2cd4
......@@ -87,8 +87,8 @@ if (WIN32)
ELSE( WIN32 )
find_path(IPOPT_INCLUDE_DIR NAMES IpNLP.hpp
PATHS "$ENV{IPOPT_HOME}/include/coin"
"/usr/include/coin"
HINTS "$ENV{IPOPT_HOME}/include/coin"
PATHS "/usr/include/coin"
"~/sw/Ipopt-3.12.4-installed/include/coin"
)
......
......@@ -36,8 +36,9 @@ endif()
find_path(METIS_INCLUDE_DIR NAMES metis.h
PATHS "$ENV{IPOPT_HOME}/ThirdParty/Metis/metis-4.0/Lib/"
"/usr/include/"
HINTS "$ENV{IPOPT_HOME}/ThirdParty/Metis/metis-4.0/Lib/"
"$ENV{IPOPT_HOME}/include/coin/ThirdParty/"
PATHS "/usr/include/"
"/usr/include/metis"
"/opt/local/include"
"/opt/local/include/metis"
......@@ -46,18 +47,18 @@ find_path(METIS_INCLUDE_DIR NAMES metis.h
)
find_library( METIS_LIBRARY_RELEASE
metis coinmetis
PATHS "$ENV{IPOPT_HOME}/lib/"
"/usr/lib"
coinmetis metis
HINTS "$ENV{IPOPT_HOME}/lib/"
PATHS "/usr/lib"
"/opt/local/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.9/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/lib"
)
find_library( METIS_LIBRARY_DEBUG
metisd coinmetisd
PATHS "$ENV{IPOPT_HOME}/lib/"
"/usr/lib"
coinmetisd metisd
HINTS "$ENV{IPOPT_HOME}/lib/"
PATHS "/usr/lib"
"/opt/local/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.9/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/lib"
......
......@@ -35,24 +35,25 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
endif()
find_path(MUMPS_INCLUDE_DIR NAMES dmumps_c.h
PATHS "$ENV{IPOPT_HOME}/ThirdParty/Mumps/MUMPS/include/"
"/usr/include/"
HINTS "$ENV{IPOPT_HOME}/ThirdParty/Mumps/MUMPS/include/"
"$ENV{IPOPT_HOME}/include/coin/ThirdParty"
PATHS "/usr/include/"
"${VS_SEARCH_PATH}Ipopt-3.12.9/include/mumps"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/include/mumps"
)
find_library( MUMPS_LIBRARY_DEBUG
dmumpsd coinmumpsd coinmumpscd
PATHS "$ENV{IPOPT_HOME}/lib/"
"/usr/lib"
coinmumpsd dmumpsd coinmumpscd
HITNS "$ENV{IPOPT_HOME}/lib/"
PATHS "/usr/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.9/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/lib"
)
find_library( MUMPS_LIBRARY_RELEASE
dmumps coinmumps coinmumpsc
PATHS "$ENV{IPOPT_HOME}/lib/"
"/usr/lib"
coinmumps dmumps coinmumpsc
HINTS "$ENV{IPOPT_HOME}/lib/"
PATHS "/usr/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.9/lib"
"${VS_SEARCH_PATH}Ipopt-3.12.4/Ipopt/MSVisualStudio/v8-ifort/installed/lib"
)
......
......@@ -62,7 +62,14 @@ if( WIN32 )
# if we found the library, add it to the defined libraries
IF ( SUITESPARSE_LIBRARY_DIRS )
if ( EXISTS "${SUITESPARSE_LIBRARY_DIRS}/libamd.lib" )
set(LIBS_HAVE_LIB_PREFIX FALSE)
foreach(dir ${SUITESPARSE_LIBRARY_DIRS})
if (EXISTS "${dir}/libamd.lib")
set (LIBS_HAVE_LIB_PREFIX TRUE)
endif()
endforeach()
if ( LIBS_HAVE_LIB_PREFIX )
list ( APPEND SUITESPARSE_LIBRARY_DIRS "${SUITESPARSE_LIBRARY_DIRS}/lapack_blas_windows") # because liblapack.lib lies here
list ( APPEND SUITESPARSE_LIBRARIES optimized;libamd;optimized;libcamd;optimized;libccolamd;optimized;libcholmod;optimized;libcolamd;optimized;metis;optimized;libspqr;optimized;libumfpack;debug;libamdd;debug;libcamdd;debug;libccolamdd;debug;libcholmodd;debug;libspqrd;debug;libumfpackd;debug;libcolamdd;debug;metisd;optimized;liblapack;debug;liblapackd;optimized;suitesparseconfig;debug;suitesparseconfigd )
else()
list ( APPEND SUITESPARSE_LIBRARIES optimized;amd;optimized;camd;optimized;ccolamd;optimized;cholmod;optimized;colamd;optimized;metis;optimized;spqr;optimized;umfpack;debug;amdd;debug;camdd;debug;ccolamdd;debug;cholmodd;debug;spqrd;debug;umfpackd;debug;colamdd;debug;metisd;optimized;blas;optimized;libf2c;optimized;lapack;debug;blasd;debug;libf2cd;debug;lapackd )
......@@ -80,6 +87,8 @@ if( WIN32 )
PATHS ${SUITESPARSE_LIBRARY_DIRS} )
IF (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES optimized;libspqr;debug;libspqrd)
ELSE (SUITESPARSE_SPQR_LIBRARY)
SET(SUITESPARSE_SPQR_VALID FALSE)
ENDIF (SUITESPARSE_SPQR_LIBRARY)
endif()
......@@ -87,6 +96,25 @@ if( WIN32 )
ENDIF( SUITESPARSE_LIBRARY_DIRS )
else( WIN32 )
if( APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /opt/local/include/ufsparse )
FIND_LIBRARY(SUITESPARSE_LIBRARY
NAMES libSuiteSparse.dylib
PATHS /opt/local/lib)
message("SUITESPARSE_LIBRARY: ${SUITESPARSE_LIBRARY}")
FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libSuiteSparse.dylib
PATHS /opt/local/lib )
message("SUITESPARSE_LIBRARY_DIR: ${SUITESPARSE_LIBRARY_DIR}")
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_LIBRARY})
else(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /usr/local/include
/usr/include
......@@ -104,8 +132,8 @@ else( WIN32 )
/opt/local/lib
/usr/lib/x86_64-linux-gnu )
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
endif(APPLE)
# Add cholmod include directory to collection include directories
IF ( CHOLMOD_INCLUDE_DIR )
......@@ -116,24 +144,46 @@ else( WIN32 )
# if we found the library, add it to the defined libraries
IF ( SUITESPARSE_LIBRARY_DIR )
# Skipped, as this is set for apple in the block above
# if (NOT APPLE)
list ( APPEND SUITESPARSE_LIBRARIES amd)
list ( APPEND SUITESPARSE_LIBRARIES btf)
list ( APPEND SUITESPARSE_LIBRARIES camd)
list ( APPEND SUITESPARSE_LIBRARIES ccolamd)
list ( APPEND SUITESPARSE_LIBRARIES cholmod)
list ( APPEND SUITESPARSE_LIBRARIES colamd)
FIND_LIBRARY(SUITESPARSE_AMD_LIBRARY
NAMES amd
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_AMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CAMD_LIBRARY
NAMES camd
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CCOLAMD_LIBRARY
NAMES ccolamd
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CCOLAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CHOLMOD_LIBRARY
NAMES cholmod
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CHOLMOD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_COLAMD_LIBRARY
NAMES cholmod
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_COLAMD_LIBRARY})
FIND_LIBRARY(SUITESPARSE_CXSPARSE_LIBRARY
NAMES cxsparse
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_CXSPARSE_LIBRARY})
FIND_LIBRARY(SUITESPARSE_KLU_LIBRARY
NAMES klu
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_KLU_LIBRARY})
FIND_LIBRARY(SUITESPARSE_UMFPACK_LIBRARY
NAMES umfpack
PATHS ${SUITESPARSE_LIBRARY_DIR})
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_UMFPACK_LIBRARY})
# list ( APPEND SUITESPARSE_LIBRARIES csparse)
list ( APPEND SUITESPARSE_LIBRARIES cxsparse)
list ( APPEND SUITESPARSE_LIBRARIES klu)
# list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES umfpack)
# endif()
# Metis and spqr are optional
FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY
NAMES metis
NAMES coinmetis metis
HINTS "$ENV{IPOPT_HOME}/lib"
PATHS ${SUITESPARSE_LIBRARY_DIR} )
IF (SUITESPARSE_METIS_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_METIS_LIBRARY})
......@@ -150,7 +200,7 @@ else( WIN32 )
NAMES spqr
PATHS ${SUITESPARSE_LIBRARY_DIR} )
IF (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_SPQR_LIBRARY})
ENDIF (SUITESPARSE_SPQR_LIBRARY)
endif()
......@@ -158,11 +208,12 @@ else( WIN32 )
endif( WIN32 )
IF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
IF (SUITESPARSE_LIBRARY_DIR AND SUITESPARSE_LIBRARIES)
IF(WIN32)
list (APPEND SUITESPARSE_INCLUDE_DIRS ${CHOLMOD_INCLUDE_DIR}/../../UFconfig )
ENDIF(WIN32)
SET(SUITESPARSE_FOUND TRUE)
ELSE (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
ELSE (SUITESPARSE_LIBRARY_DIR AND SUITESPARSE_LIBRARIES)
SET( SUITESPARSE_FOUND FALSE )
ENDIF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
ENDIF (SUITESPARSE_LIBRARY_DIR AND SUITESPARSE_LIBRARIES)
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