space-physics / iri2016

International Reference Ionosphere 2016 from Python and Matlab
http://irimodel.org/
MIT License
67 stars 34 forks source link

build fails with unknown CMake option #5

Closed st-bender closed 5 years ago

st-bender commented 5 years ago

Hi, Installing the package from pypi does not work, pip fails with some obscure message. Using a local clone, pip install . failed with -j as an unknown option to cmake, which needs a double dash before that. Thus, the following patch to setup.py fixes at least the local builds, it may also fix the pypi install:

diff --git a/setup.py b/setup.py
index 8a156d6..524ea5d 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,7 @@ def cmake_setup():
         subprocess.check_call(['cmake', str(SRCDIR)],
                               cwd=BINDIR)

-    subprocess.check_call(['cmake', '--build', str(BINDIR), '-j'])
+    subprocess.check_call(['cmake', '--build', str(BINDIR), '--', '-j'])

 def meson_setup():

Cheers.

brianbreitsch commented 5 years ago

I can confirm that this was an issue for me and the solution st-bender posted fixed it.

scivision commented 5 years ago

This has been reworked in the iri2016/build.py, that autobuilds on first run rather than setup.py. This is to avoid putting executable code in setup.py and to make the package setup-platform agnostic.