From 74a59cb21b4e7e4a5bdfa4f708db93d213f4bf96 Mon Sep 17 00:00:00 2001 From: LAVAUX Guilhem Date: Tue, 28 Apr 2020 14:12:36 +0200 Subject: [PATCH 1/2] Adjust linkage --- python/CMakeLists.txt | 8 ++++---- python/_cosmo_power.pyx | 2 +- setup.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6045aca..90d3e6e 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -50,11 +50,11 @@ if(APPLE) set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup") endif() -target_link_libraries(_cosmotool ${CosmoTool_local} ${GSL_LIBRARIES}) -target_link_libraries(_cosmo_power ${CosmoTool_local} ${GSL_LIBRARIES}) -target_link_libraries(_cosmo_cic ${CosmoTool_local} ${GSL_LIBRARIES}) +target_link_libraries(_cosmotool PRIVATE ${CosmoTool_local} ${GSL_LIBRARIES}) +target_link_libraries(_cosmo_power PRIVATE ${CosmoTool_local} ${GSL_LIBRARIES}) +target_link_libraries(_cosmo_cic PRIVATE ${CosmoTool_local} ${GSL_LIBRARIES}) target_link_libraries(_project ) -target_link_libraries(_fast_interp ${CosmoTool_local} ) +target_link_libraries(_fast_interp PRIVATE ${CosmoTool_local} ) SET(ct_TARGETS _cosmotool _project _cosmo_power _cosmo_cic _fast_interp ) diff --git a/python/_cosmo_power.pyx b/python/_cosmo_power.pyx index 2d01e72..bf4bd4b 100644 --- a/python/_cosmo_power.pyx +++ b/python/_cosmo_power.pyx @@ -81,7 +81,7 @@ cdef class CosmologyPower: if 'ns' in cosmo: self.power.n = cosmo['ns'] if 'T27' in cosmo: - self.power.THETA_27 = cosmo['T27'] + self.power.Theta_27 = cosmo['T27'] assert self.power.OMEGA_C > 0 diff --git a/setup.py b/setup.py index a3d1a58..74d4925 100644 --- a/setup.py +++ b/setup.py @@ -218,7 +218,7 @@ class BuildCMakeExt(build_ext): CosmoTool_extension = CMakeExtension(name="cosmotool") setup(name='cosmotool', - version='1.0.0a2', + version='1.0.0a3', packages=["cosmotool"], package_dir={'cosmotool': 'python/cosmotool'}, setup_requires=['cython','cffi','numexpr'], From f35d0cc6944370175169456cb6ca81c77f9165c1 Mon Sep 17 00:00:00 2001 From: LAVAUX Guilhem Date: Tue, 28 Apr 2020 14:52:59 +0200 Subject: [PATCH 2/2] Add dummy source code --- python/dummy.c | 1 + setup.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 python/dummy.c diff --git a/python/dummy.c b/python/dummy.c new file mode 100644 index 0000000..ad8787c --- /dev/null +++ b/python/dummy.c @@ -0,0 +1 @@ +static void dummyFunc() {} diff --git a/setup.py b/setup.py index 74d4925..f1cf6d6 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ class CMakeExtension(Extension): doesn't try to build your sources for you """ - def __init__(self, name, sources=[]): + def __init__(self, name, sources=["python/dummy.c"]): super().__init__(name = name, sources = sources) @@ -218,7 +218,7 @@ class BuildCMakeExt(build_ext): CosmoTool_extension = CMakeExtension(name="cosmotool") setup(name='cosmotool', - version='1.0.0a3', + version='1.0.0a4', packages=["cosmotool"], package_dir={'cosmotool': 'python/cosmotool'}, setup_requires=['cython','cffi','numexpr'],