-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ccsb-scripps/boost_upgrade
Remove deprecated Boost features and improve compiling for newer Boost versions
- Loading branch information
Showing
81 changed files
with
9,140 additions
and
9,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
BASE=/usr/local | ||
BOOST_VERSION=1_41 | ||
BOOST_VERSION=1_71 | ||
BOOST_INCLUDE = $(BASE)/include | ||
C_PLATFORM=-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 | ||
GPP=/usr/bin/g++ | ||
C_OPTIONS= -O3 -DNDEBUG | ||
C_PLATFORM=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk | ||
GPP=clang++ | ||
C_OPTIONS= -O2 -DNDEBUG | ||
BOOST_LIB_VERSION= | ||
|
||
include ../../makefile_common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
/* | ||
Copyright (c) 2006-2010, The Scripps Research Institute | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
Author: Dr. Oleg Trott <ot14@columbia.edu>, | ||
The Olson Lab, | ||
The Scripps Research Institute | ||
*/ | ||
|
||
#ifndef VINA_ARRAY3D_H | ||
#define VINA_ARRAY3D_H | ||
|
||
#include <exception> // std::bad_alloc | ||
#include "common.h" | ||
|
||
inline sz checked_multiply(sz i, sz j) { | ||
if(i == 0 || j == 0) return 0; | ||
const sz tmp = i * j; | ||
if(tmp < i || tmp < j || tmp / i != j) | ||
throw std::bad_alloc(); // can't alloc if the size makes sz wrap around | ||
return tmp; | ||
} | ||
|
||
inline sz checked_multiply(sz i, sz j, sz k) { | ||
return checked_multiply(checked_multiply(i, j), k); | ||
} | ||
|
||
template<typename T> | ||
class array3d { | ||
sz m_i, m_j, m_k; | ||
std::vector<T> m_data; | ||
friend class boost::serialization::access; | ||
template<typename Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & m_i; | ||
ar & m_j; | ||
ar & m_k; | ||
ar & m_data; | ||
} | ||
public: | ||
array3d() : m_i(0), m_j(0), m_k(0) {} | ||
array3d(sz i, sz j, sz k) : m_i(i), m_j(j), m_k(k), m_data(checked_multiply(i, j, k)) {} | ||
sz dim0() const { return m_i; } | ||
sz dim1() const { return m_j; } | ||
sz dim2() const { return m_k; } | ||
sz dim(sz i) const { | ||
switch(i) { | ||
case 0: return m_i; | ||
case 1: return m_j; | ||
case 2: return m_k; | ||
default: assert(false); return 0; // to get rid of the warning | ||
} | ||
} | ||
void resize(sz i, sz j, sz k) { // data is essentially garbled | ||
m_i = i; | ||
m_j = j; | ||
m_k = k; | ||
m_data.resize(checked_multiply(i, j, k)); | ||
} | ||
T& operator()(sz i, sz j, sz k) { return m_data[i + m_i*(j + m_j*k)]; } | ||
const T& operator()(sz i, sz j, sz k) const { return m_data[i + m_i*(j + m_j*k)]; } | ||
}; | ||
|
||
#endif | ||
/* | ||
Copyright (c) 2006-2010, The Scripps Research Institute | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
Author: Dr. Oleg Trott <ot14@columbia.edu>, | ||
The Olson Lab, | ||
The Scripps Research Institute | ||
*/ | ||
|
||
#ifndef VINA_ARRAY3D_H | ||
#define VINA_ARRAY3D_H | ||
|
||
#include <exception> // std::bad_alloc | ||
#include "common.h" | ||
|
||
inline sz checked_multiply(sz i, sz j) { | ||
if(i == 0 || j == 0) return 0; | ||
const sz tmp = i * j; | ||
if(tmp < i || tmp < j || tmp / i != j) | ||
throw std::bad_alloc(); // can't alloc if the size makes sz wrap around | ||
return tmp; | ||
} | ||
|
||
inline sz checked_multiply(sz i, sz j, sz k) { | ||
return checked_multiply(checked_multiply(i, j), k); | ||
} | ||
|
||
template<typename T> | ||
class array3d { | ||
sz m_i, m_j, m_k; | ||
std::vector<T> m_data; | ||
friend class boost::serialization::access; | ||
template<typename Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & m_i; | ||
ar & m_j; | ||
ar & m_k; | ||
ar & m_data; | ||
} | ||
public: | ||
array3d() : m_i(0), m_j(0), m_k(0) {} | ||
array3d(sz i, sz j, sz k) : m_i(i), m_j(j), m_k(k), m_data(checked_multiply(i, j, k)) {} | ||
sz dim0() const { return m_i; } | ||
sz dim1() const { return m_j; } | ||
sz dim2() const { return m_k; } | ||
sz dim(sz i) const { | ||
switch(i) { | ||
case 0: return m_i; | ||
case 1: return m_j; | ||
case 2: return m_k; | ||
default: assert(false); return 0; // to get rid of the warning | ||
} | ||
} | ||
void resize(sz i, sz j, sz k) { // data is essentially garbled | ||
m_i = i; | ||
m_j = j; | ||
m_k = k; | ||
m_data.resize(checked_multiply(i, j, k)); | ||
} | ||
T& operator()(sz i, sz j, sz k) { return m_data[i + m_i*(j + m_j*k)]; } | ||
const T& operator()(sz i, sz j, sz k) const { return m_data[i + m_i*(j + m_j*k)]; } | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
/* | ||
Copyright (c) 2006-2010, The Scripps Research Institute | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
Author: Dr. Oleg Trott <ot14@columbia.edu>, | ||
The Olson Lab, | ||
The Scripps Research Institute | ||
*/ | ||
|
||
#ifndef VINA_ATOM_H | ||
#define VINA_ATOM_H | ||
|
||
#include "atom_base.h" | ||
|
||
struct atom_index { | ||
sz i; | ||
bool in_grid; | ||
atom_index() : i(max_sz), in_grid(false) {} | ||
atom_index(sz i_, bool in_grid_) : i(i_), in_grid(in_grid_) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & i; | ||
ar & in_grid; | ||
} | ||
}; | ||
|
||
inline bool operator==(const atom_index& i, const atom_index& j) { | ||
return i.i == j.i && i.in_grid == j.in_grid; | ||
} | ||
|
||
struct bond { | ||
atom_index connected_atom_index; | ||
fl length; | ||
bool rotatable; | ||
bond() : length(0), rotatable(false) {} | ||
bond(const atom_index& connected_atom_index_, fl length_, bool rotatable_) : connected_atom_index(connected_atom_index_), length(length_), rotatable(rotatable_) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & connected_atom_index; | ||
ar & length; | ||
ar & rotatable; | ||
} | ||
}; | ||
|
||
struct atom : public atom_base { | ||
vec coords; | ||
std::vector<bond> bonds; | ||
atom() : coords(max_vec) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & boost::serialization::base_object<atom_base>(*this); | ||
ar & coords; | ||
ar & bonds; | ||
} | ||
}; | ||
|
||
typedef std::vector<atom> atomv; | ||
|
||
#endif | ||
/* | ||
Copyright (c) 2006-2010, The Scripps Research Institute | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
Author: Dr. Oleg Trott <ot14@columbia.edu>, | ||
The Olson Lab, | ||
The Scripps Research Institute | ||
*/ | ||
|
||
#ifndef VINA_ATOM_H | ||
#define VINA_ATOM_H | ||
|
||
#include "atom_base.h" | ||
|
||
struct atom_index { | ||
sz i; | ||
bool in_grid; | ||
atom_index() : i(max_sz), in_grid(false) {} | ||
atom_index(sz i_, bool in_grid_) : i(i_), in_grid(in_grid_) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & i; | ||
ar & in_grid; | ||
} | ||
}; | ||
|
||
inline bool operator==(const atom_index& i, const atom_index& j) { | ||
return i.i == j.i && i.in_grid == j.in_grid; | ||
} | ||
|
||
struct bond { | ||
atom_index connected_atom_index; | ||
fl length; | ||
bool rotatable; | ||
bond() : length(0), rotatable(false) {} | ||
bond(const atom_index& connected_atom_index_, fl length_, bool rotatable_) : connected_atom_index(connected_atom_index_), length(length_), rotatable(rotatable_) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & connected_atom_index; | ||
ar & length; | ||
ar & rotatable; | ||
} | ||
}; | ||
|
||
struct atom : public atom_base { | ||
vec coords; | ||
std::vector<bond> bonds; | ||
atom() : coords(max_vec) {} | ||
private: | ||
friend class boost::serialization::access; | ||
template<class Archive> | ||
void serialize(Archive& ar, const unsigned version) { | ||
ar & boost::serialization::base_object<atom_base>(*this); | ||
ar & coords; | ||
ar & bonds; | ||
} | ||
}; | ||
|
||
typedef std::vector<atom> atomv; | ||
|
||
#endif |
Oops, something went wrong.