Skip to content

Commit

Permalink
Precompile templates if enabled by roboptim-core only
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed May 16, 2016
1 parent 73dfcf6 commit 5e3c200
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -28,6 +28,7 @@ script:
after_success: ./.travis/run after_success
after_failure: ./.travis/run after_failure
before_install:
- if [ "${ENABLE_CXX11}" == "1" ]; then export CMAKE_ADDITIONAL_OPTIONS="-DUSE_CXX11:BOOL=ON -DROBOPTIM_PRECOMPILE_DENSE_SPARSE:BOOL=ON ${CMAKE_ADDITIONAL_OPTIONS}"; fi
- ./.travis/dependencies/eigen-3.2
- ./.travis/run before_install
matrix:
Expand All @@ -39,12 +40,10 @@ matrix:
- os: linux
dist: trusty
compiler: gcc
env: CMAKE_ADDITIONAL_OPTIONS="-DUSE_CXX11:BOOL=ON -DROBOPTIM_PRECOMPILE_DENSE_SPARSE:BOOL=ON"
env: ENABLE_CXX11=1
- os: linux
dist: trusty
compiler: clang
env: CMAKE_ADDITIONAL_OPTIONS="-DUSE_CXX11:BOOL=ON -DROBOPTIM_PRECOMPILE_DENSE_SPARSE:BOOL=ON"
env: ENABLE_CXX11=1
os:
- linux
Expand Down
Expand Up @@ -41,8 +41,10 @@ namespace roboptim

{}

# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI FunctionOnManifold<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI FunctionOnManifold<EigenMatrixSparse>;
# endif
} // end of namespace roboptim.

#endif //! ROBOPTIM_CORE_MANIFOLD_MAP_DECORATOR_FUNCTION_ON_MANIFOLD_HXX
Expand Up @@ -376,11 +376,13 @@ BoundsAndScalingSetter<T>::BoundsAndScalingSetter(std::pair<typename GenericFunc
: bNSPair_(bNSPair)
{}

# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
extern template struct ROBOPTIM_CORE_MANIFOLD_DLLAPI BoundsAndScalingSetter<EigenMatrixDense>;
extern template struct ROBOPTIM_CORE_MANIFOLD_DLLAPI BoundsAndScalingSetter<EigenMatrixSparse>;

extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI ManifoldProblemFactory<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI ManifoldProblemFactory<EigenMatrixSparse>;
# endif

}

Expand Down
Expand Up @@ -59,7 +59,9 @@ namespace roboptim
return manifold_;
}

# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI ProblemOnManifold<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI ProblemOnManifold<EigenMatrixSparse>;
# endif
}
#endif //!ROBOPTIM_CORE_MANIFOLD_MAP_DECORATOR_PROBLEM_ON_MANIFOLD_HXX
Expand Up @@ -233,11 +233,12 @@ namespace roboptim
return functionsToSum_.size();
}

# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI SumOnManifold<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI SumOnManifold<EigenMatrixSparse>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI AdderOnManifold<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI AdderOnManifold<EigenMatrixSparse>;

# endif
}

#endif //! ROBOPTIM_CORE_MANIFOLD_MAP_DECORATOR_SUM_ON_MANIFOLD_HXX
Expand Up @@ -609,10 +609,12 @@ namespace roboptim
return flags|fct_->getFlags();
}

# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
ROBOPTIM_ALLOW_ATTRIBUTES_ON
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI WrapperOnManifold<EigenMatrixDense>;
extern template class ROBOPTIM_CORE_MANIFOLD_DLLAPI WrapperOnManifold<EigenMatrixSparse>;
ROBOPTIM_ALLOW_ATTRIBUTES_OFF
# endif

} // end of namespace roboptim.

Expand Down
2 changes: 2 additions & 0 deletions src/roboptim-core-manifold-precompile.cc
@@ -1,3 +1,4 @@
# ifdef ROBOPTIM_PRECOMPILED_DENSE_SPARSE
# include <roboptim/core/manifold-map/decorator/function-on-manifold.hh>
# include <roboptim/core/manifold-map/decorator/manifold-problem-factory.hh>
# include <roboptim/core/manifold-map/decorator/problem-on-manifold.hh>
Expand Down Expand Up @@ -28,3 +29,4 @@ namespace roboptim
template class WrapperOnManifold<EigenMatrixDense>;
template class WrapperOnManifold<EigenMatrixSparse>;
}
# endif // ROBOPTIM_PRECOMPILE_DENSE_SPARSE

0 comments on commit 5e3c200

Please sign in to comment.