[Debian-med-packaging] Autodock-vina adapted to current libboost
Andreas Tille
andreas at an3as.eu
Mon Nov 28 12:24:06 UTC 2011
Hi Oleg,
please find below a patch for autodock-vina which fixes build problems
with current libboost in Debian. Hope this helps for inclusion into
your upstream distribution.
Kind regards
Andreas.
----- Forwarded message from Sebastian Ramacher <s.ramacher at gmx.at> -----
Date: Mon, 28 Nov 2011 12:04:40 +0100
From: Sebastian Ramacher <s.ramacher at gmx.at>
To: debian-mentors at lists.debian.org
Subject: Re: Help with libboost needed
On 11/28/2011 11:32 AM, Andreas Tille wrote:
> On Mon, Nov 28, 2011 at 10:25:53AM +0100, Sebastian Ramacher wrote:
>> There is a list of deprecated methods and their replacement at [1]. If that
>> doesn't help you can try to compile with -DBOOST_FILESYSTEM_VERSION=2 for now
>> [2, note at the top].
>
> thanks for the helpful hint. Before I try the workaround with
> BOOST_FILESYSTEM_VERSION=2 I'd like to try whether I could provide a proper
> fix. Thanks to your link to the deprecated classes I was able to work around
> the first problem[3]. However, a new one raised and this does not look that
> simple as the first one - at least not to me as a weak C++ coder. Any help
> with this:
>
> make[2]: Entering directory `/tmp/buildd/autodock-vina-1.1.2/build/linux/release'
> g++ -pthread -ansi -Wno-long-long -O3 -DNDEBUG -I /usr/include -I ../../../src/lib -o main.o -c ../../../src/main/main.cpp
> ../../../src/main/main.cpp: In function 'path make_path(const string&)':
> ../../../src/main/main.cpp:50:44: error: invalid conversion from 'bool (*)(const string&) {aka bool (*)(const std::basic_string<char>&)}' to 'boost::enable_if_c<true, void>::type* {aka void*}' [-fpermissive]
> /usr/include/boost/filesystem/v3/path.hpp:130:5: error: initializing argument 2 of 'boost::filesystem3::path::path(const Source&, typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type*) [with Source = std::basic_string<char>, typename boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename boost::decay<Source>::type> >::type = void]' [-fpermissive]
> make[2]: *** [main.o] Error 1
According to [1] the constructor path(string, name_check) is not supported
anymore. It's just path(string) now. Attached is a patch to fix this and all the
remaining issues (you now also need to link against boost_filesystem). The patch
includes also your changes from [3].
Kind regards,
>> [1] http://www.boost.org/doc/libs/1_48_0/libs/filesystem/v3/doc/deprecated.html
>> [2] http://www.boost.org/doc/libs/1_48_0/libs/filesystem/v3/doc/index.htm
>
> [3] svn://svn.debian.org/svn/debian-med/trunk/packages/autodock-vina/trunk/debian/patches/fix_boost.patch
--
Sebastian Ramacher
diff --git a/build/makefile_common b/build/makefile_common
index 8ebe06c..9eee80c 100644
--- a/build/makefile_common
+++ b/build/makefile_common
@@ -10,7 +10,7 @@ CC = ${GPP} ${C_PLATFORM} -ansi -Wno-long-long ${C_OPTIONS} $(INCFLAGS)
LDFLAGS = -L$(BASE)/lib -L.
-LIBS = -l boost_system${BOOST_LIB_VERSION} -l boost_thread${BOOST_LIB_VERSION} -l boost_program_options${BOOST_LIB_VERSION}#-l pthread
+LIBS = -l boost_system${BOOST_LIB_VERSION} -l boost_thread${BOOST_LIB_VERSION} -l boost_program_options${BOOST_LIB_VERSION} -lboost_filesystem${BOOST_LIB_VERSION} #-l pthread
.SUFFIXES: .cpp .o
diff --git a/src/main/main.cpp b/src/main/main.cpp
index f49c8f5..e088208 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -47,7 +47,7 @@
using boost::filesystem::path;
path make_path(const std::string& str) {
- return path(str, boost::filesystem::native);
+ return path(str);
}
void doing(int verbosity, const std::string& str, tee& log) {
@@ -661,7 +661,7 @@ Thank you!\n";
cpu, seed, verbosity, max_modes_sz, energy_range, log);
}
catch(file_error& e) {
- std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
+ std::cerr << "\n\nError: could not open \"" << e.name.string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
return 1;
}
catch(boost::filesystem::filesystem_error& e) {
@@ -673,7 +673,7 @@ Thank you!\n";
return 1;
}
catch(parse_error& e) {
- std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.string() << "\": " << e.reason << '\n';
return 1;
}
catch(std::bad_alloc&) {
diff --git a/src/split/split.cpp b/src/split/split.cpp
index 54c614b..de2e4ed 100644
--- a/src/split/split.cpp
+++ b/src/split/split.cpp
@@ -38,7 +38,7 @@
using boost::filesystem::path;
path make_path(const std::string& str) {
- return path(str, boost::filesystem::native);
+ return path(str);
}
std::string default_prefix(const std::string& input_name, const std::string& add) {
@@ -208,7 +208,7 @@ Thank you!\n";
write_multimodel_pdbqt(tmp, ligand_prefix, flex_prefix);
}
catch(file_error& e) {
- std::cerr << "\n\nError: could not open \"" << e.name.native_file_string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
+ std::cerr << "\n\nError: could not open \"" << e.name.string() << "\" for " << (e.in ? "reading" : "writing") << ".\n";
return 1;
}
catch(boost::filesystem::filesystem_error& e) {
@@ -220,7 +220,7 @@ Thank you!\n";
return 1;
}
catch(parse_error& e) {
- std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.native_file_string() << "\": " << e.reason << '\n';
+ std::cerr << "\n\nParse error on line " << e.line << " in file \"" << e.file.string() << "\": " << e.reason << '\n';
return 1;
}
catch(std::bad_alloc&) {
----- End forwarded message -----
--
http://fam-tille.de
More information about the Debian-med-packaging
mailing list