Skip to content

Commit

Permalink
Changed all remaining ROOT2 to ROOT. Especially fixed ROOT.demo() fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
grasph committed Jun 6, 2024
1 parent 05f7924 commit 8094ac2
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 15 deletions.
1 change: 0 additions & 1 deletion deps/.gitignore

This file was deleted.

24 changes: 12 additions & 12 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)

.PHONY: all clean distclean run_demo run_demo2 check_root make_lib_from_objs

PRODUCTS = $(BUILD_DIR)/libjlROOT2$(SO_SUFFIX)
PRODUCTS = $(BUILD_DIR)/libjlROOT$(SO_SUFFIX)

#Define WRAPPER_CXX
#WRAPPER_CXX: = $(file < src/generated_cxx) Extra.cxx #does not work on MacOS
Expand All @@ -63,7 +63,7 @@ $(BUILD_DIR):
@mkdir -p $(BUILD_DIR)
@echo 'all:\n\n%:\n\t$$(MAKE) -C .. $$@\nclean:\n\t$$(MAKE) -C .. clean build\n' > $(BUILD_DIR)/Makefile

$(BUILD_DIR)/ROOT2-generated.wit: ROOT2.wit $(BUILD_DIR)
$(BUILD_DIR)/ROOT-generated.wit: ROOT.wit $(BUILD_DIR)
$(MAKE) check_root
$(shell echo "#\n# Warning: file generated automatically from $<\n#" > $@)
$(shell sed "s@%ROOT_INC_DIR%@$(ROOT_INC_DIR)@" $< >> $@ || rm $@)
Expand All @@ -81,26 +81,26 @@ run_demo2: all

test: all
LD_LIBRARY_PATH=$(shell $(ROOT_CONFIG) --libdir) \
JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. demo_ROOT2.jl
JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. demo_ROOT.jl
cmp demo_ROOT.png demo_ROOT-ref.png
LD_LIBRARY_PATH=$(shell $(ROOT_CONFIG) --libdir) \
JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. demo_TGraph.jl
JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. demo_TGraph.jl
cmp demo_TGraph.png demo_TGraph-ref.png
LD_LIBRARY_PATH=$(shell $(ROOT_CONFIG) --libdir) \
JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree1.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/read_tree1.jl
JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree1.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/read_tree1.jl
LD_LIBRARY_PATH=$(shell $(ROOT_CONFIG) --libdir) \
JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree2.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. -e 'import Pkg; Pkg.activate(;temp=true); Pkg.add("UnROOT"); include("TTree_examples/read_tree2.jl")'
JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree2.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. -e 'import Pkg; Pkg.activate(;temp=true); Pkg.add("UnROOT"); include("TTree_examples/read_tree2.jl")'
LD_LIBRARY_PATH=$(shell $(ROOT_CONFIG) --libdir) \
JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree3.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT2/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/read_tree3.jl
JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/write_tree3.jl \
&& JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=.. TTree_examples/read_tree3.jl

$(BUILD_DIR)/%.o: src/%.cxx $(BUILD_DIR)
[ -d $(BUILD_DIR)/libROOT2/build ] || mkdir -p $(BUILD_DIR)/libROOT2/build
[ -d $(BUILD_DIR)/libROOT/build ] || mkdir -p $(BUILD_DIR)/libROOT/build
$(COMPILE.cc) $(CPPFLAGS) -o $@ $<

$(BUILD_DIR)/libjlROOT2$(SO_SUFFIX): $(OBJS)
$(BUILD_DIR)/libjlROOT$(SO_SUFFIX): $(OBJS)
$(MAKE) check_root
$(LINK.o) -o $@ --shared -fPIC $(OBJS) $(ROOT_LIBS) $(LDLIBS)

Expand Down
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Scratch
const CXXWRAP_PREFIX = CxxWrap.prefix_path()
const JL_SHARE = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia")
const JULIA = joinpath(Sys.BINDIR, "julia")
const libname="libjlROOT2." * Libdl.dlext
const libname="libjlROOT." * Libdl.dlext

const conda_root_version = "6.30.04"
const supported_root_versions = [ conda_root_version ]
Expand Down
2 changes: 1 addition & 1 deletion src/demo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function demo()

h = TH1D("h", "Normal distribution", 100, -5, 5)
FillRandom(h, "gaus")
c = ROOT2.TCanvas()
c = TCanvas()
Fit(h, "gaus")
c
end
Expand Down
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Test
import Pkg
import ROOT

Base.ENV["JULIA_PROJECT"] = dirname(Pkg.project().path)

Expand All @@ -26,4 +27,12 @@ end
@testset "write_tree3" test_nothrow("../examples/TTree_examples/write_tree3.jl")
@testset "read_tree3" test_nothrow("../examples/TTree_examples/read_tree3.jl")
@testset "string_branch_example" test_nothrow("../examples/TTree_examples/string_branch_example.jl")
@testset "ROOT.demo()" begin
@test try
ROOT.demo()
true
catch
false
end
end
end

0 comments on commit 8094ac2

Please sign in to comment.