Skip to content

Instantly share code, notes, and snippets.

@harukaeru
Last active May 2, 2022 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harukaeru/652f1814c495944537a736e14ed8a8ab to your computer and use it in GitHub Desktop.
Save harukaeru/652f1814c495944537a736e14ed8a8ab to your computer and use it in GitHub Desktop.
The script that makes python installed from Homebrew available in C/C++ on Mac OS X
$ ln -s /usr/local/Cellar/python@3.10/3.10.1/Frameworks/Python.framework/Versions/3.10/include/python3.10/* /usr/local/include
$ which gj
gj: aliased to /usr/local/Cellar/gcc/11.2.0_3/bin/g++-11 -D GLIBCXX_DEBUG -Wl,-demangle -std=c++17 -Wall -Werror -fsanitize=undefined -O2 -g
$ which aa
aa () {
if [[ -z $1 ]]
then
./a.out
else
cat $1 | ./a.out
fi
}
$ gj $(python3-config --cflags --embed) $(python3-config --embed --ldflags) pyt.cpp
@harukaeru
Copy link
Author

image

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