Skip to content

Commit 4999031

Browse files
Merge pull request #11 from iainrb/devel
Changes for release 1.6
2 parents da4fbf9 + 3c536be commit 4999031

43 files changed

Lines changed: 2747 additions & 3871 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@
1414
*.lai
1515
*.la
1616
*.a
17+
18+
# Temporary test directories
19+
temp*
20+
21+
# Files generated by cxxtest
22+
test_simtools.cpp
23+
runner
24+
runner.cpp
25+
26+
# Compiled executables
27+
sim
28+
simtools
29+
g2i
30+
gtc
31+
gtc_process
32+
normalize_manifest

Gtc.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
//
1010
// Author: Jennifer Liddle <js10@sanger.ac.uk, jennifer@jsquared.co.uk>
1111
//
12-
// Redistribution and use in source and binary forms, with or without modification,
13-
// are permitted provided that the following conditions are met:
14-
// 1. Redistributions of source code must retain the above copyright notice, this
15-
// list of conditions and the following disclaimer.
16-
// 2. Redistributions in binary form must reproduce the above copyright notice,
17-
// this list of conditions and the following disclaimer in the documentation and/or
18-
// other materials provided with the distribution.
19-
// 3. Neither the name of the Genome Research Ltd nor the names of its contributors
20-
// may be used to endorse or promote products derived from software without specific
21-
// prior written permission.
12+
// Redistribution and use in source and binary forms, with or without
13+
// modification, are permitted provided that the following conditions are met:
14+
// 1. Redistributions of source code must retain the above copyright notice,
15+
// this list of conditions and the following disclaimer.
16+
// 2. Redistributions in binary form must reproduce the above copyright
17+
// notice, this list of conditions and the following disclaimer in the
18+
// documentation and/or other materials provided with the distribution.
19+
// 3. Neither the name of Genome Research Ltd nor the names of the
20+
// contributors may be used to endorse or promote products derived from
21+
// software without specific prior written permission.
2222
//
23-
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR WARRANTIES,
24-
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25-
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. EVENT SHALL GENOME RESEARCH LTD. BE LIABLE
26-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27-
// (INCLUDING, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29-
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30-
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31-
// THE POSSIBILITY OF SUCH DAMAGE.
23+
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24+
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25+
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26+
// IN NO EVENT SHALL GENOME RESEARCH LTD. BE LIABLE FOR ANY DIRECT, INDIRECT,
27+
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29+
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32+
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3233
//
3334
//
3435
#include "Gtc.h"

Gtc.h

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,29 @@
1010

1111
// Author: Jennifer Liddle <js10@sanger.ac.uk, jennifer@jsquared.co.uk>
1212
//
13-
// Redistribution and use in source and binary forms, with or without modification,
14-
// are permitted provided that the following conditions are met:
15-
// 1. Redistributions of source code must retain the above copyright notice, this
16-
// list of conditions and the following disclaimer.
17-
// 2. Redistributions in binary form must reproduce the above copyright notice,
18-
// this list of conditions and the following disclaimer in the documentation and/or
19-
// other materials provided with the distribution.
20-
// 3. Neither the name of the Genome Research Ltd nor the names of its contributors
21-
// may be used to endorse or promote products derived from software without specific
22-
// prior written permission.
2313
//
24-
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR WARRANTIES,
25-
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26-
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. EVENT SHALL GENOME RESEARCH LTD. BE LIABLE
27-
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28-
// (INCLUDING, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30-
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31-
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32-
// THE POSSIBILITY OF SUCH DAMAGE.
14+
// Redistribution and use in source and binary forms, with or without
15+
// modification, are permitted provided that the following conditions are met:
16+
// 1. Redistributions of source code must retain the above copyright notice,
17+
// this list of conditions and the following disclaimer.
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
// 3. Neither the name of Genome Research Ltd nor the names of the
22+
// contributors may be used to endorse or promote products derived from
23+
// software without specific prior written permission.
24+
//
25+
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26+
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27+
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28+
// IN NO EVENT SHALL GENOME RESEARCH LTD. BE LIABLE FOR ANY DIRECT, INDIRECT,
29+
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30+
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
31+
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34+
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+
//
3336
//
3437

