Skip to content

Commit

Permalink
Switch extern Minuit2 repo to official root repo (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Oct 14, 2020
1 parent 21e1442 commit 2917bef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "extern/Minuit2"]
path = extern/Minuit2
url = https://github.com/GooFit/Minuit2.git
[submodule "extern/root"]
path = extern/root
url = https://github.com/root-project/root.git
1 change: 0 additions & 1 deletion extern/Minuit2
Submodule Minuit2 deleted from ec87e4
1 change: 1 addition & 0 deletions extern/root
Submodule root added at a5d880
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,26 @@ def lazy_compile(
numpy_header = []


# Install missing Minuit2 submodule as needed
if not os.listdir(join(cwd, "extern/Minuit2")):
# Install missing ROOT submodule as needed
if not os.listdir(join(cwd, "extern/root")):
try:
import subprocess as subp

print("Minuit2 submodule is missing, attempting download...")
print("ROOT is missing, attempting download...")
subp.check_call(["git", "submodule", "update"])
except subp.CalledProcessError:
raise SystemExit(
"Could not download Minuit2 submodule, run `git submodule update` manually"
)
raise SystemExit("Could not download ROOT, run `git submodule update` manually")

minuit2_cxx = [
join(cwd, "extern/Minuit2/src", x) + ".cxx"
join(cwd, "extern/root/math/minuit2/src", x) + ".cxx"
for x in open(join(cwd, "minuit2_cxx.lst"), "r").read().split("\n")
if x
]

libiminuit = Extension(
"iminuit._libiminuit",
sources=sorted(glob(join(cwd, "src/iminuit/*" + ext)) + minuit2_cxx),
include_dirs=[join(cwd, "extern/Minuit2/inc")] + numpy_header,
include_dirs=[join(cwd, "extern/root/math/minuit2/inc")] + numpy_header,
define_macros=[
("WARNINGMSG", "1"),
("ROOT_Math_VecTypes", "1"),
Expand Down

0 comments on commit 2917bef

Please sign in to comment.