Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Integrate mahilleb/Feb17 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Project Philly committed Feb 22, 2017
2 parents 28bbac4 + a11222a commit e2f0f9f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
45 changes: 31 additions & 14 deletions Scripts/install/linux/install-cntk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,54 @@
# for full license information.
# ==============================================================================

SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"

PARSED_ARGS=$(getopt -o '' --long py-version:,anaconda-basepath: -n "$SCRIPT_NAME" -- "$@")

[ $? != 0 ] && {
echo Terminating...
exit 1
}

eval set -- "$PARSED_ARGS"
PY_VERSION=35
ANACONDA_PREFIX="$HOME/anaconda3"

while [ $# -gt 0 ]; do
while true; do
case "$1" in
--py-version)
case "$2" in
27 | 34 | 35)
PY_VERSION="$2"
;;
*)
echo Invalid or missing value for --py-version option, please specify 27, 34, or 35.
echo Invalid value for --py-version option, please specify 27, 34, or 35.
exit 1
;;
esac
shift # extra shift
shift 2
;;
*)
echo Unknown option $1
exit 1
--anaconda-basepath)
ANACONDA_PREFIX="$2"
shift 2
;;
--)
shift
break
;;
esac
shift
done

[ $# = 0 ] || {
echo Extra parameters detected: $*
exit 1
}

# Log steps, stop on error
# TODO cut down on logging
set -x -e -o pipefail

SCRIPT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"

# Go to the drop root
cd "$SCRIPT_DIR/../../.."

Expand All @@ -51,7 +69,7 @@ CNTK_BINARY="$CNTK_BIN_PATH/cntk"
CNTK_PY_ENV_FILE="$SCRIPT_DIR/conda-linux-cntk-py$PY_VERSION-environment.yml"
CNTK_WHEEL_PATH="cntk/python/cntk-2.0.beta11.0-$PYWHEEL_QUALIFIER-linux_x86_64.whl"

test -d "$CNTK_BIN_PATH" && test -d "$CNTK_LIB_PATH" && test -d "$CNTK_DEP_LIB_PATH" &&
test -d "$CNTK_BIN_PATH" && test -d "$CNTK_LIB_PATH" && test -d "$CNTK_DEP_LIB_PATH" &&
test -d "$CNTK_TUTORIALS_PATH" &&
test -d "$CNTK_EXAMPLES_PATH" && test -x "$CNTK_BINARY" &&
test -f "$CNTK_PY_ENV_FILE" && test -f "$CNTK_WHEEL_PATH" || {
Expand Down Expand Up @@ -122,7 +140,6 @@ fi
# Anaconda install and environment setup
# TODO consider miniconda

ANACONDA_PREFIX="$HOME/anaconda3"
if [ -d "$ANACONDA_PREFIX" ]; then
printf "Path '%s' already exists, skipping Anaconda install\n" "$ANACONDA_PREFIX"
else
Expand All @@ -135,11 +152,11 @@ else
"./$ANACONDA" -b -p "$ANACONDA_PREFIX"
fi

CONDA="$HOME/anaconda3/bin/conda"
CONDA="$ANACONDA_PREFIX/bin/conda"
[ -x "$CONDA" ]
PY_ACTIVATE="$HOME/anaconda3/bin/activate"
PY_ACTIVATE="$ANACONDA_PREFIX/bin/activate"
[ -x "$PY_ACTIVATE" ]
PY_DEACTIVATE="$HOME/anaconda3/bin/deactivate"
PY_DEACTIVATE="$ANACONDA_PREFIX/bin/deactivate"
[ -x "$PY_DEACTIVATE" ]

CNTK_PY_ENV_NAME="cntk-py$PY_VERSION"
Expand Down
18 changes: 3 additions & 15 deletions Source/CNTKv2LibraryDll/CNTKv2LibraryDll.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
<AdditionalLibraryDirectories>$(SolutionDir)Source\ComputationNetworkLib;$(SolutionDir)Source\Math;$(MSMPI_LIB64);$(SolutionDir)$(Platform)\$(Configuration);$(NvmlLibPath);$(ProtobufLibPath)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(ReaderLibs);ComputationNetworkLib.lib;SequenceTrainingLib.lib;$(ProtobufLib);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(DebugBuild)">
<ClCompile>
Expand Down Expand Up @@ -106,12 +109,6 @@
<DelayLoadDLLs>Math.dll; msmpi.dll; PerformanceProfilerDll.dll </DelayLoadDLLs>
<OptimizeReferences Condition="'$(Configuration)|$(Platform)'=='Debug_CpuOnly|x64'">false</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_CpuOnly|x64'">prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_CpuOnly|x64'">prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(GpuBuild)">
<ClCompile>
Expand All @@ -124,15 +121,6 @@
<Command>if exist "%ProgramW6432%\NVIDIA Corporation\NVSMI" xcopy /I /D /Y "%ProgramW6432%\NVIDIA Corporation\NVSMI\nvml*.dll" "$(TargetDir)"</Command>
<Message>Copying NVidia GDK extension DLL to target folder</Message>
</PostBuildEvent>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_NoOpt|x64'">prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">prebuild.bat "$(Configuration)" "$(CNTK_MKL_SEQUENTIAL)" "$(CNTK_ENABLE_1BitSGD)" "$(CudaPath)" "$(CUDNN_PATH)" "$(CUB_PATH)" "$(CNTK_ENABLE_ASGD)"</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="API\CNTKLibrary.h" />
Expand Down
5 changes: 1 addition & 4 deletions Tests/Install/windows/test-install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ Expand-Archive -Path BinaryDrop.zip
$installCache = '.\BinaryDrop\cntk\Scripts\install\windows\InstallCache'
Move-Item -Path InstallCache -Destination $installCache

# Mock host input for installation
function Read-Host { if ($global:readHostMockCtr++) { 'y' } else { '1' } }

.\BinaryDrop\cntk\Scripts\install\windows\install.ps1 -Execute
.\BinaryDrop\cntk\Scripts\install\windows\install.ps1 -NoConfirm

Set-Location BinaryDrop
..\test-install.bat cntk\scripts\cntkpy35.bat
Expand Down

0 comments on commit e2f0f9f

Please sign in to comment.