joaoleal / CppADCodeGen

Source Code Generation for Automatic Differentiation using Operator Overloading
Other
162 stars 36 forks source link

cppad_ipopt dependency #76

Closed briansoe66 closed 1 year ago

briansoe66 commented 1 year ago

cmake/FindCppAD.cmake searches for cppad_ipopt library (libcppad_ipopt.so/.a), but I don't see any other references to ipopt in the code. Does CppADCodeGen use ipopt? If not, can we instead search for the default library cppad_lib (libcppad_lib.so/.a)?

For example, Pinocchio dynamics library uses this Findcppad.cmake:

# Copyright 2020 CNRS INRIA
# Author: Guilhem Saurel, Rohan Budhiraja
# Try to find cppad in standard prefixes and in ${cppad_PREFIX} Once done this
# will define cppad_FOUND - System has cppad cppad_INCLUDE_DIR - The cppad
# include directories cppad_LIBRARY - The libraries needed to use cppad
# cppad_DEFINITIONS - Compiler switches required for using cppad cppad_VERSION -
# Version of cppad found

find_path(
  cppad_INCLUDE_DIR
  NAMES cppad/configure.hpp
  PATHS ${cppad_PREFIX}
  PATH_SUFFIXES include)
find_library(
  cppad_LIBRARY
  NAMES cppad_lib
  PATHS ${cppad_PREFIX}
  PATH_SUFFIXES lib)

if(cppad_INCLUDE_DIR AND EXISTS "${cppad_INCLUDE_DIR}/cppad/configure.hpp")
  file(STRINGS "${cppad_INCLUDE_DIR}/cppad/configure.hpp" cppad_version_str
       REGEX "^# *define[\t ]+CPPAD_PACKAGE_STRING[\t ]+\"cppad-.*\"")
  string(
    REGEX
    REPLACE "^# *define[\t ]+CPPAD_PACKAGE_STRING[\t ]+\"cppad-([^\"]*)\".*"
            "\\1" cppad_VERSION "${cppad_version_str}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  cppad
  REQUIRED_VARS cppad_LIBRARY cppad_INCLUDE_DIR
  VERSION_VAR cppad_VERSION)
mark_as_advanced(cppad_INCLUDE_DIR cppad_LIBRARY)
bradbell commented 1 year ago

The cppad_ipopt library was deprecated on 2021-11-28 (ten years ago); see https://coin-or.github.io/CppAD/doc/cppad_ipopt_nlp.htm

joaoleal commented 1 year ago

Yes, that lib can be removed since there is no source that depends on IPOPT in CPPADCodeGen.

briansoe66 commented 1 year ago

PR with the change: https://github.com/joaoleal/CppADCodeGen/pull/77