Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Reinecke
ducc
Commits
b7a416e3
Commit
b7a416e3
authored
Jun 08, 2020
by
Martin Reinecke
Browse files
Merge branch 'tweak_setup' into 'ducc_0_1'
partial merge of Simon's changes See merge request
!14
parents
e3d06876
b858f482
Pipeline
#76255
passed with stages
in 13 minutes and 4 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pyproject.toml
0 → 100644
View file @
b7a416e3
[build-system]
requires
=
[
"setuptools >= 40.6.0"
,
"pybind11 >= 2.5.0"
,
"numpy >= 1.17.0"
]
build-backend
=
"setuptools.build_meta"
python/ducc.cc
View file @
b7a416e3
...
...
@@ -24,6 +24,8 @@ using namespace mr;
PYBIND11_MODULE
(
PKGNAME
,
m
)
{
m
.
attr
(
"__version__"
)
=
PKGVERSION
;
add_fft
(
m
);
add_sht
(
m
);
add_totalconvolve
(
m
);
...
...
setup.py
View file @
b7a416e3
from
setuptools
import
setup
,
Extension
import
sys
import
os.path
import
itertools
from
glob
import
iglob
pkgname
=
'ducc_0_1'
class
_deferred_pybind11_include
(
object
):
def
__init__
(
self
,
user
=
False
):
self
.
user
=
user
def
__str__
(
self
):
import
pybind11
return
pybind11
.
get_include
(
self
.
user
)
from
setuptools
import
setup
,
Extension
import
pybind11
pkgname
=
'ducc_0_1'
version
=
'0.1.0'
def
_get_files_by_suffix
(
directory
,
suffix
):
path
=
directory
...
...
@@ -23,48 +17,66 @@ def _get_files_by_suffix(directory, suffix):
include_dirs
=
[
'.'
,
'./src/'
,
_deferred_pybind11_include
(
True
),
_deferred_pybind11_include
()]
pybind11
.
get_include
(
True
),
pybind11
.
get_include
(
False
)]
extra_compile_args
=
[
'--std=c++17'
,
'-march=native'
,
'-ffast-math'
,
'-O3'
]
python_module_link_args
=
[]
define_macros
=
[(
"PKGNAME"
,
pkgname
)]
define_macros
=
[(
"PKGNAME"
,
pkgname
),
(
"PKGVERSION"
,
'"%s"'
%
version
)]
if
sys
.
platform
==
'darwin'
:
import
distutils.sysconfig
extra_compile_args
+=
[
'-mmacosx-version-min=10.9'
]
python_module_link_args
+=
[
'-mmacosx-version-min=10.9'
,
'-bundle'
]
vars
=
distutils
.
sysconfig
.
get_config_vars
()
vars
[
'LDSHARED'
]
=
vars
[
'LDSHARED'
].
replace
(
'-bundle'
,
''
)
cfg_
vars
=
distutils
.
sysconfig
.
get_config_vars
()
cfg_
vars
[
'LDSHARED'
]
=
cfg_
vars
[
'LDSHARED'
].
replace
(
'-bundle'
,
''
)
elif
sys
.
platform
==
'win32'
:
extra_compile_args
=
[
'/Ox'
,
'/EHsc'
,
'/std:c++17'
]
else
:
extra_compile_args
+=
[
'-Wfatal-errors'
,
'-Wfloat-conversion'
,
'-W'
,
'-Wall'
,
'-Wstrict-aliasing=2'
,
'-Wwrite-strings'
,
'-Wredundant-decls'
,
'-Woverloaded-virtual'
,
'-Wcast-qual'
,
'-Wcast-align'
,
'-Wpointer-arith'
]
python_module_link_args
+=
[
'-march=native'
,
'-Wl,-rpath,$ORIGIN'
,
'-s'
]
extra_compile_args
+=
[
'-Wfatal-errors'
,
'-Wfloat-conversion'
,
'-W'
,
'-Wall'
,
'-Wstrict-aliasing=2'
,
'-Wwrite-strings'
,
'-Wredundant-decls'
,
'-Woverloaded-virtual'
,
'-Wcast-qual'
,
'-Wcast-align'
,
'-Wpointer-arith'
]
python_module_link_args
+=
[
'-march=native'
,
'-Wl,-rpath,$ORIGIN'
,
'-s'
]
# if you want debugging info, remove the "-s" from python_module_link_args
depfiles
=
(
_get_files_by_suffix
(
'.'
,
'h'
)
+
_get_files_by_suffix
(
'.'
,
'cc'
)
+
[
'setup.py'
])
def
get_extension_modules
():
depfiles
=
_get_files_by_suffix
(
'.'
,
'h'
)
+
_get_files_by_suffix
(
'.'
,
'cc'
)
+
[
'setup.py'
]
return
[
Extension
(
pkgname
,
language
=
'c++'
,
sources
=
[
'python/ducc.cc'
],
depends
=
depfiles
,
include_dirs
=
include_dirs
,
define_macros
=
define_macros
,
extra_compile_args
=
extra_compile_args
,
extra_link_args
=
python_module_link_args
)]
extensions
=
[
Extension
(
pkgname
,
language
=
'c++'
,
sources
=
[
'python/ducc.cc'
],
depends
=
depfiles
,
include_dirs
=
include_dirs
,
define_macros
=
define_macros
,
extra_compile_args
=
extra_compile_args
,
extra_link_args
=
python_module_link_args
)]
setup
(
name
=
pkgname
,
version
=
'0.1.0'
,
version
=
version
,
description
=
'Definitely useful code collection'
,
url
=
'https://gitlab.mpcdf.mpg.de/mtr/
cxxbase
'
,
url
=
'https://gitlab.mpcdf.mpg.de/mtr/
ducc
'
,
include_package_data
=
True
,
author
=
'Martin Reinecke'
,
author_email
=
'martin@mpa-garching.mpg.de'
,
packages
=
[],
setup
_requires
=
[
'numpy>=1.17.0'
,
'pybind11>=2.5.0'
]
,
ext_modules
=
get_
extension
_modules
()
,
install_requires
=
[
'numpy>=1.17.0'
,
'pybind11>=2.5.0'
],
python
_requires
=
">=3.6"
,
ext_modules
=
extension
s
,
install_requires
=
[
'numpy>=1.17.0'
],
license
=
"GPLv2"
,
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment