Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iRMB
VirtualFluids
Commits
1cd5bda3
Commit
1cd5bda3
authored
2 years ago
by
Hkorb
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
dd368931
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!170
Kernel templetization and efficiency improvements
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+18
-44
18 additions, 44 deletions
setup.py
utilities/setup_builder.py
+2
-2
2 additions, 2 deletions
utilities/setup_builder.py
with
20 additions
and
46 deletions
setup.py
+
18
−
44
View file @
1cd5bda3
...
...
@@ -5,72 +5,46 @@ import setuptools
import
skbuild
"""
Install python wrapper of
v
irtual
f
luids
Install python wrapper of
V
irtual
F
luids
install via python:
python setup.py
develop
python setup.py
install
set CMAKE Flags via -DBUILD_VF_GPU:BOOL=1
CMAKE flags have to be separated by --
example: python setup.py
develop
-- VBUILD_VF_CPU:BOOL=ON
example: python setup.py
install
-- VBUILD_VF_CPU:BOOL=ON
or install via pip:
pip install
-e
.
pip install .
for pip>21:
set CMAKE Flags via --config-settings
"
-DBUILD_VF_GPU=ON
"
example: pip install -e . --config-settings=
"
-DBUILD_VF_GPU=ON
"
example: pip install . --config-settings=
"
-DBUILD_VF_GPU=ON
"
each option has to be passed in individually i.e --config-settings=
"
-DOPT1=ON
"
--config-settings=
"
-DOPT2=OFF
"
for pip <21:
set CMAKE Flags via --global-option =
"
-DBUILD_VF_GPU=ON
"
example: pip install
-e
. --global-option=
"
-DBUILD_VF_GPU=ON
"
example: pip install . --global-option=
"
-DBUILD_VF_GPU=ON
"
"""
init_py
=
"
from .bindings import *
"
top_dir
=
Path
(
__file__
).
parent
#create __init__.py
pyfluids_dir
=
top_dir
/
"
pythonbindings/pyfluids
"
pyfluids_dir
.
mkdir
(
exist_ok
=
True
)
init_file
=
pyfluids_dir
/
"
__init__.py
"
init_file
.
write_text
(
init_py
)
(
pyfluids_dir
/
"
__init__.py
"
).
touch
()
# # create build_dir
# name_of_build_dir = "build"
# build_dir = top_dir/name_of_build_dir
# build_dir.mkdir(exist_ok=True)
package_name
=
"
pyfluids
"
target
=
"
python_bindings
"
src_dir
=
"
pythonbindings
"
config_args
=
[]
if
(
"
cmake_args
"
in
locals
()):
config_args
.
extend
([
f
"
{
k
}
=
{
v
}
"
for
k
,
v
in
locals
()[
"
cmake_args
"
].
items
()])
# hack to get config-args for installation with pip>21
cmake_args
=
[]
if
(
"
config_args
"
in
locals
()):
cmake_args
.
extend
([
f
"
{
k
}
=
{
v
}
"
for
k
,
v
in
locals
()[
"
config_args
"
].
items
()])
cmake_args
=
[
cmake_args
+=
[
f
"
-DPython3_ROOT_DIR=
{
Path
(
sys
.
prefix
)
}
"
,
"
-DBUILD_VF_PYTHON_BINDINGS=ON
"
,
"
-DBUILD_SHARED_LIBS=OFF
"
,
"
-DBUILD_VF_DOUBLE_ACCURACY=OFF
"
,
"
-DBUILD_VF_UNIT_TESTS:BOOL=OFF
"
,
"
-DBUILD_WARNINGS_AS_ERRORS=OFF
"
,
]
+
config_args
#+ sys_args
# maker = skbuild.cmaker.CMaker()
# maker.configure(clargs=cmake_args, cmake_install_dir=build_dir)
# maker.make(install_target=target)
]
skbuild
.
setup
(
name
=
"
pyfluids
"
,
packages
=
[
"
pyfluids
"
],
package_dir
=
{
""
:
"
pythonbindings
"
},
name
=
package_name
,
packages
=
[
package_name
],
package_dir
=
{
""
:
src_dir
},
cmake_args
=
cmake_args
,
cmake_install_target
=
target
,
# package_data={"pyfluids": ["bindings.*"]},
include_package_data
=
True
,
# cmake_install_dir="pythonbindings"
# data_files=[("python_bindings/pyfluids", ["bindings.*"])]
)
# setuptools.setup(
# name="pyfluids",
# packages=["pyfluids"],
# package_dir={"": "pythonbindings"},
# )
This diff is collapsed.
Click to expand it.
utilities/setup_builder.py
+
2
−
2
View file @
1cd5bda3
...
...
@@ -11,14 +11,14 @@ class builder(build_meta._BuildMetaBackend):
with
build_meta
.
_open_setup_script
(
__file__
)
as
f
:
code
=
f
.
read
().
replace
(
r
'
\r\n
'
,
r
'
\n
'
)
args
=
locals
()
args
[
"
c
make
_args
"
]
=
self
.
extra_args
args
[
"
c
onfig
_args
"
]
=
self
.
extra_args
exec
(
code
,
args
)
def
add_settings
(
self
,
config_settings
):
self
.
extra_args
=
dict
()
if
config_settings
:
self
.
extra_args
=
{
k
:
v
for
k
,
v
in
config_settings
.
items
()
if
k
[:
2
]
==
"
-D
"
}
self
.
extra_args
=
config_settings
def
build_wheel
(
self
,
wheel_directory
,
config_settings
=
None
,
metadata_directory
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment