Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

visual c++ fixed for c++11 stuff. getting there...

  • Loading branch information...
commit ce9f73152c639cfe0edaeb285216edd0ba700d7a 1 parent 9270340
@sim82 authored
View
6 CMakeLists.txt
@@ -19,7 +19,7 @@ add_subdirectory(ivy_mike)
include_directories( ${include_directories} ${IVYMIKE_INCLUDE} . ublasJama-1.0.2.3 )
-set( USE_CPP11 no )
+set( USE_CPP11 yes )
# handle the stupid autolinking shit of visualc++
IF(WIN32)
@@ -29,7 +29,9 @@ IF(WIN32)
ENDIF()
include_directories( ${BOOST_ROOT} )
- #LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${BOOST_ROOT}\\stage\\lib)
+ LINK_DIRECTORIES(C:/src/poco-1.4.5/lib )
+ include_directories(C:/src/poco-1.4.5/Foundation/include)
+
set( BOOST_LIBS )
set( SYSDEP_LIBS )
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_SCL_SECURE_NO_WARNINGS /INCREMENTAL:NO") # as long as there is no support for std::array, these warnings are plain stupid!
2  ivy_mike
@@ -1 +1 @@
-Subproject commit 5626330f892acfa12c3d63015d6c53b3de85af37
+Subproject commit c369cd766e6cb8c4bb509f29ca02cdc9d086e7bd
View
2  phy_to_fasta.cpp
@@ -10,7 +10,7 @@ static bool nogap( char c ) {
return c != '-' && c != 'N';
}
-#if __cplusplus <= 199711L
+#if __cplusplus <= 199711L && !defined(_MSC_VER)
namespace std {
// OH NOES, copy_if is c++11... rip it from gnu
template<typename _InputIterator, typename _OutputIterator,
View
22 propara.cpp
@@ -21,11 +21,11 @@
#define BOOST_UBLAS_NDEBUG 1
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/syscall.h>
+//#include <sys/time.h>
+//#include <sys/resource.h>
+//#include <sys/syscall.h>
#include <sys/types.h>
-#include <unistd.h>
+//#include <unistd.h>
#include <stdexcept>
#include <iostream>
@@ -36,14 +36,15 @@
#include <functional>
#include <cstring>
#include <limits>
-
+#include <cmath>
#include <boost/io/ios_state.hpp>
#include <boost/iostreams/tee.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/bind.hpp>
#include <boost/array.hpp>
-#include <boost/thread.hpp>
+//#include <boost/thread.hpp>
+#include "ivymike/thread.h"
#include "parsimony.h"
@@ -565,7 +566,8 @@ class log_odds_viterbi {
// std::cout << std::setw(10) << match_log_odds;
}
- assert( std::isfinite(*m0) );
+ // assert( std::isfinite(*m0) );
+ assert( *m0 == *m0 ); // FIXME: is this a valid replacement for std::isfinite?
#if 0
std::cout << i << " " << j << " " << m_(i,j) << " : " << m_(i-1, j-1) + ngap_log_odds
<< " " << d_(i-1, j-1) + gap_log_odds << " " << i_(i-1, j-1) + gap_log_odds << " " << match_log_odds << " " << gap_log_odds << " " << ngap_log_odds << " max: " << m_max << "\n";
@@ -1724,7 +1726,7 @@ struct scoring_results {
// }
void merge( const scoring_results &other ) {
- boost::lock_guard<boost::mutex> lock(mtx_);
+ ivy_mike::lock_guard<ivy_mike::mutex> lock(mtx_);
const size_t size = best_score_.size();
assert( size == best_ref_.size() );
@@ -1754,7 +1756,7 @@ struct scoring_results {
std::ofstream os_;
- boost::mutex mtx_;
+ ivy_mike::mutex mtx_;
};
@@ -1952,7 +1954,7 @@ int main( int argc, char *argv[] ) {
scoring_worker w0(qs, refs, &res, 0, opt_num_threads );
- boost::thread_group tg;
+ ivy_mike::thread_group tg;
for( int i = 1; i < opt_num_threads; ++i ) {
std::cout << "starting additional thread: " << i << "\n";
tg.create_thread(scoring_worker(qs, refs, &res, i, opt_num_threads ));
View
14 raxml_interface.cpp
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with papara. If not, see <http://www.gnu.org/licenses/>.
*/
-
+#include "ivymike/disable_shit.h"
#include <Poco/Process.h>
#include <Poco/File.h>
@@ -30,6 +30,8 @@
#include <deque>
#include <vector>
#include <cassert>
+#include <array>
+//#include <unordered_map>
#include "ivymike/time.h"
@@ -38,8 +40,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/dynamic_bitset.hpp>
-#include <boost/tr1/unordered_map.hpp>
-#include <boost/tr1/array.hpp>
+//#include <boost/tr1/unordered_map.hpp>
+//#include <boost/tr1/array.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/lexical_cast.hpp>
#include "raxml_interface.h"
@@ -47,6 +49,10 @@
#include "ivymike/tree_split_utils.h"
+//#ifdef max
+//#undef max
+//#endif
+
using ivy_mike::tree_parser_ms::lnode;
using ivy_mike::tree_parser_ms::adata;
using ivy_mike::tree_parser_ms::ln_pool;
@@ -110,7 +116,7 @@ void pipe_into_deque( Poco::Pipe &pipe, std::deque<char> &deq ) {
// i don't trust the complicated implementation for std::vector, so use this...
//std::vector<char> buf(4096);
- std::tr1::array<char,4096> buf;
+ std::array<char,4096> buf;
size_t readsize = -1;
while( (readsize = pipe.readBytes( buf.data(), buf.size())) != 0 ) {
View
24 stepwise_addition_pro.cpp
@@ -19,6 +19,10 @@
// #include "pch.h"
+// someone down the line tries to sabotage us by including a windows header,
+// which will clutter the whole namespace with macros. I don't know who it is,
+// but disable_shit.h takes care of restricting the damage...
+#include "ivymike/disable_shit.h"
#include <cctype>
#include <algorithm>
@@ -27,10 +31,12 @@
#include <iostream>
#include <fstream>
#include <iterator>
-
+#include <deque>
+#include <thread>
+#include <iomanip>
#define BOOST_UBLAS_NDEBUG
-#include <boost/thread.hpp>
+
#include <boost/bind.hpp>
#include <boost/dynamic_bitset.hpp>
#include <boost/numeric/ublas/matrix.hpp>
@@ -50,6 +56,7 @@
#include "ivymike/tree_split_utils.h"
#include "ivymike/flat_map.h"
#include "ivymike/fasta.h"
+#include "ivymike/thread.h"
namespace tree_parser = ivy_mike::tree_parser_ms;
@@ -159,8 +166,8 @@ class log_odds_viterbi {
ref_gap_prob_log_ = ref_gap_prob_;
{
auto &d = ref_gap_prob_log_.data();
- std::transform( d.begin(), d.end(), d.begin(), log );
-
+ //std::transform( d.begin(), d.end(), d.begin(), log );
+ std::transform( d.begin(), d.end(), d.begin(), [](double v){ return log(v); } );
}
@@ -955,7 +962,7 @@ class flat_map {
if( !sorted_ ) {
throw std::runtime_error( "flat_map::get on unsorted map" );
}
- auto lb = std::lower_bound( pairs_.begin(), pairs_.end(), ipair{key, V()} );
+ auto lb = std::lower_bound( pairs_.begin(), pairs_.end(), ipair(key, V()) );
if( lb == pairs_.end() || lb->key_ != key ) {
return nullptr;
@@ -992,7 +999,7 @@ class flat_map {
class sequences {
public:
- sequences() = delete;
+ //sequences() = delete;
sequences( std::istream &is ) : pw_scoring_matrix_( 3, 0 ) {
assert( is.good() );
@@ -1574,7 +1581,7 @@ class tree_builder {
ivy_mike::tree_parser_ms::splice_with_rollback swr( np, virtual_root );
- std::deque<rooted_bifurcation<lnode>> rto;
+ std::deque<rooted_bifurcation<lnode> > rto;
rooted_traveral_order_rec( virtual_root, rto, false );
// incremental = true;
for( auto it = rto.begin(); it != rto.end(); ++it ) {
@@ -2278,7 +2285,8 @@ int main( int argc, char *argv[] ) {
ivy_mike::getopt::parser igp;
std::string opt_seq_file;
- int num_cores = boost::thread::hardware_concurrency();
+
+ int num_cores = std::thread::hardware_concurrency();
int opt_num_ali_threads;
int opt_num_nv_threads;
View
6 vec_unit.h
@@ -409,7 +409,8 @@ struct vector_unit<int, 4> {
#ifdef __SSE4_1__
return _mm_min_epi32( a, b );
#else
- #error "probably untested code!"
+ //#warning "probably untested code!"
+ assert(0);
const vec_t ma = _mm_cmplt_epi32( a, b );
return _mm_or_si128( _mm_and_si128( ma, a ), _mm_andnot_si128( ma, b ) );
#endif
@@ -420,7 +421,8 @@ struct vector_unit<int, 4> {
#ifdef __SSE4_1__
return _mm_max_epi32( a, b );
#else
- #error "probably untested code!"
+ //#warning "probably untested code!"
+ assert(0);
const vec_t ma = _mm_cmpgt_epi32( a, b );
return _mm_or_si128( _mm_and_si128( ma, a ), _mm_andnot_si128( ma, b ) );
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.