-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[CppAD] Add CppAD port #12560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nicole mazzuca (strega-nil)
merged 7 commits into
microsoft:master
from
GiulioRomualdi:add/cpp_ad
Aug 7, 2020
Merged
[CppAD] Add CppAD port #12560
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8d636b4
[CppAD] Add CppAD port
GiulioRomualdi f92ebda
[CppAD] Fix compilation on Linux
GiulioRomualdi 52c528e
[CppAD] Remove vcpkg_common_functions from portfile.cmake
GiulioRomualdi 7803ab5
[CppAD] Avoid to add the postfix 'd' in the debug library
GiulioRomualdi 34ce3a7
[CppAD] Patch the pkgconfig file generation
GiulioRomualdi 1b94c82
[CppAD] Remove the support for uwp and arm
GiulioRomualdi 3edc2aa
[CppAD] add DISABLE_PARALLEL_CONFIGURE as option of vcpkg_configure_c…
GiulioRomualdi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Source: cppad | ||
| Version: 20200000.3 | ||
| Homepage: https://github.com/coin-or/CppAD | ||
| Description: CppAD: A Package for Differentiation of C++ Algorithms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO coin-or/CppAD | ||
| REF 20200000.3 | ||
| SHA512 4e980665a21c76cf355d1c5597c65fbfba7ac3e15c43a88ccfe3ba0267b85b4e9aa7c6e8a0ed7a728f8cf2c6e1424625d5cbcdd295a6c0a08b47b4b121572d13 | ||
| HEAD_REF master | ||
| PATCHES | ||
| windows-fix.patch | ||
| ) | ||
|
|
||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -Dcppad_prefix=${CURRENT_PACKAGES_DIR} | ||
| OPTIONS_RELEASE | ||
| -Dcmake_install_libdirs=lib | ||
| -Dcppad_debug_which:STRING=debug_none | ||
| OPTIONS_DEBUG | ||
| -DCMAKE_DEBUG_POSTFIX=d | ||
| -Dcmake_install_libdirs=debug/lib | ||
| ) | ||
| else() | ||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -Dcppad_prefix=${CURRENT_PACKAGES_DIR} | ||
| OPTIONS_RELEASE | ||
| -Dcmake_install_libdirs=lib | ||
| -Dcppad_debug_which:STRING=debug_none | ||
| OPTIONS_DEBUG | ||
| -Dcmake_install_libdirs=debug/lib | ||
| ) | ||
| endif() | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| # Install the pkgconfig file | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") | ||
| file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) | ||
| endif() | ||
| if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") | ||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| vcpkg_replace_string(${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/pkgconfig/cppad.pc "-lcppad_lib" "-lcppad_libd") | ||
| endif() | ||
| file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/pkgconfig/cppad.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) | ||
| endif() | ||
|
|
||
| vcpkg_fixup_pkgconfig() | ||
|
|
||
| # Add the copyright | ||
| file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| diff --git a/cppad_lib/cppad_colpack.cpp b/cppad_lib/cppad_colpack.cpp | ||
| index dc3327053..739363292 100644 | ||
| --- a/cppad_lib/cppad_colpack.cpp | ||
| +++ b/cppad_lib/cppad_colpack.cpp | ||
| @@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: | ||
|
|
||
| # if CPPAD_HAS_COLPACK == 0 | ||
| namespace CppAD { namespace local { | ||
| - CPPAD_LIB_EXPORT void this_routine_should_never_get_called(void) | ||
| + void this_routine_should_never_get_called(void) | ||
| { CPPAD_ASSERT_UNKNOWN(false); } | ||
| } } | ||
| # else // CPPAD_HAS_COLPACK | ||
| @@ -52,7 +52,7 @@ the entry with index (i, adolc_pattern[i][k]) is a non-zero | ||
| in the sparsity pattern for the matrix. | ||
| */ | ||
| // ---------------------------------------------------------------------- | ||
| -CPPAD_LIB_EXPORT void cppad_colpack_general( | ||
| +void cppad_colpack_general( | ||
| CppAD::vector<size_t>& color , | ||
| size_t m , | ||
| size_t n , | ||
| @@ -164,7 +164,7 @@ For i = 0 , ... , m-1, and for k = 1, ... ,adolc_pattern[i][0], | ||
| the entry with index (i, adolc_pattern[i][k]) is | ||
| in the sparsity pattern for the symmetric matrix. | ||
| */ | ||
| -CPPAD_LIB_EXPORT void cppad_colpack_symmetric( | ||
| +void cppad_colpack_symmetric( | ||
| CppAD::vector<size_t>& color , | ||
| size_t m , | ||
| const CppAD::vector<unsigned int*>& adolc_pattern ) | ||
| diff --git a/cppad_lib/json_parser.cpp b/cppad_lib/json_parser.cpp | ||
| index fac417d9f..ac0910cee 100644 | ||
| --- a/cppad_lib/json_parser.cpp | ||
| +++ b/cppad_lib/json_parser.cpp | ||
| @@ -20,7 +20,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: | ||
| // documentation for this routine is in the file below | ||
| # include <cppad/local/graph/json_parser.hpp> | ||
|
|
||
| -CPPAD_LIB_EXPORT void CppAD::local::graph::json_parser( | ||
| +void CppAD::local::graph::json_parser( | ||
| const std::string& json , | ||
| cpp_graph& graph_obj ) | ||
| { using std::string; | ||
| diff --git a/cppad_lib/json_writer.cpp b/cppad_lib/json_writer.cpp | ||
| index 250345c6e..add4b20a9 100644 | ||
| --- a/cppad_lib/json_writer.cpp | ||
| +++ b/cppad_lib/json_writer.cpp | ||
| @@ -17,7 +17,7 @@ in the Eclipse Public License, Version 2.0 are satisfied: | ||
| // documentation for this routine is in the file below | ||
| # include <cppad/local/graph/json_writer.hpp> | ||
|
|
||
| -CPPAD_LIB_EXPORT void CppAD::local::graph::json_writer( | ||
| +void CppAD::local::graph::json_writer( | ||
| std::string& json , | ||
| const cpp_graph& graph_obj ) | ||
| { using std::string; | ||
| diff --git a/include/cppad/local/cppad_colpack.hpp b/include/cppad/local/cppad_colpack.hpp | ||
| index ee96ab5fe..6dd022180 100644 | ||
| --- a/include/cppad/local/cppad_colpack.hpp | ||
| +++ b/include/cppad/local/cppad_colpack.hpp | ||
| @@ -59,7 +59,7 @@ it is not the case that both | ||
| This routine tries to minimize, with respect to the choice of colors, | ||
| the number of colors. | ||
| */ | ||
| -extern void cppad_colpack_general( | ||
| +CPPAD_LIB_EXPORT void cppad_colpack_general( | ||
| CppAD::vector<size_t>& color , | ||
| size_t m , | ||
| size_t n , | ||
| @@ -91,7 +91,7 @@ The properties of this coloring have not yet been determined; see | ||
| Efficient Computation of Sparse Hessians Using Coloring | ||
| and Automatic Differentiation (pdf/ad/gebemedhin14.pdf) | ||
| */ | ||
| -extern void cppad_colpack_symmetric( | ||
| +CPPAD_LIB_EXPORT void cppad_colpack_symmetric( | ||
| CppAD::vector<size_t>& color , | ||
| size_t n , | ||
| const CppAD::vector<unsigned int*>& adolc_pattern | ||
| diff --git a/include/cppad/local/graph/json_parser.hpp b/include/cppad/local/graph/json_parser.hpp | ||
| index 17bcc7c7e..a28d2c045 100644 | ||
| --- a/include/cppad/local/graph/json_parser.hpp | ||
| +++ b/include/cppad/local/graph/json_parser.hpp | ||
| @@ -42,7 +42,7 @@ Upon return it is a $cref cpp_ad_graph$$ representation of this function. | ||
| $head Prototype$$ | ||
| $srccode%hpp% */ | ||
| namespace CppAD { namespace local { namespace graph { | ||
| - void json_parser( | ||
| + CPPAD_LIB_EXPORT void json_parser( | ||
| const std::string& json , | ||
| cpp_graph& graph_obj | ||
| ); | ||
| diff --git a/include/cppad/local/graph/json_writer.hpp b/include/cppad/local/graph/json_writer.hpp | ||
| index 36a4cb39f..299c56cc0 100644 | ||
| --- a/include/cppad/local/graph/json_writer.hpp | ||
| +++ b/include/cppad/local/graph/json_writer.hpp | ||
| @@ -41,7 +41,7 @@ This is a $code cpp_graph$$ object. | ||
| $head Prototype$$ | ||
| $srccode%hpp% */ | ||
| namespace CppAD { namespace local { namespace graph { | ||
| - void json_writer( | ||
| + CPPAD_LIB_EXPORT void json_writer( | ||
| std::string& json , | ||
| const cpp_graph& graph_obj | ||
| ); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.