Skip to content

Commit

Permalink
use the prebuilt library from libroot_julia_jll and ROOT_jll
Browse files Browse the repository at this point in the history
- Use of Conda to install ROOT binaries replaced by _jll packages; ROOT_jll for
C++ ROOT binaries, and libroot_julia_jll for the wrapper library.
- Improved handling of wrapper build in case of use of ROOT binaries installed outside of Julia.
   - Compilation options handled by the new ROOTpreds package.
   - library not rebuilt during package precompilation in case it is up-to-date.
  • Loading branch information
grasph committed Jan 29, 2025
1 parent f6ccc2a commit f959448
Show file tree
Hide file tree
Showing 12 changed files with 409 additions and 167 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ test/demo_fit_with_jl_func_2.png
test/test1.root
test/test2.root
test/test3.root
LocalPreferences.toml
14 changes: 10 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name = "ROOT"
uuid = "1706fdcc-8426-44f1-a283-5be479e9517c"
authors = ["Philippe Gras CEA/IRFU"]
version = "0.3.2"
version = "0.4.0-DEV"

[deps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PkgDependency = "9eb5382b-762c-48ca-8139-e736883fe800"
ROOT_jll = "45b42145-bbac-5752-8807-01f8b2702242"
ROOTprefs = "492d890c-d9c4-11ef-b95f-3722e36032c2"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
libroot_julia_jll = "2e5227ad-a2cb-5771-a73d-8331af68b27e"

[compat]
CxxWrap = "0.16"
Scratch = "1.2"
julia = "1.6"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UnROOT = "3cd96dde-e98d-4713-81e9-a4a1b0235ce9"

[targets]
test = ["Test", "UnROOT"]
test = ["Test", "Pkg"]
27 changes: 19 additions & 8 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ JULIA = julia

CXX_IS_CLANG = $(shell $(CXX) -dM -E - < /dev/null | grep -c __clang__)

VERBOSE = no #use -DVERBOSE to enable verbosity
# Verbose output
ifeq ($(VERBOSE), no)
Q =
else
Q = @
endif

ifeq ($(UNAME),Darwin)
SO_SUFFIX = .dylib
else
Expand Down Expand Up @@ -63,10 +71,11 @@ distclean:
# @echo 'all:\n\n%:\n\t$$(MAKE) -C .. $$@\nclean:\n\t$$(MAKE) -C .. clean build\n' > $(BUILD_DIR)/Makefile

$(BUILD_DIR)/ROOT-generated.wit: ROOT.wit #$(BUILD_DIR)
$(MAKE) check_root
[ -d $(BUILD_DIR)/libROOT/build ] || mkdir -p $(BUILD_DIR)/libROOT/build
$(shell echo "#\n# Warning: file generated automatically from $<\n#" > $@)
$(shell sed "s@%ROOT_INC_DIR%@$(ROOT_INC_DIR)@" $< >> $@ || rm $@)
@echo "Build $(notdir $@)"
$(Q) $(MAKE) -DVERBOSE=$(VERBOSE) check_root
$(Q) [ -d $(BUILD_DIR)/libROOT/build ] || mkdir -p $(BUILD_DIR)/libROOT/build
$(Q) $(shell echo "#\n# Warning: file generated automatically from $<\n#" > $@)
$(Q) $(shell sed "s@%ROOT_INC_DIR%@$(ROOT_INC_DIR)@" $< >> $@ || rm $@)

check_root:
ifeq ($(ROOT_LIBS),)
Expand Down Expand Up @@ -97,12 +106,14 @@ JULIA_LOAD_PATH=`pwd`/build/ROOT/src:$(JULIA_LOAD_PATH): "$(JULIA)" --project=..
&& 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)/libROOT/build ] || mkdir -p $(BUILD_DIR)/libROOT/build
$(COMPILE.cc) $(CPPFLAGS) -o $@ $<
@echo "Make $(notdir $@)"
$(Q) [ -d $(BUILD_DIR)/libROOT/build ] || mkdir -p $(BUILD_DIR)/libROOT/build
$(Q) $(COMPILE.cc) $(CPPFLAGS) -o $@ $<

$(BUILD_DIR)/libroot_julia$(SO_SUFFIX): $(OBJS)
$(MAKE) check_root
$(LINK.o) -o $@ --shared -fPIC $(OBJS) $(ROOT_LIBS) $(LDLIBS)
@echo "Make $(notdir $@)"
$(Q) $(MAKE) check_root
$(Q) $(LINK.o) -o $@ --shared -fPIC $(OBJS) $(ROOT_LIBS) $(LDLIBS)


echo_%:
Expand Down
88 changes: 0 additions & 88 deletions deps/build.jl

This file was deleted.

3 changes: 3 additions & 0 deletions deps/root_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const static int wrapped_root_version_major = 6;
const static int wrapped_root_version_minor = 32;
const static int wrapped_root_version_patch = 6;
2 changes: 1 addition & 1 deletion deps/src/Extra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ void updateAllCanvas(){
canvas->Update();
}
}

Loading

0 comments on commit f959448

Please sign in to comment.