Skip to content

Commit

Permalink
Add Makefile for Apple ARM64 machines
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Nov 23, 2023
1 parent 2ff9a38 commit 961567d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ clean:

install: all
mkdir -p ${PLUGINDIR}/qwrap${VERSION} && \
rsync -av qwrap.so pkgIndex.tcl ${PLUGINDIR}/qwrap${VERSION}/.
rsync -av qwrap.so pkgIndex.tcl ${PLUGINDIR}/qwrap${VERSION}/.
32 changes: 32 additions & 0 deletions Makefile.OSX_ARM64
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

VERSION=1.6
VMDDIR="/Applications/VMD\ 1.9.4a55-arm64-Rev11.app/Contents/vmd"
TCLINC=-I/usr/include/tcl8.6
#TCLLIB=-L/usr/lib64 -ltclstub8.6
PLUGINDIR=${VMDDIR}/plugins/MACOSXAMD64/tcl
FRAMEWORK=-F ${VMDDIR}/../Frameworks -framework Tcl

# Tested with g++ and clang++
CXX=g++
#CXX=clang++
CPPFLAGS=-fpic -O3 -Wall ${TCLINC} -DVERSION=\"${VERSION}\"

all: qwrap.so.${VERSION} pkgIndex.tcl

qwrap.so.${VERSION}: qwrap.o
$(CXX) -dynamiclib -DUSE_TCL_STUBS $< ${FRAMEWORK} -o $@
ln -s -f qwrap.so.${VERSION} qwrap.so

qwrap.tar.gz: qwrap.cpp Makefile pkgIndex.tcl
tar czf qwrap${VERSION}.tar.gz qwrap.cpp Makefile pkgIndex.tcl

pkgIndex.tcl: qwrap.so
tclsh mkindex.tcl

clean:
rm -f *.o *.so

install: all
mkdir -p ${PLUGINDIR}/qwrap${VERSION} && \
rsync -av qwrap.so pkgIndex.tcl ${PLUGINDIR}/qwrap${VERSION}/.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ First make sure Tcl development packages are installed (tcl-dev or tcl-devel).
tar xf qwrap.tar.gz (in own directory)
make
```

For Macs with ARM64 processors (M1, M2, M3 etc.), try adapting the paths in `Makefile.OSX_ARM64` and running:
```
make -f Makefile.OSX_ARM64
```

Optionally, install as a VMD plugin:
```
# update the PLUGINDIR variable in Makefile
Expand Down

0 comments on commit 961567d

Please sign in to comment.