Commit c21ceab3 by Maarten L. Hekkelman

start

parent a3e1301a
...@@ -14,3 +14,4 @@ GNUmakefile ...@@ -14,3 +14,4 @@ GNUmakefile
config.status config.status
config.log config.log
aclocal.m4 aclocal.m4
dssp
...@@ -16,11 +16,12 @@ firstTarget: all ...@@ -16,11 +16,12 @@ firstTarget: all
CXX = @CXX@ CXX = @CXX@
CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @BOOST_CPPFLAGS@ @PTHREAD_CFLAGS@ CXXFLAGS = @CXXFLAGS@ @CPPFLAGS@ @BOOST_CPPFLAGS@ @PTHREAD_CFLAGS@
LDFLAGS = @LDFLAGS@ @BOOST_LDFLAGS@ @PTHREAD_CFLAGS@ LDFLAGS = @LDFLAGS@ @BOOST_LDFLAGS@ @PTHREAD_CFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@ \
@BOOST_IOSTREAMS_LIB@ \
BOOST_LIBS = program_options @BOOST_THREAD_LIB@ \
@BOOST_REGEX_LIB@ \
LIBS += $(BOOST_LIBS:%=-lboost_%) @BOOST_PROGRAM_OPTIONS_LIB@ \
-lboost_timer -lboost_chrono
prefix = @prefix@ prefix = @prefix@
exec_prefix = @exec_prefix@ exec_prefix = @exec_prefix@
...@@ -49,6 +50,9 @@ endif ...@@ -49,6 +50,9 @@ endif
# Use the DEBUG flag to build debug versions of the code # Use the DEBUG flag to build debug versions of the code
DEBUG = @DEBUG@ DEBUG = @DEBUG@
VERSION = @PACKAGE_VERSION@
DEFINES += VERSION='"$(VERSION)"'
ifeq "$(DEBUG)" "1" ifeq "$(DEBUG)" "1"
DEFINES += DEBUG DEFINES += DEBUG
CXXFLAGS += -g -O0 CXXFLAGS += -g -O0
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,7 @@ AC_INIT([dssp], 3.0, [m.hekkelman@nki.nl]) ...@@ -2,7 +2,7 @@ AC_INIT([dssp], 3.0, [m.hekkelman@nki.nl])
dnl Switch to a C++ compiler, and check if it works. dnl Switch to a C++ compiler, and check if it works.
AC_LANG(C++) AC_LANG(C++)
AX_CXX_COMPILE_STDCXX_17([noext]) AX_CXX_COMPILE_STDCXX_14([noext])
AC_CONFIG_SRCDIR([src/dssp.cpp]) AC_CONFIG_SRCDIR([src/dssp.cpp])
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
...@@ -19,6 +19,10 @@ AC_PATH_PROG([PKG_CONFIG], [pkg-config]) ...@@ -19,6 +19,10 @@ AC_PATH_PROG([PKG_CONFIG], [pkg-config])
AX_PTHREAD AX_PTHREAD
AX_BOOST_BASE([1.65.1], [], [AC_MSG_ERROR([Could not find a recent version of boost])]) AX_BOOST_BASE([1.65.1], [], [AC_MSG_ERROR([Could not find a recent version of boost])])
AX_BOOST_IOSTREAMS
AX_BOOST_THREAD
AX_BOOST_REGEX
AX_BOOST_PROGRAM_OPTIONS
AC_ARG_WITH([cif++], AC_ARG_WITH([cif++],
AS_HELP_STRING([--with-cif++=@<:@location@:>@], AS_HELP_STRING([--with-cif++=@<:@location@:>@],
...@@ -27,11 +31,88 @@ AC_ARG_WITH([cif++], ...@@ -27,11 +31,88 @@ AC_ARG_WITH([cif++],
CPPFLAGS="$CPPFLAGS -I ${withval}/include" CPPFLAGS="$CPPFLAGS -I ${withval}/include"
CXXFLAGS="$CXXFLAGS -I ${withval}/include" CXXFLAGS="$CXXFLAGS -I ${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/.libs" LDFLAGS="$LDFLAGS -L${withval}/.libs"
LIBS="$LIBS -lcif++"
]) ])
AX_CHECK_LIBRARY([LIBCIFPP], [cif++/Config.h], [cif++], AX_CHECK_LIBRARY([LIBCIFPP], [cif++/Config.h], [cif++],
[], [],
[AC_MSG_ERROR([libcif++ not found - cannot continue])]) [AC_MSG_ERROR([libcif++ not found - cannot continue])])
AC_ARG_VAR([CCP4], [The location where CCP4 is installed])
AS_IF([test x"$CCP4" != x""],
[
CPPFLAGS="$CPPFLAGS -I ${CCP4}/include"
CXXFLAGS="$CXXFLAGS -I ${CCP4}/include"
LDFLAGS="$LDFLAGS -L${CCP4}/lib -Wl,-rpath=${CCP4}/lib"
])
AC_ARG_WITH([clipper],
AS_HELP_STRING([--with-clipper=@<:@location@:>@],
[Use the clipper library as specified.
@<:@location=$CCP4@:>@]),
[
CPPFLAGS="$CPPFLAGS -I ${withval}/include"
CXXFLAGS="$CXXFLAGS -I ${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/lib"
LIBS="$LIBS -lclipper-ccp4 -lclipper-minimol -lclipper-mmdb -lclipper-cns -lclipper-phs -lclipper-contrib -lclipper-core"
])
AC_CHECK_HEADER(
[clipper/clipper.h],
[],
[AC_MSG_ERROR([
Can't find the main clipper include file clipper/clipper.h. Please
specify either the CCP4 location of the location of the installed
clipper using --with-clipper=<path>
])])
AX_CHECK_LIBRARY([LIBCLIPPER], [clipper/clipper.h], [clipper-core],
[],
[AC_MSG_ERROR([libclipper not found - cannot continue])])
AC_ARG_WITH([newuoa],
AS_HELP_STRING([--with-newuoa=@<:@location@:>@],
[Use the newuoa library as specified.]),
[
CPPFLAGS="$CPPFLAGS -I ${withval}/include"
CXXFLAGS="$CXXFLAGS -I ${withval}/include"
LDFLAGS="$LDFLAGS -L${withval}/lib"
LIBS="$LIBS -lnewuoa"
])
AC_CHECK_HEADER(
[newuoa.h],
[],
[AC_MSG_ERROR([
Can't find the newuoa include file newuoa.h. Please install this
library and specify its location with --with-newuoa=<path>.
You can find newuoa at https://github.com/elsid/newuoa-cpp.git
])])
AX_CHECK_LIBRARY([LIBZ], [zlib.h], [z],
[ LIBS="$LIBS -lz" ],
[AC_MSG_ERROR([libz not found - compressed files not supported])])
AX_CHECK_LIBRARY([LIBBZ2], [bzlib.h], [bz2],
[ LIBS="$LIBS -lbz2"],
[AC_MSG_ERROR([libbz2 not found - compressed files not supported])])
dnl AC_MSG_CHECKING([clipper version])
dnl AC_COMPILE_IFELSE(
dnl [read_test(clipper-test.cpp)],
dnl [],
dnl [AC_MSG_ERROR([The version of clipper is not up to date])])
dnl
dnl AC_CHECK_HEADER(
dnl [newuoa.h],
dnl [],
dnl [AC_MSG_ERROR([
dnl Can't find the newuoa include file newuoa.h. Please install this
dnl library and specify its location with --with-newuoa=<path>.
dnl You can find newuoa at https://github.com/elsid/newuoa-cpp.git
dnl ])])
dnl Process Makefile.in to create Makefile dnl Process Makefile.in to create Makefile
AC_OUTPUT([GNUmakefile]) AC_OUTPUT([GNUmakefile])
// Copyright Maarten L. Hekkelman 2020
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <exception>
#include <iostream>
#include <fstream>
#include <cif++/Config.h>
#include <cif++/Structure.h>
#include <boost/program_options.hpp>
namespace po = boost::program_options;
// --------------------------------------------------------------------
// recursively print exception whats:
void print_what (const std::exception& e)
{
std::cerr << e.what() << std::endl;
try
{
std::rethrow_if_nested(e);
}
catch (const std::exception& nested)
{
std::cerr << " >> ";
print_what(nested);
}
}
// --------------------------------------------------------------------
int main(int argc, char* argv[])
{
using namespace std::literals;
po::options_description visible_options(argv[0] + " input-file [output-file] [options]"s);
visible_options.add_options()
("xyzin", po::value<std::string>(), "coordinates file")
("output", po::value<std::string>(), "Output to this file")
("dict", po::value<std::vector<std::string>>(),
"Dictionary file containing restraints for residues in this specific target, can be specified multiple times.")
("help,h", "Display help message")
("version", "Print version")
("verbose,v", "verbose output")
;
po::options_description hidden_options("hidden options");
hidden_options.add_options()
("debug,d", po::value<int>(), "Debug level (for even more verbose output)")
;
po::options_description cmdline_options;
cmdline_options.add(visible_options).add(hidden_options);
po::positional_options_description p;
p.add("xyzin", 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("version"))
{
std::cout << argv[0] << " version " << VERSION << std::endl;
exit(0);
}
if (vm.count("help"))
{
std::cerr << visible_options << std::endl;
exit(0);
}
if (vm.count("xyzin") == 0)
{
std::cerr << "Input file not specified" << std::endl;
exit(1);
}
cif::VERBOSE = vm.count("verbose") != 0;
if (vm.count("debug"))
cif::VERBOSE = vm["debug"].as<int>();
if (vm.count("dict"))
{
for (auto dict: vm["dict"].as<std::vector<std::string>>())
mmcif::CompoundFactory::instance().pushDictionary(dict);
}
mmcif::File f(vm["xyzin"].as<std::string>());
mmcif::Structure structure(f);
// --------------------------------------------------------------------
if (vm.count("output"))
{
std::ofstream of(vm["output"].as<std::string>());
if (not of.is_open())
{
std::cerr << "Could not open output file" << std::endl;
exit(1);
}
// of << calculateZScores(structure, nShuffles);
}
// 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