Unverified Commit b9070f76 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #14 from jcarpent/devel

Try Windows without CppADCodeGen
parents d215aad4 c4ba2e4c
......@@ -3,10 +3,6 @@ name: PyCppAD CI for MacOS/Linux
on:
pull_request:
push:
branches:
- master
- devel
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
......@@ -56,7 +52,6 @@ jobs:
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON
make
make build_tests
export CTEST_OUTPUT_ON_FAILURE=1
make test
make install
......@@ -65,4 +60,4 @@ jobs:
shell: bash -l {0}
run: |
cd build
make uninstall
\ No newline at end of file
make uninstall
name: PyCppAD CI for Windows
name: PyCppAD CI for Windows - Clang
on:
pull_request:
push:
branches:
- master
- devel
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
......@@ -63,7 +60,7 @@ jobs:
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON ^
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=OFF ^
..
:: Build
......
name: PyCppAD CI for Windows - (v142)
on:
pull_request:
push:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
name: [windows-latest]
include:
- name: windows-latest
os: windows-2019
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
run: |
git submodule update --init
- uses: goanpeca/setup-miniconda@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
activate-environment: pycppad
environment-file: .github/workflows/conda/conda-env.yml
python-version: 3.7
- name: Install cmake and update conda
run: |
conda install cmake -c main
- name: Build PyCppAD
shell: cmd /C CALL {0}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
:: unset extra Boost envs
set Boost_ROOT=
set BOOST_ROOT_1_69_0=
set BOOST_ROOT_1_72_0=
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
:: Create build directory
mkdir build
pushd build
:: Configure
cmake ^
-G "Visual Studio 16 2019" -T "v142" -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=OFF ^
..
:: Build
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
:: Testing
set PATH=%PATH%;%CONDA_PREFIX%\Lib\site-packages\pycppad
ctest --output-on-failure -C Release -V
:: Test Python import
cd ..
python -c "import pycppad"
......@@ -99,6 +99,21 @@ IF(BUILD_WITH_CPPAD_CODEGEN_BINDINGS)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${CMAKE_DL_LIBS})
ENDIF(BUILD_WITH_CPPAD_CODEGEN_BINDINGS)
IF(MSVC)
TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PUBLIC "/bigobj")
ENDIF()
# Do not report:
# -Wconversion as the BOOST_PYTHON_FUNCTION_OVERLOADS implicitly converts.
# -Wcomment as latex equations have multi-line comments.
IF(NOT WIN32)
TARGET_COMPILE_OPTIONS(${PROJECT_NAME} PRIVATE -Wno-conversion -Wno-comment)
ENDIF(NOT WIN32)
IF(WIN32)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DNOMINMAX)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${PYTHON_LIBRARY})
ENDIF(WIN32)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME}
SYSTEM PUBLIC
${Boost_INCLUDE_DIRS}
......
......@@ -5,6 +5,7 @@
#ifndef __pycppad_cppad_hpp__
#define __pycppad_cppad_hpp__
#include "pycppad/fwd.hpp"
namespace pycppad
{
......@@ -12,7 +13,7 @@ namespace pycppad
template<typename Scalar>
void exposeCppADScalar();
void enablePyCppAD();
PYCPPAD_DLLAPI void enablePyCppAD();
}
#endif // #ifndef __pycppad_cppad_hpp__
......@@ -25,12 +25,16 @@ IF(IS_ABSOLUTE ${PYTHON_SITELIB})
ELSE()
SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
ENDIF()
IF(WIN32)
TARGET_COMPILE_DEFINITIONS(${PYWRAP} PRIVATE -DNOMINMAX)
TARGET_LINK_LIBRARIES(${PYWRAP} PUBLIC ${PYTHON_LIBRARY})
ENDIF(WIN32)
SET_TARGET_PROPERTIES(${PYWRAP}
PROPERTIES
PREFIX ""
SUFFIX ${PYTHON_EXT_SUFFIX}
OUTPUT_NAME "${PROJECT_NAME}"
OUTPUT_NAME "${PYWRAP}"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/python/${PROJECT_NAME}"
)
......
......@@ -23,7 +23,7 @@ inline std::string printVersion(const std::string & delimiter = ".")
namespace bp = boost::python;
BOOST_PYTHON_MODULE(pycppad)
BOOST_PYTHON_MODULE(pycppad_pywrap)
{
bp::docstring_options module_docstring_options(true,true,false);
......
......@@ -2,5 +2,5 @@
# Copyright 2021 INRIA
#
from .pycppad import *
#from .pycppad import __version__, __raw_version__
from .pycppad_pywrap import *
from .pycppad_pywrap import __version__, __raw_version__
......@@ -9,7 +9,6 @@
#include "pycppad/cppad.hpp"
#include "pycppad/cppad-scalar.hpp"
namespace pycppad
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment