Skip to content
Snippets Groups Projects
Commit f55ab246 authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

added cmake option to set hidden visibility for gcc compiles; fixed several...

added cmake option to set hidden visibility for gcc compiles; fixed several missing visibility declarations
parent e8871e5b
Branches
Tags
No related merge requests found
......@@ -50,6 +50,7 @@ option(DEPLOYMENT "switch on deployment settings" OFF)
option(COMPILE_TESTS "whether unit tests should be compiled by default" OFF)
option(ENABLE_STATIC "whether static libraries should be compiled" OFF)
option(DEBIAN_STYLE_LIBEXEC "whether 'libexec' should be put under 'lib/openstructure" OFF)
option(HIDDEN_VISIBILITY "on gcc, use -fvisibility=hidden" OFF)
if (CXX)
set(CMAKE_CXX_COMPILER ${CXX})
......@@ -250,9 +251,14 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# with multiple -fno-strict-aliasing flags, triggering a complete rebuild whenever
# cmake is run
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing")
if(HIDDEN_VISIBILITY)
set (CMAKE_CXX_FLAGS "-fvisibility=hidden")
set (_HIDDEN_VIS ON)
else(HIDDEN_VISIBILITY)
set (_HIDDEN_VIS OFF)
endif(HIDDEN_VISIBILITY)
endif()
# basic environment
include_directories(${Boost_INCLUDE_DIRS}
${FFTW_INCLUDE_PATH}
......@@ -313,5 +319,6 @@ message(STATUS
" Compound Lib (-DCOMPOUND_LIB) : ${_COMP_LIB}\n"
" TMAlign and TMScore (-DCOMPILE_TMTOOLS) : ${_TM_TOOLS}\n"
" Static Libraries (-DENABLE_STATIC) : ${ENABLE_STATIC}\n"
" Debian-style 'libexec' (-DDEBIAN_STYLE_LIBEXEC) : ${_DEBIAN_STYLE_LIBEXEC}" )
" Debian-style 'libexec' (-DDEBIAN_STYLE_LIBEXEC) : ${_DEBIAN_STYLE_LIBEXEC}\n"
" Hidden object visibility (-DHIDDEN_VISIBILITY) : ${_HIDDEN_VIS}")
......@@ -29,7 +29,7 @@
namespace ost { namespace conop {
struct Date {
struct DLLEXPORT_OST_CONOP Date {
Date(int y, int m, int d):
year(y), month(m), day(d)
{ }
......@@ -68,7 +68,7 @@ struct Date {
int day;
};
struct AtomSpec {
struct DLLEXPORT_OST_CONOP AtomSpec {
AtomSpec()
: ordinal(0), is_leaving(false) {
}
......@@ -88,7 +88,7 @@ struct AtomSpec {
}
};
struct BondSpec {
struct DLLEXPORT_OST_CONOP BondSpec {
BondSpec()
: atom_one(0), atom_two(0), order(1) {
......
......@@ -27,6 +27,7 @@
#include "mat3.hh"
#include "quat.hh"
#include "module_config.hh"
/*
composite classes in 3D space
......@@ -47,7 +48,7 @@ private:
Vec3 ori_,dir_;
};
std::ostream& operator<<(std::ostream& s, const Line3& l);
DLLEXPORT_OST_GEOM std::ostream& operator<<(std::ostream& s, const Line3& l);
class DLLEXPORT_OST_GEOM Plane {
public:
......@@ -80,7 +81,7 @@ private:
Real p_;
};
class DLLEXPORT Sphere {
class DLLEXPORT_OST_GEOM Sphere {
public:
Sphere();
Sphere(const Vec3& origin, Real r);
......@@ -98,7 +99,7 @@ private:
/// half extent
///
/// \relates Cuboid
class DLLEXPORT CuboidAxis {
class DLLEXPORT_OST_GEOM CuboidAxis {
public:
CuboidAxis(): axis_(), half_extent_(0.0)
{ }
......@@ -112,7 +113,7 @@ private:
};
/// \brief arbitrary oriented bounding cuboid
class DLLEXPORT Cuboid {
class DLLEXPORT_OST_GEOM Cuboid {
public:
Cuboid();
Cuboid(const Vec3& center, const CuboidAxis& a,
......@@ -140,7 +141,7 @@ private:
CuboidAxis axes_[3];
};
class DLLEXPORT Rotation3
class DLLEXPORT_OST_GEOM Rotation3
{
public:
Rotation3();
......@@ -184,8 +185,8 @@ private:
typedef std::vector<Rotation3> Rotation3List;
DLLEXPORT Rotation3List ImportEulerAngles (const boost::filesystem::path& loc);
DLLEXPORT void ExportEulerAngles (const Rotation3List& rot_list,
DLLEXPORT_OST_GEOM Rotation3List ImportEulerAngles (const boost::filesystem::path& loc);
DLLEXPORT_OST_GEOM void ExportEulerAngles (const Rotation3List& rot_list,
const boost::filesystem::path& loc);
} // ns
......
......@@ -211,15 +211,15 @@ inline Real DistanceWithPBC(const Vec3& v1, const Vec3& v2, const Vec3& basis_ve
return sqrt(Distance2WithPBC(v1, v2, basis_vec));
}
//! returns the minimal distance between the points in two Vec3List
Real MinDistance(const Vec3List& l1, const Vec3List& l2);
DLLEXPORT_OST_GEOM Real MinDistance(const Vec3List& l1, const Vec3List& l2);
//! returns the minimal distance between the points in two Vec3List
// with periodic boundaries in x,y,z given in basis_vec
Real MinDistanceWithPBC(const Vec3List& l1, const Vec3List& l2, Vec3& basis_vec);
DLLEXPORT_OST_GEOM Real MinDistanceWithPBC(const Vec3List& l1, const Vec3List& l2, Vec3& basis_vec);
//!wraps a vector in a box with periodic boundaries
Vec3 WrapVec3(const Vec3& v1,const Vec3& box_center,const Vec3& basis_vec);
//!wraps all the verctors in a Vec3List in a box with periodic boundaries
Vec3List WrapVec3List(const Vec3List& vl,const Vec3& box_center,const Vec3& basis_vec);
DLLEXPORT_OST_GEOM Vec3 WrapVec3(const Vec3& v1,const Vec3& box_center,const Vec3& basis_vec);
//!wraps all the vectors in a Vec3List in a box with periodic boundaries
DLLEXPORT_OST_GEOM Vec3List WrapVec3List(const Vec3List& vl,const Vec3& box_center,const Vec3& basis_vec);
} // ns
......
......@@ -25,7 +25,7 @@
namespace ost { namespace mol { namespace alg {
/// \brief List of reference atom-atom distances to detect clashes between non-bonded atoms
class ClashingDistances
class DLLEXPORT_OST_MOL_ALG ClashingDistances
{
public:
......@@ -61,7 +61,7 @@ private:
/// \brief List of stereo chemical parameters (Bonds and angles)
///
/// For each item (bond or angle in a specific residue), stores the mean and standard deviation
class StereoChemicalParams
class DLLEXPORT_OST_MOL_ALG StereoChemicalParams
{
public:
......
......@@ -28,7 +28,7 @@ namespace ost { namespace mol { namespace alg {
/// \brief Contains the infomation needed to uniquely identify an atom in a structure
///
/// Used by the the Local Distance Difference Test classes and functions
class UniqueAtomIdentifier
class DLLEXPORT_OST_MOL_ALG UniqueAtomIdentifier
{
public:
......@@ -169,7 +169,7 @@ Real DLLEXPORT_OST_MOL_ALG LDDTHA(EntityView& v, const GlobalRDMap& global_dist_
/// \brief Creates a list of distances to check during a Local Difference Distance Test
///
/// Requires a reference structure and an inclusion radius (max_dist)
GlobalRDMap CreateDistanceList(const EntityView& ref,Real max_dist);
GlobalRDMap DLLEXPORT_OST_MOL_ALG CreateDistanceList(const EntityView& ref,Real max_dist);
/// \brief Creates a list of distances to check during a Local Difference Distance Test starting from multiple reference structures
///
......@@ -193,17 +193,17 @@ GlobalRDMap CreateDistanceList(const EntityView& ref,Real max_dist);
/// must be passed to the function. These parameters do not influence the output distance list, which always includes all distances
/// within the provided max_dist (to make it consistent with the single-reference corresponding function). However, the parameters are used when
/// dealing with the naming convention of residues with ambiguous nomenclature.
GlobalRDMap CreateDistanceListFromMultipleReferences(const std::vector<EntityView>& ref_list,std::vector<Real>& cutoff_list, int sequence_separation, Real max_dist);
GlobalRDMap DLLEXPORT_OST_MOL_ALG CreateDistanceListFromMultipleReferences(const std::vector<EntityView>& ref_list,std::vector<Real>& cutoff_list, int sequence_separation, Real max_dist);
/// \brief Prints all distances in a global distance list to standard output
void PrintGlobalRDMap(const GlobalRDMap& glob_dist_list);
void DLLEXPORT_OST_MOL_ALG PrintGlobalRDMap(const GlobalRDMap& glob_dist_list);
/// \brief Prints all distances in a residue distance list to standard output
void PrintResidueRDMap(const ResidueRDMap& res_dist_list);
void DLLEXPORT_OST_MOL_ALG PrintResidueRDMap(const ResidueRDMap& res_dist_list);
// required by some helper function. Cannot reuse similar functions in other modules without creating
// circular dependencies
bool IsStandardResidue(String rn);
bool DLLEXPORT_OST_MOL_ALG IsStandardResidue(String rn);
}}}
......
......@@ -22,6 +22,8 @@
#include <ost/base.hh>
#include <ost/string_ref.hh>
#include "module_config.hh"
namespace ost { namespace mol {
/// \enum different kinds of chains
......@@ -46,7 +48,7 @@ typedef enum {
///
/// \return The ChainType corresponding to the input, throws a
/// std::runtime_error on unknown type
ChainType ChainTypeFromString(const StringRef identifier);
ChainType DLLEXPORT_OST_MOL ChainTypeFromString(const StringRef identifier);
/// \brief Create a ChainType item for a given string
///
......@@ -54,7 +56,7 @@ ChainType ChainTypeFromString(const StringRef identifier);
///
/// \return The ChainType corresponding to the input, throws a
/// std::runtime_error on unknown type
ChainType ChainTypeFromString(const String& identifier);
ChainType DLLEXPORT_OST_MOL ChainTypeFromString(const String& identifier);
/// \brief Return the String identifier for a given type
///
......@@ -62,7 +64,7 @@ ChainType ChainTypeFromString(const String& identifier);
///
/// \return String corresponding to the input, throws a std::runtime_error on
/// unknown type
String StringFromChainType(ChainType type);
String DLLEXPORT_OST_MOL StringFromChainType(ChainType type);
}} //ns
......
......@@ -216,31 +216,31 @@ public:
This function returns a vector containing the atom indices of the atoms in an EntityView;
it is used to accelerate the extraction of information from a trajectory
*/
void GetIndices(const EntityView& sele, std::vector<unsigned long>& indices);
DLLEXPORT_OST_MOL void GetIndices(const EntityView& sele, std::vector<unsigned long>& indices);
/*!
This function returns a vector containing the atom masses of the atoms in an EntityView;
it is used together with GetIndices to accelerate the extraction of RMSD from a trajectory
*/
void GetMasses(const EntityView& sele, std::vector<Real>& masses);
DLLEXPORT_OST_MOL void GetMasses(const EntityView& sele, std::vector<Real>& masses);
//! conveniece for GetIndices and GetMasses in one call
void GetIndicesAndMasses(const EntityView& sele,
std::vector<unsigned long>& indices,
std::vector<Real>& masses);
DLLEXPORT_OST_MOL void GetIndicesAndMasses(const EntityView& sele,
std::vector<unsigned long>& indices,
std::vector<Real>& masses);
//! Writes the positions of all atoms in the EntityView into the provided vec3 list
void GetPositions(const EntityView& sele, std::vector<geom::Vec3>& ref_pos);
DLLEXPORT_OST_MOL void GetPositions(const EntityView& sele, std::vector<geom::Vec3>& ref_pos);
//! Writes the indices of all atoms in the EntityView into the provided list
void GetCaIndices(const EntityView& segment, std::vector<unsigned long>& indices_ca);
DLLEXPORT_OST_MOL void GetCaIndices(const EntityView& segment, std::vector<unsigned long>& indices_ca);
//! Writes the backbone indices of all residues in the EntityView into the provided list
void GetCaCONIndices(const EntityView& segment,
std::vector<unsigned long>& indices_ca,
std::vector<unsigned long>& indices_c,
std::vector<unsigned long>& indices_o,
std::vector<unsigned long>& indices_n);
DLLEXPORT_OST_MOL void GetCaCONIndices(const EntityView& segment,
std::vector<unsigned long>& indices_ca,
std::vector<unsigned long>& indices_c,
std::vector<unsigned long>& indices_o,
std::vector<unsigned long>& indices_n);
}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment