diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index 839e8a5..0000000 --- a/deps/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/deps.jl diff --git a/deps/Makefile b/deps/Makefile index fba58f8..0e0519b 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -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 @@ -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 $@) @@ -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) diff --git a/deps/build.jl b/deps/build.jl index ca6013f..25c8317 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -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 ] diff --git a/src/demo.jl b/src/demo.jl index ff2cd73..0213a94 100644 --- a/src/demo.jl +++ b/src/demo.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index dea5517..99d5551 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ using Test import Pkg +import ROOT Base.ENV["JULIA_PROJECT"] = dirname(Pkg.project().path) @@ -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