Skip to content

Instantly share code, notes, and snippets.

@tvand7093
Last active May 20, 2016 02:26
Show Gist options
  • Save tvand7093/e65dd039d0933ebac98e to your computer and use it in GitHub Desktop.
Save tvand7093/e65dd039d0933ebac98e to your computer and use it in GitHub Desktop.
Setup Mac for libplot

Libplot setup on Mac

First, install XQuartz if you don't already have it.

Next, (assuming you have homebrew installed) run the following command: brew install plotutils --with-x11

This will install the required libraries.

Finally, add the following before your rules and commands in your makefile for building your application:

#includes and libs

#you may need to change the version number here. this is the path where brew installed plotutils.
PLOTLIBS = -L/usr/local/Cellar/plotutils/2.6_1/lib
XLIBS = -L/opt/x11/lib
INCLUDE = -I/usr/local/Cellar/plotutils/2.6_1/include

#check OS
ifeq ($(shell uname),Darwin)
        CFLAGS=$(XLIBS) $(PLOTLIBS) $(INCLUDE) -Qunused-arguments
endif

Now just make sure to add $(CFLAGS) to your compile statements to include the libraries.

That's it! Happy Plotting!

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