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
TurTLE
TurTLE
Commits
d93071dc
Commit
d93071dc
authored
Sep 07, 2021
by
Cristian Lalescu
Browse files
cleans up __init__.py and setup.py
parent
f5720cc6
Pipeline
#109395
passed with stages
in 32 minutes and 43 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
d93071dc
...
...
@@ -498,6 +498,11 @@ configure_file(
"
${
PROJECT_SOURCE_DIR
}
/TurTLE/__init__.py.in"
"
${
PROJECT_SOURCE_DIR
}
/TurTLE/__init__.py"
@ONLY
)
# update setup.py
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/setup.py.in"
"
${
PROJECT_BINARY_DIR
}
/python/setup.py"
@ONLY
)
# copy command
install
(
CODE
"execute_process(COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
PROJECT_SOURCE_DIR
}
/TurTLE
${
PROJECT_BINARY_DIR
}
/python/TurTLE/)"
)
if
(
EXISTS
"
${
PROJECT_BINARY_DIR
}
/host_info.py"
)
...
...
@@ -509,7 +514,7 @@ else()
install
(
CODE
"execute_process(COMMAND
${
CMAKE_COMMAND
}
-E copy
${
PROJECT_SOURCE_DIR
}
/pc_host_info.py
${
PROJECT_BINARY_DIR
}
/python/TurTLE/host_info.py)"
)
endif
()
endif
()
install
(
CODE
"execute_process(COMMAND
${
PYTHON_EXECUTABLE
}
${
PROJECT_
SOURCE_DIR
}
/setup.py install --force --prefix=
${
CMAKE_INSTALL_PREFIX
}
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/python/)"
)
install
(
CODE
"execute_process(COMMAND
${
PYTHON_EXECUTABLE
}
${
PROJECT_
BINARY_DIR
}
/python
/setup.py install --force --prefix=
${
CMAKE_INSTALL_PREFIX
}
WORKING_DIRECTORY
${
PROJECT_BINARY_DIR
}
/python/)"
)
#####################################################################################
...
...
TurTLE/__init__.py.in
View file @
d93071dc
...
...
@@ -24,28 +24,11 @@
import os
import sys
import pickle
import pkg_resources
try:
__version__ = pkg_resources.require('TurTLE')[0].version
_dist = pkg_resources.get_distribution('TurTLE')
dist_loc = os.path.realpath(_dist.location)
lib_dir = os.path.join(dist_loc, 'TurTLE')
except:
__version__ = '@TURTLE_VERSION_LONG@'
dist_loc = None
lib_dir = None
__version__ = '@TURTLE_VERSION_LONG@'
data_dir = os.path.join('@CMAKE_INSTALL_PREFIX@', 'share/TurTLE-@TURTLE_VERSION_LONG@')
here = os.path.normcase(__file__)
homefolder = os.path.expanduser('~')
from .host_info import host_info
from .DNS import DNS
...
...
setup.py
→
setup.py
.in
View file @
d93071dc
...
...
@@ -26,65 +26,20 @@
AUTHOR = 'Cristian C Lalescu'
AUTHOR_EMAIL = 'Cristian.Lalescu@ds.mpg.de'
import
os
import
shutil
import
datetime
import
sys
import
subprocess
import pickle
### package versioning
import
get_version
VERSION
=
get_version
.
main
()
VERSION = '@TURTLE_VERSION_LONG@'
print('This is TurTLE version ' + VERSION)
import
distutils.cmd
class
CompileLibCommand
(
distutils
.
cmd
.
Command
):
description
=
'Compile TurTLE library.'
user_options
=
[
(
'timing-output='
,
None
,
'Toggle timing output.'
),
(
'fftw-estimate='
,
None
,
'Use FFTW ESTIMATE.'
),
(
'split-fftw-many='
,
None
,
'Turn on SPLIT_FFTW_MANY.'
),
(
'disable-fftw-omp='
,
None
,
'Turn Off FFTW OpenMP.'
),
]
def
initialize_options
(
self
):
self
.
timing_output
=
0
self
.
fftw_estimate
=
0
self
.
disable_fftw_omp
=
0
self
.
split_fftw_many
=
0
return
None
def
finalize_options
(
self
):
self
.
timing_output
=
(
int
(
self
.
timing_output
)
==
1
)
self
.
split_fftw_many
=
(
int
(
self
.
split_fftw_many
)
==
1
)
self
.
fftw_estimate
=
(
int
(
self
.
fftw_estimate
)
==
1
)
self
.
disable_fftw_omp
=
(
int
(
self
.
disable_fftw_omp
)
==
1
)
return
None
def
run
(
self
):
### save compiling information
pickle
.
dump
(
{
'install_date'
:
now
,
'VERSION'
:
VERSION
,
'git_revision'
:
git_revision
},
open
(
'turtle/install_info.pickle'
,
'wb'
),
protocol
=
2
)
return
None
from setuptools import setup
setup(
name = 'TurTLE',
packages = ['TurTLE', 'TurTLE/test'],
install_requires = ['numpy>=1.8', 'h5py>=2.2.1'],
package_data
=
{
'TurTLE'
:
[
'test/B32p1e4_checkpoint_0.h5'
,
'test/particle_set/NSVEparticle_set.hpp'
,
'test/particle_set/NSVEparticle_set.cpp'
,
'test/profiler/scalar_evolution.hpp'
,
'test/profiler/scalar_evolution.cpp'
,
'test/profiler/Kraichnan_scalar_v1.hpp'
,
'test/profiler/Kraichnan_scalar_v1.cpp'
,
]},
# package data is installed by CMake
#package_data = {'TurTLE': []},
entry_points = {
'console_scripts': [
'turtle = TurTLE.__main__:main',
...
...
Write
Preview
Supports
Markdown
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