Skip to content
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

Fix missing unique_ptr get() (#52) #55

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(cppadcg CXX C)

SET(cppadcg_version "2.4.2" )
SET(cppadcg_version "2.4.3" )
SET(cppadcg_url "https://github.com/joaoleal/CppADCodeGen" )
SET(cppadcg_description "A C++ Algorithmic Differentiation Package with Source Code Generation" )

Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
cppadcodegen (2.4.3-1) unstable; urgency=low

* fix getCustomLibraryExtension()

-- Joao Leal <joaoruileal@gmail.com> Mon, 16 Mar 2020 18:00:00 +0000

cppadcodegen (2.4.2-1) unstable; urgency=low

* fix missing inline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DynamicModelLibraryProcessor : public ModelLibraryProcessor<Base> {
* @return a custom library extension
*/
inline const std::string* getCustomLibraryExtension() const {
return _customLibExtension;
return _customLibExtension.get();
}

/**
Expand Down
3 changes: 1 addition & 2 deletions include/cppad/cg/model/functor_model_library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class FunctorModelLibrary : public ModelLibrary<Base> {
/**
* Creates a new FunctorGenericModel object that can be used to evaluate
* the model.
* This object must be released by the user!
*
* @param modelName The model name.
* @return The model object or nullptr if no model exists with the provided
Expand Down Expand Up @@ -94,7 +93,7 @@ class FunctorModelLibrary : public ModelLibrary<Base> {
}
}

virtual bool isThreadPoolDisabled() const override {
bool isThreadPoolDisabled() const override {
if(_isThreadPoolDisabled != nullptr) {
return bool((*_isThreadPoolDisabled)());
}
Expand Down
1 change: 0 additions & 1 deletion test/cppad/cg/CppADCGDynamicAtomicNestedTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ class CppADCGDynamicAtomicNestedTest : public CppADCGTest {
* (compile source code)
*/
DynamicModelLibraryProcessor<double> p(compDynHelp, "innerModel");

GccCompiler<double> compiler1;
prepareTestCompilerFlags(compiler1);

Expand Down
18 changes: 18 additions & 0 deletions test/cppad/cg/CppADCGDynamicTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,23 @@ class CppADCGDynamicTest : public CppADCGModelTest {
SaveFilesModelLibraryProcessor<double>::saveLibrarySourcesTo(libSourceGen, "sources_" + _name + "_1");

DynamicModelLibraryProcessor<double> p(libSourceGen);

// some additional tests
ASSERT_EQ(p.getLibraryName(), "cppad_cg_model");
p.setLibraryName("cppad_cg_lib");
ASSERT_EQ(p.getLibraryName(), "cppad_cg_lib");

ASSERT_EQ(p.getCustomLibraryExtension(), nullptr);
p.setCustomLibraryExtension(".so.123");
ASSERT_NE(p.getCustomLibraryExtension(), nullptr);
ASSERT_EQ(*p.getCustomLibraryExtension(), ".so.123");

p.removeCustomLibraryExtension();
ASSERT_EQ(p.getCustomLibraryExtension(), nullptr);

const auto& cp = p;
ASSERT_TRUE(cp.getOptions().empty());

GccCompiler<double> compiler;
//compiler.setSaveToDiskFirst(true); // useful to detect problem
prepareTestCompilerFlags(compiler);
Expand All @@ -148,6 +165,7 @@ class CppADCGDynamicTest : public CppADCGModelTest {
#ifdef CPPAD_CG_SYSTEM_LINUX
// this is required because the OpenMP implementation in GCC causes a segmentation fault on dlclose
p.getOptions()["dlOpenMode"] = std::to_string(RTLD_NOW | RTLD_NODELETE);
ASSERT_TRUE(!p.getOptions().empty());
#endif
} else if(libSourceGen.getMultiThreading() == MultiThreadingType::PTHREADS) {
compiler.addCompileFlag("-pthread");
Expand Down