Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
84861ca3
Commit
84861ca3
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
switch to boost program_options library. windows doesn't have getopt
parent
4c7b2b39
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
modules/mol/alg/src/CMakeLists.txt
+2
-1
2 additions, 1 deletion
modules/mol/alg/src/CMakeLists.txt
modules/mol/alg/src/ldt.cc
+37
-31
37 additions, 31 deletions
modules/mol/alg/src/ldt.cc
with
41 additions
and
32 deletions
CMakeLists.txt
+
2
−
0
View file @
84861ca3
...
@@ -206,9 +206,11 @@ find_package(Boost ${_BOOST_MIN_VERSION} COMPONENTS iostreams REQUIRED)
...
@@ -206,9 +206,11 @@ find_package(Boost ${_BOOST_MIN_VERSION} COMPONENTS iostreams REQUIRED)
set
(
BOOST_IOSTREAM_LIBRARIES
${
Boost_LIBRARIES
}
)
set
(
BOOST_IOSTREAM_LIBRARIES
${
Boost_LIBRARIES
}
)
set
(
Boost_LIBRARIES
)
set
(
Boost_LIBRARIES
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS program_options REQUIRED
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS program_options REQUIRED
)
set
(
BOOST_PROGRAM_OPTIONS
${
Boost_LIBRARIES
}
)
set
(
Boost_LIBRARIES
)
set
(
Boost_LIBRARIES
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS regex REQUIRED
)
find_package
(
Boost
${
_BOOST_MIN_VERSION
}
COMPONENTS regex REQUIRED
)
set
(
BOOST_REGEX_LIBRARIES
${
Boost_LIBRARIES
}
)
set
(
BOOST_REGEX_LIBRARIES
${
Boost_LIBRARIES
}
)
set
(
Boost_LIBRARIES
)
find_package
(
Qt4 4.5.0 REQUIRED
)
find_package
(
Qt4 4.5.0 REQUIRED
)
...
...
This diff is collapsed.
Click to expand it.
modules/mol/alg/src/CMakeLists.txt
+
2
−
1
View file @
84861ca3
...
@@ -37,7 +37,8 @@ executable(NAME ldt SOURCES ldt.cc
...
@@ -37,7 +37,8 @@ executable(NAME ldt SOURCES ldt.cc
module
(
NAME mol_alg SOURCES
${
OST_MOL_ALG_SOURCES
}
module
(
NAME mol_alg SOURCES
${
OST_MOL_ALG_SOURCES
}
HEADERS
${
OST_MOL_ALG_HEADERS
}
HEADERS
${
OST_MOL_ALG_HEADERS
}
HEADER_OUTPUT_DIR ost/mol/alg
HEADER_OUTPUT_DIR ost/mol/alg
DEPENDS_ON
${
MOL_ALG_DEPS
}
)
DEPENDS_ON
${
MOL_ALG_DEPS
}
LINK
${
BOOST_PROGRAM_OPTIONS
}
)
copy_if_different
(
"."
"
${
STAGE_DIR
}
/share/openstructure"
copy_if_different
(
"."
"
${
STAGE_DIR
}
/share/openstructure"
"atom_scattering_properties.txt"
"ATOM_SCATTERING_PROPS"
"atom_scattering_properties.txt"
"ATOM_SCATTERING_PROPS"
...
...
This diff is collapsed.
Click to expand it.
modules/mol/alg/src/ldt.cc
+
37
−
31
View file @
84861ca3
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
// along with this library; if not, write to the Free Software Foundation, Inc.,
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include
<boost/program_options.hpp>
#include
<ost/mol/alg/local_dist_test.hh>
#include
<ost/mol/alg/local_dist_test.hh>
#include
<ost/mol/alg/filter_clashes.hh>
#include
<ost/mol/alg/filter_clashes.hh>
#include
<ost/io/mol/pdb_reader.hh>
#include
<ost/io/mol/pdb_reader.hh>
...
@@ -24,6 +25,7 @@
...
@@ -24,6 +25,7 @@
using
namespace
ost
;
using
namespace
ost
;
using
namespace
ost
::
io
;
using
namespace
ost
::
io
;
using
namespace
ost
::
mol
;
using
namespace
ost
::
mol
;
namespace
po
=
boost
::
program_options
;
EntityHandle
load
(
const
String
&
file
,
const
IOProfile
&
profile
)
EntityHandle
load
(
const
String
&
file
,
const
IOProfile
&
profile
)
{
{
...
@@ -54,48 +56,52 @@ void usage()
...
@@ -54,48 +56,52 @@ void usage()
std
::
cerr
<<
" -t fault tolerant parsing"
<<
std
::
endl
;
std
::
cerr
<<
" -t fault tolerant parsing"
<<
std
::
endl
;
}
}
int
main
(
int
argc
,
char
*
const
*
argv
)
int
main
(
int
argc
,
char
*
*
argv
)
{
{
IOProfile
profile
;
IOProfile
profile
;
// parse options
// parse options
String
sel
;
String
sel
;
bool
filter_clashes
=
false
;
bool
filter_clashes
=
false
;
char
ch
=
0
;
po
::
options_description
desc
(
"Options"
);
while
((
ch
=
getopt
(
argc
,
argv
,
"ftcs:"
))
!=-
1
)
{
desc
.
add_options
()
switch
(
ch
)
{
(
"calpha,c"
,
"consider only calpha atoms"
)
case
'c'
:
(
"sel,s"
,
po
::
value
<
String
>
(
&
sel
)
->
default_value
(
""
),
"selection for reference"
)
profile
.
calpha_only
=
true
;
(
"tolerant,t"
,
"fault tolerant mode"
)
break
;
(
"filter-clashes,f"
,
"filter clashes"
)
case
't'
:
(
"files"
,
po
::
value
<
std
::
vector
<
String
>
>
(),
"input file"
)
profile
.
fault_tolerant
=
true
;
;
break
;
po
::
positional_options_description
p
;
case
'f'
:
p
.
add
(
"files"
,
-
1
);
filter_clashes
=
true
;
po
::
variables_map
vm
;
break
;
po
::
store
(
po
::
command_line_parser
(
argc
,
argv
).
case
's'
:
options
(
desc
).
positional
(
p
).
run
(),
sel
=
optarg
;
vm
);
break
;
po
::
notify
(
vm
);
case
'?'
:
if
(
vm
.
count
(
"calpha"
))
{
default:
profile
.
calpha_only
=
true
;
usage
();
}
return
-
1
;
if
(
vm
.
count
(
"filter-clashes"
))
{
}
filter_clashes
=
true
;
}
if
(
vm
.
count
(
"tolerant"
))
{
profile
.
fault_tolerant
=
true
;
}
}
argc
-=
optind
;
std
::
vector
<
String
>
files
;
argv
+=
optind
;
if
(
vm
.
count
(
"files"
))
{
if
(
argc
<
2
)
{
files
=
vm
[
"files"
].
as
<
std
::
vector
<
String
>
>
();
}
else
{
usage
();
usage
();
return
-
1
;
exit
(
-
1
);
}
}
String
ref_file
=
files
.
back
();
String
ref_file
=
argv
[
argc
-
1
];
EntityHandle
ref
=
load
(
ref_file
,
profile
);
EntityHandle
ref
=
load
(
ref_file
,
profile
);
if
(
!
ref
)
{
if
(
!
ref
)
{
return
-
1
;
return
-
1
;
}
}
files
.
pop_back
();
EntityView
ref_view
=
ref
.
Select
(
sel
);
EntityView
ref_view
=
ref
.
Select
(
sel
);
for
(
in
t
i
=
0
;
i
<
argc
-
1
;
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
files
.
size
()
;
++
i
)
{
EntityHandle
model
=
load
(
argv
[
i
],
profile
);
EntityHandle
model
=
load
(
files
[
i
],
profile
);
if
(
!
model
)
{
if
(
!
model
)
{
if
(
!
profile
.
fault_tolerant
)
{
if
(
!
profile
.
fault_tolerant
)
{
return
-
1
;
return
-
1
;
...
@@ -112,7 +118,7 @@ int main (int argc, char* const *argv)
...
@@ -112,7 +118,7 @@ int main (int argc, char* const *argv)
ldt
+=
alg
::
LocalDistTest
(
v
,
ref_view
,
cutoffs
[
n
],
8.0
);
ldt
+=
alg
::
LocalDistTest
(
v
,
ref_view
,
cutoffs
[
n
],
8.0
);
}
}
ldt
/=
4.0
;
ldt
/=
4.0
;
std
::
cout
<<
argv
[
i
]
<<
" "
<<
ldt
<<
std
::
endl
;
std
::
cout
<<
files
[
i
]
<<
" "
<<
ldt
<<
std
::
endl
;
}
}
return
0
;
return
0
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment