From ac6f5dd55157d9dc1a525c98c0fb45287f1b97e6 Mon Sep 17 00:00:00 2001 From: Lucas McConnell Date: Wed, 9 Oct 2024 18:02:27 +0100 Subject: [PATCH 1/4] Fix machine setup for HDF5 on macOS Need to us a different library extension (".dylib" instead of ".so") on macOS. --- .../shared/add_dependencies_to_project.jl | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/machines/shared/add_dependencies_to_project.jl b/machines/shared/add_dependencies_to_project.jl index 008045e93..d130cc56f 100644 --- a/machines/shared/add_dependencies_to_project.jl +++ b/machines/shared/add_dependencies_to_project.jl @@ -151,17 +151,26 @@ end println("\n** Setting up to use system HDF5\n") +function get_hdf5_lib_names(dirname) + if Sys.isapple() + libhdf5_name = joinpath(dirname, "libhdf5.dylib") + libhdf5_hl_name = joinpath(dirname, "libhdf5_hl.dylib") + else + libhdf5_name = joinpath(dirname, "libhdf5.so") + libhdf5_hl_name = joinpath(dirname, "libhdf5_hl.so") + end + return libhdf5_name, libhdf5_hl_name +end + if machine_settings["hdf5_library_setting"] == "system" hdf5_dir = joinpath(ENV["HDF5_DIR"], "lib") # system hdf5 using HDF5 - HDF5.API.set_libraries!(joinpath(hdf5_dir, "libhdf5.so"), - joinpath(hdf5_dir, "libhdf5_hl.so")) + HDF5.API.set_libraries!(get_hdf5_lib_names(hdf5_dir)...) elseif machine_settings["hdf5_library_setting"] == "download" artifact_dir = joinpath(repo_dir, "machines", "artifacts") hdf5_dir = joinpath(artifact_dir, "hdf5-build", "lib") using HDF5 - HDF5.API.set_libraries!(joinpath(hdf5_dir, "libhdf5.so"), - joinpath(hdf5_dir, "libhdf5_hl.so")) + HDF5.API.set_libraries!(get_hdf5_lib_names(hdf5_dir)...) elseif machine_settings["hdf5_library_setting"] == "prompt" # Prompt user to select what HDF5 to use if mk_preferences["build_hdf5"] == "y" @@ -169,13 +178,11 @@ elseif machine_settings["hdf5_library_setting"] == "prompt" local_hdf5_install_dir = realpath(local_hdf5_install_dir) # We have downloaded and compiled HDF5, so link that hdf5_dir = local_hdf5_install_dir - hdf5_lib = joinpath(local_hdf5_install_dir, "libhdf5.so") - hdf5_lib_hl = joinpath(local_hdf5_install_dir, "libhdf5_hl.so") + hdf5_lib, hdf5_lib_hl = get_hdf5_lib_names(hdf5_dir) elseif !prompt_for_lib_paths hdf5_dir = mk_preferences["hdf5_dir"] if hdf5_dir != "default" - hdf5_lib = joinpath(hdf5_dir, "libhdf5.so") - hdf5_lib_hl = joinpath(hdf5_dir, "libhdf5_hl.so") + hdf5_lib, hdf5_lib_hl = get_hdf5_lib_names(hdf5_dir) end else println("\n** Setting up to use system HDF5\n") @@ -206,8 +213,7 @@ elseif machine_settings["hdf5_library_setting"] == "prompt" if isdir(hdf5_dir) hdf5_dir = realpath(hdf5_dir) end - hdf5_lib = joinpath(hdf5_dir, "libhdf5.so") - hdf5_lib_hl = joinpath(hdf5_dir, "libhdf5_hl.so") + hdf5_lib, hdf5_lib_hl = get_hdf5_lib_names(hdf5_dir) if isfile(hdf5_lib) && isfile(hdf5_lib_hl) break else From 4886efcaf7a1bcf82080b4cb8fc8d590cd8ac27f Mon Sep 17 00:00:00 2001 From: John Omotani Date: Fri, 11 Oct 2024 13:02:35 +0100 Subject: [PATCH 2/4] Make default for `figsize` a Vector so it can be written to TOML This is needed so that `makie_post_processing.generate_example_input_file()` can work. Also requires us to convert `figsize` back to a `Tuple` before we use it, because a `Tuple` is required by Makie. --- .../makie_post_processing/src/makie_post_processing.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makie_post_processing/makie_post_processing/src/makie_post_processing.jl b/makie_post_processing/makie_post_processing/src/makie_post_processing.jl index 1034df1a0..b881ddfa7 100644 --- a/makie_post_processing/makie_post_processing/src/makie_post_processing.jl +++ b/makie_post_processing/makie_post_processing/src/makie_post_processing.jl @@ -826,7 +826,7 @@ function _setup_single_input!(this_input_dict::OrderedDict{String,Any}, include_patterns=String[], exclude_patterns=String[], ranks=mk_int[], - figsize=(600,800) + figsize=[600,800] ) # We allow top-level options in the post-processing input file @@ -8492,7 +8492,7 @@ function timing_data(run_info::Tuple; plot_prefix=nothing, threshold=nothing, if figsize === nothing if input !== nothing - figsize = input.figsize + figsize = Tuple(input.figsize) else figsize = (600,800) end @@ -8602,7 +8602,7 @@ function timing_data(run_info; plot_prefix=nothing, threshold=nothing, if figsize === nothing if input !== nothing - figsize = input.figsize + figsize = Tuple(input.figsize) else figsize = (600,800) end From 2466dbc5c9595245f2705694469c9d217ab249c3 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Fri, 11 Oct 2024 13:07:21 +0100 Subject: [PATCH 3/4] Make Python venv setup more portable in machine setup scripts Avoids errors when `python` is not a valid shell command, or when it runs Python-2 instead of Python-3. --- machines/shared/machine_setup_stage_two.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/machines/shared/machine_setup_stage_two.jl b/machines/shared/machine_setup_stage_two.jl index 5c8714d1e..12b847917 100644 --- a/machines/shared/machine_setup_stage_two.jl +++ b/machines/shared/machine_setup_stage_two.jl @@ -11,7 +11,7 @@ batch_system = mk_preferences["batch_system"] if mk_preferences["use_plots"] == "y" python_venv_path = joinpath(repo_dir, "machines", "artifacts", "mk_venv") activate_path = joinpath(python_venv_path, "bin", "activate") - run(`bash -c "python -m venv --system-site-packages $python_venv_path; source $activate_path; PYTHONNOUSERSITE=1 pip install matplotlib"`) + run(`bash -c "/usr/bin/env python3 -m venv --system-site-packages $python_venv_path; source $activate_path; PYTHONNOUSERSITE=1 pip install matplotlib"`) if batch_system open("julia.env", "a") do io println(io, "source $activate_path") From d8f43ed269324bc79f68175c9bb9b917785e2383 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Fri, 11 Oct 2024 13:11:34 +0100 Subject: [PATCH 4/4] Mention makie_post_processing.generate_example_input_file() in docs --- docs/src/post_processing_notes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/src/post_processing_notes.md b/docs/src/post_processing_notes.md index 6ef936e99..d474a6892 100644 --- a/docs/src/post_processing_notes.md +++ b/docs/src/post_processing_notes.md @@ -19,6 +19,11 @@ julia> makie_post_process("runs/example-run1/", "runs/example-run2/", "runs/exam What this function does is controlled by the settings in an input file, by default `post_processing_input.toml`. +!!! note "Example input file" + You can generate an example input file, with all the options shown (with + their default values) but commented out, by running + `makie_post_processing.generate_example_input_file()`. + To run from the command line ```julia julia --project run_makie_post_processing.jl dir1 [dir2 [dir3 ...]]