Skip to content

Commit

Permalink
Merge pull request #80 from Illumina/release-to-public
Browse files Browse the repository at this point in the history
Refactor of C++ and SWIG code
  • Loading branch information
ezralanglois authored Aug 30, 2016
2 parents 34a5cd6 + 4cd290d commit 907191f
Show file tree
Hide file tree
Showing 202 changed files with 9,675 additions and 5,877 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(INTEROP_DL_LIB interop_fpic_lib)
option(ENABLE_BACKWARDS_COMPATIBILITY "Compile code for c++98" ON)
option(ENABLE_DOCS "Build documentation with Doxygen" ON)
option(ENABLE_SWIG "Build third-party language bindings, e.g. C#" ON)
option(ENABLE_CSHARP "Build C# language bindings" ON)
option(ENABLE_TEST "Build unit tests (depends on Boost)" ON)
option(ENABLE_APPS "Build command line programs" ON)
option(ENABLE_EXAMPLES "Build example programs" ON)
Expand Down Expand Up @@ -75,6 +76,7 @@ if(ENABLE_DOCS)
add_subdirectory("docs")
endif()
install(DIRECTORY interop DESTINATION include)
install(FILES README.md docs/src/changes.md DESTINATION .)

find_package(Git)
if(GIT_FOUND)
Expand Down
17 changes: 12 additions & 5 deletions cmake/InternalUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ macro(interop_config_compiler_and_linker)

include(CheckIsNaN)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(COMPILER_IS_GNUCC_OR_CLANG ON)
else()
set(COMPILER_IS_GNUCC_OR_CLANG OFF)
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL "4")
Expand Down Expand Up @@ -72,7 +74,7 @@ macro(interop_config_compiler_and_linker)
if(IS_INT64_LONG)
add_definitions(-DHAVE_LONG64)
endif()

check_type_size(size_t SIZE_T)
if(MINGW)
set(CXX11_FLAG_ "-std=gnu++11")
else()
Expand Down Expand Up @@ -101,12 +103,17 @@ macro(interop_config_compiler_and_linker)
message(FATAL_ERROR "Unsupported compiler")
endif()
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCC)
if(COMPILER_IS_GNUCC_OR_CLANG)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-c++0x-compat -Wno-error=c++0x-compat -Wextra")
if(WIN32 AND MINGW)
# Add big object support to Windows Compilers
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()
elseif(MSVC)
# Visual Studio Complains about not being able to create an assignment operator and copy constructor
# -wd4511 and -wd4512 disable these pointless warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX -wd4511 -wd4512")
# Add big object support to Windows Compilers
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX -wd4511 -wd4512 /bigobj")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
Expand All @@ -115,7 +122,7 @@ macro(interop_config_compiler_and_linker)
endif()
endif()
if(NOT ENABLE_BACKWARDS_COMPATIBILITY)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR CMAKE_COMPILER_IS_GNUCC)
if(COMPILER_IS_GNUCC_OR_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_CX11_FLAG}")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand Down
30 changes: 28 additions & 2 deletions cmake/Modules/FindGMock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,24 @@ find_library(GMOCK_LIBRARY
PATH_SUFFIXES . lib lib64
)
find_library(GMOCK_MAIN_LIBRARY
NAMES gmock_main$
NAMES gmock_main
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . lib lib64
)


find_library(GMOCK_LIBRARY_DEBUG
NAMES gmock-d
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . lib lib64
)
find_library(GMOCK_MAIN_LIBRARY_DEBUG
NAMES gmock_main-d
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . lib lib64
)


if(NOT GMOCK_INCLUDE_DIR OR NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY)

if(NOT GMOCK_INCLUDE_DIR)
Expand Down Expand Up @@ -82,7 +95,20 @@ if(NOT GMOCK_INCLUDE_DIR OR NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY)
set(GMOCK_TARGET googlemock)
endif()


if(GMOCK_LIBRARY AND GMOCK_LIBRARY_DEBUG)
get_filename_component(GMOCK_RELEASE_EXT ${GMOCK_LIBRARY} EXT)
get_filename_component(GMOCK_DEBUG_EXT ${GMOCK_LIBRARY_DEBUG} EXT)
if(GMOCK_RELEASE_EXT STREQUAL GMOCK_DEBUG_EXT)
set(GMOCK_LIBRARY optimized ${GMOCK_LIBRARY} debug ${GMOCK_LIBRARY_DEBUG})
endif()
endif()
if(GMOCK_MAIN_LIBRARY AND GMOCK_MAIN_LIBRARY_DEBUG)
get_filename_component(GMOCK_RELEASE_EXT ${GMOCK_MAIN_LIBRARY} EXT)
get_filename_component(GMOCK_DEBUG_EXT ${GMOCK_MAIN_LIBRARY_DEBUG} EXT)
if(GMOCK_RELEASE_EXT STREQUAL GMOCK_DEBUG_EXT)
set(GMOCK_MAIN_LIBRARY optimized ${GMOCK_MAIN_LIBRARY} debug ${GMOCK_MAIN_LIBRARY_DEBUG})
endif()
endif()

