Permalink
Browse files

build windows 32 bit

  • Loading branch information...
tcaduser committed Nov 14, 2018
1 parent 00ff07b commit 887b17d5adcc71df5dcbe82db3e5eb42d1779b47
Showing with 78 additions and 53 deletions.
  1. +3 −3 .travis.yml
  2. +4 −14 CMakeLists.txt
  3. +31 −7 appveyor.cmake
  4. +16 −15 appveyor.yml
  5. +24 −9 scripts/setup_appveyor.sh
  6. +0 −2 scripts/setup_ubuntu_14.04.sh
  7. +0 −3 testing/CMakeLists.txt
@@ -5,9 +5,9 @@ os:
- linux
- osx

branches:
only:
- master
#branches:
# only:
# - master

# please see this if you have issues in docker with utf8_py3.out
#https://stackoverflow.com/questions/29740662/python3-utf8-codecs-not-decoding-as-expected-in-docker-ubuntutrusty
@@ -1,4 +1,4 @@
PROJECT (SYMDIFF)
PROJECT (SYMDIFF CXX)

OPTION(TCLMAIN "Build with TCL Interpreter" ON)
#Python 2 version is always build
@@ -23,6 +23,7 @@ set(PROJECT_SCRIPTS_DIR ${PROJECT_SOURCE_DIR}/scripts)
set(PROJECT_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
set(PROJECT_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)

#TODO: put these in the individual setup scripts
IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
ADD_DEFINITIONS(-Wall -DTCL_THREADS -DUSE_TCL_STUBS -fvisibility=hidden)
#SET(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -33,21 +34,10 @@ ADD_DEFINITIONS(-Wall -DTCL_THREADS -DUSE_TCL_STUBS -fvisibility=hidden)
#SET (CMAKE_INSTALL_NAME_DIR "@rpath")
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
ENDIF(APPLE)
IF (WIN32)
ADD_DEFINITIONS(-DTCL_THREADS -DUSE_TCL_STUBS)
ADD_DEFINITIONS(-DSTATIC_BUILD -D_USE_MATH_DEFINES)
SET (CMAKE_CXX_WARNING_LEVEL 4)
SET (FLEX "C:/cygwin/bin/flex.exe")
SET (BISON "C:/cygwin/bin/bison.exe")
# warning C4251 for dll exports
# warning C4005 concerning macro redefines in stdint.h
# warning C4996: 'isatty': The POSIX name for this item is deprecated
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /wd4251 /wd4005 /wd4996")
SET (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /wd4251 /wd4005 /wd4996")
ELSE (WIN32)

SET (FLEX flex)
SET (DIFF diff)
SET (BISON bison)
ENDIF (WIN32)

INCLUDE(${SYMDIFF_CONFIG}.cmake OPTIONAL)

@@ -2,18 +2,42 @@
# http://creativecommons.org/publicdomain/zero/1.0/
#SET(PYTHON_BIN="/usr/bin/python")

ADD_DEFINITIONS(-DTCL_THREADS -DUSE_TCL_STUBS)
ADD_DEFINITIONS(-DSTATIC_BUILD -D_USE_MATH_DEFINES)
SET (CMAKE_CXX_WARNING_LEVEL 4)


# warning C4251 for dll exports
# warning C4005 concerning macro redefines in stdint.h
# warning C4996: 'isatty': The POSIX name for this item is deprecated
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /wd4251 /wd4005 /wd4996")
SET (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /wd4251 /wd4005 /wd4996")
#64 bit build
#SET(TCL_INCLUDE "c:/Tcl/include")
#SET(TCL_ARCHIVE "c:/Tcl/lib/tclstub85.lib")
SET(TCL_INCLUDE "c:/Miniconda-x64/Library/include")
SET(TCL_ARCHIVE "c:/Miniconda-x64/Library/lib/tclstub86.lib")
SET(TCL_BIN "c:/Miniconda-x64/Library/bin/tclsh.exe")
SET (PYTHON_ARCHIVE C:/Miniconda-x64/libs/python27.lib)
SET (PYTHON_INCLUDE C:/Miniconda-x64/include)
SET (PYTHON3_ARCHIVE C:/Miniconda36-x64/libs/python36.lib)
SET (PYTHON3_INCLUDE C:/Miniconda36-x64/include)
IF (${CMAKE_SIZEOF_VOID_P} MATCHES 4)
SET (MINICONDA2 C:/Miniconda)
SET (MINICONDA3 C:/Miniconda36)
ELSE (${CMAKE_SIZEOF_VOID_P} MATCHES 4)
SET (MINICONDA2 C:/Miniconda-x64)
SET (MINICONDA3 C:/Miniconda36-x64)
ENDIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4)

SET(TCL_INCLUDE "${MINICONDA2}/Library/include")
SET(TCL_ARCHIVE "${MINICONDA2}/Library/lib/tclstub86.lib")
SET(TCL_BIN "${MINICONDA2}/Library/bin/tclsh.exe")
SET (PYTHON_ARCHIVE ${MINICONDA2}/libs/python27.lib)
SET (PYTHON_INCLUDE ${MINICONDA2}/include)
SET (PYTHON3_ARCHIVE ${MINICONDA3}/libs/python36.lib)
SET (PYTHON3_INCLUDE ${MINICONDA3}/include)

SET (PERL "C:/cygwin/bin/perl.exe")
SET (FLEX "C:/cygwin/bin/flex.exe")
SET (BISON "C:/cygwin/bin/bison.exe")
SET (DIFF "C:/cygwin/bin/diff.exe")

SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /EHsc")
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:python3")
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")

@@ -76,14 +76,13 @@ clone_depth: 5 # clone entire repository history if not def
# secure: $#(JFDA)jQ@#$

# this is how to allow failing jobs in the matrix
#fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
matrix:
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
allow_failures:
- platform: x64
configuration: Release

# - platform: x86
# configuration: Debug
- platform: x86
configuration: Release

# build cache to preserve files/folders between builds
#cache:
@@ -111,10 +110,11 @@ install:
#- appveyor DownloadFile http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/ActiveTcl8.5.18.0.298892-win32-x86_64-threaded.exe
#- ActiveTcl8.5.18.0.298892-win32-x86_64-threaded.exe --directory C:\Tcl
# tcl libraries
- c:\Miniconda-x64\Scripts\conda install --yes tk
- IF "%PLATFORM%"=="x64" c:\Miniconda-x64\Scripts\conda install --yes tk
- IF "%PLATFORM%"=="x86" c:\Miniconda\Scripts\conda install --yes tk
- appveyor DownloadFile https://cygwin.com/setup-x86.exe
- setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P flex -P bison -P perl
- C:\cygwin\bin\bash.exe scripts/setup_appveyor.sh
- C:\cygwin\bin\bash.exe scripts/setup_appveyor.sh %PLATFORM%

# enable patching of AssemblyInfo.* files
#assembly_info:
@@ -137,12 +137,12 @@ install:
#---------------------------------#

# build platform, i.e. x86, x64, Any CPU. This setting is optional.
platform: x64
#platform: x64

# to add several platforms to build matrix:
#platform:
# - x86
# - Any CPU
platform:
- x64
- x86

# build Configuration, i.e. Debug, Release, etc.
configuration: Release
@@ -176,10 +176,11 @@ before_package:
after_build:

# to run your custom scripts instead of automatic MSBuild
# prevent NativeCommandError
build_script:
- cd win64
- cmake --build . --config Release -- /m
- IF "%PLATFORM%"=="x64" cd win64 && cmake --build . --config Release -- /m /nologo /verbosity:minimal
- IF "%PLATFORM%"=="x86" cd win32 && cmake --build . --config Release -- /m /nologo /verbosity:minimal


# to disable automatic builds
#build: off
@@ -226,9 +227,9 @@ test_script:
#- bin\symdiff_tcl.bat %APPVEYOR_BUILD_FOLDER%\testing\arrhenius_tcl.tcl
#- bin\symdiff.bat %APPVEYOR_BUILD_FOLDER%\examples\arrhenius.py
#- bin\symdiff_py3.bat %APPVEYOR_BUILD_FOLDER%\examples\arrhenius.py
- cd %APPVEYOR_BUILD_FOLDER%\win64
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- ctest
- IF "%PLATFORM%"=="x64" cd win64 && ctest
- IF "%PLATFORM%"=="x86" cd win32 && ctest

# to disable automatic tests
#test: off
@@ -5,35 +5,50 @@
CMAKE=/cygdrive/C/Program\ Files\ \(x86\)/CMake/bin/cmake.exe
SYMDIFF_CONFIG="appveyor"

if [ "$1" = x86 ]; then
GENERATOR="Visual Studio 15 2017"
BUILDDIR="win32"
python2base="c:\\Miniconda"
python3base="c:\\Miniconda36"
fi
if [ "$1" = x64 ]; then
GENERATOR="Visual Studio 15 2017 Win64"
BUILDDIR="win64"
python2base="c:\\Miniconda-x64"
python3base="c:\\Miniconda36-x64"
fi

#/usr/bin/mkdir -p win32
#(cd win32; "$CMAKE" -G "Visual Studio 14" -DSYMDIFF_CONFIG=${SYMDIFF_CONFIG} ..)

/usr/bin/mkdir -p win64
(cd win64; "$CMAKE" -G "Visual Studio 15 2017 Win64" -DSYMDIFF_CONFIG=${SYMDIFF_CONFIG} -DTCLMAIN=ON -DPYTHON3=ON ..)
/usr/bin/mkdir -p ${BUILDDIR}
#echo "$CMAKE" -G "${GENERATOR}" -DSYMDIFF_CONFIG=${SYMDIFF_CONFIG} -DTCLMAIN=ON -DPYTHON3=ON ..
(cd ${BUILDDIR}; "$CMAKE" -G "${GENERATOR}" -DSYMDIFF_CONFIG=${SYMDIFF_CONFIG} -DTCLMAIN=ON -DPYTHON3=ON ..)
#(cd win64; "$CMAKE" -G "Visual Studio 14 Win64" -DSYMDIFF_CONFIG=${SYMDIFF_CONFIG} -DTCLMAIN=ON ..)

libpath=`/usr/bin/cygpath -w $PWD/lib`
#python2bin="${python2base}\\python"
#python3bin="${python3base}\\python"

python2path='c:\Miniconda-x64\python'
#echo $libpath
# TODO: fix to use conda activate
/usr/bin/mkdir -p bin
/usr/bin/cat << EOF > bin/symdiff.bat
@setlocal
@echo off
SET PATH=c:\\Miniconda-x64;c:\\Miniconda-x64\\Library\\bin;%PATH%
SET PATH=${python2base};${python2base}\\Library\\bin;%PATH%
SET PYTHONPATH=$libpath
$python2path %*
python %*
EOF
/usr/bin/chmod +x bin/symdiff.bat

python3path='c:\Miniconda36-x64\python'
/usr/bin/cat << EOF > bin/symdiff_py3.bat
@setlocal
@echo off
SET PATH=c:\\Miniconda36-x64;c:\\Miniconda36-x64\\Library\\bin;%PATH%
SET PATH=${python3base};${python3base}\\Library\\bin;%PATH%
SET PYTHONIOENCODING=utf-8
SET PYTHONPATH=$libpath
$python3path %*
python %*
EOF
/usr/bin/chmod +x bin/symdiff_py3.bat

@@ -42,7 +57,7 @@ libpath=`/usr/bin/cygpath -m $PWD/lib`
/usr/bin/cat << EOF > bin/symdiff_tcl.bat
@setlocal
@echo off
SET PATH=c:\\Miniconda-x64;c:\\Miniconda-x64\\Library\\bin;%PATH%
SET PATH=${python2base};${python2base}\\Library\\bin;%PATH%
SET TCLLIBPATH="$libpath" %TCLLIBPATH%
tclsh %*
EOF
@@ -3,7 +3,6 @@
CMAKE="/usr/bin/cmake"
CMAKE_CXX_FLAGS="-std=c++0x"
CXX="/usr/bin/g++"
CC="/usr/bin/gcc"
TCL_ARCHIVE="/usr/lib/x86_64-linux-gnu/libtclstub.a"
TCL_INCLUDE="/usr/include/tcl"
TCL_BIN="/usr/bin/tclsh"
@@ -22,7 +21,6 @@ ARCH=`uname -m`
-DCMAKE_CXX_FLAGS:STRING="${CMAKE_CXX_FLAGS}" \
-DCMAKE_BUILD_TYPE=${TYPE} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_C_COMPILER=${CC} \
-DPYTHON_INCLUDE=${PYTHON_INCLUDE} \
-DPYTHON_ARCHIVE=${PYTHON_ARCHIVE} \
-DPYTHON_BIN=${PYTHON_BIN} \
@@ -4,8 +4,6 @@ INCLUDE_DIRECTORIES (
# pass linker so order important

IF (WIN32)
SET (DIFF C:/cygwin/bin/diff.exe)
SET (PERL C:/cygwin/bin/perl.exe)
SET (RUNDIFFTEST ${PERL} ${PROJECT_SOURCE_DIR}/testing/rundifftest.pl)
SET (GOLDENDIR ${PROJECT_SOURCE_DIR}/goldenresults/unix)
SET (RUNDIR ${PROJECT_SOURCE_DIR}/testing)
@@ -14,7 +12,6 @@ SET (TCLCOMP ${PROJECT_BIN_DIR}/symdiff_tcl.bat)
SET (PYTHONCOMP ${PROJECT_BIN_DIR}/symdiff.bat)
SET (PYTHON3COMP ${PROJECT_BIN_DIR}/symdiff_py3.bat)
ELSE (WIN32)
SET (DIFF diff)
SET (RUNDIFFTEST ${PROJECT_SOURCE_DIR}/testing/rundifftest.pl)
SET (GOLDENDIR ${PROJECT_SOURCE_DIR}/goldenresults/unix)
SET (RUNDIR ${PROJECT_SOURCE_DIR}/testing)

0 comments on commit 887b17d

Please sign in to comment.