Skip to content

Commit 3d8b92a

Browse files
author
Leon Kuchenbecker
committed
[COMPAT] Build compatibility
- CMakeLists.txt is case sensitive in earlier cmake versions - Make sure no copy construction of std::ofstream is attempted - Suppress warnings in gcc
1 parent 31ceaa2 commit 3d8b92a

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ if(GIT_FOUND)
1616
COMMAND ${GIT_EXECUTABLE} describe --dirty=-dirty
1717
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
1818
OUTPUT_VARIABLE DESCRIBE_BUILD
19+
ERROR_QUIET
1920
OUTPUT_STRIP_TRAILING_WHITESPACE)
2021
# string(REGEX MATCH "[0-9]+" BUILD_NUMBER ${DESCRIBE_BUILD})
2122
endif()
@@ -89,7 +90,7 @@ add_executable (imseq
8990
target_link_libraries (imseq ${SEQAN_LIBRARIES})
9091

9192
# Add CXX flags found by find_package (SeqAn).
92-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS}")
93+
set (CMAKE_CXX_FLAGS "-Wno-address ${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS}")
9394

9495
# ----------------------------------------------------------------------------
9596
# Installation

src/imseq.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,10 +1217,10 @@ CharString getBcOutPath(CdrOptions const & options, AminoAcid)
12171217
return options.aminoOutBc;
12181218
}
12191219

1220-
inline std::ofstream openAndCheck(CharString const & path)
1220+
inline std::ofstream * openAndCheck(CharString const & path)
12211221
{
1222-
std::ofstream ofs(toCString(path));
1223-
if (!ofs.good())
1222+
std::ofstream * ofs = new std::ofstream(toCString(path));
1223+
if (!ofs->good())
12241224
{
12251225
std::cerr << "\n[ERROR] Cannot open output file '" << path << "'!" << std::endl;
12261226
std::exit(1);
@@ -1273,17 +1273,21 @@ void _writeClonotypeCounts(std::map<Clone<TAlphabet>, ClusterResult>const & clon
12731273
// ============================================================================
12741274
if (outPath != "")
12751275
{
1276-
std::ofstream ofs = openAndCheck(outPath);
1276+
std::ofstream * ofsPtr = openAndCheck(outPath);
1277+
std::ofstream & ofs = *ofsPtr;
12771278
for (typename TCounter::const_iterator fpCount = fingerPrintCounter.begin(); fpCount!=fingerPrintCounter.end(); ++fpCount)
12781279
ofs << fpCount->first << '\t' << fpCount->second.count << std::endl;
12791280
ofs.close();
1281+
delete ofsPtr;
12801282
}
12811283
if (bcOutPath != "")
12821284
{
1283-
std::ofstream ofs = openAndCheck(bcOutPath);
1285+
std::ofstream * ofsPtr = openAndCheck(bcOutPath);
1286+
std::ofstream & ofs = *ofsPtr;
12841287
for (typename TCounter::const_iterator fpCount = fingerPrintCounter.begin(); fpCount!=fingerPrintCounter.end(); ++fpCount)
12851288
ofs << fpCount->first << '\t' << fpCount->second.contribBCs.size() << std::endl;
12861289
ofs.close();
1290+
delete ofsPtr;
12871291
}
12881292

12891293
}

util/src-tarball/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To build IMSEQ, you will need
2525
Invoke the following commands to build IMSEQ:
2626

2727
$ cmake ./seqan_minimal/
28-
$ make
28+
$ make imseq
2929

3030
If you do not want to use your systems default C++ compiler, you can specify
3131
the path to your C++ compiler as shown in this example:

0 commit comments

Comments
 (0)