Skip to content

Commit

Permalink
Merge pull request #356 from X-DataInitiative/swig4
Browse files Browse the repository at this point in the history
swig v4
  • Loading branch information
PhilipDeegan authored May 15, 2019
2 parents cd284cd + 0ad0621 commit 3f27be1
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ matrix:
language: generic
sudo: required
env:
- PYVER=3.6.1
osx_image: xcode9.1
- PYVER=3.6.7
osx_image: xcode10.2
## 3.7 is dropped until more mature
# - os: osx
# language: generic
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ cache:
install:
- git submodule update --init
- curl -o mkn.exe -L https://github.com/Dekken/maiken/raw/binaries/win10_x64/mkn.exe
- IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install tools\windows\swig.3.0.12.nupkg --yes --limit-output #> $null
- IF NOT EXIST C:\ProgramData\chocolatey\bin\swig.exe choco install tools\windows\swig.4.0.0.nupkg --yes --limit-output #> $null
- cat C:\ProgramData\chocolatey\logs\chocolatey.log
- git clone https://github.com/X-DataInitiative/tick_appveyor -b master --depth 1 appveyor

build_script:
Expand Down
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ def add_dir_name(dir_name, filenames):

min_swig_opts = ['-py3',
'-c++',
'-modern',
'-new_repr',
'-Ilib/swig',
'-Ilib/include',
'-outdir', swig_path.build,
Expand Down Expand Up @@ -302,9 +300,6 @@ def add_dir_name(dir_name, filenames):
else:
## Added -Wall to get all warnings and -Werror to treat them as errors
extra_compile_args.append("-Werror")
## This warning is turned off because SWIG generates files that triggers the
## warning
extra_compile_args.append("-Wno-uninitialized")

# Include directory of module
mod = SwigPath(module_dir, extension_name)
Expand Down
6 changes: 3 additions & 3 deletions sh/swig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ for P in "${PROFILES[@]}"; do
[ -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \
rm "${SWIG_BASE}/$P/${B}_wrap.cpp"
[ ! -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \
$SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \
$SWIG -python -py3 -c++ ${INCS[@]} \
-outdir $DIR/build "$SWIG_C_FLAGS" \
-o ${SWIG_BASE}/$P/${B}_wrap.cpp $IF
else
Expand All @@ -70,7 +70,7 @@ for P in "${PROFILES[@]}"; do
[ -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \
rm "${SWIG_BASE}/$P/${B}_wrap.cpp"
[ ! -f "${SWIG_BASE}/$P/${B}_wrap.cpp" ] && \
$SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \
$SWIG -python -py3 -c++ ${INCS[@]} \
-outdir $DIR/build "$SWIG_C_FLAGS" \
-o ${SWIG_BASE}/$P/${B}_wrap.cpp $IF
done
Expand All @@ -80,7 +80,7 @@ for P in "${PROFILES[@]}"; do
[ -f "${SWIG_BASE}/$P/${P1}_wrap.cpp" ] && \
rm "${SWIG_BASE}/$P/${P1}_wrap.cpp"
[ ! -f "${SWIG_BASE}/$P/${P}_wrap.cpp" ] && \
$SWIG -python -py3 -c++ -modern -new_repr ${INCS[@]} \
$SWIG -python -py3 -c++ ${INCS[@]} \
-outdir $DIR/build "$SWIG_C_FLAGS" -o ${SWIG_BASE}/$P/${P1}_wrap.cpp \
"${DIR}/swig/${P1}.i"
fi
Expand Down
2 changes: 1 addition & 1 deletion tick/dataset/download_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def load_dataset(dataset_path, data_home=None, n_features=None):
cache_path = os.path.join(data_home, dataset_path)

if cache_path.endswith(".npz"):
dataset = np.load(cache_path)
dataset = np.load(cache_path, allow_pickle=True)
# If we have only one numpy array we return it directly otherwise
# we return the row dictionary
if len(dataset.keys()) == 1:
Expand Down
9 changes: 8 additions & 1 deletion tools/travis/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ set -e -x
cp -R /io src
cd src

eval "$(pyenv init -)"
( apt-get update && apt-get remove --purge -y swig* && apt-get autoremove && \
apt-get install -y autotools-dev automake gawk bison flex && \
git clone https://github.com/swig/swig -b rel-4.0.0 swig && \
cd swig && ./autogen.sh && ./configure --without-pcre && \
make && make install ) & SWIG_PID=$!

eval "$(pyenv init -)"
pyenv global ${PYVER}
pyenv local ${PYVER}

Expand All @@ -20,6 +25,8 @@ pyenv local ${PYVER}

python -m pip install -r requirements.txt
python setup.py cpplint
wait $SWIG_PID
swig -version # should be 4.0.0
PYMAJ=$(python -c "import sys; print(sys.version_info[0])")
PYMIN=$(python -c "import sys; print(sys.version_info[1])")
if (( PYMAJ == 3 )) && (( PYMIN == 6 )); then
Expand Down
21 changes: 7 additions & 14 deletions tools/travis/osx_install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
#!/usr/bin/env bash

set -e -x
set -ex

shell_session_update() { :; }

brew update
brew upgrade pyenv
brew install swig


if [ ! -d googletest ] || [ ! -f googletest/CMakeLists.txt ]; then
git clone https://github.com/google/googletest
mkdir -p googletest/build
pushd googletest/build
cmake .. && make -s && make -s install
popd
fi
( git clone https://github.com/google/googletest && \
mkdir -p googletest/build && cd googletest/build && \
cmake .. && make -s && make -s install) & GTEST_PID=$!

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
Expand All @@ -24,7 +18,7 @@ export CXX="clang++"

eval "$(pyenv init -)"

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -s ${PYVER}
env CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -s ${PYVER}

pyenv local ${PYVER}

Expand All @@ -42,8 +36,7 @@ fi
python -m pip install --quiet -U pip
python -m pip install --quiet numpy pandas
python -m pip install -r requirements.txt
python -m pip install sphinx pillow
python -m pip install cpplint
python -m pip install sphinx pillow cpplint
[[ "${PYVER}" != "3.7.0" ]] && python -m pip install tensorflow # does not yet exist on python 3.7
pyenv rehash

wait $GTEST_PID
Binary file removed tools/windows/swig.3.0.12.nupkg
Binary file not shown.
Binary file added tools/windows/swig.4.0.0.nupkg
Binary file not shown.

0 comments on commit 3f27be1

Please sign in to comment.