Answers.Body: <p>I better explain this style of parameter rich MCMC takes ages and the issues are how speed this up.</p>
  <hr />
  <p>Having given this some thought my suggestion is to install <code>miniconda</code> or <code>anaconda</code> and then install the port to OpenCL, then install beast and beagle.</p>
  <p>Anaconda is here: <a href="https://www.anaconda.com/products/individual" rel="nofollow noreferrer">https://www.anaconda.com/products/individual</a></p>
  <p>Then install openCL via conda:</p>
  <pre><code> conda create -n beasty python=3.9
   conda activate beasty
   conda install -c conda-forge pyopencl 
   conda install -c bioconda beagle
   conda install -c bioconda beast2
  </code></pre>
  <p>My idea was you'd access OpenCL via python described <a href="https://documen.tician.de/pyopencl/" rel="nofollow noreferrer">here</a>. This wouldn't work ... its complicated.</p>
  <p><strong>Traditionally OpenCL and Beagle didn't work ... on an Intel Mac</strong></p>
  <blockquote>
  <p>2 : Intel(R) HD Graphics 620 (OpenCL 2.1 )</p>
  </blockquote>
  <p>However, if this is your chip set - I wouldn't give up. In any other scenario  I wouldn't pursue this - personally, below.</p>
  <p>One alternative is NVIDA e.g. Cloud computing used via CUDA and Beagle. CUDA will easily install and Beagle stacks straight on top.</p>
  <p>Any heavy duty MCMC is very amenable to traditional CPU parallelisation - if you think at it - it would be and thats why GPU - CUDA will work. Personally, looking at your resources I would parallelise under you cluster using a MINIMUM of 8-cores per calculation outside CUDA/OpenCL. If that has not already been done, that is the solution in context in my opinion. Unless you're a Google developer few will have access to a NVIDA cluster in any case sufficient CPU parallelisation should be able to achieve the runtime close to that of a good GPU (its gonna be a lot of CPUs though).</p>
  <p><strong>Conclusion</strong>
  Honestly, my personal advise is that phylogenetics sump clusters no matter what the calculation is being used and that has always been the case. The best solution is to max out on available cores. When eukaryote genome guys complain about 1000 hour runtimes (obviously thats the total CPU parallelised), thats a routine calculation in phylogenetics. Buying in NVIDA doesn't necessarily solve this, because whilst MCMC is massively accelerated for maximum likelihood isn't accelerated to that extent by comparison.</p>
  <p><strong>Extra information</strong> In case the OP is not aware, the enormous advantage of Beast2 is the ability to resume an MCMC at the point it ended (or some checkpoint therein), you don't need to run the whole thing again. You should seek to exploit that, so a calculation started on a laptop can be finished on a cluster. I can't state sufficiently how powerful that is, it stands to reason because the random number stream is declared and every sample thereafter. Keeping all calculations is standard practice in any case, but especially with a Beast2 run and don't every discard it (hard disk is cheap right?). You might find you have to return to it and its a whole lot better than needing to do the whole thing again.</p>
  <p><em>Its time to move on.</em></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T11:21:16.050Z
