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
9fe6e5df
Unverified
Commit
9fe6e5df
authored
Aug 14, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dependency on boost::program_options
parent
ce7434a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
67 deletions
+20
-67
CMakeLists.txt
+5
-6
test/pdb2cif-test.cpp
+6
-28
test/rename-compound-test.cpp
+0
-4
tools/symop-map-generator.cpp
+5
-29
tools/update-dictionary-script
+4
-0
No files found.
CMakeLists.txt
View file @
9fe6e5df
...
...
@@ -184,18 +184,17 @@ if(CIFPP_RECREATE_SYMOP_DATA)
# The tool to create the table
add_executable
(
symop-map-generator
"
${
CMAKE_SOURCE_DIR
}
/tools/symop-map-generator.cpp"
)
target_link_libraries
(
symop-map-generator Threads::Threads
Boost::regex Boost::program_options
${
CIFPP_REQUIRED_LIBRARIES
}
)
target_link_libraries
(
symop-map-generator Threads::Threads
${
CIFPP_REQUIRED_LIBRARIES
}
)
set
(
$ENV{CLIBD}
${
CLIBD
}
)
add_custom_command
(
OUTPUT
${
CMAKE_SOURCE_DIR
}
/src/SymOpTable_data.hpp
COMMAND $<TARGET_FILE:symop-map-generator>
${
CLIBD
}
/syminfo.lib
${
CMAKE_SOURCE_DIR
}
/src/SymOpTable_data.hpp
OUTPUT
${
CMAKE_SOURCE_DIR
}
/src/
structure/
SymOpTable_data.hpp
COMMAND $<TARGET_FILE:symop-map-generator>
${
CLIBD
}
/syminfo.lib
${
CMAKE_SOURCE_DIR
}
/src/
structure/
SymOpTable_data.hpp
)
add_custom_target
(
OUTPUT
${
CMAKE_SOURCE_DIR
}
/src/SymOpTable_data.hpp
OUTPUT
${
CMAKE_SOURCE_DIR
}
/src/
structure/
SymOpTable_data.hpp
DEPENDS symop-map-generator
"$ENV{CLIBD}/syminfo.lib"
)
endif
()
...
...
@@ -418,7 +417,7 @@ if(CIFPP_BUILD_TESTS)
list
(
APPEND CIFPP_tests
#
pdb2cif
pdb2cif
# rename-compound
# structure
# sugar
...
...
test/pdb2cif-test.cpp
View file @
9fe6e5df
#include "../include/cif++/
Cif++
.hpp"
#include "../include/cif++/
PDB2Cif.hpp
"
#include "../include/cif++/
cif
.hpp"
#include "../include/cif++/
pdb/PDB2Cif.hpp"
"
#include <iostream>
#include <fstream>
#include <boost/program_options.hpp>
// #include "pdb2cif.h"
namespace
po
=
boost
::
program_options
;
int
main
(
int
argc
,
char
*
argv
[])
{
using
namespace
std
::
literals
;
po
::
options_description
desc
(
"pdb2cif-test options"
);
desc
.
add_options
()
(
"input,i"
,
po
::
value
<
std
::
string
>
(),
"Input file"
)
(
"help,h"
,
"Display help message"
)
(
"verbose,v"
,
"Verbose output"
)
(
"debug,d"
,
po
::
value
<
int
>
(),
"Debug level (for even more verbose output)"
);
po
::
positional_options_description
p
;
p
.
add
(
"input"
,
1
);
po
::
variables_map
vm
;
po
::
store
(
po
::
command_line_parser
(
argc
,
argv
).
options
(
desc
).
positional
(
p
).
run
(),
vm
);
po
::
notify
(
vm
);
if
(
vm
.
count
(
"help"
)
or
vm
.
count
(
"input"
)
==
0
)
if
(
argc
!=
2
)
{
std
::
cerr
<<
desc
<<
std
::
endl
;
std
::
cerr
<<
"Usage: pdb2cif-test <input-file>"
<<
std
::
endl
;
exit
(
1
);
}
cif
::
VERBOSE
=
vm
.
count
(
"verbose"
)
!=
0
;
if
(
vm
.
count
(
"debug"
))
cif
::
VERBOSE
=
vm
[
"debug"
].
as
<
int
>
();
std
::
ifstream
is
(
vm
[
"input"
].
as
<
std
::
string
>
()
);
std
::
ifstream
is
(
argv
[
1
]
);
if
(
not
is
.
is_open
())
throw
std
::
runtime_error
(
"Could not open file "
+
vm
[
"input"
].
as
<
std
::
string
>
()
);
throw
std
::
runtime_error
(
"Could not open file "
s
+
argv
[
1
]
);
cif
::
File
f
;
ReadPDBFile
(
is
,
f
);
...
...
test/rename-compound-test.cpp
View file @
9fe6e5df
...
...
@@ -5,10 +5,6 @@
#include <iostream>
#include <fstream>
#include <boost/program_options.hpp>
namespace
po
=
boost
::
program_options
;
int
main
(
int
argc
,
char
*
argv
[])
{
cif
::
VERBOSE
=
3
;
...
...
tools/symop-map-generator.cpp
View file @
9fe6e5df
...
...
@@ -34,12 +34,9 @@
#include <map>
#include <filesystem>
#include <boost/program_options.hpp>
#include <cstdlib>
namespace
fs
=
std
::
filesystem
;
namespace
po
=
boost
::
program_options
;
std
::
regex
kNameRx
(
R"(^(\d+) +(\d+) +(\d+) +(\S+) +(\S+) +(\S+) +'([^']+)'( +'([^']+)')?(?: +!.+)?$)"
);
...
...
@@ -233,35 +230,14 @@ int main(int argc, char* const argv[])
try
{
po
::
options_description
visible_options
(
"symop-map-generator symlib-file output-file"
);
visible_options
.
add_options
()
(
"help,h"
,
"Display help message"
)
(
"verbose,v"
,
"Verbose output"
)
;
po
::
options_description
hidden_options
(
"hidden options"
);
hidden_options
.
add_options
()
(
"input,i"
,
po
::
value
<
std
::
string
>
(),
"Input file"
)
(
"output,o"
,
po
::
value
<
std
::
string
>
(),
"Output file"
);
po
::
options_description
cmdline_options
;
cmdline_options
.
add
(
visible_options
).
add
(
hidden_options
);
po
::
positional_options_description
p
;
p
.
add
(
"input"
,
1
);
p
.
add
(
"output"
,
1
);
po
::
variables_map
vm
;
po
::
store
(
po
::
command_line_parser
(
argc
,
argv
).
options
(
cmdline_options
).
positional
(
p
).
run
(),
vm
);
po
::
notify
(
vm
);
if
(
vm
.
count
(
"input"
)
==
0
or
vm
.
count
(
"output"
)
==
0
or
vm
.
count
(
"help"
))
if
(
argc
!=
3
)
{
std
::
cerr
<<
visible_options
<<
std
::
endl
;
exit
(
vm
.
count
(
"help"
)
==
0
);
std
::
cerr
<<
"Usage symop-map-generator <input-file> <output-file>"
<<
std
::
endl
;
exit
(
1
);
}
fs
::
path
input
(
vm
[
"input"
].
as
<
std
::
string
>
()
);
fs
::
path
output
(
vm
[
"output"
].
as
<
std
::
string
>
()
);
fs
::
path
input
(
argv
[
1
]
);
fs
::
path
output
(
argv
[
2
]
);
tmpFile
=
output
.
parent_path
()
/
(
output
.
filename
().
string
()
+
".tmp"
);
...
...
tools/update-dictionary-script
View file @
9fe6e5df
...
...
@@ -45,3 +45,7 @@ fetch_dictionary () {
fetch_dictionary
"/var/cache/libcifpp/mmcif_pdbx_v50.dic"
"https://mmcif.wwpdb.org/dictionaries/ascii/mmcif_pdbx_v50.dic.gz"
fetch_dictionary
"/var/cache/libcifpp/components.cif"
"ftp://ftp.wwpdb.org/pub/pdb/data/monomers/components.cif.gz"
# this one is not compressed
wget
-O
/var/cache/libcifpp/mmcif_ma.dic
"https://github.com/ihmwg/ModelCIF/raw/master/dist/mmcif_ma.dic"
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