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

[LinearAlgera, Core] Fix linking with LTO on MacOS/Clang #4293

Merged
merged 1 commit into from
Nov 22, 2023
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
1 change: 1 addition & 0 deletions Sofa/framework/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ set(SOURCE_FILES
${SRC_ROOT}/topology/Topology.cpp
${SRC_ROOT}/topology/TopologyChange.cpp
${SRC_ROOT}/topology/TopologyHandler.cpp
${SRC_ROOT}/topology/TopologyData.cpp
${SRC_ROOT}/topology/TopologySubsetIndices.cpp
${SRC_ROOT}/visual/Data[DisplayFlags].cpp
${SRC_ROOT}/visual/DisplayFlags.cpp
Expand Down
32 changes: 32 additions & 0 deletions Sofa/framework/Core/src/sofa/core/topology/TopologyData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: [email protected] *
******************************************************************************/
#define SOFA_CORE_TOPOLOGY_TOPOLOGYDATA_DEFINITION

#include <sofa/core/topology/TopologyData.inl>


namespace sofa::core::topology
{

template class SOFA_CORE_API sofa::core::topology::TopologyData < core::topology::BaseMeshTopology::Point, type::vector<Index> >;

} //namespace sofa::core::topology
4 changes: 4 additions & 0 deletions Sofa/framework/Core/src/sofa/core/topology/TopologyData.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,9 @@ template< class VecT > using QuadData = TopologyData<core::topology::Base
template< class VecT > using TetrahedronData = TopologyData<core::topology::BaseMeshTopology::Tetrahedron, VecT>;
template< class VecT > using HexahedronData = TopologyData<core::topology::BaseMeshTopology::Hexahedron, VecT>;

#if !defined(SOFA_CORE_TOPOLOGY_TOPOLOGYDATA_DEFINITION)
extern template class SOFA_CORE_API sofa::core::topology::TopologyData < core::topology::BaseMeshTopology::Point, type::vector<Index> >;
#endif


} //namespace sofa::core::topology
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void TopologySubsetIndices::updateLastIndex(Index posLastIndex, Index newGlobalI
}

template class SOFA_CORE_API sofa::core::topology::TopologyDataHandler < core::topology::BaseMeshTopology::Point, type::vector<Index> >;
template class SOFA_CORE_API sofa::core::topology::TopologyData < core::topology::BaseMeshTopology::Point, type::vector<Index> >;
//template class SOFA_CORE_API sofa::core::topology::BaseTopologyData < type::vector<Index> >;

} //namespace sofa::core::topology
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* *
* Contact information: [email protected] *
******************************************************************************/
#define SOFABASELINEARSOLVER_FULLMATRIX_DEFINITION
#define SOFA_LINEARALGEBRA_FULLVECTOR_DEFINITION
#include <sofa/linearalgebra/FullVector.inl>

namespace sofa::linearalgebra
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class FullVector : public linearalgebra::BaseVector
SOFA_LINEARALGEBRA_API std::ostream& operator <<(std::ostream& out, const FullVector<float>& v);
SOFA_LINEARALGEBRA_API std::ostream& operator <<(std::ostream& out, const FullVector<double>& v);

#if !defined(SOFABASELINEARSOLVER_FULLMATRIX_DEFINITION)
#if !defined(SOFA_LINEARALGEBRA_FULLVECTOR_DEFINITION)
extern template class SOFA_LINEARALGEBRA_API FullVector<float>;
extern template class SOFA_LINEARALGEBRA_API FullVector<double>;
#endif
Expand Down
Loading