3538
#ifndef _GTC_H

Makefile

Lines changed: 61 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,90 @@
88

99
# Author: Jennifer Liddle <js10@sanger.ac.uk, jennifer@jsquared.co.uk>
1010
#
11-
# Redistribution and use in source and binary forms, with or without modification,
12-
# are permitted provided that the following conditions are met:
13-
# 1. Redistributions of source code must retain the above copyright notice, this
14-
# list of conditions and the following disclaimer.
15-
# 2. Redistributions in binary form must reproduce the above copyright notice,
16-
# this list of conditions and the following disclaimer in the documentation and/or
17-
# other materials provided with the distribution.
18-
# 3. Neither the name of the Genome Research Ltd nor the names of its contributors
19-
# may be used to endorse or promote products derived from software without specific
20-
# prior written permission.
21-
#
22-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR WARRANTIES,
23-
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24-
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. EVENT SHALL GENOME RESEARCH LTD. BE LIABLE
25-
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26-
# (INCLUDING, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28-
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29-
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30-
# THE POSSIBILITY OF SUCH DAMAGE.
31-
#
3211

33-
INSTALLLIB=/software/varinf/lib
12+
# Redistribution and use in source and binary forms, with or without
13+
# modification, are permitted provided that the following conditions are met:
14+
# 1. Redistributions of source code must retain the above copyright notice,
15+
# this list of conditions and the following disclaimer.
16+
# 2. Redistributions in binary form must reproduce the above copyright
17+
# notice, this list of conditions and the following disclaimer in the
18+
# documentation and/or other materials provided with the distribution.
19+
# 3. Neither the name of Genome Research Ltd nor the names of the
20+
# contributors may be used to endorse or promote products derived from
21+
# software without specific prior written permission.
22+
23+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26+
# IN NO EVENT SHALL GENOME RESEARCH LTD. BE LIABLE FOR ANY DIRECT, INDIRECT,
27+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29+
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32+
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
34+
35+
36+
.PHONY: test # always run, regardless of timestamps
37+
38+
DIR = INSTALL_DIRECTORY # placeholder for main installation directory
39+
BIN=$(DIR)/bin
40+
# default directories for g2i
41+
INSTALLLIB=/software/varinf/lib
3442
INSTALLBIN=/software/varinf/bin
43+
# other useful paths
3544
STLPORT_INC=/software/solexa/pkg/STLport/current/stlport
3645
STLPORT_LIB=/software/solexa/pkg/STLport/current/build/lib/obj/gcc/so
3746
#STLPORT_INC=/software/varinf/lib/STLport/include/stlport
3847
#STLPORT_LIB=/software/varinf/lib/STLport/lib
3948
PERL_CORE=/usr/lib/perl/5.8.8/CORE
4049
PERL_CORE=/software/perl-5.8.8/lib/5.8.8/x86_64-linux-thread-multi/CORE
4150

42-
TARGETS=libplinkbin.so gtc g2i b2i b2g gtc_process sim simtools
51+
52+
TARGETS=libplinkbin.so gtc g2i gtc_process sim simtools normalize_manifest
4353
PERL_TARGETS=Gtc.so Sim.so
4454
LIBS=Gtc.o win2unix.o Sim.o
4555

4656
# To compile with debug information added, invoke as (say):
4757
# make DEBUG='y'
4858
# to build all targets with debug info.
4959
# For just one target, say:
50-
# make DEBUG='y' b2i
60+
# make DEBUG='y' simtools
5161

5262
CC=/usr/bin/g++
5363