set(GMOCK_LIBRARIES ${GMOCK_LIBRARY} )
set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR} )
Expand Down
47 changes: 44 additions & 3 deletions cmake/Modules/FindGTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,40 @@ find_library(GTEST_LIBRARY
PATH_SUFFIXES . lib lib64
)
find_library(GTEST_MAIN_LIBRARY
NAMES gtest_main$
NAMES gtest_main
HINTS ${PC_GTEST_INCLUDEDIR} ${PC_GTEST_INCLUDE_DIRS} ${GTEST_ROOT} $ENV{GTEST_DIR}
PATH_SUFFIXES . lib lib64
)

if(NOT GTEST_INCLUDE_DIR OR NOT GTEST_LIBRARY OR NOT GTEST_MAIN_LIBRARY)
find_library(GTEST_LIBRARY_DEBUG
NAMES gtest-d
HINTS ${PC_GTEST_INCLUDEDIR} ${PC_GTEST_INCLUDE_DIRS} ${GTEST_ROOT} $ENV{GTEST_DIR}
PATH_SUFFIXES . lib lib64
)
find_library(GTEST_MAIN_LIBRARY_DEBUG
NAMES gtest_main-d
HINTS ${PC_GTEST_INCLUDEDIR} ${PC_GTEST_INCLUDE_DIRS} ${GTEST_ROOT} $ENV{GTEST_DIR}
PATH_SUFFIXES . lib lib64
)

find_path(GMOCK_INCLUDE_DIR_TEST
NAMES gmock/gmock.h
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . include
)

find_library(GMOCK_LIBRARY_TEST
NAMES gmock
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . lib lib64
)
find_library(GMOCK_MAIN_LIBRARY_TEST
NAMES gmock_main
HINTS ${PC_GMOCK_INCLUDEDIR} ${PC_GMOCK_INCLUDE_DIRS} ${GMOCK_ROOT} $ENV{GMOCK_DIR}
PATH_SUFFIXES . lib lib64
)

if(NOT GTEST_INCLUDE_DIR OR NOT GTEST_LIBRARY OR NOT GTEST_MAIN_LIBRARY OR NOT GMOCK_INCLUDE_DIR_TEST OR NOT GMOCK_LIBRARY_TEST OR NOT GMOCK_MAIN_LIBRARY_TEST)

if(NOT GTEST_INCLUDE_DIR)
message(STATUS "GTest include directory not found")
Expand Down Expand Up @@ -82,7 +110,20 @@ if(NOT GTEST_INCLUDE_DIR OR NOT GTEST_LIBRARY OR NOT GTEST_MAIN_LIBRARY)
set(GTEST_TARGET gtest)
endif()


if(GTEST_LIBRARY AND GTEST_LIBRARY_DEBUG)
get_filename_component(GTEST_RELEASE_EXT ${GTEST_LIBRARY} EXT)
get_filename_component(GTEST_DEBUG_EXT ${GTEST_LIBRARY_DEBUG} EXT)
if(GTEST_RELEASE_EXT STREQUAL GTEST_DEBUG_EXT)
set(GTEST_LIBRARY optimized ${GTEST_LIBRARY} debug ${GTEST_LIBRARY_DEBUG})
endif()
endif()
if(GTEST_MAIN_LIBRARY AND GTEST_MAIN_LIBRARY_DEBUG)
get_filename_component(GTEST_RELEASE_EXT ${GTEST_MAIN_LIBRARY} EXT)
get_filename_component(GTEST_DEBUG_EXT ${GTEST_MAIN_LIBRARY_DEBUG} EXT)
if(GTEST_RELEASE_EXT STREQUAL GTEST_DEBUG_EXT)
set(GTEST_MAIN_LIBRARY optimized ${GTEST_MAIN_LIBRARY} debug ${GTEST_MAIN_LIBRARY_DEBUG})
endif()
endif()

set(GTEST_LIBRARIES ${GTEST_LIBRARY} )
set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR} )
Expand Down
11 changes: 5 additions & 6 deletions cmake/Modules/UseCSharp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ macro( CSHARP_ADD_PROJECT type name )
#endif ()
#list( SORT sources_dep )

set(CSHARP_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CSHARP_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})

