diff --git a/build_configs/buildconfig_arch_clang b/build_configs/buildconfig_arch_clang deleted file mode 100644 index b77971c56aca6baa9ac12ce82dfa4e6344c309bf..0000000000000000000000000000000000000000 --- a/build_configs/buildconfig_arch_clang +++ /dev/null @@ -1,10 +0,0 @@ -set(PYTHON_BINARY "/usr/bin/python2" CACHE PATH "") -set(CMAKE_C_COMPILER "/usr/bin/clang" CACHE PATH "") -set(CMAKE_CXX_COMPILER "/usr/bin/clang++" CACHE PATH "") -set(CMAKE_AR "/usr/bin/llvm-ar" CACHE PATH "") -set(CMAKE_LINKER "/usr/bin/llvm-ld" CACHE PATH "") -set(CMAKE_NM "/usr/bin/llvm-inm" CACHE PATH "") -set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump" CACHE PATH "") -set(CMAKE_RANLIB "/usr/bin/llvm-ranlib" CACHE PATH "") -set(CMAKE_CXX_FLAGS_RELEASE "-Wno-array-bounds -pthread -O3 -DNDEBUG -Wno-parentheses -Wno-constant-logical-operand -fcolor-diagnostics" CACHE STRING "") -set(CMAKE_CXX_FLAGS_DEBUG "-Wno-array-bounds -g -pthread -Wno-parentheses -Wno-constant-logical-operand -fcolor-diagnostics" CACHE STRING "") diff --git a/modules/base/src/CMakeLists.txt b/modules/base/src/CMakeLists.txt index 6bc47461f8c012949e77afe150d9f996caca1730..e6691bc1de9af1dccafbaebad7b6b399b0fa81e4 100644 --- a/modules/base/src/CMakeLists.txt +++ b/modules/base/src/CMakeLists.txt @@ -8,6 +8,7 @@ string_ref.cc platform.cc message.cc test_utils/compare_files.cc +boost_filesystem_helper.cc ) set(OST_BASE_HEADERS @@ -30,6 +31,7 @@ string_ref.hh pod_vector.hh fixed_string.hh tri_matrix.hh +boost_filesystem_helper.hh ) set(OST_EXPORT_HELPERS diff --git a/modules/base/src/boost_filesystem_helper.cc b/modules/base/src/boost_filesystem_helper.cc new file mode 100644 index 0000000000000000000000000000000000000000..b235b0498dbb26fee19814e41692d254c2304f87 --- /dev/null +++ b/modules/base/src/boost_filesystem_helper.cc @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// This file is part of the OpenStructure project <www.openstructure.org> +// +// Copyright (C) 2008-2011 by the OpenStructure authors +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License as published by the Free +// Software Foundation; either version 3.0 of the License, or (at your option) +// any later version. +// This library is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +// details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this library; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +//------------------------------------------------------------------------------ +/* + Author: Valerio Mariani +*/ + diff --git a/modules/base/src/boost_filesystem_helper.hh b/modules/base/src/boost_filesystem_helper.hh new file mode 100644 index 0000000000000000000000000000000000000000..5418253fd7553f7f715e8259d1f6f08615080ca1 --- /dev/null +++ b/modules/base/src/boost_filesystem_helper.hh @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// This file is part of the OpenStructure project <www.openstructure.org> +// +// Copyright (C) 2008-2011 by the OpenStructure authors +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License as published by the Free +// Software Foundation; either version 3.0 of the License, or (at your option) +// any later version. +// This library is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +// details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this library; if not, write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +//------------------------------------------------------------------------------ +/* + Author: Valerio Mariani +*/ + +#ifndef OST_BOOST_FILESYSTEM_HELPER_HH +#define OST_BOOST_FILESYSTEM_HELPER_HH + +#include <boost/filesystem/path.hpp> + +namespace { + +inline +String BFPathToString(const boost::filesystem::path& path) +{ +#if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 + return path.string(); +#else + return path.file_string(); +#endif +} + +} + + + +#endif // OST_BOOST_FILESYSTEM_HELPER diff --git a/modules/io/src/mol/entity_io_crd_handler.cc b/modules/io/src/mol/entity_io_crd_handler.cc index 0f08c72e08ab95460e5552770706bd3c54d3a002..d27feab99e3a5441eaf98b2f12c84f9e3d565bea 100644 --- a/modules/io/src/mol/entity_io_crd_handler.cc +++ b/modules/io/src/mol/entity_io_crd_handler.cc @@ -33,6 +33,7 @@ #include <ost/conop/conop.hh> #include <ost/mol/xcs_editor.hh> #include <ost/profile.hh> +#include <ost/boost_filesystem_helper.hh> #include <ost/io/io_exception.hh> #include <ost/io/swap_util.hh> @@ -244,11 +245,7 @@ CRDWriter::CRDWriter(std::ostream& ostream, bool ext) : {} CRDWriter::CRDWriter(const boost::filesystem::path& filename, bool ext) : -#if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - outfile_(filename.string().c_str()), -#else - outfile_(filename.file_string().c_str()), -#endif + outfile_(BFPathToString(filename).c_str()), outstream_(outfile_), ext_(ext), atom_count_(0), res_count_(0) {} diff --git a/modules/io/src/mol/pdb_writer.cc b/modules/io/src/mol/pdb_writer.cc index 28c18cd36732b6296d52b108b4f670f74f34639e..3df6a4917db7901bbc4cb246d8346cd3f7c25f19 100644 --- a/modules/io/src/mol/pdb_writer.cc +++ b/modules/io/src/mol/pdb_writer.cc @@ -28,6 +28,8 @@ #include <boost/filesystem/convenience.hpp> #include <boost/algorithm/string.hpp> +#include <ost/base.hh> +#include <ost/boost_filesystem_helper.hh> #include <ost/io/io_exception.hh> #include <ost/mol/atom_handle.hh> #include <ost/mol/residue_handle.hh> @@ -349,11 +351,7 @@ PDBWriter::PDBWriter(std::ostream& stream, const IOProfile& profile): PDBWriter::PDBWriter(const boost::filesystem::path& filename, const IOProfile& profile): -#if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - outfile_(filename.string().c_str()), outstream_(outfile_), -#else - outfile_(filename.file_string().c_str()), outstream_(outfile_), -#endif + outfile_(BFPathToString(filename).c_str()), outstream_(outfile_), mol_count_(0), line_(80), multi_model_(false), charmm_style_(profile.dialect=="CHARMM"), is_pqr_(false), profile_(profile), filename_("") diff --git a/modules/io/src/mol/sdf_writer.cc b/modules/io/src/mol/sdf_writer.cc index 973224e48aff879b099aacd5fbd0f85002071b1b..45bc1867a1d6083601189c2c149ff75c9eaebf64 100644 --- a/modules/io/src/mol/sdf_writer.cc +++ b/modules/io/src/mol/sdf_writer.cc @@ -22,6 +22,7 @@ #include "sdf_writer.hh" +#include <ost/boost_filesystem_helper.hh> #include <ost/mol/atom_view.hh> #include <ost/mol/residue_view.hh> #include <ost/mol/chain_view.hh> @@ -140,11 +141,7 @@ SDFWriter::SDFWriter(const String& filename) } SDFWriter::SDFWriter(const boost::filesystem::path& filename): -#if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - outfile_(filename.string().c_str()), -#else - outfile_(filename.file_string().c_str()), -#endif + outfile_(BFPathToString(filename).c_str()), ostr_(outfile_), counter_(0), atom_indices_() {} void SDFWriter::Write(const mol::EntityView& ent) { diff --git a/modules/mol/alg/src/lddt.cc b/modules/mol/alg/src/lddt.cc index fdd70d953c802f7319611071b57ca1e30a2b5c32..8ef174b67b610d1b35f7009a069ce21787cfa2e4 100644 --- a/modules/mol/alg/src/lddt.cc +++ b/modules/mol/alg/src/lddt.cc @@ -23,6 +23,8 @@ #include <boost/program_options.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/convenience.hpp> +#include <ost/base.hh> +#include <ost/boost_filesystem_helper.hh> #include <ost/mol/alg/local_dist_diff_test.hh> #include <ost/mol/alg/filter_clashes.hh> #include <ost/io/mol/pdb_reader.hh> @@ -284,11 +286,7 @@ int main (int argc, char **argv) boost::filesystem::path pathstring(files[i]); - #if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - String filestring=pathstring.string(); - #else - String filestring=pathstring.file_string(); - #endif + String filestring=BFPathToString(pathstring); std::cout << "File: " << files[i] << std::endl; std::pair<int,int> cov = compute_coverage(v,glob_dist_list); std::cout << "Coverage: " << (float(cov.first)/float(cov.second)) << " (" << cov.first << " out of " << cov.second << " residues)" << std::endl; diff --git a/tools/molck/main.cc b/tools/molck/main.cc index 07baf9496ca1a9a3aee7bd2deb03502206f010fe..dab69250c67ce2022bc66555b0179c8386ef577e 100644 --- a/tools/molck/main.cc +++ b/tools/molck/main.cc @@ -2,6 +2,8 @@ #include <boost/program_options.hpp> #include <boost/filesystem/path.hpp> #include <boost/filesystem/convenience.hpp> +#include <ost/base.hh> +#include <ost/boost_filesystem_helper.hh> #include <ost/platform.hh> #include <ost/conop/model_check.hh> #include <ost/conop/conop.hh> @@ -74,11 +76,7 @@ CompoundLibPtr load_compound_lib(const String& custom_path) share_path/="openstructure"; share_path/="compounds.chemlib"; - #if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - String share_path_string=share_path.string(); - #else - String share_path_string=share_path.file_string(); - #endif + String share_path_string=BFPathToString(share_path); if (fs::exists(share_path_string)) { return CompoundLib::Load(share_path_string); @@ -375,11 +373,7 @@ int main(int argc, char *argv[]) fs::path input_filename = input_file_path.stem(); - #if BOOST_FILESYSTEM_VERSION==3 || BOOST_VERSION<103400 - String input_filename_string=input_filename.string(); - #else - String input_filename_string=input_filename.file_string(); - #endif + String input_filename_string=BFPathToString(input_filename); size_t replstart =output_blueprint_string.find('%');