Getting beagle and beast2 to run on a M1 Mac

1,696 views
Skip to first unread message

Santiago Sánchez

unread,
Jul 5, 2021, 10:24:18 PM7/5/21
to beast...@googlegroups.com
Hi everyone,

I just got beast to recognize my beagle installation on my M1 Mac mini and it's running smoothly right now. This might be helpful for other users in the same situation as me that are struggling with java versions and other stuff.

(1) First off, I'm using BEAST v2.6.5. So if you have a different version download this one from: https://github.com/CompEvol/beast2/releases/tag/v2.6.5
Just use the regular MacOS binaries.

(2) Next is getting a JDK version (for compiling beagle) that works with M1 Silicon chips. You can get one form Azul here: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk
I'm using version 8. I tried with a more recent version (v16) and I was able to compile beagle but beast was not working.

(3) Open the .dmg file and run the .pkg. You'll find the OpenJDK installation in: /Library/Java/JavaVirtualMachines/
This is going to be your default java version.
So you need to create a semi-permanent path to those java build. You can do this by exporting the path every time you open up a terminal using your ~/.bash_profile conf file.

$ echo 'export JAVA_HOME="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"' >> ~/.bash_profile
$ source ~/.bash_profile

(5) You should now have a working and compatible java build. Now it's time to compile beagle:

$ cd beagle-lib
$ ./autogen.sh

For these steps you should have command-line tools installed on your Mac. So you should've run through these at some point:

$ xcode-select --install
$ # if you don't have homebrew installed
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ brew install libtool autoconf automake

Now, run the configure script using these commands:

$ ./configure --disable-sse --with-jdk=$JAVA_HOME --prefix=`pwd`

I don't think Apple M1 chips include SSE vectorization. This is why you need to turn the option off. The compilation will also fail without it too. You are specifying the path to the JDK folder that you installed and you will install the libs on the current dir (You'll see why).

Finish the installation:

$ make install
$ make check

All checks should be in green.

(6) The next step is to make beagle visible to beast. This can be done in many different ways. This is the one I chose:
Copy the beagle lib files to the java home folder. You will need admin permissions to do this:

$ sudo cp -R lib/* $JAVA_HOME/lib
$ sudo cp -R include $JAVA_HOME

This should be safe-ish to do.

(7) Last but not least, I had to tweak the beast executable file in the /Applications/BEAST\ 2.6.5 directory.

Just open it up in you favorite text editor (TextEdit, Atom, nano, vim). Then change these lines from:

if [ -n "$BEAST_EXTRA_LIBS" ]; then
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$BEAST_EXTRA_LIBS -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
else
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
fi

to:

if [ -n "$BEAST_EXTRA_LIBS" ]; then
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$BEAST_EXTRA_LIBS:$JAVA_HOME/lib -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
else
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$JAVA_HOME/lib -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
fi

Save the file and that's it. Running this from your terminal should indicate that BEAST is recognizing BEAGLE:

$ /Applications/BEAST\ 2.6.5/bin/beast -beagle_info

Hope this helps,
Santiago





Matthew Green

unread,
Jul 17, 2021, 7:55:44 PM7/17/21
to beast-users
Hey Santiago, 

I, too, am having issues with BEAGLE on a M1 Mac. I was able to follow your instructions until the tinytest failed. Any clue as to why the second test would fail?

Thanks,
Matt Green.

Santiago Sánchez

unread,
Jul 18, 2021, 6:11:14 PM7/18/21
to beast...@googlegroups.com
Hi Matt,

Are you referring to the tests beagle runs after compilation? Like with “make check”?

Try doing a basic beagle compilation without jdk --without-jdk and sse --disable-sse see id that works. If it passes the tests then its probably your jdk installation.

That’s all I could think of for now.

Cheers,
Santiago

--
You received this message because you are subscribed to the Google Groups "beast-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/5df31ec1-99bd-42db-826d-d4e5db8db5d9n%40googlegroups.com.

Santiago Sánchez

unread,
Jul 18, 2021, 11:51:09 PM7/18/21
to Matthew Green, beast...@googlegroups.com
To me this suggests that beagle didn't compile properly.

Here are a few suggestions. Try updating autoconf and automake:

$ brew upgrade autoconf automake libtool

I did get as many warnings as you did after running the first command.

Another thing that I noticed is that after you run ./configure the script is finding a cuda installation:

checking for /usr/local/cuda/... yes

checking for /usr/local/cuda/include... no

checking for /usr/local/cuda/lib... yes


And I think it's attempting to compile with GPU enabled.

Try explicitly disabling cuda:

$ ./configure --disable-sse --without-jdk --without-cuda

If you are able to compile and pass the test, then rerun configure by specifying the JDK installation: $JAVA_HOME

This is all I can think of right now.

Cheers,
Santiago



On Sun, Jul 18, 2021 at 9:11 PM Matthew Green <mwg...@g.clemson.edu> wrote:
Hey Santiago, 

Thanks for responding. Yes, with the make check command.

I've posted my terminal job below. The second check still failed without building with jdk.

 ~ % git clone --depth=1 https://github.com/beagle-dev/beagle-lib.git

Cloning into 'beagle-lib'...

remote: Enumerating objects: 301, done.

remote: Counting objects: 100% (301/301), done.

remote: Compressing objects: 100% (257/257), done.

remote: Total 301 (delta 91), reused 147 (delta 37), pack-reused 0

Receiving objects: 100% (301/301), 2.76 MiB | 712.00 KiB/s, done.

Resolving deltas: 100% (91/91), done.


~ % cd beagle-lib


 % ./autogen.sh

glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.config'.

glibtoolize: linking file '.config/ltmain.sh'

glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.

glibtoolize: linking file 'm4/libtool.m4'

glibtoolize: linking file 'm4/ltoptions.m4'

glibtoolize: linking file 'm4/ltsugar.m4'

glibtoolize: linking file 'm4/ltversion.m4'

glibtoolize: linking file 'm4/lt~obsolete.m4'

glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, '.config'.

glibtoolize: copying file '.config/ltmain.sh'

glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.

glibtoolize: copying file 'm4/libtool.m4'

glibtoolize: copying file 'm4/ltoptions.m4'

glibtoolize: copying file 'm4/ltsugar.m4'

glibtoolize: copying file 'm4/ltversion.m4'

glibtoolize: copying file 'm4/lt~obsolete.m4'

configure.ac:62: warning: The macro `AM_DISABLE_STATIC' is obsolete.

configure.ac:62: You should run autoupdate.

m4/ltoptions.m4:260: AM_DISABLE_STATIC is expanded from...

configure.ac:62: the top level

configure.ac:63: warning: The macro `AC_PROG_LIBTOOL' is obsolete.

configure.ac:63: You should run autoupdate.

m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...

configure.ac:63: the top level

configure.ac:64: warning: The macro `AM_PROG_LIBTOOL' is obsolete.

configure.ac:64: You should run autoupdate.

m4/libtool.m4:100: AM_PROG_LIBTOOL is expanded from...

configure.ac:64: the top level

configure.ac:82: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:82: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:82: the top level

configure.ac:99: warning: AX_GCC_VERSION is obsolete;please use AX_COMPILER_VERSION instead

./lib/autoconf/general.m4:2448: AC_OBSOLETE is expanded from...

m4/ax_gcc_version.m4:50: AX_GCC_VERSION is expanded from...

configure.ac:99: the top level

configure.ac:99: warning: The macro `AC_OBSOLETE' is obsolete.

configure.ac:99: You should run autoupdate.

./lib/autoconf/general.m4:2448: AC_OBSOLETE is expanded from...

m4/ax_gcc_version.m4:50: AX_GCC_VERSION is expanded from...

configure.ac:99: the top level

configure.ac:107: warning: The macro `AC_TRY_LINK' is obsolete.

configure.ac:107: You should run autoupdate.

./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...

lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...

./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...

m4/ax_openmp.m4:70: AX_OPENMP is expanded from...

m4/ax_compare_version.m4:85: AX_COMPARE_VERSION is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

configure.ac:107: the top level

configure.ac:107: warning: The macro `AC_TRY_LINK' is obsolete.

configure.ac:107: You should run autoupdate.

./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...

lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...

./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...

m4/ax_openmp.m4:70: AX_OPENMP is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

configure.ac:107: the top level

configure.ac:132: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:132: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:132: the top level

configure.ac:143: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:143: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:143: the top level

configure.ac:178: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:178: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:178: the top level

configure.ac:235: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:235: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:235: the top level

configure.ac:332: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:332: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:332: the top level

configure.ac:335: warning: The macro `AC_TRY_RUN' is obsolete.

configure.ac:335: You should run autoupdate.

./lib/autoconf/general.m4:2997: AC_TRY_RUN is expanded from...

lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...

m4/ax_ext.m4:48: AX_EXT is expanded from...

configure.ac:335: the top level

configure.ac:346: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:346: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:346: the top level

configure.ac:350: warning: The macro `AC_TRY_RUN' is obsolete.

configure.ac:350: You should run autoupdate.

./lib/autoconf/general.m4:2997: AC_TRY_RUN is expanded from...

lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...

lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...

./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...

m4/ax_ext.m4:48: AX_EXT is expanded from...

configure.ac:350: the top level

configure.ac:363: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:363: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:363: the top level

configure.ac:374: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:374: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:374: the top level

configure.ac:413: warning: The macro `AC_HELP_STRING' is obsolete.

configure.ac:413: You should run autoupdate.

./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...

configure.ac:413: the top level

configure.ac:438: warning: The macro `AC_PROG_JAVAC' is obsolete.

configure.ac:438: You should run autoupdate.

m4/ax_prog_javac.m4:69: AC_PROG_JAVAC is expanded from...

configure.ac:438: the top level

configure.ac:441: warning: The macro `AC_JNI_INCLUDE_DIR' is obsolete.

configure.ac:441: You should run autoupdate.

m4/ax_jni_include_dir.m4:49: AC_JNI_INCLUDE_DIR is expanded from...

configure.ac:441: the top level

configure.ac:57: installing '.config/compile'

configure.ac:63: installing '.config/config.guess'

configure.ac:63: installing '.config/config.sub'

configure.ac:55: installing '.config/install-sh'

configure.ac:55: installing '.config/missing'

Makefile.am: installing './INSTALL'

examples/complextest/Makefile.am: installing '.config/depcomp'

parallel-tests: installing '.config/test-driver'


  ./configure --disable-sse --without-jdk --prefix=`pwd`

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a race-free mkdir -p... ./.config/install-sh -c -d

checking for gawk... no

checking for mawk... no

checking for nawk... no

checking for awk... awk

checking whether make sets $(MAKE)... yes

checking whether make supports nested variables... yes

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables... 

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether the compiler supports GNU C... yes

checking whether gcc accepts -g... yes

checking for gcc option to enable C11 features... none needed

checking whether gcc understands -c and -o together... yes

checking whether make supports the include directive... yes (GNU style)

checking dependency style of gcc... gcc3

checking for g++... g++

checking whether the compiler supports GNU C++... yes

checking whether g++ accepts -g... yes

checking for g++ option to enable C++11 features... none needed

checking dependency style of g++... gcc3

checking whether ln -s works... yes

checking build system type... aarch64-apple-darwin20.5.0

checking host system type... aarch64-apple-darwin20.5.0

checking how to print strings... printf

checking for a sed that does not truncate output... /usr/bin/sed

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for fgrep... /usr/bin/grep -F

checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld

checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no

checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B

checking the name lister (/usr/bin/nm -B) interface... BSD nm

checking the maximum length of command line arguments... 786432

checking how to convert aarch64-apple-darwin20.5.0 file names to aarch64-apple-darwin20.5.0 format... func_convert_file_noop

checking how to convert aarch64-apple-darwin20.5.0 file names to toolchain format... func_convert_file_noop

checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r

checking for objdump... objdump

checking how to recognize dependent libraries... pass_all

checking for dlltool... no

checking how to associate runtime and link libraries... printf %s\n

checking for ar... ar

checking for archiver @FILE support... no

checking for strip... strip

checking for ranlib... ranlib

checking command to parse /usr/bin/nm -B output from gcc object... ok

checking for sysroot... no

checking for a working dd... /bin/dd

checking how to truncate binary pipes... /bin/dd bs=4096 count=1

checking for mt... no

checking if : is a manifest tool... no

checking for dsymutil... dsymutil

checking for nmedit... nmedit

checking for lipo... lipo

checking for otool... otool

checking for otool64... no

checking for -single_module linker flag... yes

checking for -exported_symbols_list linker flag... yes

checking for -force_load linker flag... yes

checking for stdio.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for strings.h... yes

checking for sys/stat.h... yes

checking for sys/types.h... yes

checking for unistd.h... yes

checking for dlfcn.h... yes

checking for objdir... .libs

checking if gcc supports -fno-rtti -fno-exceptions... yes

checking for gcc option to produce PIC... -fno-common -DPIC

checking if gcc PIC flag -fno-common -DPIC works... yes

checking if gcc static flag -static works... no

checking if gcc supports -c -o file.o... yes

checking if gcc supports -c -o file.o... (cached) yes

checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin20.5.0 dyld

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... no

checking how to run the C++ preprocessor... g++ -E

checking for ld used by g++... /Library/Developer/CommandLineTools/usr/bin/ld

checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no

checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes

checking for g++ option to produce PIC... -fno-common -DPIC

checking if g++ PIC flag -fno-common -DPIC works... yes

checking if g++ static flag -static works... no

checking if g++ supports -c -o file.o... yes

checking if g++ supports -c -o file.o... (cached) yes

checking whether the g++ linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin20.5.0 dyld

checking how to hardcode library paths into programs... immediate

checking for library containing dlopen... none required

checking for C compiler vendor... clang

checking for C compiler version... 12.0.5

checking for /usr/local/cuda/... yes

checking for /usr/local/cuda/include... no

checking for /usr/local/cuda/lib... yes

checking for doxygen... /opt/homebrew/bin/doxygen

checking for perl... /usr/bin/perl

checking for dot... no

configure: WARNING: dot not found - will not generate graphics for doxygen documentation

checking that generated files are newer than configure... done

configure: creating ./config.status

config.status: creating Makefile

config.status: creating hmsbeagle-1.pc

config.status: creating libhmsbeagle/Makefile

config.status: creating libhmsbeagle/GPU/Makefile

config.status: creating libhmsbeagle/GPU/kernels/Makefile

config.status: creating libhmsbeagle/CPU/Makefile

config.status: creating libhmsbeagle/plugin/Makefile

config.status: creating libhmsbeagle/benchmark/Makefile

config.status: creating libhmsbeagle/JNI/Makefile

config.status: creating examples/Makefile

config.status: creating examples/tinytest/Makefile

config.status: creating examples/complextest/Makefile

config.status: creating examples/oddstatetest/Makefile

config.status: creating examples/fourtaxon/Makefile

config.status: creating examples/synthetictest/Makefile

config.status: creating examples/matrixtest/Makefile

config.status: creating libhmsbeagle/config.h

config.status: executing depfiles commands

config.status: executing libtool commands

configure: WARNING: OpenCL not found or disabled.  OpenCL implementation  will not be built. If OpenCL support is desired, check the path to OpenCL and specify --with-opencl=/path/to/opencl

configure: WARNING: NVIDIA CUDA nvcc compiler not found or CUDA support disabled.  CUDA implementation will not be built. If CUDA support is desired, check the path to CUDA and specify --with-cuda=/path/to/cuda

configure: WARNING: JDK installation not found.  JNI wrapper will not be built.  Check the path to JDK and specify --with-jdk=/path/to/jdk.  If using Mac OS X also try installing Java for OS X Developer Package


 % make install

Making install in libhmsbeagle

Making install in GPU

Making install in kernels

/Library/Developer/CommandLineTools/usr/bin/make  install-am

make[5]: Nothing to be done for `install-exec-am'.

make[5]: Nothing to be done for `install-data-am'.

make[4]: Nothing to be done for `install-data-am'.

Making install in CPU

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I/Users/mwgreen/beagle-lib -I/Users/mwgreen/beagle-lib  -O3 -std=c++11 -DDLS_MACOS   -MT libhmsbeagle_cpu_la-BeagleCPUPlugin.lo -MD -MP -MF .deps/libhmsbeagle_cpu_la-BeagleCPUPlugin.Tpo -c -o libhmsbeagle_cpu_la-BeagleCPUPlugin.lo `test -f 'BeagleCPUPlugin.cpp' || echo './'`BeagleCPUPlugin.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle -I/Users/mwgreen/beagle-lib -I/Users/mwgreen/beagle-lib -O3 -std=c++11 -DDLS_MACOS -MT libhmsbeagle_cpu_la-BeagleCPUPlugin.lo -MD -MP -MF .deps/libhmsbeagle_cpu_la-BeagleCPUPlugin.Tpo -c BeagleCPUPlugin.cpp  -fno-common -DPIC -o .libs/libhmsbeagle_cpu_la-BeagleCPUPlugin.o

mv -f .deps/libhmsbeagle_cpu_la-BeagleCPUPlugin.Tpo .deps/libhmsbeagle_cpu_la-BeagleCPUPlugin.Plo

/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS   -module -version-number 32  -o libhmsbeagle-cpu.la -rpath /Users/mwgreen/beagle-lib/lib  libhmsbeagle_cpu_la-BeagleCPUPlugin.lo  

libtool: link: g++ -Wl,-undefined -Wl,dynamic_lookup -o .libs/libhmsbeagle-cpu.32.so -bundle  .libs/libhmsbeagle_cpu_la-BeagleCPUPlugin.o    -O3  

libtool: link: (cd ".libs" && rm -f "libhmsbeagle-cpu.so" && ln -s "libhmsbeagle-cpu.32.so" "libhmsbeagle-cpu.so")

libtool: link: ( cd ".libs" && rm -f "libhmsbeagle-cpu.la" && ln -s "../libhmsbeagle-cpu.la" "libhmsbeagle-cpu.la" )

 ../.././.config/install-sh -c -d '/Users/mwgreen/beagle-lib/lib'

 /bin/sh ../../libtool   --mode=install /usr/bin/install -c   libhmsbeagle-cpu.la '/Users/mwgreen/beagle-lib/lib'

libtool: install: /usr/bin/install -c .libs/libhmsbeagle-cpu.32.so /Users/mwgreen/beagle-lib/lib/libhmsbeagle-cpu.32.so

libtool: install: (cd /Users/mwgreen/beagle-lib/lib && { ln -s -f libhmsbeagle-cpu.32.so libhmsbeagle-cpu.so || { rm -f libhmsbeagle-cpu.so && ln -s libhmsbeagle-cpu.32.so libhmsbeagle-cpu.so; }; })

libtool: install: /usr/bin/install -c .libs/libhmsbeagle-cpu.lai /Users/mwgreen/beagle-lib/lib/libhmsbeagle-cpu.la

make[3]: Nothing to be done for `install-data-am'.

Making install in plugin

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..  -O3 -std=c++11 -DDLS_MACOS  -MT libplugin_la-Plugin.lo -MD -MP -MF .deps/libplugin_la-Plugin.Tpo -c -o libplugin_la-Plugin.lo `test -f 'Plugin.cpp' || echo './'`Plugin.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle -I../.. -I../.. -O3 -std=c++11 -DDLS_MACOS -MT libplugin_la-Plugin.lo -MD -MP -MF .deps/libplugin_la-Plugin.Tpo -c Plugin.cpp  -fno-common -DPIC -o .libs/libplugin_la-Plugin.o

mv -f .deps/libplugin_la-Plugin.Tpo .deps/libplugin_la-Plugin.Plo

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..  -O3 -std=c++11 -DDLS_MACOS  -MT libplugin_la-UnixSharedLibrary.lo -MD -MP -MF .deps/libplugin_la-UnixSharedLibrary.Tpo -c -o libplugin_la-UnixSharedLibrary.lo `test -f 'UnixSharedLibrary.cpp' || echo './'`UnixSharedLibrary.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle -I../.. -I../.. -O3 -std=c++11 -DDLS_MACOS -MT libplugin_la-UnixSharedLibrary.lo -MD -MP -MF .deps/libplugin_la-UnixSharedLibrary.Tpo -c UnixSharedLibrary.cpp  -fno-common -DPIC -o .libs/libplugin_la-UnixSharedLibrary.o

mv -f .deps/libplugin_la-UnixSharedLibrary.Tpo .deps/libplugin_la-UnixSharedLibrary.Plo

/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS    -o libplugin.la  libplugin_la-Plugin.lo libplugin_la-UnixSharedLibrary.lo  

libtool: link: ar cru .libs/libplugin.a .libs/libplugin_la-Plugin.o .libs/libplugin_la-UnixSharedLibrary.o 

libtool: link: ranlib .libs/libplugin.a

libtool: link: ( cd ".libs" && rm -f "libplugin.la" && ln -s "../libplugin.la" "libplugin.la" )

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in benchmark

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..  -O3 -std=c++11 -DDLS_MACOS  -MT libbenchmark_la-BeagleBenchmark.lo -MD -MP -MF .deps/libbenchmark_la-BeagleBenchmark.Tpo -c -o libbenchmark_la-BeagleBenchmark.lo `test -f 'BeagleBenchmark.cpp' || echo './'`BeagleBenchmark.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle -I../.. -I../.. -O3 -std=c++11 -DDLS_MACOS -MT libbenchmark_la-BeagleBenchmark.lo -MD -MP -MF .deps/libbenchmark_la-BeagleBenchmark.Tpo -c BeagleBenchmark.cpp  -fno-common -DPIC -o .libs/libbenchmark_la-BeagleBenchmark.o

mv -f .deps/libbenchmark_la-BeagleBenchmark.Tpo .deps/libbenchmark_la-BeagleBenchmark.Plo

/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..  -O3 -std=c++11 -DDLS_MACOS  -MT libbenchmark_la-linalg.lo -MD -MP -MF .deps/libbenchmark_la-linalg.Tpo -c -o libbenchmark_la-linalg.lo `test -f 'linalg.cpp' || echo './'`linalg.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle -I../.. -I../.. -O3 -std=c++11 -DDLS_MACOS -MT libbenchmark_la-linalg.lo -MD -MP -MF .deps/libbenchmark_la-linalg.Tpo -c linalg.cpp  -fno-common -DPIC -o .libs/libbenchmark_la-linalg.o

mv -f .deps/libbenchmark_la-linalg.Tpo .deps/libbenchmark_la-linalg.Plo

/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS    -o libbenchmark.la  libbenchmark_la-BeagleBenchmark.lo libbenchmark_la-linalg.lo  

libtool: link: ar cru .libs/libbenchmark.a .libs/libbenchmark_la-BeagleBenchmark.o .libs/libbenchmark_la-linalg.o 

libtool: link: ranlib .libs/libbenchmark.a

libtool: link: ( cd ".libs" && rm -f "libbenchmark.la" && ln -s "../libbenchmark.la" "libbenchmark.la" )

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

/bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -I.. -I..   -O3 -std=c++11 -DDLS_MACOS  -MT libhmsbeagle_la-beagle.lo -MD -MP -MF .deps/libhmsbeagle_la-beagle.Tpo -c -o libhmsbeagle_la-beagle.lo `test -f 'beagle.cpp' || echo './'`beagle.cpp

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -O3 -std=c++11 -DDLS_MACOS -MT libhmsbeagle_la-beagle.lo -MD -MP -MF .deps/libhmsbeagle_la-beagle.Tpo -c beagle.cpp  -fno-common -DPIC -o .libs/libhmsbeagle_la-beagle.o

mv -f .deps/libhmsbeagle_la-beagle.Tpo .deps/libhmsbeagle_la-beagle.Plo

/bin/sh ../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS  -version-info 5:0:4  -o libhmsbeagle.la -rpath /Users/mwgreen/beagle-lib/lib libhmsbeagle_la-beagle.lo plugin/libplugin.la benchmark/libbenchmark.la  

libtool: link: g++ -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libhmsbeagle.1.dylib  .libs/libhmsbeagle_la-beagle.o   -Wl,-force_load,plugin/.libs/libplugin.a -Wl,-force_load,benchmark/.libs/libbenchmark.a   -O3   -install_name  /Users/mwgreen/beagle-lib/lib/libhmsbeagle.1.dylib -compatibility_version 6 -current_version 6.0 -Wl,-single_module

libtool: link: (cd ".libs" && rm -f "libhmsbeagle.dylib" && ln -s "libhmsbeagle.1.dylib" "libhmsbeagle.dylib")

libtool: link: ( cd ".libs" && rm -f "libhmsbeagle.la" && ln -s "../libhmsbeagle.la" "libhmsbeagle.la" )

 .././.config/install-sh -c -d '/Users/mwgreen/beagle-lib/lib'

 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libhmsbeagle.la '/Users/mwgreen/beagle-lib/lib'

libtool: install: /usr/bin/install -c .libs/libhmsbeagle.1.dylib /Users/mwgreen/beagle-lib/lib/libhmsbeagle.1.dylib

libtool: install: (cd /Users/mwgreen/beagle-lib/lib && { ln -s -f libhmsbeagle.1.dylib libhmsbeagle.dylib || { rm -f libhmsbeagle.dylib && ln -s libhmsbeagle.1.dylib libhmsbeagle.dylib; }; })

libtool: install: /usr/bin/install -c .libs/libhmsbeagle.lai /Users/mwgreen/beagle-lib/lib/libhmsbeagle.la

 .././.config/install-sh -c -d '/Users/mwgreen/beagle-lib/include/libhmsbeagle-1/libhmsbeagle'

 /usr/bin/install -c -m 644 beagle.h platform.h '/Users/mwgreen/beagle-lib/include/libhmsbeagle-1/libhmsbeagle'

Making install in libhmsbeagle/JNI

make[2]: Nothing to be done for `install-data-am'.

Making install in examples

Making install in synthetictest

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in tinytest

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in oddstatetest

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in complextest

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in fourtaxon

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

Making install in matrixtest

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

make[3]: Nothing to be done for `install-exec-am'.

make[3]: Nothing to be done for `install-data-am'.

make[2]: Nothing to be done for `install-exec-am'.

 ./.config/install-sh -c -d '/Users/mwgreen/beagle-lib/lib/pkgconfig'

 /usr/bin/install -c -m 644 hmsbeagle-1.pc '/Users/mwgreen/beagle-lib/lib/pkgconfig'


 % make check

Making check in libhmsbeagle

Making check in GPU

Making check in kernels

/Library/Developer/CommandLineTools/usr/bin/make  check-am

make[4]: Nothing to be done for `check-am'.

make[3]: Nothing to be done for `check-am'.

Making check in CPU

make[2]: Nothing to be done for `check'.

Making check in plugin

make[2]: Nothing to be done for `check'.

Making check in benchmark

make[2]: Nothing to be done for `check'.

make[2]: Nothing to be done for `check-am'.

Making check in libhmsbeagle/JNI

make[1]: Nothing to be done for `check'.

Making check in examples

Making check in synthetictest

/Library/Developer/CommandLineTools/usr/bin/make  synthetictest synthetictest.sh

g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..   -O3 -std=c++11 -DDLS_MACOS  -MT synthetictest.o -MD -MP -MF .deps/synthetictest.Tpo -c -o synthetictest.o synthetictest.cpp

mv -f .deps/synthetictest.Tpo .deps/synthetictest.Po

g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..   -O3 -std=c++11 -DDLS_MACOS  -MT linalg.o -MD -MP -MF .deps/linalg.Tpo -c -o linalg.o linalg.cpp

mv -f .deps/linalg.Tpo .deps/linalg.Po

/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS    -o synthetictest synthetictest.o linalg.o ../../libhmsbeagle/libhmsbeagle.la 

libtool: link: g++ -O3 -std=c++11 -DDLS_MACOS -o .libs/synthetictest synthetictest.o linalg.o -Wl,-bind_at_load  ../../libhmsbeagle/.libs/libhmsbeagle.dylib

echo './synthetictest' > synthetictest.sh

echo './synthetictest --states 64 --sites 100 --taxa 10' >> synthetictest.sh

chmod +x synthetictest.sh

/Library/Developer/CommandLineTools/usr/bin/make  check-TESTS

PASS: synthetictest.sh

============================================================================

Testsuite summary for libhmsbeagle 3.2.0

============================================================================

# TOTAL: 1

# PASS:  1

# SKIP:  0

# XFAIL: 0

# FAIL:  0

# XPASS: 0

# ERROR: 0

============================================================================

Making check in tinytest

/Library/Developer/CommandLineTools/usr/bin/make  tinytest

g++ -DHAVE_CONFIG_H -I. -I../../libhmsbeagle  -I../.. -I../..  -O3 -std=c++11 -DDLS_MACOS  -MT tinytest.o -MD -MP -MF .deps/tinytest.Tpo -c -o tinytest.o tinytest.cpp

mv -f .deps/tinytest.Tpo .deps/tinytest.Po

/bin/sh ../../libtool  --tag=CXX   --mode=link g++ -O3 -std=c++11 -DDLS_MACOS    -o tinytest tinytest.o ../../libhmsbeagle/libhmsbeagle.la 

libtool: link: g++ -O3 -std=c++11 -DDLS_MACOS -o .libs/tinytest tinytest.o -Wl,-bind_at_load  ../../libhmsbeagle/.libs/libhmsbeagle.dylib

/Library/Developer/CommandLineTools/usr/bin/make  check-TESTS

FAIL: tinytest

============================================================================

Testsuite summary for libhmsbeagle 3.2.0

============================================================================

# TOTAL: 1

# PASS:  0

# SKIP:  0

# XFAIL: 0

# FAIL:  1

# XPASS: 0

# ERROR: 0

============================================================================

See examples/tinytest/test-suite.log

Please report to beagl...@googlegroups.com

============================================================================

make[4]: *** [test-suite.log] Error 1

make[3]: *** [check-TESTS] Error 2

make[2]: *** [check-am] Error 2

make[1]: *** [check-recursive] Error 1

make: *** [check-recursive] Error 1

_______________________________________

Matthew Green, MS
PhD Candidate
Clemson University Arthropod Collection (CUAC) &
Department of Forestry and Environmental Conservation
Clemson University
303 Long Hall (Office)
E-143 Poole Agricultural Center (Mail)
Clemson, SC  29634-0310
Email: mwg...@g.clemson.edu
Phone: +1.336.671.8365
https://aquaticinsectlab.weebly.com
_______________________________________


You received this message because you are subscribed to a topic in the Google Groups "beast-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beast-users/reqD7Xbue_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/CAH5Y-yMDkrEtSsepiQK%2BpOmdWVfda8Zarg-hY7ri28BOqt6CJw%40mail.gmail.com.

Jonathan Chang

unread,
Jul 19, 2021, 3:02:02 AM7/19/21
to beast-users
Hi folks,

The currently released version of BEAGLE will not run on an m1 mac even if you configure it with --disable-sse and --enable-opencl. It's likely that cuda will need to be enabled but I don't have nvcc installed so I couldn't test it. I added a binary package of beagle to Homebrew for m1 macs (3.1.2_1-1) and while it builds and installs correctly we can observe that when running beast -beagle_info the available resources are empty and beast will refuse to run with an actual xml file:

% beast -beagle_info
Unable to load CPU plugin!
Please check for proper libhmsbeagle installation.
[snip]
Using BEAGLE library v3.1.2 for accelerated, parallel likelihood evaluation
2009-, BEAGLE Working Group - https://beagle-dev.github.io/
Citation: Ayres et al (2012) Systematic Biology 61: 170-173 | doi:10.1093/sysbio/syr100


BEAGLE resources available:


Building the pre-release version of beagle (v4) is straightforward if you have cmake and openjdk 17 alpha (for m1 macs) installed via homebrew.

cd beagle-lib
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/beagle/4.0alpha -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DJAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home -DJAVA_AWT_INCLUDE_PATH=/opt/homebrew/opt/openjdk/include
make install
brew link beagle

Then the proper libraries should show up in /opt/homebrew/lib and so forth and beast -beagle_info shows:

BEAGLE resources available:
0 : CPU (arm64)
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_CPP THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU


1 : Apple M1 (OpenCL 1.2 )
    Global memory (MB): 10922
    Clock speed (Ghz): 1.00
    Number of compute units: 8
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH COMPUTATION_ASYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_CPP THREADING_NONE PROCESSOR_GPU FRAMEWORK_OPENCL PARALLELOPS_STREAMS PARALLELOPS_GRID


I had to write a patch to get it to work https://github.com/beagle-dev/beagle-lib/pull/165 but other than that it seems to work fine.

Matthew Green

unread,
Jul 19, 2021, 5:11:27 AM7/19/21
to beast...@googlegroups.com, santiag...@gmail.com
You received this message because you are subscribed to a topic in the Google Groups "beast-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beast-users/reqD7Xbue_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beast-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beast-users/CAH5Y-yMDkrEtSsepiQK%2BpOmdWVfda8Zarg-hY7ri28BOqt6CJw%40mail.gmail.com.

Santiago Sánchez

unread,
Jul 19, 2021, 1:49:48 PM7/19/21
to beast...@googlegroups.com
Hi Johnathan,

Thanks for chiming in! Cool that you were able to make a binary package available. It would've been great to look at that before jumping through hoops!

It is my understanding that Marc Suchard was able to port beagle for use in M1 mac. For example, look at this tweet by Andrew Rambaut: https://twitter.com/arambaut/status/1377549941229416450

Unfortunately, I don't think a package release is yet ready as you can tell from these open issues on github: https://github.com/beagle-dev/beagle-lib/issues/159

I can assure you that I was able to compile and use beagle (v3.2) with beast on my M1 mac following the steps in my initial post. I think the key is to use an OpenJDK that works with M1 Macs. This is why I point to the Azul build.

I'm very curious to know how to add OpenCL to the beagle compilation. I couldn't find pre-install opencl libraries on my Mac and I don't know how to get it installed either. Do you mind adding more info on how to do this?

Thanks,
Santiago

PD, here is what I get with the -beagle_info command:

$ beast -beagle_info

                        BEAST v2.6.5, 2002-2021
             Bayesian Evolutionary Analysis Sampling Trees
                       Designed and developed by
 Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard
                                   
                   Centre for Computational Evolution
                         University of Auckland
                       r.bou...@auckland.ac.nz
                        ale...@cs.auckland.ac.nz
                                   
                   Institute of Evolutionary Biology
                        University of Edinburgh
                           a.ra...@ed.ac.uk
                                   
                    David Geffen School of Medicine
                 University of California, Los Angeles
                           msuc...@ucla.edu
                                   
                      Downloads, Help & Resources:
                           http://beast2.org/
                                   
  Source code distributed under the GNU Lesser General Public License:
                   http://github.com/CompEvol/beast2
                                   
                           BEAST developers:
   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled,
 Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li,
Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel,
          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie
                                   
                               Thanks to:
          Roald Forsberg, Beth Shapiro and Korbinian Strimmer


--- BEAGLE RESOURCES ---

0 : CPU
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU



Santiago Sánchez

unread,
Jul 19, 2021, 2:46:30 PM7/19/21
to beast...@googlegroups.com
UPDATE:

Thanks to Johnathan's post I did a bit more digging and was able to get beagle to recognize a native OpenCL library on my M1 mac. This way you can also use the GPU resources of your M1 mac.

It turns out the OpenCL include dir is somewhat tricky to find as it is buried in the filesystem. All I did is perform a "locate" search with:

$ locate OpenCL

I found the OpenCL include header files in this directory:

/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2/

Now, all I had to do is rerun the configure script and add the --with-opencl argument as follows:

./configure --disable-sse --with-jdk=$JAVA_HOME --prefix=`pwd` --with-opencl=/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/lib/clang/3.2

Redo all the steps in my original post after the ./configure step.

The only difference with editing the beast bash script in /Applications/BEAST\ 2.6.5/bin

In addition to the $JAVA_HOME/lib directory also add the $JAVA_HOME/include directory to the path:

if [ -n "$BEAST_EXTRA_LIBS" ]; then
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$BEAST_EXTRA_LIBS -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
else
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
fi

to:

if [ -n "$BEAST_EXTRA_LIBS" ]; then
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$BEAST_EXTRA_LIBS:$JAVA_HOME/lib:$JAVA_HOME/include -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
else
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx8g -Djava.library.path=$JAVA_HOME/lib:$JAVA_HOME/include -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
fi

After this step, your beast/beagle installation should be able to recognize ALL resources in your M1 mac:

$ /Applications/BEAST\ 2.6.5/bin/beast -beagle_info
1 : Apple M1 (OpenCL 1.2 )
    Global memory (MB): 5461

    Clock speed (Ghz): 1.00
    Number of compute units: 8
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH COMPUTATION_ASYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_NONE PROCESSOR_GPU FRAMEWORK_OPENCL



Santiago Sánchez

unread,
Jul 19, 2021, 4:31:02 PM7/19/21
to beast...@googlegroups.com
Last update (I promise!):

I went back and started from scratch and had trouble getting beagle compiled again :-(. As Matt described some tests were failing and beast was not picking up beagle.

So I deleted all my beagle installations and followed Jonathan's steps (above post). And it worked pretty well and with less hassle I have to say. Here is what I did:

# download beagle
# change the branch to "v4_release"
git checkout origin/v4_release
# compile with cmake
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/homebrew/Cellar/beagle/4.0alpha -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DJAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home -DJAVA_AWT_INCLUDE_PATH=/opt/homebrew/opt/openjdk/include
make install
brew link beagle

Next, I added this to my ~/.bash_profile file:

echo "export BEAGLE_LIB=/opt/homebrew/lib" >> ~/.bash_profile
source ~/.bash_profile

If you have a clean BEAST installation, beagle should be working without changing the beast shell script.

/Applications/BEAST\ 2.6.4/bin/beast -beagle_info
0 : CPU (arm64)
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU


1 : Apple M1 (OpenCL 1.2 )
    Global memory (MB): 5461
    Clock speed (Ghz): 1.00
    Number of compute units: 8
    Flags: PRECISION_SINGLE PRECISION_DOUBLE COMPUTATION_SYNCH COMPUTATION_ASYNCH EIGEN_REAL EIGEN_COMPLEX SCALING_MANUAL SCALING_AUTO SCALING_ALWAYS SCALERS_RAW SCALERS_LOG VECTOR_NONE THREADING_NONE PROCESSOR_GPU FRAMEWORK_OPENCL


Thanks a bunch, Jonathan!

Santiago



Reply all
Reply to author
Forward
0 new messages