Skip to content

Commit

Permalink
Patch out C++ bugs in plink
Browse files Browse the repository at this point in the history
Also force dynamic linking so it picks up libz.
  • Loading branch information
owainkenwayucl committed Jul 21, 2015
1 parent 279f00c commit a71ecf2
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plink-1.07_install
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ then
unzip $temp_dir/${APPNAME}-${VERSION}-src.zip

cd ${APPNAME}-${VERSION}-src
cp /shared/ucl/apps/build_scripts/plink-patches/*.patch .
for a in `ls *.patch`
do
patch < $a
done
make
else
echo "Hash mismatch."
Expand Down
11 changes: 11 additions & 0 deletions plink-patches/Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- Makefile.old 2015-07-21 13:23:55.000000000 +0100
+++ Makefile 2015-07-21 13:15:01.000000000 +0100
@@ -27,7 +27,7 @@
FORCE_32BIT =
WITH_ZLIB = 1
WITH_LAPACK =
-FORCE_DYNAMIC =
+FORCE_DYNAMIC = 1

# Put C++ compiler here; Windows has it's own specific version
CXX_UNIX = g++
25 changes: 25 additions & 0 deletions plink-patches/elf.cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- elf.cpp.old 2015-07-21 13:02:42.000000000 +0100
+++ elf.cpp 2015-07-21 13:03:24.000000000 +0100
@@ -1175,10 +1175,10 @@
<< setw(8) << gcnt << " "
<< setw(8) << (double)cnt / (double)gcnt << "\n";

- map<int,int>::iterator i = chr_cnt.begin();
- while ( i != chr_cnt.end() )
+ map<int,int>::iterator it3 = chr_cnt.begin();
+ while ( it3 != chr_cnt.end() )
{
- int c = i->first;
+ int c = it3->first;
int x = chr_cnt.find( c )->second;
int y = chr_gcnt.find( c )->second;

@@ -1189,7 +1189,7 @@
<< setw(8) << y << " "
<< setw(8) << (double)x / (double)y << "\n";

- ++i;
+ ++it3;
}

}
19 changes: 19 additions & 0 deletions plink-patches/idhelp.cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- idhelp.cpp.old 2015-07-21 13:04:26.000000000 +0100
+++ idhelp.cpp 2015-07-21 13:09:25.000000000 +0100
@@ -772,12 +772,12 @@
for (int j = 0 ; j < jointField.size(); j++ )
{
set<IDField*> & jf = jointField[j];
- set<IDField*>::iterator j = jf.begin();
+ set<IDField*>::iterator it1 = jf.begin();
PP->printLOG(" { ");
- while ( j != jf.end() )
+ while ( it1 != jf.end() )
{
- PP->printLOG( (*j)->name + " " );
- ++j;
+ PP->printLOG( (*it1)->name + " " );
+ ++it1;
}
PP->printLOG(" }");
}
18 changes: 18 additions & 0 deletions plink-patches/sets.cpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- sets.cpp.old 2015-07-21 12:58:06.000000000 +0100
+++ sets.cpp 2015-07-21 13:01:36.000000000 +0100
@@ -768,11 +768,11 @@
//////////////////////////////////////////////
// Reset original missing status

- vector<Individual*>::iterator i = PP->sample.begin();
- while ( i != PP->sample.end() )
+ vector<Individual*>::iterator it2 = PP->sample.begin();
+ while ( it2 != PP->sample.end() )
{
- (*i)->missing = (*i)->flag;
- ++i;
+ (*it2)->missing = (*it2)->flag;
+ ++it2;
}

////////////////////////////////////////////////

0 comments on commit a71ecf2

Please sign in to comment.