Commit f0980a7f by Maarten L. Hekkelman

start

parent c21ceab3
......@@ -62,6 +62,14 @@ CXXFLAGS += -O2
DEFINES += NDEBUG
endif
MRC = @MRC@
CIFPP_RSRC = @CIFPP_RSRC@
ifneq "$(MRC)" ""
DEFINES += USE_RSRC
endif
# targets
VPATH += src:test
......@@ -79,7 +87,14 @@ $(OBJDIR):
APPLICATION = @PACKAGE_NAME@
OBJECTS = $(APPLICATION:%=$(OBJDIR)/%.o)
ifneq "$(MRC)" ""
OBJECTS += $(APPLICATION:%=$(OBJDIR)/%_rsrc.o)
$(OBJDIR)/$(APPLICATION)_rsrc.o: $(CIFPP_RSRC)/dictionaries
$(MRC) -o $@ $^
endif
-include $(OBJECTS:%.o=%.d)
$(OBJECTS:.o=.d):
......
......@@ -625,6 +625,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
HAVE_DLADDR
LIBBZ2_LDFLAGS
LIBBZ2_CPPFLAGS
LIBZ_LDFLAGS
......@@ -635,6 +636,7 @@ CCP4
CXXCPP
LIBCIFPP_LDFLAGS
LIBCIFPP_CPPFLAGS
CIFPP_RSRC
BOOST_PROGRAM_OPTIONS_LIB
BOOST_REGEX_LIB
BOOST_THREAD_LIB
......@@ -660,6 +662,7 @@ build_os
build_vendor
build_cpu
build
MRC
PKG_CONFIG
DEBUG
INSTALL_DATA
......@@ -735,6 +738,7 @@ LIBS
CPPFLAGS
CCC
DEBUG
MRC
CC
CFLAGS
CPP
......@@ -1414,6 +1418,7 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
DEBUG Build a debug version of the application
MRC Specify a location for the mrc executable
CC C compiler command
CFLAGS C compiler flags
CPP C preprocessor
......@@ -3437,6 +3442,55 @@ fi
if test "x$MRC" = "x"; then
# Extract the first word of "mrc", so it can be a program name with args.
set dummy mrc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_MRC+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MRC in
[\\/]* | ?:[\\/]*)
ac_cv_path_MRC="$MRC" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_MRC="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
MRC=$ac_cv_path_MRC
if test -n "$MRC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MRC" >&5
$as_echo "$MRC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test "x$MRC" = "x"; then
as_fn_error $? "mrc not found, the application will be built without resources" "$LINENO" 5
fi
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
......@@ -6334,6 +6388,8 @@ if test "${with_cif__+set}" = set; then :
CXXFLAGS="$CXXFLAGS -I ${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/.libs"
LIBS="$LIBS -lcif++"
CIFPP_RSRC=${withval}/rsrc
fi
......@@ -6990,6 +7046,69 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr1" >&5
$as_echo_n "checking for library containing dladdr1... " >&6; }
if ${ac_cv_search_dladdr1+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dladdr1 ();
int
main ()
{
return dladdr1 ();
;
return 0;
}
_ACEOF
for ac_lib in '' dl; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_search_dladdr1=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_dladdr1+:} false; then :
break
fi
done
if ${ac_cv_search_dladdr1+:} false; then :
else
ac_cv_search_dladdr1=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr1" >&5
$as_echo "$ac_cv_search_dladdr1" >&6; }
ac_res=$ac_cv_search_dladdr1
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_DLADDR 1" >>confdefs.h
fi
ac_config_files="$ac_config_files GNUmakefile"
......
......@@ -16,6 +16,17 @@ AC_ARG_VAR([DEBUG], [Build a debug version of the application])
AC_PATH_PROG([PKG_CONFIG], [pkg-config])
AC_ARG_VAR([MRC], [Specify a location for the mrc executable])
dnl We really want to use mrc
if test "x$MRC" = "x"; then
AC_PATH_PROG([MRC], [mrc])
fi
if test "x$MRC" = "x"; then
AC_MSG_ERROR([mrc not found, the application will be built without resources])
fi
AX_PTHREAD
AX_BOOST_BASE([1.65.1], [], [AC_MSG_ERROR([Could not find a recent version of boost])])
......@@ -32,6 +43,7 @@ AC_ARG_WITH([cif++],
CXXFLAGS="$CXXFLAGS -I ${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/.libs"
LIBS="$LIBS -lcif++"
AC_SUBST([CIFPP_RSRC], [${withval}/rsrc])
])
......@@ -99,6 +111,13 @@ AX_CHECK_LIBRARY([LIBBZ2], [bzlib.h], [bz2],
[ LIBS="$LIBS -lbz2"],
[AC_MSG_ERROR([libbz2 not found - compressed files not supported])])
AC_SEARCH_LIBS([dladdr1], [dl],
[
AC_DEFINE([HAVE_DLADDR], 1, [Define if the system has dladdr])
], [], [])
AC_SUBST([HAVE_DLADDR])
dnl AC_MSG_CHECKING([clipper version])
dnl AC_COMPILE_IFELSE(
dnl [read_test(clipper-test.cpp)],
......
......@@ -9,6 +9,8 @@
#include <cif++/Config.h>
#include <cif++/Structure.h>
#include <cif++/Secondary.h>
#include <cif++/CifUtils.h>
#include <boost/program_options.hpp>
......@@ -33,6 +35,19 @@ void print_what (const std::exception& e)
// --------------------------------------------------------------------
void writeDSSP(const mmcif::Structure& structure, std::ostream& os)
{
mmcif::DSSP dssp(structure);
}
void annotateDSSP(const mmcif::Structure& structure, std::ostream& os)
{
}
// --------------------------------------------------------------------
int main(int argc, char* argv[])
{
using namespace std::literals;
......@@ -47,7 +62,13 @@ int main(int argc, char* argv[])
("help,h", "Display help message")
("version", "Print version")
("output-format", po::value<std::string>(), "Output format, can be either 'dssp' for classic DSSP or 'mmcif' for annotated mmCIF. The default is chosen based on the extension of the output file, if any.")
#if not USE_RSRC
("rsrc-dir", po::value<std::string>(), "Directory containing the 'resources' used by this application")
#endif
("verbose,v", "verbose output")
;
......@@ -88,10 +109,27 @@ int main(int argc, char* argv[])
exit(1);
}
if (vm.count("output-format") and vm["output-format"].as<std::string>() != "dsps" and vm["output-format"].as<std::string>() != "mmcif")
{
std::cerr << "Output format should be one of 'dssp' or 'mmcif'" << std::endl;
exit(1);
}
cif::VERBOSE = vm.count("verbose") != 0;
if (vm.count("debug"))
cif::VERBOSE = vm["debug"].as<int>();
// --------------------------------------------------------------------
#if USE_RSRC
cif::rsrc_loader::init();
#else
std::string rsrc_dir = ".";
cif::rsrc_loader::init({ { cif::rsrc_loader_type::file, rsrc_dir }});
#endif
// --------------------------------------------------------------------
if (vm.count("dict"))
{
for (auto dict: vm["dict"].as<std::vector<std::string>>())
......@@ -102,6 +140,8 @@ int main(int argc, char* argv[])
mmcif::Structure structure(f);
// --------------------------------------------------------------------
auto fmt = vm["output-format"].as<std::string>();
if (vm.count("output"))
{
......@@ -111,10 +151,19 @@ int main(int argc, char* argv[])
std::cerr << "Could not open output file" << std::endl;
exit(1);
}
// of << calculateZScores(structure, nShuffles);
if (fmt == "dssp")
writeDSSP(structure, of);
else
annotateDSSP(structure, of);
}
else
{
if (fmt == "dssp")
writeDSSP(structure, std::cout);
else
annotateDSSP(structure, std::cout);
}
// else
// cout << calculateZScores(structure, nShuffles) << endl;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment