Added scripts and debugged cmake to make compile windows ready. Now it compiles, bug the problem is, we have DLL load failed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Anne de Jong 2023-04-19 12:36:32 -07:00
parent 3f0d9f4b00
commit ad864ddb4a
4 changed files with 47 additions and 34 deletions

View File

@ -3,27 +3,9 @@ if(WIN32)
# set(miniconda_dir ${home}\\Miniconda3)
message("Building for Windows")
include_directories(
..\\rtaudio
C:\\mingw\\mingw64\\include\\OpenBLAS
link_directories(${home}\\miniconda3\\Library\\include)
)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH} $miniconda_dir\\Lib\\cmake")
# include(
add_definitions(-DMS_WIN64)
link_directories(C:\\mingw\\mingw64\\lib)
link_directories(C:\\mingw\\mingw64\\bin)
link_directories(..\\rtaudio)
link_directories(${home}\\Miniconda3)
add_definitions(-DHAS_RTAUDIO_WIN_WASAPI_API)
else() # Linux compile
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wfatal-errors")
include_directories(/usr/local/include/rtaudio)
include_directories(/usr/include/rtaudio)
link_directories(/usr/local/lib)
# This should become optional later on, and be added to the windows list as
# well.
endif()
# The last argument here takes care of calling SIGABRT when an integer overflow
# occures.

View File

@ -0,0 +1,3 @@
#!/bin/sh
#
cmake . -G"MinGW Makefiles" -DLASP_HAS_ULDAQ=OFF -DPython3_ROOT_DIR=C:\\winpython\\python-3.10.9.amd64

View File

@ -0,0 +1,23 @@
#!/bin/sh
#
#
# set default options for invoking pacman (in CI this variable is already set globally)
if [ -z $CI ]; then
PACMAN_OPTIONS="--needed --noconfirm"
fi
arch=mingw-w64-x86_64
pacman -S ${PACMAN_OPTIONS} make
deps="gcc make toolchain ccache cmake openblas pybind11 fftw"
for dep in $deps; do
pacman -S ${PACMAN_OPTIONS} ${arch}-${dep}
done
# install Python modules not provided as MSYS2/MinGW packages
#PACKAGES=""
#for arch in $(eval echo $ARCH); do
#/mingw64/bin/pip3 install --upgrade ${PACKAGES}
#done

View File

@ -1,26 +1,31 @@
import glob, os
import platform
from setuptools import setup
if 'Linux' in platform.platform():
ext_name_glob = 'lasp_cpp.cpython*'
extensions = list(glob.glob('src/lasp/' + ext_name_glob))
pf = platform.platform()
if 'Linux' in pf:
ext_name_glob = 'lasp_cpp.cpython*'
# Split of path from file.
ext_names = [os.path.split(a)[1] for a in extensions]
extensions = list(glob.glob('src/lasp/' + ext_name_glob))
elif 'Windows' in pf:
ext_name_glob = 'lasp_cpp.cp*.pyd'
# Split of path from file.
extensions = list(glob.glob('src\\lasp/' + ext_name_glob))
else:
raise RuntimeError('Not yet Windows-proof')
print(extensions)
ext_names = [os.path.split(a)[1] for a in extensions]
if len(extensions) == 0:
raise RuntimeError('Please first run CMake to build extension')
elif len(extensions) > 1:
raise RuntimeError('Too many extension files found')
pkgdata = ext_names
else:
raise RuntimeError('Not yet Windows-proof')
classifiers = [
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3.8",