-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 461180f
Showing
25 changed files
with
596 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
xndpy | ||
===== | ||
|
||
xndpy is intended for packaging the Python bindings for xnd. The authoritative | ||
sources for the Python modules are in the xnd repository, where they are built | ||
for testing libndtypes, libxnd and libgumath. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, Stefan Krah | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
if "%~1" == "" goto usage | ||
if "%~2" == "" goto usage | ||
if "%~3" == "" goto usage | ||
if not "%~4" == "" goto usage | ||
|
||
set executable=%1 || goto out | ||
set arch=%2 || goto out | ||
set install_prefix=%3 || goto out | ||
|
||
if exist xnd_build rd /q /s xnd_build || goto out | ||
mkdir xnd_build || goto out | ||
cd xnd_build || goto out | ||
|
||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath > vcpath.txt || goto out | ||
set /p vcpath=<vcpath.txt || goto out | ||
del vcpath.txt || goto out | ||
call "%vcpath%\VC\Auxiliary\Build\vcvarsall.bat" %arch% || goto out | ||
|
||
cmake -S ..\source\xnd -DCMAKE_BUILD_TYPE=Release ^ | ||
-DCMAKE_INSTALL_PREFIX=%install_prefix% ^ | ||
-DPython3_EXECUTABLE="%executable%" ^ | ||
-DMOD_GUMATH_WITH_XNDLIB=ON || goto out | ||
|
||
cmake --build . --config Release --target install --parallel || goto out | ||
|
||
cd .. | ||
|
||
:out | ||
exit /b 0 | ||
|
||
:usage | ||
echo "build.bat: usage: build.bat ^<python3 executable^> ^<architecture^> ^<install_prefix^>" | ||
exit /b 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DO NOT EDIT: This file may be overwritten by in-tree builds. The real | ||
# sources are in src/xnd/mod/ndtypes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from flit.buildapi import build_wheel as _build_wheel | ||
from flit.buildapi import build_sdist as _build_sdist | ||
import os ,platform, shutil | ||
import subprocess, sys, sysconfig | ||
|
||
def check_err(proc): | ||
if proc.returncode != 0: | ||
raise RuntimeError("executing cmake commands failed") | ||
|
||
def call_cmake(install_prefix): | ||
proc = subprocess.run(["cmake", | ||
"-S", "../source/xnd", | ||
"-DCMAKE_BUILD_TYPE=Release", | ||
"-DCMAKE_INSTALL_PREFIX=%s" % install_prefix, | ||
"-DPython3_EXECUTABLE=%s" % sys.executable, | ||
"-DMOD_GUMATH_WITH_XNDLIB=ON"]) | ||
check_err(proc) | ||
|
||
proc = subprocess.run(["cmake", | ||
"--build", ".", | ||
"--config", "Release", | ||
"--target", "install", | ||
"--parallel"]) | ||
check_err(proc) | ||
|
||
def build_wheel(wheel_dir, config_settings=None, metadata_directory=None): | ||
|
||
arch = "x64" if platform.architecture()[0] == "64bit" else "x86" | ||
mingw = "mingw" in sysconfig.get_platform() | ||
install_prefix = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
if sys.platform == "win32" and not mingw: | ||
proc = subprocess.run(["build.bat", sys.executable, arch, install_prefix]) | ||
else: | ||
if os.path.isdir("gumath_build"): | ||
shutil.rmtree("gumath_build") | ||
os.mkdir("gumath_build") | ||
os.chdir("gumath_build") | ||
|
||
try: | ||
call_cmake(install_prefix) | ||
finally: | ||
os.chdir("..") | ||
|
||
return _build_wheel(wheel_dir, config_settings, metadata_directory) | ||
|
||
def build_sdist(sdist_dir, config_settings=None): | ||
return _build_sdist(sdist_dir, config_settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[project] | ||
name = "gumath" | ||
version = "0.3.2" | ||
dependencies = ["xndlibs==0.3.2", "ndtypes==0.3.2", "xnd==0.3.2"] | ||
requires-python = ">=3.8" | ||
|
||
authors = [ { name = "Stefan Krah", email = "skrah@bytereef.org" } ] | ||
license = { file = "LICENSE.txt" } | ||
description = "Dynamic types for data description and in-memory computations" | ||
keywords = ["gumath", "array computing", "data description"] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: End Users/Desktop", | ||
"Intended Audience :: Financial and Insurance Industry", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD-3-clause", | ||
"Programming Language :: C", | ||
"Programming Language :: C++", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
"Topic :: Software Development"] | ||
|
||
[build-system] | ||
requires = ["flit"] | ||
build-backend = "gumath_backend" | ||
backend-path = ["."] | ||
|
||
[tool.flit.sdist] | ||
include = ["gumath", "source", "gumath_backend.py", "build.bat", | ||
"pyproject.toml"] | ||
exclude = ["source/xnd/.git"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, Stefan Krah | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
if "%~1" == "" goto usage | ||
if "%~2" == "" goto usage | ||
if "%~3" == "" goto usage | ||
if not "%~4" == "" goto usage | ||
|
||
set executable=%1 || goto out | ||
set arch=%2 || goto out | ||
set install_prefix=%3 || goto out | ||
|
||
if exist xnd_build rd /q /s xnd_build || goto out | ||
mkdir xnd_build || goto out | ||
cd xnd_build || goto out | ||
|
||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath > vcpath.txt || goto out | ||
set /p vcpath=<vcpath.txt || goto out | ||
del vcpath.txt || goto out | ||
call "%vcpath%\VC\Auxiliary\Build\vcvarsall.bat" %arch% || goto out | ||
|
||
cmake -S ..\source\xnd -DCMAKE_BUILD_TYPE=Release ^ | ||
-DCMAKE_INSTALL_PREFIX=%install_prefix% ^ | ||
-DPython3_EXECUTABLE="%executable%" ^ | ||
-DMOD_NDTYPES_WITH_XNDLIB=ON || goto out | ||
|
||
cmake --build . --config Release --target install --parallel || goto out | ||
|
||
cd .. | ||
|
||
:out | ||
exit /b 0 | ||
|
||
:usage | ||
echo "build.bat: usage: build.bat ^<python3 executable^> ^<architecture^> ^<install_prefix^>" | ||
exit /b 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# DO NOT EDIT: This file may be overwritten by in-tree builds. The real | ||
# sources are in src/xnd/mod/ndtypes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from flit.buildapi import build_wheel as _build_wheel | ||
from flit.buildapi import build_sdist as _build_sdist | ||
import os ,platform, shutil | ||
import subprocess, sys, sysconfig | ||
|
||
def check_err(proc): | ||
if proc.returncode != 0: | ||
raise RuntimeError("executing cmake commands failed") | ||
|
||
def call_cmake(install_prefix): | ||
proc = subprocess.run(["cmake", | ||
"-S", "../source/xnd", | ||
"-DCMAKE_BUILD_TYPE=Release", | ||
"-DCMAKE_INSTALL_PREFIX=%s" % install_prefix, | ||
"-DPython3_EXECUTABLE=%s" % sys.executable, | ||
"-DMOD_NDTYPES_WITH_XNDLIB=ON"]) | ||
check_err(proc) | ||
|
||
proc = subprocess.run(["cmake", | ||
"--build", ".", | ||
"--config", "Release", | ||
"--target", "install", | ||
"--parallel"]) | ||
check_err(proc) | ||
|
||
def build_wheel(wheel_dir, config_settings=None, metadata_directory=None): | ||
|
||
arch = "x64" if platform.architecture()[0] == "64bit" else "x86" | ||
mingw = "mingw" in sysconfig.get_platform() | ||
install_prefix = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
if sys.platform == "win32" and not mingw: | ||
proc = subprocess.run(["build.bat", sys.executable, arch, install_prefix]) | ||
else: | ||
if os.path.isdir("ndtypes_build"): | ||
shutil.rmtree("ndtypes_build") | ||
os.mkdir("ndtypes_build") | ||
os.chdir("ndtypes_build") | ||
|
||
try: | ||
call_cmake(install_prefix) | ||
finally: | ||
os.chdir("..") | ||
|
||
return _build_wheel(wheel_dir, config_settings, metadata_directory) | ||
|
||
def build_sdist(sdist_dir, config_settings=None): | ||
return _build_sdist(sdist_dir, config_settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[project] | ||
name = "ndtypes" | ||
version = "0.3.2" | ||
dependencies = ["xndlibs==0.3.2"] | ||
requires-python = ">=3.8" | ||
|
||
authors = [ { name = "Stefan Krah", email = "skrah@bytereef.org" } ] | ||
license = { file = "LICENSE.txt" } | ||
description = "Dynamic types for data description and in-memory computations" | ||
keywords = ["ndtypes", "array computing", "data description"] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: End Users/Desktop", | ||
"Intended Audience :: Financial and Insurance Industry", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD-3-clause", | ||
"Programming Language :: C", | ||
"Programming Language :: C++", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
"Topic :: Software Development"] | ||
|
||
[build-system] | ||
requires = ["flit"] | ||
build-backend = "ndtypes_backend" | ||
backend-path = ["."] | ||
|
||
[tool.flit.sdist] | ||
include = ["ndtypes", "source", "ndtypes_backend.py", "build.bat", | ||
"pyproject.toml"] | ||
exclude = ["source/xnd/.git"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2024, Stefan Krah | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
if "%~1" == "" goto usage | ||
if "%~2" == "" goto usage | ||
if "%~3" == "" goto usage | ||
if not "%~4" == "" goto usage | ||
|
||
set executable=%1 || goto out | ||
set arch=%2 || goto out | ||
set install_prefix=%3 || goto out | ||
|
||
if exist xnd_build rd /q /s xnd_build || goto out | ||
mkdir xnd_build || goto out | ||
cd xnd_build || goto out | ||
|
||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath > vcpath.txt || goto out | ||
set /p vcpath=<vcpath.txt || goto out | ||
del vcpath.txt || goto out | ||
call "%vcpath%\VC\Auxiliary\Build\vcvarsall.bat" %arch% || goto out | ||
|
||
cmake -S ..\source\xnd -DCMAKE_BUILD_TYPE=Release ^ | ||
-DCMAKE_INSTALL_PREFIX=%install_prefix% ^ | ||
-DPython3_EXECUTABLE="%executable%" ^ | ||
-DMOD_XND_WITH_XNDLIB=ON || goto out | ||
|
||
cmake --build . --config Release --target install --parallel || goto out | ||
|
||
cd .. | ||
|
||
:out | ||
exit /b 0 | ||
|
||
:usage | ||
echo "build.bat: usage: build.bat ^<python3 executable^> ^<architecture^> ^<install_prefix^>" | ||
exit /b 1 |
Oops, something went wrong.