Answers.Text: There is [a way](https://beast.community/online_inference) to save states in BEAST 1. Should it be left here as a comment or as the answer correction?
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T14:21:13.287Z
Answers.Text: That is certainly interesting @Vovin , no its more than a comment. A separate answer would be cool, because I'm not aware of this and it is important or I can ask a separate question.
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T16:24:45.670Z
Answers.Text: In this case, I think I could made a Q&A according to [this](https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-answer-your-own-questions/)
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-20T21:25:42.737Z
Answers.Text: Thats perfectly, look forward to this @Vovin
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-28T16:00:43.363Z
Answers.Text: I have gotten `Found conflicts! Looking for incompatible packages.
  This can take several minutes.  Press CTRL-C to abor\
  failed
  
  UnsatisfiableError: The following specifications were found to be incompatible with each other:
  
  Output in format: Requested package -> Available versions
  
  Package libstdcxx-ng conflicts for:
  python=3.10 -> libffi[version='>=3.4.2,<3.5.0a0'] -> libstdcxx-ng[version='>=7.3.0|>=7.5.0']`
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-28T16:02:42.047Z
Answers.Text: `beast2 -> beagle-lib -> libstdcxx-ng[version='>=10.3.0|>=9.3.0|>=7.5.0|>=7.3.0']The following specifications were found to be incompatible with your system:
  
    - feature:/linux-64::__glibc==2.17=0
    - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  
  Your installed version is: 2.17`
  What does this mean? Which packages should I delete? Of what is 2.17 a version? Please could you help?
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-29T09:39:36.487Z
Answers.Text: I get the same conflict with a spanking new environment :(
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-29T10:45:17.577Z
Answers.Text: `beast2` can be installed with `beagle` & `opencl` only through adding `conda-forge` & `bioconda` channels, & creating new environment from scratch as `conda create -n env_name opencl beagle beast2`. Nonetheless, `conda run beast -beagle_info` shows only 1 resource: CPU without **OpenCL**
Answers.UserDisplayName: Vovin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-24T16:45:49.403Z
Answers.LastActivityDate: 2022-03-29T16:56:11.007Z
Answers.LastEditDate: 2022-03-29T16:56:11.007Z
Answers.UserDisplayName: M__
Body: <p>I am conducting phylogeny analyses using BEAST 2 as software tool. It is said that it can be accelerated by BEAGLE-library. I have a personal laptop with Windows &amp; a cluster with CentOS.</p>
  <p>I installed both BEAST 2 &amp; BEAGLE onto them. This gives me a boost by 3.6 times. It was said too that using OpenCL with BEAGLE gives me more speed-up. Nonetheless, my calculations takes from twelve hours to 3 days so I got really interested in this. Installing it on Windows were very simple. When I ran <code>beast -beagle_info</code>, I saw:</p>
  <pre><code>                        BEAST v2.6.6, 2002-2021
               Bayesian Evolutionary Analysis Sampling Trees
                         Designed and developed by
   Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut &amp; Marc A. Suchard
  
                     Centre for Computational Evolution
                           University of Auckland
                         r.bouckaert@auckland.ac.nz
                          alexei@cs.auckland.ac.nz
  
                     Institute of Evolutionary Biology
                          University of Edinburgh
                             a.rambaut@ed.ac.uk
  
                      David Geffen School of Medicine
                   University of California, Los Angeles
                             msuchard@ucla.edu
  
                        Downloads, Help &amp; 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_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  
  1 : NVIDIA GeForce 940MX
      Global memory (MB): 2048
      Clock speed (Ghz): 1.19
      Number of cores: 384
      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_CUDA
  
  2 : Intel(R) HD Graphics 620 (OpenCL 2.1 )
      Global memory (MB): 3219
      Clock speed (Ghz): 1.00
      Number of compute units: 24
      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
  
  3 : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (OpenCL 2.1 (Build 10))
      Global memory (MB): 8067
      Clock speed (Ghz): 2.50
      Number of compute units: 4
      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_CPU FRAMEWORK_OPENCL
  </code></pre>
  <p>However, it still uses only resourse #0, even through forced <code>beast -beagle_order 3 -threads 1 filename.xml</code>. Although, in comparison to Linux case, it was more successful.</p>
  <p>I have downloaded intel_sdk_for_opencl_applications_2020.3.494.tar.gz from <a href="http://software.intel.com/en-us/vcsource/tools/opencl-sdk" rel="nofollow noreferrer">here</a>. Then I unzipped it &amp; run <strong>install.sh</strong>. Installation was successful. After that, I have decided to go to <strong>build</strong> folder in <strong>beagle-lib</strong> &amp; run <code>cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..</code> in order to go on to run <code>make install</code> but I get the next message:</p>
  <pre><code>-- JAVA_HOME=
  -- JNI_INCLUDE_DIRS=/usr/lib/jvm/java/include;/usr/lib/jvm/java/include/linux;/usr/lib/jvm/java/include
  -- JNI_LIBRARIES=/usr/lib/jvm/java/lib/libjawt.so;/usr/lib/jvm/java/lib/server/libjvm.so
  -- Not using libtools for plugins
  -- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)
  CUDA_TOOLKIT_ROOT_DIR not found or specified
  -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /export/home/rinkman/beagle-lib/build
  </code></pre>
  <p>It was solved through manual specification of directories <code>cmake -DOpenCL_INCLUDE_DIR=~/intel/system_studio_2020/opencl/SDK/include/ -DOpenCL_LIBRARY=~/intel/system_studio_2020/opencl/SDK/lib64/libOpenCL.so.1.2 -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..</code>. The compiling was successful after that. <code>make test</code> was executed without any problems. I detected the file <strong>libhmsbeagle-opencl.so.40.0.0</strong> in <strong>~/lib folder</strong>. But <code>beast -beafle_info</code> did not show OpenCL. As there are older versions of BEAST &amp; BEAGLE on the root, I tried to change very roughly startup script to run only my local BEAGLE but nothing changed:</p>
  <pre><code>#!/bin/sh
  
  if [ -z &quot;<span class="math-container">$BEAST" ]; then
      ## resolve links - $</span>0 may be a link to application
      PRG=&quot;$0&quot;
  
      # need this for relative symlinks
      while [ -h &quot;<span class="math-container">$PRG" ] ; do
          ls=`ls -ld "$</span>PRG&quot;`
          link=`expr &quot;<span class="math-container">$ls" : '.*-&gt; \(.*\)$</span>'`
          if expr &quot;$link&quot; : '/.*' &gt; /dev/null; then
          PRG=&quot;$link&quot;
          else
          PRG=&quot;`dirname &quot;<span class="math-container">$PRG"`/$</span>link&quot;
          fi
      done
  
      # make it fully qualified
      saveddir=`pwd`
      BEAST0=`dirname &quot;$PRG&quot;`/..
      BEAST=`cd &quot;$BEAST0&quot; &amp;&amp; pwd`
      cd &quot;$saveddir&quot;
  fi
  
  BEAST_LIB=&quot;$BEAST/lib&quot;
  
  if [ -z &quot;<span class="math-container">$JAVA_HOME" ]; then
    JAVA=java
  else
    JAVA="$</span>JAVA_HOME&quot;/bin/java
  fi
  
  
  # use BEAGLE_LIB if the BEAGLE library is not in a standard location
  if [ -n &quot;<span class="math-container">$BEAGLE_LIB" ]; then
      if [ -n "$</span>BEAST_EXTRA_LIBS&quot; ]; then
          BEAST_EXTRA_LIBS=&quot;<span class="math-container">$BEAST_EXTRA_LIBS:$</span>BEAGLE_LIB&quot;
      else
          BEAST_EXTRA_LIBS=&quot;$BEAGLE_LIB&quot;
      fi
  fi
  
  # Explicitly add /usr/local/lib to library search path to ensure 
  # beast continues to find beagle when installed here.  (This is
  # necessary due to known problems with certain JREs.)
  if [ -z &quot;<span class="math-container">$LD_LIBRARY_PATH" ]; then
      export LD_LIBRARY_PATH=/usr/local/lib
  else
      export LD_LIBRARY_PATH="$</span>LD_LIBRARY_PATH&quot;:/usr/local/lib
  fi
  
  BEAST_EXTRA_LIBS=&quot;$HOME/lib/&quot;
  
  # use BEAST_EXTRA_LIBS variable to load BEAGLE and other libraries from non-default locations 
  # this assumes that the library path contains all these libraries (or are set through LD_LIBRARY_PATH)
  #if [ -n &quot;<span class="math-container">$BEAST_EXTRA_LIBS" ]; then 
  #  "$</span>JAVA&quot; -Dlauncher.wait.for.exit=true -Xms256m -Xmx1g -Djava.library.path=&quot;<span class="math-container">$BEAST_EXTRA_LIBS" -Duser.language=en -cp "$</span>BEAST_LIB/launcher.jar&quot; beast.app.beastapp.BeastLauncher <span class="math-container">$*
  #else   
  #  "$</span>JAVA&quot; -Dlauncher.wait.for.exit=true -Xms256m -Xmx1g -Duser.language=en -cp &quot;<span class="math-container">$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $</span>*
  #fi
  &quot;<span class="math-container">$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx1g -Djava.library.path="$</span>BEAST_EXTRA_LIBS&quot; -Duser.language=en -cp &quot;<span class="math-container">$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $</span>*
  </code></pre>
  <p>Please, could anyone help with this?</p>
  <p>P.S. I am a noviciate in unix-systems.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-17T17:55:41.743Z
Comments.Text: @M__ I installed **BEAGLE** successfully per se & it does work but I would like to run it with OpenCL.
Comments.UserDisplayName: Vovin
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-17T20:53:29.303Z
Comments.Text: @M__ Do you mean beast-users?
Comments.UserDisplayName: Vovin
Tags: <phylogenetics><linux><beast>
Title: BEAGLE do not see and/or not use OpenCL
ThreadText: # BEAGLE do not see and/or not use OpenCL
  
  (Asked by: username_0 on 2022-03-17)
  
  I am conducting phylogeny analyses using BEAST 2 as software tool. It is said that it can be accelerated by BEAGLE-library. I have a personal laptop with Windows & a cluster with CentOS.
  
  I installed both BEAST 2 & BEAGLE onto them. This gives me a boost by 3.6 times. It was said too that using OpenCL with BEAGLE gives me more speed-up. Nonetheless, my calculations takes from twelve hours to 3 days so I got really interested in this. Installing it on Windows were very simple. When I ran `beast -beagle_info`, I saw:
  
  ```
                          BEAST v2.6.6, 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.bouckaert@auckland.ac.nz
                          alexei@cs.auckland.ac.nz
  
                     Institute of Evolutionary Biology
                          University of Edinburgh
                             a.rambaut@ed.ac.uk
  
                      David Geffen School of Medicine
                   University of California, Los Angeles
                             msuchard@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_SSE VECTOR_NONE THREADING_NONE PROCESSOR_CPU FRAMEWORK_CPU
  
  1 : NVIDIA GeForce 940MX
      Global memory (MB): 2048
      Clock speed (Ghz): 1.19
      Number of cores: 384
      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_CUDA
  
  2 : Intel(R) HD Graphics 620 (OpenCL 2.1 )
      Global memory (MB): 3219
      Clock speed (Ghz): 1.00
      Number of compute units: 24
      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
  
  3 : Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (OpenCL 2.1 (Build 10))
      Global memory (MB): 8067
      Clock speed (Ghz): 2.50
      Number of compute units: 4
      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_CPU FRAMEWORK_OPENCL
  
  ```
  
  However, it still uses only resourse #0, even through forced `beast -beagle_order 3 -threads 1 filename.xml`. Although, in comparison to Linux case, it was more successful.
  
  I have downloaded intel\_sdk\_for\_opencl\_applications\_2020.3.494.tar.gz from [here](http://software.intel.com/en-us/vcsource/tools/opencl-sdk). Then I unzipped it & run **install.sh**. Installation was successful. After that, I have decided to go to **build** folder in **beagle-lib** & run `cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..` in order to go on to run `make install` but I get the next message:
  
  ```
  -- JAVA_HOME=
  -- JNI_INCLUDE_DIRS=/usr/lib/jvm/java/include;/usr/lib/jvm/java/include/linux;/usr/lib/jvm/java/include
  -- JNI_LIBRARIES=/usr/lib/jvm/java/lib/libjawt.so;/usr/lib/jvm/java/lib/server/libjvm.so
  -- Not using libtools for plugins
  -- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)
  CUDA_TOOLKIT_ROOT_DIR not found or specified
  -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY)
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /export/home/rinkman/beagle-lib/build
  
  ```
  
  It was solved through manual specification of directories `cmake -DOpenCL_INCLUDE_DIR=~/intel/system_studio_2020/opencl/SDK/include/ -DOpenCL_LIBRARY=~/intel/system_studio_2020/opencl/SDK/lib64/libOpenCL.so.1.2 -DCMAKE_INSTALL_PREFIX:PATH=$HOME ..`. The compiling was successful after that. `make test` was executed without any problems. I detected the file **libhmsbeagle-opencl.so.40.0.0** in **~/lib folder**. But `beast -beafle_info` did not show OpenCL. As there are older versions of BEAST & BEAGLE on the root, I tried to change very roughly startup script to run only my local BEAGLE but nothing changed:
  
  ```
  #!/bin/sh
  
  if [ -z "$BEAST" ]; then
      ## resolve links - $0 may be a link to application
      PRG="$0"
  
      # need this for relative symlinks
      while [ -h "$PRG" ] ; do
          ls=`ls -ld "$PRG"`
          link=`expr "$ls" : '.*-> \(.*\)$'`
          if expr "$link" : '/.*' > /dev/null; then
          PRG="$link"
          else
          PRG="`dirname "$PRG"`/$link"
          fi
      done
  
      # make it fully qualified
      saveddir=`pwd`
      BEAST0=`dirname "$PRG"`/..
      BEAST=`cd "$BEAST0" && pwd`
      cd "$saveddir"
  fi
  
  BEAST_LIB="$BEAST/lib"
  
  if [ -z "$JAVA_HOME" ]; then
    JAVA=java
  else
    JAVA="$JAVA_HOME"/bin/java
  fi
  
  # use BEAGLE_LIB if the BEAGLE library is not in a standard location
  if [ -n "$BEAGLE_LIB" ]; then
      if [ -n "$BEAST_EXTRA_LIBS" ]; then
          BEAST_EXTRA_LIBS="$BEAST_EXTRA_LIBS:$BEAGLE_LIB"
      else
          BEAST_EXTRA_LIBS="$BEAGLE_LIB"
      fi
  fi
  
  # Explicitly add /usr/local/lib to library search path to ensure 
  # beast continues to find beagle when installed here.  (This is
  # necessary due to known problems with certain JREs.)
  if [ -z "$LD_LIBRARY_PATH" ]; then
      export LD_LIBRARY_PATH=/usr/local/lib
  else
      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/usr/local/lib
  fi
  
  BEAST_EXTRA_LIBS="$HOME/lib/"
  
  # use BEAST_EXTRA_LIBS variable to load BEAGLE and other libraries from non-default locations 
  # this assumes that the library path contains all these libraries (or are set through LD_LIBRARY_PATH)
  #if [ -n "$BEAST_EXTRA_LIBS" ]; then 
  #  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx1g -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 -Xmx1g -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
  #fi
  "$JAVA" -Dlauncher.wait.for.exit=true -Xms256m -Xmx1g -Djava.library.path="$BEAST_EXTRA_LIBS" -Duser.language=en -cp "$BEAST_LIB/launcher.jar" beast.app.beastapp.BeastLauncher $*
  
  ```
  
  Please, could anyone help with this?
  
  P.S. I am a noviciate in unix-systems.
  
  **Tags:** phylogenetics, linux, beast
  
  > **Comments:**
  > **username_0**: @username_1 I installed **BEAGLE** successfully per se & it does work but I would like to run it with OpenCL.  
  > **username_0**: @username_1 Do you mean beast-users?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-03-24. Score: 1
  
  I better explain this style of parameter rich MCMC takes ages and the issues are how speed this up.
  
  ---
  
  Having given this some thought my suggestion is to install `miniconda` or `anaconda` and then install the port to OpenCL, then install beast and beagle.
  
  Anaconda is here: <https://www.anaconda.com/products/individual>
  
  Then install openCL via conda:
  
  ```
   conda create -n beasty python=3.9
   conda activate beasty
   conda install -c conda-forge pyopencl 
   conda install -c bioconda beagle
   conda install -c bioconda beast2
  
  ```
  
  My idea was you'd access OpenCL via python described [here](https://documen.tician.de/pyopencl/). This wouldn't work ... its complicated.
  
  **Traditionally OpenCL and Beagle didn't work ... on an Intel Mac**
  
  > 2 : Intel(R) HD Graphics 620 (OpenCL 2.1 )
  
  However, if this is your chip set - I wouldn't give up. In any other scenario I wouldn't pursue this - personally, below.
  
  One alternative is NVIDA e.g. Cloud computing used via CUDA and Beagle. CUDA will easily install and Beagle stacks straight on top.
  
  Any heavy duty MCMC is very amenable to traditional CPU parallelisation - if you think at it - it would be and thats why GPU - CUDA will work. Personally, looking at your resources I would parallelise under you cluster using a MINIMUM of 8-cores per calculation outside CUDA/OpenCL. If that has not already been done, that is the solution in context in my opinion. Unless you're a Google developer few will have access to a NVIDA cluster in any case sufficient CPU parallelisation should be able to achieve the runtime close to that of a good GPU (its gonna be a lot of CPUs though).
  
  **Conclusion**
  Honestly, my personal advise is that phylogenetics sump clusters no matter what the calculation is being used and that has always been the case. The best solution is to max out on available cores. When eukaryote genome guys complain about 1000 hour runtimes (obviously thats the total CPU parallelised), thats a routine calculation in phylogenetics. Buying in NVIDA doesn't necessarily solve this, because whilst MCMC is massively accelerated for maximum likelihood isn't accelerated to that extent by comparison.
  
  **Extra information** In case the OP is not aware, the enormous advantage of Beast2 is the ability to resume an MCMC at the point it ended (or some checkpoint therein), you don't need to run the whole thing again. You should seek to exploit that, so a calculation started on a laptop can be finished on a cluster. I can't state sufficiently how powerful that is, it stands to reason because the random number stream is declared and every sample thereafter. Keeping all calculations is standard practice in any case, but especially with a Beast2 run and don't every discard it (hard disk is cheap right?). You might find you have to return to it and its a whole lot better than needing to do the whole thing again.
  
  *Its time to move on.*
  
  > **Comments:**
  > **username_0**: I have gotten `Found conflicts! Looking for incompatible packages. This can take several minutes.  Press CTRL-C to abor\ failed  UnsatisfiableError: The following specifications were found to be incompatible with each other:  Output in format: Requested package -> Available versions  Package libstdcxx-ng conflicts for: python=3.10 -> libffi[version='>=3.4.2,<3.5.0a0'] -> libstdcxx-ng[version='>=7.3.0|>=7.5.0']`  
  > **username_0**: `beast2 -> beagle-lib -> libstdcxx-ng[version='>=10.3.0|>=9.3.0|>=7.5.0|>=7.3.0']The following specifications were found to be incompatible with your system:    - feature:/linux-64::__glibc==2.17=0   - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']  Your installed version is: 2.17` What does this mean? Which packages should I delete? Of what is 2.17 a version? Please could you help?  
  > **username_0**: I get the same conflict with a spanking new environment :(  
  > **username_0**: `beast2` can be installed with `beagle` & `opencl` only through adding `conda-forge` & `bioconda` channels, & creating new environment from scratch as `conda create -n env_name opencl beagle beast2`. Nonetheless, `conda run beast -beagle_info` shows only 1 resource: CPU without **OpenCL**  
  > **username_0**: There is [a way](https://beast.community/online_inference) to save states in BEAST 1. Should it be left here as a comment or as the answer correction?  
  > **username_1**: That is certainly interesting @username_0 , no its more than a comment. A separate answer would be cool, because I'm not aware of this and it is important or I can ask a separate question.  
  > **username_0**: In this case, I think I could made a Q&A according to [this](https://stackoverflow.blog/2011/07/01/its-ok-to-ask-and-answer-your-own-questions/)  
  > **username_1**: Thats perfectly, look forward to this @username_0  
  
  ---
  
  