string (REPLACE ";" "," source_list "${sources}")
Expand All @@ -101,17 +100,17 @@ macro( CSHARP_ADD_PROJECT type name )
# Add custom target and command
MESSAGE( STATUS "Adding C# ${type} ${name}: '${CSHARP_COMPILER} /t:${type} /out:${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}'" )
add_custom_command(
COMMENT "Compiling C# ${type} ${name}: '${CSHARP_COMPILER} /unsafe /t:${type} /out:${CSHARP_OUTPUT_DIR}/${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}'"
OUTPUT ${CMAKE_BINARY_DIR}/${name}.${output}
COMMAND ${CMAKE_COMMAND} -DFILES_TO_COPY="${source_list}" -DDESTINATION_DIR="${CMAKE_BINARY_DIR}" -P "${CMAKE_SOURCE_DIR}/cmake/CopyListOfFiles.cmake"
COMMENT "Compiling C# ${type} ${name}: '${CSHARP_COMPILER} /unsafe /t:${type} /out:${CMAKE_CURRENT_BINARY_DIR}/${name}.${output} /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}'"
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}.${output}
COMMAND ${CMAKE_COMMAND} -DFILES_TO_COPY="${source_list}" -DDESTINATION_DIR="${CMAKE_CURRENT_BINARY_DIR}" -P "${CMAKE_SOURCE_DIR}/cmake/CopyListOfFiles.cmake"
COMMAND ${CSHARP_COMPILER}
ARGS /t:${type} /out:${CSHARP_OUTPUT_DIR}/${name}.${output} /unsafe /platform:${CSHARP_PLATFORM} ${CSHARP_SDK} ${refs} ${sources}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${sources_dep}
)
add_custom_target(
${name} ALL
DEPENDS ${CMAKE_BINARY_DIR}/${name}.${output}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}.${output}
SOURCES ${sources_dep}
)
endmacro( CSHARP_ADD_PROJECT )
9 changes: 6 additions & 3 deletions docs/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ LOOKUP_CACHE_SIZE = 0
# normally produced when WARNINGS is set to YES.
# The default value is: NO.

EXTRACT_ALL = NO
EXTRACT_ALL = YES

# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
Expand Down Expand Up @@ -654,7 +654,7 @@ SHOW_USED_FILES = YES
# (if specified).
# The default value is: YES.

SHOW_FILES = NO
SHOW_FILES = YES

# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
# page. This will remove the Namespaces entry from the Quick Index and from the
Expand Down Expand Up @@ -716,6 +716,9 @@ QUIET = NO

WARNINGS = YES

# Treat warnings as errors
#WARN_AS_ERROR = YES

# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
# will automatically be disabled.
Expand All @@ -737,7 +740,7 @@ WARN_IF_DOC_ERROR = YES
# parameter documentation, but not about the absence of documentation.
# The default value is: NO.

WARN_NO_PARAMDOC = NO
WARN_NO_PARAMDOC = YES

# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
Expand Down
30 changes: 26 additions & 4 deletions docs/src/changes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
# Changes {#changes}


## Trunk

Commit | Description
------- | -----------
## v1.0.9

Date | Description
---------- | -----------
2016-08-26 | Refactor CSharp code into additional library
2016-08-26 | IPA-5028: Add RunInfo and InterOp validation
2016-08-19 | Fix sorting in imaging table
2016-08-18 | Cleanup code
2016-08-17 | Fix the read ID
2016-08-16 | IPA-5009: Add sorting to imaging table
2016-08-16 | IPA-5007: Fix combo boxes on analysis tab
2016-08-16 | Fix msvc warning and some script differences
2016-08-15 | Add clear function to run metrics
2016-08-15 | IPA-4799: Create Internal Coverity Build
2016-08-11 | Refactor unit tests to make more flexible for regression testing
2016-08-08 | IPA-4922: Move logic code from header to cpp
2016-08-05 | IPA-4827: Make run info parsing more robust
2016-08-03 | Refactor code and add test build script
2016-08-02 | Add big object support for unit tests
2016-08-02 | Clean buffers in the heatmap and flowcell
2016-08-02 | Update travis-ci to GCC-5
2016-07-28 | Added float array backing to heat map
2016-07-25 | IPA-4752: Replace InterOp 1.x Code with InterOp 2.x Code - Imaging Tab
2016-07-22 | Fix camel case
2016-07-22 | IPA-4751: Integrated InterOp2.x with Analysis Tab
2016-07-22 | Github Issue 74: Compiler warning as error unsigned/signed comp
2016-07-21 | Bug fixes for flowcell chart and more recent versions of GCC
2016-07-17 | Added coverity online scan and fixed some issues found

Expand Down
6 changes: 3 additions & 3 deletions docs/src/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ Direct Call 1 | 38
Direct Call 2 | 45
Indirect Call | < 1

