Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
1d2f997e
Commit
1d2f997e
authored
Aug 18, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export stuff
parent
f126b1da
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
32 additions
and
96 deletions
+32
-96
CMakeLists.txt
+5
-18
include/cif++/Cif++.hpp
+1
-1
include/cif++/CifUtils.hpp
+1
-9
include/cif++/Compound.hpp
+1
-1
include/cif++/Symmetry.hpp
+4
-4
src/BondMap.cpp
+0
-4
src/Cif++.cpp
+1
-1
src/CifUtils.cpp
+17
-24
src/Compound.cpp
+2
-6
src/PDB2Cif.cpp
+0
-4
src/PDB2CifRemark3.cpp
+0
-3
src/Secondary.cpp
+0
-4
src/Structure.cpp
+0
-4
src/Symmetry.cpp
+0
-4
src/TlsParser.cpp
+0
-4
test/pdb2cif-test.cpp
+0
-2
test/rename-compound-test.cpp
+0
-3
No files found.
CMakeLists.txt
View file @
1d2f997e
...
...
@@ -98,7 +98,7 @@ find_package(Boost 1.71.0 REQUIRED COMPONENTS system iostreams regex date_time p
find_package
(
ZLIB
)
find_package
(
BZip2
)
include_directories
(
${
Boost_INCLUDE_DIR
}
${
CMAKE_SOURCE_DIR
}
/include
)
include_directories
(
${
Boost_INCLUDE_DIR
}
)
link_libraries
(
${
Boost_LIBRARIES
}
${
CMAKE_THREAD_LIBS_INIT
}
)
# Create a revision file, containing the current git version info
...
...
@@ -106,15 +106,6 @@ link_libraries(${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
find_package
(
Git
)
if
(
GIT_FOUND AND EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
include
(
GetGitRevisionDescription
)
execute_process
(
COMMAND
${
GIT_EXECUTABLE
}
rev-parse --short HEAD OUTPUT_VARIABLE SHORT_SHA OUTPUT_STRIP_TRAILING_WHITESPACE
)
set
(
REVISION
${
SHORT_SHA
}
CACHE STRING
"git short sha"
FORCE
)
# only use the plugin to tie the configure state to the sha to force rebuilds
# of files that depend on version.h
include
(
GetGitRevisionDescription
)
get_git_head_revision
(
REFSPEC COMMITHASH
)
# Generate our own version string
...
...
@@ -128,6 +119,7 @@ endif()
# generate version.h
include_directories
(
${
CMAKE_BINARY_DIR
}
)
configure_file
(
"
${
CMAKE_SOURCE_DIR
}
/src/revision.hpp.in"
"
${
CMAKE_BINARY_DIR
}
/revision.hpp"
@ONLY
)
# Sources
set
(
project_sources
...
...
@@ -171,20 +163,18 @@ include_directories(
${
PROJECT_SOURCE_DIR
}
/src
)
add_library
(
cifpp_obj OBJECT
${
project_sources
}
${
project_headers
}
)
set_target_properties
(
cifpp_obj PROPERTIES POSITION_INDEPENDENT_CODE 1
)
add_library
(
cifpp SHARED $<TARGET_OBJECTS:cifpp_obj>
)
add_library
(
cifpp SHARED
${
project_sources
}
${
project_headers
}
)
set_target_properties
(
cifpp PROPERTIES
SOVERSION
${
PROJECT_VERSION
}
INTERFACE_cifpp_MAJOR_VERSION cifpp_MAJOR_VERSION
COMPATIBLE_INTERFACE_STRING cifpp_MAJOR_VERSION
)
add_library
(
cifpp_static STATIC $
<TARGET_OBJECTS:cifpp_obj>
)
add_library
(
cifpp_static STATIC
$
{
project_sources
}
${
project_headers
}
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
target_link_options
(
cifpp PRIVATE -undefined dynamic_lookup
)
target_link_options
(
cifpp_static PRIVATE -undefined dynamic_lookup
)
endif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
# download the components.cif file from CCD
...
...
@@ -224,8 +214,6 @@ include_directories(${Boost_INCLUDE_DIRS})
link_libraries
(
${
Boost_LIBRARIES
}
)
add_compile_definitions
(
CACHE_DIR=
"
${
SHARE_INSTALL_DIR
}
/libcifpp"
DATA_DIR=
"
${
SHARE_INSTALL_DIR
}
/libcifpp"
)
configure_file
(
${
PROJECT_SOURCE_DIR
}
/src/Config-cmake.hpp.in Config.hpp
)
generate_export_header
(
cifpp
)
# Install rules
...
...
@@ -237,7 +225,6 @@ install(TARGETS cifpp cifpp_static
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
INCLUDES DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
)
install
(
DIRECTORY include/cif++
DESTINATION include
...
...
include/cif++/Cif++.hpp
View file @
1d2f997e
...
...
@@ -106,7 +106,7 @@ namespace cif
{
// flag for verbose output
extern
CIFPP_DLL_IMPORT
(
int
)
VERBOSE
;
CIFPP_EXPORT
extern
int
VERBOSE
;
// mmCIF mapping
// A CIF data file in this case contains entries (data blocks) which can contain
...
...
include/cif++/CifUtils.hpp
View file @
1d2f997e
...
...
@@ -45,15 +45,7 @@
#include <unistd.h>
#endif
#ifdef _MSC_VER
#ifdef CIFPP_BUILD_DLL
#define CIFPP_DLL_IMPORT(type) __declspec(dllexport) type
#else
#define CIFPP_DLL_IMPORT(type) __declspec(dllimport) type
#endif
#else
#define CIFPP_DLL_IMPORT(type) type
#endif
#include "cifpp_export.h"
namespace
cif
{
...
...
include/cif++/Compound.hpp
View file @
1d2f997e
...
...
@@ -145,7 +145,7 @@ class Compound
// --------------------------------------------------------------------
// Factory class for Compound and Link objects
extern
CIFPP_DLL_IMPORT
(
const
)
std
::
map
<
std
::
string
,
char
>
kAAMap
,
kBaseMap
;
CIFPP_EXPORT
extern
const
std
::
map
<
std
::
string
,
char
>
kAAMap
,
kBaseMap
;
class
CompoundFactory
{
...
...
include/cif++/Symmetry.hpp
View file @
1d2f997e
...
...
@@ -45,8 +45,8 @@ struct Spacegroup
int
nr
;
};
extern
CIFPP_DLL_IMPORT
(
const
Spacegroup
)
kSpaceGroups
[];
extern
CIFPP_DLL_IMPORT
(
const
std
::
size_t
)
kNrOfSpaceGroups
;
CIFPP_EXPORT
extern
const
Spacegroup
kSpaceGroups
[];
CIFPP_EXPORT
extern
const
std
::
size_t
kNrOfSpaceGroups
;
// --------------------------------------------------------------------
...
...
@@ -128,8 +128,8 @@ struct SymopDataBlock
static_assert
(
sizeof
(
SymopDataBlock
)
==
sizeof
(
uint64_t
),
"Size of SymopData is wrong"
);
extern
CIFPP_DLL_IMPORT
(
const
SymopDataBlock
)
kSymopNrTable
[];
extern
CIFPP_DLL_IMPORT
(
const
std
::
size_t
)
kSymopNrTableSize
;
CIFPP_EXPORT
extern
const
SymopDataBlock
kSymopNrTable
[];
CIFPP_EXPORT
extern
const
std
::
size_t
kSymopNrTableSize
;
// --------------------------------------------------------------------
...
...
src/BondMap.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <fstream>
#include <algorithm>
#include <mutex>
...
...
src/Cif++.cpp
View file @
1d2f997e
...
...
@@ -54,7 +54,7 @@ namespace fs = std::filesystem;
namespace
cif
{
int
VERBOSE
=
0
;
CIFPP_EXPORT
int
VERBOSE
=
0
;
static
const
char
*
kEmptyResult
=
""
;
...
...
src/CifUtils.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <atomic>
#include <chrono>
#include <cmath>
...
...
@@ -224,18 +220,18 @@ std::string cifIdForNumber(int number)
if
(
number
>=
26
*
26
)
{
int
v
=
number
/
(
26
*
26
);
result
+=
'A'
-
1
+
v
;
result
+=
char
(
'A'
-
1
+
v
)
;
number
%=
(
26
*
26
);
}
if
(
number
>=
26
)
{
int
v
=
number
/
26
;
result
+=
'A'
-
1
+
v
;
result
+=
char
(
'A'
-
1
+
v
)
;
number
%=
26
;
}
result
+=
'A'
+
number
;
result
+=
char
(
'A'
+
number
)
;
}
assert
(
not
result
.
empty
());
...
...
@@ -705,21 +701,21 @@ namespace
uint64_t
s
=
static_cast
<
uint64_t
>
(
std
::
trunc
(
t
.
count
()));
if
(
s
>
24
*
60
*
60
)
{
uint32_t
days
=
s
/
(
24
*
60
*
60
);
auto
days
=
s
/
(
24
*
60
*
60
);
os
<<
days
<<
"d "
;
s
%=
24
*
60
*
60
;
}
if
(
s
>
60
*
60
)
{
uint32_t
hours
=
s
/
(
60
*
60
);
auto
hours
=
s
/
(
60
*
60
);
os
<<
hours
<<
"h "
;
s
%=
60
*
60
;
}
if
(
s
>
60
)
{
uint32_t
minutes
=
s
/
60
;
auto
minutes
=
s
/
60
;
os
<<
minutes
<<
"m "
;
s
%=
60
;
}
...
...
@@ -793,8 +789,6 @@ void Progress::message(const std::string &inMessage)
}
// namespace cif
#if USE_RSRC
// --------------------------------------------------------------------
//
// Try to find a named resource. Can be either a local file with this name,
...
...
@@ -1219,8 +1213,6 @@ class basic_istream : public std::basic_istream<CharT, Traits>
using
istream
=
basic_istream
<
char
,
std
::
char_traits
<
char
>>
;
}
// namespace mrsrc
#endif
// --------------------------------------------------------------------
namespace
cif
...
...
@@ -1248,18 +1240,21 @@ std::unique_ptr<std::istream> loadResource(std::filesystem::path name)
result
.
reset
(
file
.
release
());
}
#if defined(CACHE_DIR)
and defined(DATA_DIR)
#if defined(CACHE_DIR)
if
(
not
result
and
not
fs
::
exists
(
p
))
{
for
(
const
char
*
dir
:
{
CACHE_DIR
,
DATA_DIR
})
{
auto
p2
=
fs
::
path
(
dir
)
/
p
;
auto
p2
=
fs
::
path
(
CACHE_DIR
)
/
p
;
if
(
fs
::
exists
(
p2
))
{
swap
(
p
,
p2
);
break
;
}
}
#endif
#if defined(DATA_DIR)
if
(
not
result
and
not
fs
::
exists
(
p
))
{
auto
p2
=
fs
::
path
(
DATA_DIR
)
/
p
;
if
(
fs
::
exists
(
p2
))
swap
(
p
,
p2
);
}
#endif
...
...
@@ -1270,14 +1265,12 @@ std::unique_ptr<std::istream> loadResource(std::filesystem::path name)
result
.
reset
(
file
.
release
());
}
#if USE_RSRC
if
(
not
result
)
if
(
not
result
and
gResourceData
)
{
mrsrc
::
rsrc
rsrc
(
name
);
if
(
rsrc
)
result
.
reset
(
new
mrsrc
::
istream
(
rsrc
));
}
#endif
return
result
;
}
...
...
src/Compound.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <map>
#include <mutex>
#include <numeric>
...
...
@@ -230,7 +226,7 @@ bool Compound::atomsBonded(const std::string &atomId_1, const std::string &atomI
// --------------------------------------------------------------------
// a factory class to generate compounds
const
std
::
map
<
std
::
string
,
char
>
kAAMap
{
CIFPP_EXPORT
const
std
::
map
<
std
::
string
,
char
>
kAAMap
{
{
"ALA"
,
'A'
},
{
"ARG"
,
'R'
},
{
"ASN"
,
'N'
},
...
...
@@ -254,7 +250,7 @@ const std::map<std::string, char> kAAMap{
{
"GLX"
,
'Z'
},
{
"ASX"
,
'B'
}};
const
std
::
map
<
std
::
string
,
char
>
kBaseMap
{
CIFPP_EXPORT
const
std
::
map
<
std
::
string
,
char
>
kBaseMap
{
{
"A"
,
'A'
},
{
"C"
,
'C'
},
{
"G"
,
'G'
},
...
...
src/PDB2Cif.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <map>
#include <set>
#include <system_error>
...
...
src/PDB2CifRemark3.cpp
View file @
1d2f997e
...
...
@@ -24,9 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include "cif++/Cif++.hpp"
#include <map>
...
...
src/Secondary.cpp
View file @
1d2f997e
...
...
@@ -26,10 +26,6 @@
// Calculate DSSP-like secondary structure information
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <numeric>
#include <iomanip>
#include <thread>
...
...
src/Structure.cpp
View file @
1d2f997e
...
...
@@ -36,10 +36,6 @@
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include "cif++/Cif2PDB.hpp"
#include "cif++/CifParser.hpp"
#include "cif++/PDB2Cif.hpp"
...
...
src/Symmetry.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <atomic>
#include <mutex>
...
...
src/TlsParser.cpp
View file @
1d2f997e
...
...
@@ -24,10 +24,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if __has_include("Config.hpp")
#include "Config.hpp"
#endif
#include <boost/algorithm/string.hpp>
#include "cif++/TlsParser.hpp"
...
...
test/pdb2cif-test.cpp
View file @
1d2f997e
#include "Config.hpp"
#include "../include/cif++/Cif++.hpp"
#include "../include/cif++/PDB2Cif.hpp"
...
...
test/rename-compound-test.cpp
View file @
1d2f997e
#if __has_include("../src/Config.hpp")
#include "../src/Config.hpp"
#endif
#include "../include/cif++/Cif++.hpp"
#include "../include/cif++/PDB2Cif.hpp"
#include "../include/cif++/Structure.hpp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment