diff options
Diffstat (limited to 'posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS/index 2.html')
-rw-r--r-- | posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS/index 2.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS/index 2.html b/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS/index 2.html new file mode 100644 index 0000000..e3a9e46 --- /dev/null +++ b/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS/index 2.html @@ -0,0 +1,29 @@ +<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"/><meta name="og:site_name" content="Navan Chauhan"/><link rel="canonical" href="https://navanchauhan.github.io/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS"/><meta name="twitter:url" content="https://navanchauhan.github.io/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS"/><meta name="og:url" content="https://navanchauhan.github.io/posts/2020-06-02-Compiling-AutoDock-Vina-on-iOS"/><title>Compiling AutoDock Vina on iOS | Navan Chauhan</title><meta name="twitter:title" content="Compiling AutoDock Vina on iOS | Navan Chauhan"/><meta name="og:title" content="Compiling AutoDock Vina on iOS | Navan Chauhan"/><meta name="description" content="Compiling AutoDock Vina on iOS"/><meta name="twitter:description" content="Compiling AutoDock Vina on iOS"/><meta name="og:description" content="Compiling AutoDock Vina on iOS"/><meta name="twitter:card" content="summary"/><link rel="stylesheet" href="/styles.css" type="text/css"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="shortcut icon" href="/images/favicon.png" type="image/png"/><link rel="alternate" href="/feed.rss" type="application/rss+xml" title="Subscribe to Navan Chauhan"/><meta name="twitter:image" content="https://navanchauhan.github.io/images/logo.png"/><meta name="og:image" content="https://navanchauhan.github.io/images/logo.png"/></head><head><script src="https://www.googletagmanager.com/gtag/js?id=UA-108635191-1v"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', 'UA-108635191-1');</script></head><body class="item-page"><header><div class="wrapper"><a class="site-name" href="/">Navan Chauhan</a><nav><ul><li><a href="/about">About Me</a></li><li><a class="selected" href="/posts">Posts</a></li><li><a href="/publications">Publications</a></li><li><a href="/assets/résumé.pdf">Résumé</a></li><li><a href="https://navanchauhan.github.io/repo">Repo</a></li></ul></nav></div></header><div class="wrapper"><article><div class="content"><span class="reading-time">3 minute read</span><span class="reading-time">Created on June 2, 2020</span><h1>Compiling AutoDock Vina on iOS</h1><p>Why? Because I can.</p><h2>Installing makedepend</h2><p><code>makedepend</code> is a Unix tool used to generate dependencies of C source files. Most modern programes do not use this anymore, but then again AutoDock Vina's source code hasn't been changed since 2011. The first hurdle came when I saw that there was no makedepend command, neither was there any package on any development repository for iOS. So, I tracked down the original source code for <code>makedepend</code> (https://github.com/DerellLicht/makedepend). According to the repository this is actually the source code for the makedepend utility that came with some XWindows distribution back around Y2K. I am pretty sure there is a problem with my current compiler configuration because I had to manually edit the <code>Makefile</code> to provide the path to the iOS SDKs using the <code>-isysroot</code> flag.</p><h2>Editting the Makefile</h2><p>Original Makefile ( I used the provided mac Makefile base )</p><pre><code><div class="highlight"><span></span><span class="nv">BASE</span><span class="o">=</span>/usr/local +<span class="nv">BOOST_VERSION</span><span class="o">=</span>1_41 +<span class="nv">BOOST_INCLUDE</span> <span class="o">=</span> <span class="k">$(</span>BASE<span class="k">)</span>/include +<span class="nv">C_PLATFORM</span><span class="o">=</span>-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min<span class="o">=</span><span class="m">10</span>.4 +<span class="nv">GPP</span><span class="o">=</span>/usr/bin/g++ +<span class="nv">C_OPTIONS</span><span class="o">=</span> -O3 -DNDEBUG +<span class="nv">BOOST_LIB_VERSION</span><span class="o">=</span> + +include ../../makefile_common +</div></code></pre><p>I installed Boost 1.68.0-1 from Sam Bingner's repository. ( Otherwise I would have had to compile boost too 😫 )</p><p>Editted Makefile</p><pre><code><div class="highlight"><span></span><span class="nv">BASE</span><span class="o">=</span>/usr +<span class="nv">BOOST_VERSION</span><span class="o">=</span>1_68 +<span class="nv">BOOST_INCLUDE</span> <span class="o">=</span> <span class="k">$(</span>BASE<span class="k">)</span>/include +<span class="nv">C_PLATFORM</span><span class="o">=</span>-arch arm64 -isysroot /var/sdks/Latest.sdk +<span class="nv">GPP</span><span class="o">=</span>/usr/bin/g++ +<span class="nv">C_OPTIONS</span><span class="o">=</span> -O3 -DNDEBUG +<span class="nv">BOOST_LIB_VERSION</span><span class="o">=</span> + +include ../../makefile_common +</div></code></pre><h2>Updating the Source Code</h2><p>Of course since Boost 1.41 many things have been added and deprecated, that is why I had to edit the source code to make it work with version 1.68</p><h3>Error 1 - No Matching Constructor</h3><pre><code><div class="highlight"><span></span>../../../src/main/main.cpp:50:9: error: no matching constructor <span class="k">for</span> initialization of <span class="s1">'path'</span> <span class="o">(</span>aka <span class="s1">'boost::filesystem::path'</span><span class="o">)</span> +<span class="k">return</span> path<span class="o">(</span>str, boost::filesystem::native<span class="o">)</span><span class="p">;</span> +</div></code></pre><p>This was an easy fix, I just commented this and added a return statement to return the path</p><pre><code><div class="highlight"><span></span><span class="k">return</span> path<span class="o">(</span>str<span class="o">)</span> +</div></code></pre><h3>Error 2 - No Member Named 'native<em>file</em>string'</h3><pre><code><div class="highlight"><span></span>../../../src/main/main.cpp:665:57: error: no member named <span class="s1">'native_file_string'</span> in <span class="s1">'boost::filesystem::path'</span> + std::cerr << <span class="s2">"\n\nError: could not open \""</span> <span class="s"><< e.name</span>.native_file_string<span class="o">()</span> << <span class="s2">"\" for "</span> << <span class="o">(</span>e.in ? <span class="s2">"reading"</span> : <span class="s2">"writing"</span><span class="o">)</span> << <span class="s2">".\n"</span><span class="p">;</span> + ~~~~~~ ^ +../../../src/main/main.cpp:677:80: error: no member named <span class="s1">'native_file_string'</span> in <span class="s1">'boost::filesystem::path'</span> + std::cerr << <span class="s2">"\n\nParse error on line "</span> <span class="s"><< e.line</span> << <span class="s2">" in file \""</span> <span class="s"><< e.file</span>.native_file_string<span class="o">()</span> << <span class="s2">"\": "</span> <span class="s"><< e.re</span>ason <span class="s"><< '\n';</span> +<span class="s"> ~~~~~~ ^</span> +<span class="s">2 errors gen</span>erated. +</div></code></pre><p>Turns out <code>native_file_string</code> was deprecated in Boost 1.57 and replaced with just <code>string</code></p><h3>Error 3 - Library Not Found</h3><p>This one still boggles me because there was no reason for it to not work, as a workaround I downloaded the DEB, extracted it and used that path for compiling.</p><h3>Error 4 - No Member Named 'native<em>file</em>string' Again.</h3><p>But, this time in another file and I quickle fixed it</p><h2>Moment of Truth</h2><p>Obviously it was working on my iPad, but would it work on another device? I transfered the compiled binary and</p><img src="/assets/posts/autodock-vina/s1.png" alt=""AutoDock Vina running on my iPhone""/><p>The package is available on my repository and only depends on boost. ( Both, Vina and Vina-Split are part of the package)</p></div><span>Tagged with: </span><ul class="tag-list"><li><a href="/tags/ios">iOS</a></li><li><a href="/tags/jailbreak">Jailbreak</a></li><li><a href="/tags/cheminformatics">Cheminformatics</a></li><li><a href="/tags/autodock-vina">AutoDock Vina</a></li><li><a href="/tags/moleculardocking">Molecular-Docking</a></li></ul></article></div><footer><p>Made with ❤️ using <a href="https://github.com/johnsundell/publish">Publish</a></p><p><a href="/feed.rss">RSS feed</a></p></footer></body></html>
\ No newline at end of file |