guanchangge / mosaik-aligner

Automatically exported from code.google.com/p/mosaik-aligner
0 stars 0 forks source link

Patch for compiling 64-bit on Solaris 10 x86 #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of the product are you using? On what operating system?
Mosaik-1.0.1384 on Solaris 10 x86.

Please provide any additional information below.

A couple patches will get the code to build out-of-the-box for Solaris 10
x86 with the included GCC 3.4.3 (or Sun Studio 12) and "gmake":

1.  termios.h is needed for TIOCGWINSZ. It should be safe to include on
    other platforms, as it is POSIX, but I haven't tested this on other
    platforms; you could always wrap its inclusion in an "#ifndef
    TIOCGWINSZ" if something breaks.

========================================
--- ./CommonSource/Utilities/ProgressBar.h.orig Mon Jan 25 08:25:25 2010
+++ ./CommonSource/Utilities/ProgressBar.h      Mon Jan 25 08:25:39 2010
@@ -24,6 +24,7 @@

 #ifndef WIN32
 #include <sys/ioctl.h>
+#include <termios.h>
 #endif

 using namespace std;

========================================

2. A two-line change to UnorderedMap.h:

========================================
--- CommonSource/DataStructures/UnorderedMap.h.orig     Mon Jan 25 08:22:32
2010
+++ CommonSource/DataStructures/UnorderedMap.h  Mon Jan 25 14:15:07 2010
@@ -11,7 +11,7 @@

 #pragma once

-#ifdef __APPLE__
+#if defined(__APPLE__) || (defined(__SVR4) && defined(__sun))

 #include <ext/hash_map>

@@ -25,6 +25,7 @@
                }
        };

+#if !(defined(__SVR4) && defined(__sun) && defined(_LP64)) //not 64-bit
Solaris
        template<>
        struct hash<uint64_t> {
                size_t operator()(const uint64_t r) const {
@@ -31,6 +32,7 @@
                        return (size_t)r;
                }
        };
+#endif
 }
 #define CXX
 #endif
========================================

The latter unsatisfying fix is to work around an issue that occurs when
compiling in 64-bit mode:

========================================
../../CommonSource/DataStructures/UnorderedMap.h:29: error: redefinition of
`struct __gnu_cxx::hash<long unsigned int>'
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/ext/has
h_fun.h:119:
error: previous definition of `struct __gnu_cxx::hash<long unsigned int>'
gmake[2]: *** [../../../obj/AbstractAssemblyFormat.o] Error 1
========================================

You may want to come up with something better.

When compiled as a 32-bit application on Solaris 10, MosaikAlign apparently
attempts to allocate too much memory when using the sample data for the
included Align.sh script:

========================================
Aligning read library (91640):
 0% [                                     ]                               
  |ERROR: Unable to allocate enough memory for the banded Smith-Waterman
algorithm.
------------------------------------------------------------------------------
MosaikSort 1.0.1384                                                 2010-01-24
Michael Stromberg                 Marth Lab, Boston College Biology Department
------------------------------------------------------------------------------

ERROR: The alignment archive header indicates that no reads are contained in
       this file. This might happen when the file was not closed properly -
       usually from a killed process or a crash. Your only recourse is to
       realign this data set.
       filename: [sequence_archives/c_elegans_chr2_test_aligned.dat]
========================================

I therefore just built it 64-bit, using the following simple include file:

========================================
-bash-3.00$ cat includes/solaris64.inc
# define our processor specific flags
export PLATFORM_FLAGS = -m64
========================================

Original issue reported on code.google.com by nate.we...@gmail.com on 25 Jan 2010 at 8:34