5464
# do NOT use -ffast-math, as it causes errors in infinity/NaN handling
5565
ifeq ($(DEBUG),y)
56-
CFLAGS=-g -Wall -fPIC -O0 -I$(STLPORT_INC)
66+
CFLAGS=-g -Wall -fPIC -O0 -I$(STLPORT_INC) -std=c++0x
5767
else
58-
CFLAGS=-Wall -fPIC -O3 -I$(STLPORT_INC)
68+
CFLAGS=-Wall -fPIC -O3 -I$(STLPORT_INC) -std=c++0x
5969
endif
6070
# Set runpath instead of relying on LD_LIBRARY_PATH
61-
LDFLAGS=-Wl,-rpath -Wl,$(STLPORT_LIB) -L$(STLPORT_LIB) -lstlport -lm
71+
LDFLAGS=-Wl,-rpath -Wl,$(STLPORT_LIB) -L$(STLPORT_LIB) -lstlport -lm
72+
CXXFLAGS=-Wno-deprecated -I/software/gapi/pkg/cxxtest/4.2.1/
73+
74+
usage:
75+
@echo -e "Usage: make install DIR=<destination directory>\nOther targets: make all, make test, make install_g2i"
6276

63-
default: all
6477

6578
clean:
66-
rm -f *.o Gtc_wrap.cxx Gtc.pm Sim_wrap.cxx Sim.pm $(TARGETS)
79+
rm -f *.o Gtc_wrap.cxx Gtc.pm Sim_wrap.cxx Sim.pm runner.cpp runner $(TARGETS)
80+
81+
test: Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o commands.o runner.o
82+
$(CC) $(CFLAGS) $(LDFLAGS) $(CXXFLAGS) -o runner $^ -lstlport
83+
./runner # run "./runner -v" to print trace information
6784

68-
test:
69-
run_tests
85+
runner.o: all
86+
cxxtestgen --error-printer -o runner.cpp test_simtools.h
87+
$(CC) -c $(CFLAGS) $(LDFLAGS) $(CXXFLAGS) -o $@ runner.cpp
7088

7189
install: all
90+
install -d $(BIN)
91+
install g2i gtc normalize_manifest sim simtools $(BIN)
92+
@echo -e "Simtools successfully installed."
93+
94+
install_g2i: all
7295
cp Gtc.pm $(INSTALLLIB)
7396
cp Gtc.so $(INSTALLLIB)
7497
cp Sim.pm $(INSTALLLIB)
@@ -82,24 +105,24 @@ perl: $(PERL_TARGETS)
82105
gtc: gtc.o Gtc.o Manifest.o
83106
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
84107

108+
normalize_manifest: normalize_manifest.o Manifest.o
109+
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
110+
85111
sim: sim.o Sim.o
86112
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
87113

88-
simtools: simtools.o Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o
114+
simtools: simtools.o commands.o Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o
89115
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
90116

117+
commands.o: commands.cpp
118+
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
119+
91120
manifest: manifest.o Manifest.o
92121
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
93122

94123
g2i: g2i.o Gtc.o Manifest.o win2unix.o Sim.o json/json_reader.o json/json_writer.o json/json_value.o utilities.o plink_binary.o
95124
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
96125

97-
b2i: b2i.o Manifest.o b2base.o # "b2" code needs ssl library;
98-
$(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport -lssl # pick this up from /usr/lib
99-
100-
b2g: b2g.o Manifest.o b2base.o
101-
$(CC) $(LDFLAGS) -lssl -o $@ $^ -lstlport -lssl # Ditto.
102-
103126
gtc_process: Gtc.o Manifest.o gtc_process.o
104127
$(CC) $(LDFLAGS) -o $@ $^ -lstlport
105128

@@ -132,9 +155,6 @@ gtc.o: Gtc.h Manifest.h
132155
sim.o: Sim.h
133156
simtools.o: Sim.h
134157
g2i.o: Gtc.h Manifest.h plink_binary.h
135-
b2base.o: b2base.cpp
136-
b2i.o: b2i.cpp Manifest.h
137-
b2g.o: b2g.cpp Manifest.h
138158
win2unix.o: win2unix.cpp win2unix.h
139159
plink_binary.o: plink_binary.cpp plink_binary.h
140160

0 commit comments

Comments
 (0)