The results show that everytime we make a call from the native language to C++, we pay a hefty price. In many applications
this is a price we are willing to pay. However, for those applications were performance is a concern, it pays to add
methods like `copy_focus`, which limit the number of times we have to jump between C# (or another language) and C++.
The results show that everytime we make a call from the native language to C++, we pay a hefty price. In many applications,
this is a price we are willing to pay. However, for those applications where performance is a concern, it pays to add
methods like `copy_focus`, which limit the number of times we have to jump between C# (or another language) and C++.
13 changes: 10 additions & 3 deletions interop/constants/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
INTEROP_TUPLE2(ChannelFeature, 0x10), \
INTEROP_TUPLE1(UnknownMetricFeature)


/** Enumeration of each metric type
*
* @note This macro requires the macro INTEROP_TUPLE3 to be defined before use
Expand All @@ -34,6 +35,7 @@
INTEROP_TUPLE4(FWHM, "FWHM", Extraction, CycleFeature|ChannelFeature),\
/*INTEROP_TUPLE4(PercentBase, "% Base", CorrectedInt, CycleFeature|BaseFeature), */\
INTEROP_TUPLE4(BasePercent, "% Base", CorrectedInt, CycleFeature|BaseFeature),\
INTEROP_TUPLE4(PercentNoCall, "% NoCall", CorrectedInt, CycleFeature),\
/*INTEROP_TUPLE4(PercentQ20, "% >=Q20", Q, CycleFeature),*/\
INTEROP_TUPLE4(Q20Percent, "% >=Q20", Q, CycleFeature),\
/*INTEROP_TUPLE4(PercentQ30, "% >=Q30", Q, CycleFeature),*/\
Expand All @@ -45,7 +47,7 @@
/*INTEROP_TUPLE4(Density, "Density (K/mm2)", Tile, TileFeature),*/ \
INTEROP_TUPLE4(ClustersPF, "Density PF", Tile, TileFeature),\
/*INTEROP_TUPLE4(DensityPF, "Density PF", Tile, TileFeature),*/\
INTEROP_TUPLE4(ClusterCount, "Clusters", Tile, TileFeature),\
INTEROP_TUPLE4(ClusterCount, "Cluster Count", Tile, TileFeature),\
/*INTEROP_TUPLE4(ClusterCount, "Cluster Count", Tile, TileFeature),*/\
INTEROP_TUPLE4(ClusterCountPF, "Clusters PF", Tile, TileFeature),\
INTEROP_TUPLE4(ErrorRate, "Error Rate", Error, CycleFeature),\
Expand Down Expand Up @@ -157,10 +159,10 @@
INTEROP_TUPLE1(InstrumentCount), \
INTEROP_TUPLE1(UnknownInstrument)

/** Enumeration of instrument types
/** Enumeration of metric types
*
* @note This macro requires the macro INTEROP_TUPLE1 to be defined before use
* @see illumina::interop::constants::instrument_type
* @see illumina::interop::constants::metric_base_type
*/
#define INTEROP_ENUM_METRIC_BASE_TYPES \
/** Tile base types are written out once for each tile */\
Expand All @@ -169,6 +171,8 @@
INTEROP_TUPLE1(BaseCycleType),\
/** Read base types are written out once for each tile and read */\
INTEROP_TUPLE1(BaseReadType),\
/** Lane base types are written out once for each lane and cycle */\
INTEROP_TUPLE1(BaseLaneType),\
INTEROP_TUPLE1(BaseMetricCount),\
INTEROP_TUPLE1(UnknownBaseType)

Expand Down Expand Up @@ -201,6 +205,7 @@
INTEROP_TUPLE1(Shifted),\
INTEROP_TUPLE1(UnknownBarPlotOption)

/** Sentinel for an unknown enum type */
#define INTEROP_UNKNOWN 0xff
/** This temp macro converts a enum/description pair into the an enum (first element of the pair) */
#define INTEROP_TUPLE4(X, Y, Z, A) X
Expand All @@ -211,6 +216,8 @@
/** This temp macro converts an enum/value pair to an enum */
#define INTEROP_TUPLE2(X, V) X=V



namespace illumina { namespace interop { namespace constants
{
/** Common codes for all enums */
Expand Down
2 changes: 2 additions & 0 deletions interop/constants/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ namespace illumina { namespace interop { namespace constants {
typedef constant_type<metric_base_type, BaseCycleType> base_cycle_t;
/** Define base type for read metrics */
typedef constant_type<metric_base_type, BaseReadType> base_read_t;
/** Define base type for lane metrics */
typedef constant_type<metric_base_type, BaseLaneType> base_lane_t;

}}}
3 changes: 2 additions & 1 deletion interop/interop.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
#include "interop/logic/summary/index_summary.h"
#include "interop/logic/summary/run_summary.h"

namespace illumina { namespace interop{
namespace illumina { namespace interop
{
/** Get the version of the library
*
* @return library version
Expand Down
Loading

0 comments on commit 907191f

Please sign in to comment.