Skip to content

Fix: add a check for gnuplot in Makefile #1

Description

@Urbaner3
urbaner@urbaner-laptop:~/Documents/linux2026/Modified-Merge-Sort$ make run
Benchmark 10 %
Benchmark 20 %
Benchmark 30 %
Benchmark 40 %
Benchmark 50 %
Benchmark 60 %
Benchmark 70 %
Benchmark 80 %
Benchmark 90 %
Benchmark 100%
make: gnuplot: No such file or directory
make: *** [Makefile:14: run] Error 127

Tested your sort simulation and it fails for missing gnuplot program. So I fix it in makefile.
Here is the patch.

6,8d5
< # Check if gnuplot is available
< HAS_GNUPLOT := $(shell command -v gnuplot 2>/dev/null)
< 
17d13
< ifdef HAS_GNUPLOT
19,21d14
< else
< 	@echo "Warning: gnuplot not found. Skipping plot generation."
< endif
28d20
< 
30,36c22
< ifdef HAS_GNUPLOT
< 	@gnuplot ./scripts/plot.gp
< else
< 	@echo "Error: gnuplot not found. Please install gnuplot to generate plots."
< 	@exit 1
< endif
< 
---
> 	gnuplot ./scripts/plot.gp
39c25
< 	@perf stat ./interval
---
> 	perf stat ./interval
43,44c29
< 	@perf stat ./head_tail
< 
---
> 	perf stat ./head_tail
47c32
< 	@perf stat ./recursive
---
> 	perf stat ./recursive
53d37
< ifdef HAS_GNUPLOT
55,61c39
< 	@gnuplot rand_addr.gp
< else
< 	@echo "Warning: gnuplot not found. Skipping plot generation."
< endif
< 
< .PHONY: build build_example run example clean plot interval head_tail recursive addr
< 
---
> 	@gnuplot rand_addr.gp

Modified Makefile nMake

nMake.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions