Windows fix (#333)

* Fix cmake detection in msys

* Revert windows change

* Update to unix line endings
master
Adam Gibson 2020-03-20 12:14:03 +09:00 committed by GitHub
parent 0cf4a45573
commit 30a28fae45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 35 deletions

View File

@ -181,8 +181,6 @@ if [ "$(uname)" == "Darwin" ]; then
elif [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ] || [ "$(expr substr $(uname -s) 1 4)" == "MSYS" ]; then elif [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ] || [ "$(expr substr $(uname -s) 1 4)" == "MSYS" ]; then
HOST="windows" HOST="windows"
KERNEL="windows-x86_64" KERNEL="windows-x86_64"
# need to set build path separator, it ends up being wrong on msys2
BUILD_PATH_SEPARATOR=";"
echo "Running windows" echo "Running windows"
elif [ "$(uname -m)" == "ppc64le" ]; then elif [ "$(uname -m)" == "ppc64le" ]; then
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
@ -195,9 +193,9 @@ if [ -z "$OS" ]; then
OS="$HOST" OS="$HOST"
fi fi
if [[ -z ${ANDROID_NDK:-} ]]; then
export ANDROID_NDK=$HOME/Android/android-ndk/
echo "RUNNING BUILD FOR OS $OS" fi
case "$OS" in case "$OS" in
linux-armhf) linux-armhf)
@ -251,11 +249,8 @@ case "$OS" in
if [ -z "$ARCH" ]; then if [ -z "$ARCH" ]; then
ARCH="i686" ARCH="i686"
fi fi
echo "BUILDING ANDROID x86"
setandroid_defaults setandroid_defaults
export ANDROID_BIN="$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$KERNEL/" export ANDROID_BIN="$ANDROID_NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$KERNEL/"
export ANDROID_CPP="$ANDROID_NDK/sources/cxx-stl/llvm-libc++/" export ANDROID_CPP="$ANDROID_NDK/sources/cxx-stl/llvm-libc++/"
export ANDROID_CC="$ANDROID_NDK/toolchains/llvm/prebuilt/$KERNEL/bin/clang" export ANDROID_CC="$ANDROID_NDK/toolchains/llvm/prebuilt/$KERNEL/bin/clang"
@ -364,7 +359,6 @@ case "$OS" in
PARALLEL="true" PARALLEL="true"
VERBOSE_ARG="-v" VERBOSE_ARG="-v"
else else
echo "SETTING UP WINDOWS"
export CMAKE_COMMAND="cmake -G \"MSYS Makefiles\"" export CMAKE_COMMAND="cmake -G \"MSYS Makefiles\""
export MAKE_COMMAND="make" export MAKE_COMMAND="make"
export CC=/mingw64/bin/gcc export CC=/mingw64/bin/gcc
@ -524,7 +518,6 @@ OPENBLAS_PATH="${OPENBLAS_PATH//\\//}"
if [[ -n "${BUILD_PATH:-}" ]]; then if [[ -n "${BUILD_PATH:-}" ]]; then
PREVIFS="$IFS" PREVIFS="$IFS"
IFS="$BUILD_PATH_SEPARATOR" IFS="$BUILD_PATH_SEPARATOR"
echo "BUILD PATH BUILD_PATH_SEPARATOR IS $BUILD_PATH_SEPARATOR"
for P in $BUILD_PATH; do for P in $BUILD_PATH; do
if [[ -f "$P/include/openblas_config.h" ]]; then if [[ -f "$P/include/openblas_config.h" ]]; then
OPENBLAS_PATH="$P" OPENBLAS_PATH="$P"
@ -541,7 +534,6 @@ fi
# replace any backslash with a slash # replace any backslash with a slash
OPENBLAS_PATH="${OPENBLAS_PATH//\\//}" OPENBLAS_PATH="${OPENBLAS_PATH//\\//}"
mkbuilddir() { mkbuilddir() {
if [ "$CLEAN" == "true" ]; then if [ "$CLEAN" == "true" ]; then
echo "Removing blasbuild" echo "Removing blasbuild"
@ -609,9 +601,9 @@ if [ "$MAKE_COMMAND" == "make" ]; then
MAKE_ARGUMENTS="$MAKE_ARGUMENTS --output-sync=target" MAKE_ARGUMENTS="$MAKE_ARGUMENTS --output-sync=target"
fi fi
exec 3>&1 exec 3>&1
eval "$MAKE_COMMAND" "$MAKE_ARGUMENTS" 2>&1 >&3 3>&- | python3 ../../auto_vectorization/auto_vect.py && cd ../../.. eval "$MAKE_COMMAND" "$MAKE_ARGUMENTS" 2>&1 >&3 3>&- | python3 ../../auto_vectorization/auto_vect.py && cd ../../..
exec 3>&- exec 3>&-
else else
eval "$MAKE_COMMAND" "$MAKE_ARGUMENTS" && cd ../../.. eval "$MAKE_COMMAND" "$MAKE_ARGUMENTS" && cd ../../..
fi fi

View File

@ -1,22 +1,22 @@
# CMake toolchain to build for Android 5.0 or newer. Sample usage: # CMake toolchain to build for Android 5.0 or newer. Sample usage:
# #
set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a) set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK}") set(CMAKE_ANDROID_NDK "$ENV{ANDROID_NDK}")
set(CMAKE_ANDROID_STL_TYPE c++_shared) set(CMAKE_ANDROID_STL_TYPE c++_shared)
set(CMAKE_SYSTEM_VERSION "$ENV{ANDROID_VERSION}") set(CMAKE_SYSTEM_VERSION "$ENV{ANDROID_VERSION}")
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang) set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang)
set(ANDROID TRUE) set(ANDROID TRUE)
if (WIN32) if (WIN32)
set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}.exe") set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}.exe")
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++.exe") set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++.exe")
else() else()
set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}") set(CMAKE_C_COMPILER "$ENV{ANDROID_CC}")
set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++") set(CMAKE_CXX_COMPILER "$ENV{ANDROID_CC}++")
endif (WIN32) endif (WIN32)
add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target aarch64-none-linux-android -march=armv8-a) add_definitions(-D__ANDROID_API__=$ENV{ANDROID_VERSION} -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector-strong -target aarch64-none-linux-android -march=armv8-a)

View File

@ -287,6 +287,25 @@
<javacpp.platform.extension>-avx512</javacpp.platform.extension> <javacpp.platform.extension>-avx512</javacpp.platform.extension>
</properties> </properties>
</profile> </profile>
<profile>
<id>mingw</id>
<activation>
<os>
<family>windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<configuration>
<properties>${javacpp.platform}-mingw</properties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile> <profile>
<id>libnd4j-assembly</id> <id>libnd4j-assembly</id>