diff --git a/.travis.yml b/.travis.yml index e95e059f3..727c27b84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,15 @@ matrix: - os: osx compiler: clang env: DEPLOY_BUILD=true SCRIPT="bash ./tools/package.sh $PWD $PWD/dist travis OFF Release ALL" + - os: osx + compiler: clang + env: DEPLOY_BUILD=true SCRIPT="bash ./tools/package.sh $PWD $PWD/dist travis OFF Release 3.6.10" + - os: osx + compiler: clang + env: DEPLOY_BUILD=true SCRIPT="bash ./tools/package.sh $PWD $PWD/dist travis OFF Release 3.7.7" + - os: osx + compiler: clang + env: DEPLOY_BUILD=true SCRIPT="bash ./tools/package.sh $PWD $PWD/dist travis OFF Release 3.8.2" - os: linux compiler: clang env: SCRIPT="bash ./tools/package.sh $PWD $PWD/dist travis ON Debug Disable" diff --git a/cmake/Modules/FindCSBuild.cmake b/cmake/Modules/FindCSBuild.cmake index 7deec22fa..d1666d12c 100644 --- a/cmake/Modules/FindCSBuild.cmake +++ b/cmake/Modules/FindCSBuild.cmake @@ -97,6 +97,7 @@ if(NOT CSHARP_TARGET_FRAMEWORK) endif() if(CSBUILD_FOUND) + message(STATUS "Using Framework: ${CSHARP_TARGET_FRAMEWORK}") if(DOTNET_STANDARD_FOUND) message(STATUS "Using Framework: ${CSHARP_TARGET_FRAMEWORK}") message(STATUS "Using Platform: ${CSHARP_PLATFORM}") diff --git a/docs/src/binary_formats.md b/docs/src/binary_formats.md index acfb9a946..b1ad8a49f 100644 --- a/docs/src/binary_formats.md +++ b/docs/src/binary_formats.md @@ -21,6 +21,7 @@ The documentation for the model notes when an attribute is only populated by a s - @subpage corrected_v4 "Corrected Intensity v4" - @subpage error_v3 "Error v3" - @subpage error_v4 "Error v4" + - @subpage error_v5 "Error v5" - @subpage extended_tile_v2 "Extended Tile Version 2" - @subpage extended_tile_v3 "Extended Tile Version 3" - @subpage extraction_v2 "Extraction Version 2" diff --git a/docs/src/changes.md b/docs/src/changes.md index 820760c65..5d1b3a760 100644 --- a/docs/src/changes.md +++ b/docs/src/changes.md @@ -1,6 +1,13 @@ # Changes {#changes} +## v1.1.11 + +Date | Description +---------- | ----------- +2020-08-10 | Issue-223: Add missing v5 error metric file format + + ## v1.1.10 Date | Description diff --git a/interop/model/metrics/error_metric.h b/interop/model/metrics/error_metric.h index 6f7bca1c0..95dc93d5a 100644 --- a/interop/model/metrics/error_metric.h +++ b/interop/model/metrics/error_metric.h @@ -29,7 +29,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics * The error metric is the calculated error rate, as determined by a spiked in PhiX control sample. * This metric is available for each lane and tile for every cycle. * - * @note Supported versions: 3 and 4 + * @note Supported versions: 3, 4, and 5 */ class error_metric : public metric_base::base_cycle_metric { @@ -41,7 +41,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics /** Unique type code for metric */ TYPE = constants::Error, /** Latest version of the InterOp format */ - LATEST_VERSION = 4 + LATEST_VERSION = 5 }; /** Define a uint array using an underlying vector */ @@ -52,6 +52,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics error_metric() : metric_base::base_cycle_metric(0, 0, 0), m_error_rate(std::numeric_limits::quiet_NaN()), + m_phix_adapter_rate(std::numeric_limits::quiet_NaN()), m_mismatch_cluster_count(MAX_MISMATCH, 0) { } @@ -60,6 +61,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics error_metric(const header_type&) : metric_base::base_cycle_metric(0, 0, 0), m_error_rate(std::numeric_limits::quiet_NaN()), + m_phix_adapter_rate(std::numeric_limits::quiet_NaN()), m_mismatch_cluster_count(MAX_MISMATCH, 0) { } @@ -74,9 +76,11 @@ namespace illumina { namespace interop { namespace model { namespace metrics error_metric(const uint_t lane, const uint_t tile, const uint_t cycle, - const float error) : + const float error, + const float phix_adapter_rate) : metric_base::base_cycle_metric(lane, tile, cycle), m_error_rate(error), + m_phix_adapter_rate(phix_adapter_rate), m_mismatch_cluster_count(MAX_MISMATCH, 0) { } @@ -101,6 +105,16 @@ namespace illumina { namespace interop { namespace model { namespace metrics return m_error_rate; } + /** Calculated adapter trim rate of PhiX clusters + * + * @note Supported by v5 + * @return adapter trim rate + */ + float phix_adapter_rate() const + { + return m_phix_adapter_rate; + } + /** Number of clusters at given number of mismatches * * 0: no mismatches @@ -162,6 +176,7 @@ namespace illumina { namespace interop { namespace model { namespace metrics private: float m_error_rate; + float m_phix_adapter_rate; uint_array_t m_mismatch_cluster_count; template friend diff --git a/src/interop/model/metrics/error_metric.cpp b/src/interop/model/metrics/error_metric.cpp index 3b1b72f6d..96506fe1d 100644 --- a/src/interop/model/metrics/error_metric.cpp +++ b/src/interop/model/metrics/error_metric.cpp @@ -190,6 +190,90 @@ namespace illumina{ namespace interop{ namespace io } }; + + /** Error Metric Record Layout Version 5 + * + * This class provides an interface to reading the error metric file: + * - InterOp/ErrorMetrics.bin + * - InterOp/ErrorMetricsOut.bin + * + * The class takes two template arguments: + * + * 1. Metric Type: error_metric + * 2. Version: 5 + */ + template<> + struct generic_layout : public default_layout<5> + { + /** @page error_v5 Error Version 5 + * + * This class provides an interface to reading the error metric file: + * - InterOp/ErrorMetrics.bin + * - InterOp/ErrorMetricsOut.bin + * + * The file format for error metrics is as follows: + * + * @b Header + * + * illumina::interop::io::read_metrics (Function that parses this information) + * + * byte 0: version number (5) + * byte 1: record size (16) + * + * @b n-Records + * + * illumina::interop::io::layout::base_cycle_metric (Class that parses this information) + * + * 2 bytes: lane number (uint16) + * 4 bytes: tile number (uint32) + * 2 bytes: cycle number (uint16) + * + * illumina::interop::io::generic_layout (Class that parses this information) + * + * 4 bytes: error rate (float32) + * 4 bytes: fraction of reads adapter-trimmed at the cycle (float32) + */ + /** Metric ID type */ + typedef layout::base_cycle_metric< ::uint32_t > metric_id_t; + /** Error type */ + typedef float error_t; + /** Map reading/writing to stream + * + * Reading and writing are symmetric operations, map it once + * + * @param stream input/output stream + * @param metric source/destination metric + * @return number of bytes read or total number of bytes written + */ + template + static std::streamsize map_stream(Stream& stream, Metric& metric, Header&, const bool) + { + std::streamsize count = 0; + count += stream_map< error_t >(stream, metric.m_error_rate); + count += stream_map< error_t >(stream, metric.m_phix_adapter_rate); + return count; + } + /** Compute the layout size + * + * @return size of the record + */ + static record_size_t compute_size(const error_metric::header_type&) + { + return static_cast(sizeof(metric_id_t)+ + sizeof(error_t)+ // m_errorRate + sizeof(error_t) // m_phix_adapter_rate + ); + } + /** Compute header size + * + * @return header size + */ + static record_size_t compute_header_size(const error_metric::header_type&) + { + return static_cast(sizeof(record_size_t) + sizeof(version_t)); + } + + }; #pragma pack() /** Error Metric CSV text format * @@ -246,12 +330,70 @@ namespace illumina{ namespace interop{ namespace io return 0; } }; + + /** Error Metric CSV text format + * + * This class provide an interface for writing the error metrics to a CSV file: + * + * - ErrorMetrics.csv + */ + template<> + struct text_layout< error_metric, 2 > + { + /** Define a header type */ + typedef error_metric::header_type header_type; + /** Write header to the output stream + * + * @param out output stream + * @param sep column separator + * @param eol row separator + * @return number of column headers + */ + static size_t write_header(std::ostream& out, + const header_type&, + const std::vector&, + const char sep, + const char eol) + { + const char* headers[] = + { + "Lane", "Tile", "Cycle", "ErrorRate", "PhiXAdapterRate" + }; + out << "# Column Count: " << util::length_of(headers) << eol; + out << headers[0]; + for(size_t i=1;i @@ -112,10 +104,11 @@ if(NOT ENABLE_STATIC) add_custom_command(TARGET csharp_perftest POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $ ${CMAKE_CURRENT_BINARY_DIR}) endif() +set(CSHARP_TARGET_FRAMEWORK "netstandard2.0" CACHE STRING "C# .NET framework for dotnet" ) add_custom_target(check_csharp COMMENT "Running C# unit tests: ${CSHARP_INTERPRETER} $/${CSBUILD_csharp_unittest_BINARY_NAME}" - COMMAND ${CSHARP_INTERPRETER} $/${CSBUILD_csharp_unittest_BINARY_NAME} + COMMAND ${CHECKER} ${CSHARP_INTERPRETER} $/${CSBUILD_csharp_unittest_BINARY_NAME} ) add_dependencies(check_csharp csharp_unittest) diff --git a/src/tests/csharp/metrics/ErrorMetricsTest.cs b/src/tests/csharp/metrics/ErrorMetricsTest.cs index bf6c42fac..37cb6a5e3 100644 --- a/src/tests/csharp/metrics/ErrorMetricsTest.cs +++ b/src/tests/csharp/metrics/ErrorMetricsTest.cs @@ -24,9 +24,9 @@ public class ErrorMetricsTestV3 protected void SetUp() { base_cycle_metric_header header = new base_cycle_metric_header(); - expected_metrics.Add(new error_metric(7, 1114, 1, 0.450100899f)); - expected_metrics.Add(new error_metric(7, 1114, 2, 0.900201797f)); - expected_metrics.Add(new error_metric(7, 1114, 3, 0.465621591f)); + expected_metrics.Add(new error_metric(7, 1114, 1, 0.450100899f, 0f)); + expected_metrics.Add(new error_metric(7, 1114, 2, 0.900201797f, 0f)); + expected_metrics.Add(new error_metric(7, 1114, 3, 0.465621591f, 0f)); int[] tmp = new int[]{3,30,7,0,90,4,1,0,-96,115,-26,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,7,0,90,4,2,0,-96,115,102,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/src/tests/interop/logic/summary_metrics_test.cpp b/src/tests/interop/logic/summary_metrics_test.cpp index 2c7c5a7ff..488b4d7b9 100644 --- a/src/tests/interop/logic/summary_metrics_test.cpp +++ b/src/tests/interop/logic/summary_metrics_test.cpp @@ -382,14 +382,15 @@ TEST(summary_metrics_test, cycle_35_cycle_34_tile) model::metric_base::metric_set &actual_error_metrics = actual_run_metrics.get(); typedef model::metrics::error_metric::uint_t uint_t; + const float kMissingValue = std::numeric_limits::quiet_NaN(); for (uint_t cycle_number = 0; cycle_number < 36; ++cycle_number) { - expected_error_metrics.insert(error_metric(1, 1101, 1 + cycle_number, 3.0f)); - actual_error_metrics.insert(error_metric(1, 1101, 1 + cycle_number, 3.0f)); + expected_error_metrics.insert(error_metric(1, 1101, 1 + cycle_number, 3.0f, kMissingValue)); + actual_error_metrics.insert(error_metric(1, 1101, 1 + cycle_number, 3.0f, kMissingValue)); } for (uint_t cycle_number = 0; cycle_number < 34; ++cycle_number) { - actual_error_metrics.insert(error_metric(1, 1102, 1 + cycle_number, 1.0f)); + actual_error_metrics.insert(error_metric(1, 1102, 1 + cycle_number, 1.0f, kMissingValue)); } model::summary::run_summary expected; diff --git a/src/tests/interop/metrics/error_metrics_test.cpp b/src/tests/interop/metrics/error_metrics_test.cpp index c4b16d06f..fc416978b 100644 --- a/src/tests/interop/metrics/error_metrics_test.cpp +++ b/src/tests/interop/metrics/error_metrics_test.cpp @@ -29,13 +29,17 @@ struct error_metrics_tests : public generic_test_fixture< error_metric_set > {}; error_metrics_tests::generator_type error_unit_test_generators[] = { wrap(new hardcoded_metric_generator< error_metric_v3 >) , - wrap(new write_read_metric_generator< error_metric_v3 >) - ,wrap(new hardcoded_metric_generator< error_metric_v4 >), + wrap(new hardcoded_metric_generator< error_metric_v4 >), + wrap(new hardcoded_metric_generator< error_metric_v5 >), + wrap(new write_read_metric_generator< error_metric_v3 >), wrap(new write_read_metric_generator< error_metric_v4 >), + wrap(new write_read_metric_generator< error_metric_v5 >), wrap(new by_cycle_metric_generator< error_metric_v3 >), wrap(new by_cycle_metric_generator< error_metric_v4 >), + wrap(new by_cycle_metric_generator< error_metric_v5 >), wrap(new clear_metric_generator< error_metric_v3 >), - wrap(new clear_metric_generator< error_metric_v4 >) + wrap(new clear_metric_generator< error_metric_v4 >), + wrap(new clear_metric_generator< error_metric_v5 >) }; // Setup unit tests for error_metrics_tests @@ -67,6 +71,7 @@ TEST_P(error_metrics_tests, compare_expected_actual) EXPECT_EQ(it_expected->cycle(), it_actual->cycle()); EXPECT_EQ(it_expected->mismatch_count(), it_actual->mismatch_count()); EXPECT_NEAR(it_expected->error_rate(), it_actual->error_rate(), 1e-5f); + INTEROP_EXPECT_NEAR(it_expected->phix_adapter_rate(), it_actual->phix_adapter_rate(), 1e-5f); for(ptrdiff_t i=0;i(it_expected->mismatch_count());i++) EXPECT_EQ(it_expected->mismatch_cluster_count(i), it_actual->mismatch_cluster_count(i)); } diff --git a/src/tests/interop/metrics/inc/error_metrics_test.h b/src/tests/interop/metrics/inc/error_metrics_test.h index ac35a36ec..cc57d4046 100644 --- a/src/tests/interop/metrics/inc/error_metrics_test.h +++ b/src/tests/interop/metrics/inc/error_metrics_test.h @@ -31,9 +31,10 @@ namespace illumina { namespace interop { namespace unittest static void create_expected(metric_set_t &metrics, const model::run::info& =model::run::info()) { metrics = metric_set_t(VERSION); - metrics.insert(metric_t(7, 1114, 1, 0.450100899f)); - metrics.insert(metric_t(7, 1114, 2, 0.900201797f)); - metrics.insert(metric_t(7, 1114, 3, 0.465621591f)); + const float kMissingValue = std::numeric_limits::quiet_NaN(); + metrics.insert(metric_t(7, 1114, 1, 0.450100899f, kMissingValue)); + metrics.insert(metric_t(7, 1114, 2, 0.900201797f, kMissingValue)); + metrics.insert(metric_t(7, 1114, 3, 0.465621591f, kMissingValue)); } /** Get the expected binary data @@ -199,7 +200,7 @@ namespace illumina { namespace interop { namespace unittest { const size_t cycle_within_read = run_info.cycle_within_read(cycle); const metric_t::uint_t cycle_id = static_cast(cycle); - metrics.insert(metric_t(7, 1113, cycle_id, kMissingValue)); + metrics.insert(metric_t(7, 1113, cycle_id, kMissingValue, kMissingValue)); if( cycle_within_read <= 5 ) { //Doing nothing is the same as adding a record with the missing value sentinel @@ -207,25 +208,25 @@ namespace illumina { namespace interop { namespace unittest } else if( cycle_within_read <= 35 ) { - metrics.insert(metric_t(7, 1114, cycle_id, kAverageError35)); + metrics.insert(metric_t(7, 1114, cycle_id, kAverageError35, kMissingValue)); sum += kAverageError35; } else if( cycle_within_read <= 50 ) { - metrics.insert(metric_t(7, 1114, cycle_id, kAverageError50)); + metrics.insert(metric_t(7, 1114, cycle_id, kAverageError50, kMissingValue)); sum += kAverageError35; } else if( cycle_within_read <= 75 ) { - metrics.insert(metric_t(7, 1114, cycle_id, kAverageError75)); + metrics.insert(metric_t(7, 1114, cycle_id, kAverageError75, kMissingValue)); } else if( cycle_within_read <= 100 ) { - metrics.insert(metric_t(7, 1114, cycle_id, kAverageError100)); + metrics.insert(metric_t(7, 1114, cycle_id, kAverageError100, kMissingValue)); } else { - metrics.insert(metric_t(7, 1114, cycle_id, kAverageErrorAfter)); + metrics.insert(metric_t(7, 1114, cycle_id, kAverageErrorAfter, kMissingValue)); } } } @@ -306,9 +307,11 @@ namespace illumina { namespace interop { namespace unittest static void create_expected(metric_set_t &metrics, const model::run::info& =model::run::info()) { metrics = metric_set_t(VERSION); - metrics.insert(metric_t(3, 211011, 1, 0.608985f)); - metrics.insert(metric_t(3, 211011, 2, 0.298748f)); - metrics.insert(metric_t(3, 211011, 3, 0.287257f)); + + const float kMissingValue = std::numeric_limits::quiet_NaN(); + metrics.insert(metric_t(3, 211011, 1, 0.608985f, kMissingValue)); + metrics.insert(metric_t(3, 211011, 2, 0.298748f, kMissingValue)); + metrics.insert(metric_t(3, 211011, 3, 0.287257f, kMissingValue)); } /** Get the expected binary data * @@ -325,5 +328,41 @@ namespace illumina { namespace interop { namespace unittest buffer.assign(tmp, tmp+util::length_of(tmp)); } }; + + /** This test writes three records of an InterOp files, then reads them back in and compares + * each value to ensure they did not change. + * + * @see model::metrics::error_metric + * @note Version 5 + */ + struct error_metric_v5 : metric_test + { + /** Create the expected metric set + * + * @param metrics destination metric set + */ + static void create_expected(metric_set_t &metrics, const model::run::info& =model::run::info()) + { + metrics = metric_set_t(VERSION); + metrics.insert(metric_t(3, 211011, 1, 0.608985f, 0.298748f)); + metrics.insert(metric_t(3, 211011, 2, 0.298748f, 0.287257f)); + metrics.insert(metric_t(3, 211011, 3, 0.287257f, 0.608985f)); + } + /** Get the expected binary data + * + * @param buffer binary data string + */ + template + static void create_binary_data(Collection &buffer) + { + const int tmp[] = + {5,16, + 3,0,67,56,3,0,1,0,113,-26,27,63,127,-11,-104,62, + 3,0,67,56,3,0,2,0,127,-11,-104,62,89,19,-109,62, + 3,0,67,56,3,0,3,0,89,19,-109,62,113,-26,27,63 + }; + buffer.assign(tmp, tmp+util::length_of(tmp)); + } + }; }}} diff --git a/src/tests/interop/metrics/inc/metric_format_fixtures.h b/src/tests/interop/metrics/inc/metric_format_fixtures.h index cdd45ed49..7a938e911 100644 --- a/src/tests/interop/metrics/inc/metric_format_fixtures.h +++ b/src/tests/interop/metrics/inc/metric_format_fixtures.h @@ -31,6 +31,7 @@ namespace illumina{ namespace interop { namespace unittest corrected_intensity_metric_v4, error_metric_v3, error_metric_v4, + error_metric_v5, extended_tile_metric_v1, extended_tile_metric_v2, extended_tile_metric_v3, diff --git a/tools/package.sh b/tools/package.sh index 9185183ba..f3da5e4a8 100644 --- a/tools/package.sh +++ b/tools/package.sh @@ -159,7 +159,8 @@ fi if [ "$PYTHON_VERSION" != "" ] && [ "$PYTHON_VERSION" != "Disable" ] ; then if [ "$PYTHON_VERSION" == "ALL" ] ; then - python_versions="2.7.17 3.5.9 3.6.10 3.7.7 3.8.2" + # python_versions="2.7.17 3.5.9 3.6.10 3.7.7 3.8.2" + python_versions="2.7.17 3.5.9" pyenv install --list | grep " 2.7" pyenv install --list | grep " 3\.[45678]" else diff --git a/tools/prereqs/docker-centos7-install.sh b/tools/prereqs/docker-centos7-install.sh index e2654aa4b..001754b06 100644 --- a/tools/prereqs/docker-centos7-install.sh +++ b/tools/prereqs/docker-centos7-install.sh @@ -29,7 +29,7 @@ JUNIT_URL="http://search.maven.org/remotecontent?filepath=junit/junit/4.12/junit NUNIT_URL="https://github.com/nunit/nunitv2/releases/download/2.6.4/NUnit-2.6.4.zip" JAVA_URL="http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm" VALGRIND_URL="http://www.valgrind.org/downloads/valgrind-3.14.0.tar.bz2" -DOTNET_URL="https://download.microsoft.com/download/1/1/5/115B762D-2B41-4AF3-9A63-92D9680B9409/dotnet-sdk-2.1.4-linux-x64.tar.gz" +DOTNET_URL="https://download.visualstudio.microsoft.com/download/pr/022d9abf-35f0-4fd5-8d1c-86056df76e89/477f1ebb70f314054129a9f51e9ec8ec/dotnet-sdk-2.2.207-linux-x64.tar.gz" PROG_HOME=/opt SWIG_HOME=${PROG_HOME}/swig3 JUNIT_HOME=${PROG_HOME}/junit @@ -68,10 +68,7 @@ if hash swig 2> /dev/null; then echo "Found Swig" else if [ ! -e ${SWIG_HOME} ]; then - mkdir ${SWIG_HOME} - fi - if [ ! -e ${SWIG_HOME}/src ]; then - mkdir ${SWIG_HOME}/src + mkdir -p ${SWIG_HOME}/src fi wget --no-check-certificate --quiet -O - ${SWIG_URL} | tar --strip-components=1 -xz -C ${SWIG_HOME}/src cd ${SWIG_HOME}/src @@ -160,6 +157,7 @@ java -version cmake --version mono --version dotnet --version +which dotnet yum clean all diff --git a/tools/prereqs/env_windows.bat b/tools/prereqs/env_windows.bat index 39a8bb842..a7b632a13 100644 --- a/tools/prereqs/env_windows.bat +++ b/tools/prereqs/env_windows.bat @@ -4,13 +4,24 @@ rem Software required to build InterOp rem Assumes you have the windows package manager installed: https://chocolatey.org/ rem -------------------------------------------------------------------------------------------------------------------- -set MINICONDA_HOME=C:\ProgramData\Miniconda2 +set python_version=2.7 +set numpy_version= +if NOT '%1' == '' ( + set python_version=%1 +) +if NOT '%2' == '' ( +set conda_version=%2 +) +if NOT '%3' == '' ( +set numpy_version="=%3" +) +set MINICONDA_HOME=C:\tools\miniconda3 set CMAKE_HOME=C:\Program Files\CMake\bin set NUNIT_HOME=C:\Program Files (x86)\NUnit 2.6.4\bin -set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144\bin +set JAVA_BIN=C:\Program Files\Java\jdk1.8.0_144\bin set MINGW_HOME=C:\mingw\mingw64\bin set DOTNET_HOME=c:\dotnet -set PATH=%PATH%;%MINICONDA_HOME%;%MINICONDA_HOME%\Scripts;%CMAKE_HOME%;%NUNIT_HOME%;%JAVA_HOME%;%MINGW_HOME%;%DOTNET_HOME% +set PATH=%PATH%;%CMAKE_HOME%;%NUNIT_HOME%;%JAVA_BIN%;%MINGW_HOME%;%DOTNET_HOME% rem -------------------------------------------------------------------------------------------------------------------- rem Install MinGW @@ -40,18 +51,29 @@ rem ---------------------------------------------------------------------------- where /q cmake if %errorlevel% neq 0 choco install cmake --yes --limit-output --installargs 'ADD_CMAKE_TO_PATH=""System""' -where /q conda -if %errorlevel% neq 0 choco install miniconda --yes --limit-output + +choco upgrade cmake --yes --limit-output --installargs 'ADD_CMAKE_TO_PATH=""System""' --no-progress + +choco uninstall miniconda --yes --limit-output +choco uninstall miniconda3 --yes --limit-output +choco install miniconda3 --yes --limit-output --no-progress +call %MINICONDA_HOME%\Scripts\\activate.bat +call conda config --set always_yes yes --set changeps1 no +call conda info + where /q javac -if %errorlevel% neq 0 choco install jdk8 --yes --limit-output --version 8.0.144 +if %errorlevel% neq 0 choco install jdk8 --yes --limit-output --version 8.0.144 --force --no-progress where /q nuget if %errorlevel% neq 0 choco install nuget.commandline --yes --limit-output -where /q swig -if %errorlevel% neq 0 choco install swig --yes --limit-output + +choco install swig --yes --limit-output --version 3.0.12 --allow-downgrade --force --no-progress +if %errorlevel% neq 0 exit /b %errorlevel% + where /q git -if %errorlevel% neq 0 choco install git.install --yes --limit-output +if %errorlevel% neq 0 choco install git.install --yes --limit-output --no-progress + where /q nunit-console.exe -if %errorlevel% neq 0 choco install nunit --version 2.6.4 --yes --limit-output +if %errorlevel% neq 0 choco install nunit --version 2.6.4 --yes --limit-output --no-progress rem -------------------------------------------------------------------------------------------------------------------- rem Test if required programs are available @@ -59,6 +81,7 @@ rem ---------------------------------------------------------------------------- where /q javac if errorlevel 1 ( + dir C:\Program Files\Java\jdk1.8.0_144\bin echo Failed to find javac exit /b %errorlevel% ) @@ -99,21 +122,32 @@ rem Version Info rem -------------------------------------------------------------------------------------------------------------------- cmake --version -conda --version javac -version nuget help swig -version git --version dotnet --version -rem -------------------------------------------------------------------------------------------------------------------- -rem Install Python Requirements -rem -------------------------------------------------------------------------------------------------------------------- - -conda install numpy -y -q -if %errorlevel% neq 0 exit %errorlevel% - -activate python3 || conda create --name python3 python=3 numpy -y -q +echo "Create environment: %python_version% - %conda_version%" +if '%python_version%' == '' goto SKIP_CONDA_UPDATE +echo "Configure conda" +rem call conda config --add channels conda-forge +rem call conda config --set channel_priority strict +rem call conda config --set allow_conda_downgrades true +echo "Update Anaconda" +call conda update -n base conda +call conda remove --name py%python_version% --all -y +rem call conda install conda=4.6.14 -y +echo "Create environment" +call conda create --no-default-packages -n py%python_version% python=%python_version% -y || echo "Environment exists" +echo "Activate py%python_version%" +call activate py%python_version% +if %errorlevel% neq 0 exit /b %errorlevel% +call conda install numpy wheel -y +if %errorlevel% neq 0 exit /b %errorlevel% +:SKIP_CONDA_UPDATE + +echo "Installing requirements complete"