Skip to content

Commit

Permalink
fixes for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Jan 9, 2024
1 parent 8c39105 commit b1c943e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ dependencies:
- cmake
- cmake-build-extension
- control
- make
- ninja
- matplotlib
- numpy
- pandas
Expand Down
34 changes: 4 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#import inspect
import os
import sys
from pathlib import Path
Expand All @@ -7,22 +6,6 @@
import cmake_build_extension
import setuptools

# Importing the bindings inside the build_extension_env context manager is necessary only
# in Windows with Python>=3.8.
# See https://github.com/diegoferigo/cmake-build-extension/issues/8.
# Note that if this manager is used in the init file, cmake-build-extension becomes an
# install_requires that must be added to the setup.cfg. Otherwise, cmake-build-extension
# could only be listed as build-system requires in pyproject.toml since it would only
# be necessary for packaging and not during runtime.
#init_py = inspect.cleandoc(
# """
# import cmake_build_extension

# with cmake_build_extension.build_extension_env():
# from . import bindings
# """
#)

# Extra options passed to the CI/CD pipeline that uses cibuildwheel
CIBW_CMAKE_OPTIONS = []
if "CIBUILDWHEEL" in os.environ and os.environ["CIBUILDWHEEL"] == "1":
Expand Down Expand Up @@ -65,27 +48,18 @@
if "FC" not in os.environ:
os.environ["FC"] = "gfortran"

if "gfortran" in os.environ["FC"].lower():
cmake_args += ['-G', 'MinGW Makefiles']
else:
cmake_args += ['-DCMAKE_GENERATOR_PLATFORM=x64']
#if "gfortran" in os.environ["FC"].lower():
# cmake_args += ['-G', 'MinGW Makefiles']
#else:
# cmake_args += ['-DCMAKE_GENERATOR_PLATFORM=x64']

# This example is compliant with PEP517 and PEP518. It uses the setup.cfg file to store
# most of the package metadata. However, build extensions are not supported and must be
# configured in the setup.py.
setuptools.setup(
ext_modules=[
cmake_build_extension.CMakeExtension(
# This could be anything you like, it is used to create build folders
name="rosco",
install_prefix="rosco",
# Exposes the binary print_answer to the environment.
# It requires also adding a new entry point in setup.cfg.
#expose_binaries=["bin/print_answer"],
# Writes the content to the top-level __init__.py
#write_top_level_init=init_py,
# Selects the folder where the main CMakeLists.txt is stored
# (it could be a subfolder)
source_dir=os.path.join('rosco','controller'),
cmake_configure_options=cmake_args + CIBW_CMAKE_OPTIONS,
),
Expand Down

0 comments on commit b1c943e

Please sign in to comment.