<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://articles.vides-son.us</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 20:32:15 GMT</lastBuildDate><atom:link href="https://articles.vides-son.us/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[YDPA #02: You Don't Pay to do #Acoustics]]></title><description><![CDATA[(cover credit @askubuntumemes)
We will be finally setting our foot on the ground! Feel free to clone the repository to follow along:
https://github.com/Universite-Gustave-Eiffel/I-Simpa
 
What you need before starting
First of all, you need the commo...]]></description><link>https://articles.vides-son.us/ydpa-02-you-dont-pay-to-do-acoustics</link><guid isPermaLink="true">https://articles.vides-son.us/ydpa-02-you-dont-pay-to-do-acoustics</guid><category><![CDATA[#Acoustics]]></category><dc:creator><![CDATA[Jay]]></dc:creator><pubDate>Thu, 28 Sep 2023 13:03:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1695900906449/269d4d69-bc2a-412f-8f29-617659952bd0.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>(cover credit <a target="_blank" href="https://twitter.com/askubuntumemes">@askubuntumemes</a>)</p>
<p>We will be finally setting our foot on the ground! Feel free to clone the repository to follow along:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://github.com/Universite-Gustave-Eiffel/I-Simpa">https://github.com/Universite-Gustave-Eiffel/I-Simpa</a></div>
<p> </p>
<h1 id="heading-what-you-need-before-starting">What you need before starting</h1>
<p>First of all, you need the common developer tools available on Mac: <code>git</code>, <code>gcc</code>, <code>make</code> and <code>g++</code>. If they aren't, proceed to Terminal and run through <code>xcode-select --install</code>.</p>
<p>And, make sure you have <a target="_blank" href="https://brew.sh">Homebrew</a> installed!</p>
<p>Finally, we need a few packages from Homebrew before proceeding, they are essential for building the dependencies needed in later stages:</p>
<pre><code class="lang-bash">brew install pcre automake
</code></pre>
<h1 id="heading-dependencies">Dependencies</h1>
<p>A glimpse of the CI configurations at <code>appveyor.yml</code> and <code>ci/travis/linux.yml</code> for (Appveyor and Travis CI respectively) reveals the general flow of building the software:</p>
<ol>
<li><p>Download source codes of third-party packages</p>
</li>
<li><p>Install the packages with custom options (using <code>make</code>)</p>
</li>
<li><p>Navigate to the project directory, compile</p>
</li>
<li><p>Pack, install, and test the compiled artifacts</p>
</li>
</ol>
<p>The main packages used are:</p>
<ul>
<li><p><code>python 3.8</code> : Needed for compiling, in case of user-supplied scripts</p>
</li>
<li><p><code>boost 1.73.0</code> : Used in EVERY module</p>
<ul>
<li>Sublibraries: <code>filesystem,system,test,regex,python,random,thread,timer,date_time</code></li>
</ul>
</li>
<li><p><code>swig 3.0.10</code> : Transforming numerical codes into <code>python</code> external packages, which could be used by user-supplied scripts</p>
</li>
<li><p><code>wxWidgets 3.1.4</code> : Rendering interactive components in the User Interface</p>
</li>
<li><p><code>CMake 3.17.2</code>: For building the software</p>
</li>
<li><p><code>OpenGL</code> (in a subtle way): Rendering 3D models in the User Interface</p>
</li>
</ul>
<div data-node-type="callout">
<div data-node-type="callout-emoji">☹</div>
<div data-node-type="callout-text">While using third-party package managers (<code>conan</code>, <code>vcpkg</code>) could be beneficiary in the long term, this goal is suspended at the moment due to compatibility concerns.</div>
</div>

<hr />
<h1 id="heading-lets-have-fun">Let's have fun :)</h1>
<h2 id="heading-boostrapping">Boostrapping</h2>
<p>In case the version of <code>python</code> does no match exactly on your machine (it was shipped in <code>xcode-select --install</code>), you can install it via <code>brew install python@3.8</code> or manually compiling the source code.</p>
<pre><code class="lang-bash">&gt; python3 --version
Python 3.9.6
</code></pre>
<p>In the former case, <code>brew</code> linked the binary to <code>python3.8</code> automatically.</p>
<pre><code class="lang-bash">&gt; <span class="hljs-built_in">which</span> python3.8
/usr/<span class="hljs-built_in">local</span>/bin/python3.8
</code></pre>
<hr />
<p>Now let's follow along with the Linux build scripts from the original repository:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># ci/travis/linux/before_install.sh</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># Boost install</span>

<span class="hljs-keyword">if</span> [ -d <span class="hljs-variable">$HOME</span>/boost-install/boost ] ; <span class="hljs-keyword">then</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Boost already built (and in travis cache)"</span>
<span class="hljs-keyword">else</span>
    <span class="hljs-built_in">cd</span>
    wget https://sourceforge.net/projects/boost/files/boost/1.73.0/boost_1_73_0.tar.bz2
    tar -xjf boost_1_73_0.tar.bz2 --strip-components=1 -C <span class="hljs-variable">$HOME</span>/boost-install
    ls -l <span class="hljs-variable">$HOME</span>/boost-install
    <span class="hljs-built_in">cd</span> <span class="hljs-variable">$HOME</span>/boost-install &amp;&amp; <span class="hljs-built_in">echo</span> <span class="hljs-string">"using python : 3.8 : /usr/bin/python3 : /usr/include/python3.8 : /usr/lib ;"</span> &gt; tools/build/src/user-config.jam
    <span class="hljs-built_in">cd</span> <span class="hljs-variable">$HOME</span>/boost-install &amp;&amp; ./bootstrap.sh link=static variant=release address-model=64 cxxflags=<span class="hljs-string">"-std=c++11 -fPIC"</span> boost.locale.icu=off --with-libraries=filesystem,system,<span class="hljs-built_in">test</span>,regex,python,random,thread,timer,date_time --prefix=<span class="hljs-variable">$HOME</span>/boost-install &amp;&amp; ./b2 install
<span class="hljs-keyword">fi</span>
<span class="hljs-built_in">export</span> BOOST_LIBRARYDIR=<span class="hljs-variable">$HOME</span>/boost-install/lib/
<span class="hljs-built_in">export</span> BOOST_INCLUDEDIR=<span class="hljs-variable">$HOME</span>/boost-install/
<span class="hljs-built_in">export</span> BOOST_ROOT=<span class="hljs-variable">$HOME</span>/boost-install/

<span class="hljs-comment">#</span>
<span class="hljs-comment"># Swig install</span>
<span class="hljs-keyword">if</span> [ -f <span class="hljs-variable">$HOME</span>/swig-install/bin/swig ] ; <span class="hljs-keyword">then</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Swig already built (and in travis cache)"</span>
<span class="hljs-keyword">else</span>
    <span class="hljs-built_in">cd</span>
    wget https://github.com/swig/swig/archive/rel-3.0.10.tar.gz
    tar zxvf rel-3.0.10.tar.gz
    mkdir <span class="hljs-variable">$HOME</span>/swig-install
    <span class="hljs-built_in">cd</span>  <span class="hljs-variable">$HOME</span>/swig-rel-3.0.10 &amp;&amp; ./autogen.sh &amp;&amp; ./configure --prefix=<span class="hljs-variable">$HOME</span>/swig-install &amp;&amp; make &amp;&amp; make install
<span class="hljs-keyword">fi</span>

<span class="hljs-comment">#</span>
<span class="hljs-comment"># WXWidget install</span>

<span class="hljs-keyword">if</span> [ -d <span class="hljs-variable">$HOME</span>/wxWidgets-install/include ] ; <span class="hljs-keyword">then</span>
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"wxWidget already built (and in travis cache)"</span>
<span class="hljs-keyword">else</span>
    <span class="hljs-built_in">cd</span>
    wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.tar.bz2
    tar -xjf wxWidgets-3.1.4.tar.bz2
    mkdir <span class="hljs-variable">$HOME</span>/wxWidgets-install
    <span class="hljs-built_in">cd</span> <span class="hljs-variable">$HOME</span>/wxWidgets-3.1.4 &amp;&amp; ./configure --prefix=<span class="hljs-variable">$HOME</span>/wxWidgets-install --disable-shared &amp;&amp; make &amp;&amp; make install
<span class="hljs-keyword">fi</span>
</code></pre>
<p>The above steps could take a while, it is straightforward enough that the packages are downloaded, and built under designated locations. These locations would be referenced by <code>CMAKE</code> in later stages.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">In case <code>wget https://x.y.z</code> is not available, use <code>curl -LOJ https://x.y.z</code> instead. Pay attention to the names of downloaded files.</div>
</div>

<p>And finally, we download <code>CMake</code> and make sure everything is okay.</p>
<p>Note the change of file name from <code>cmake-3.17.2-Linux-x86_64.tar.gz</code> to <code>cmake-3.17.2-Darwin-x86_64.tar.gz</code>, and the <code>strip</code> value.</p>
<pre><code class="lang-bash"><span class="hljs-comment"># check wxWidget install</span>
<span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$HOME</span>/wxWidgets-install/bin/:<span class="hljs-variable">$PATH</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">"wxWidget version : "</span>
wx-config --version

<span class="hljs-comment"># Download CMake</span>
<span class="hljs-built_in">cd</span>
wget --no-check-certificate curl -LOJ https://cmake.org/files/v3.17/cmake-3.17.2-Darwin-x86_64.tar.gz
mkdir <span class="hljs-variable">$HOME</span>/cmake-install
tar zxvf cmake-3.17.2-Darwin-x86_64.tar.gz -C <span class="hljs-variable">$HOME</span>/cmake-install --strip 3
</code></pre>
<hr />
<h2 id="heading-compiling-with-cmake">Compiling with <code>CMake</code></h2>
<h3 id="heading-librt-and-clockgettime">librt and clock_gettime()</h3>
<pre><code class="lang-bash"><span class="hljs-comment"># ci/travis/linux/install.sh</span>
mkdir build
<span class="hljs-built_in">cd</span> build

CLANG_WARNINGS=<span class="hljs-string">""</span>

<span class="hljs-comment"># wxWidget path (only in script scope)</span>
<span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$HOME</span>/wxWidgets-install/bin/:<span class="hljs-variable">$HOME</span>/swig-install/bin/:<span class="hljs-variable">$HOME</span>/cmake-install/bin/:<span class="hljs-variable">$PATH</span>
<span class="hljs-built_in">export</span> BOOST_LIBRARYDIR=<span class="hljs-variable">$HOME</span>/boost-install/lib/
<span class="hljs-built_in">export</span> BOOST_INCLUDEDIR=<span class="hljs-variable">$HOME</span>/boost-install/
<span class="hljs-built_in">export</span> BOOST_ROOT=<span class="hljs-variable">$HOME</span>/boost-install/

cmake --version
<span class="hljs-comment"># ${CC} --version</span>
<span class="hljs-comment"># ${CXX} --version</span>

ls <span class="hljs-variable">$HOME</span>/boost-install/lib/

cmake ..
</code></pre>
<p>Here the original script is fully applicable to MacOS environments, theoretically (cough). Now CMake comes into play.</p>
<pre><code class="lang-plaintext">-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
CMake Error at src/spps/CMakeLists.txt:74 (message):
  clock_gettime not found
-- Configuring incomplete, errors occurred!
</code></pre>
<p>And at <code>src/spps/CMakeLists.txt</code>:</p>
<pre><code class="lang-plaintext"># Check for clock_gettime function
if (UNIX)
  include(CheckLibraryExists)
  check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME )
  if(NOT HAVE_CLOCK_GETTIME)
    message(FATAL_ERROR "clock_gettime not found")
  endif(NOT HAVE_CLOCK_GETTIME)
endif(UNIX)
</code></pre>
<p>The issue is, although OSX is Unix, but neither <code>clock_gettime()</code> nor <code>librt</code> is implemented. We could get away with this error simply by narrowing the if-condition.</p>
<pre><code class="lang-diff"><span class="hljs-deletion">-if (UNIX)</span>
<span class="hljs-addition">+if (UNIX AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))</span>
   include(CheckLibraryExists)
   check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME )
   if(NOT HAVE_CLOCK_GETTIME)
     message(FATAL_ERROR "clock_gettime not found")
   endif(NOT HAVE_CLOCK_GETTIME)
<span class="hljs-deletion">-endif(UNIX)</span>
<span class="hljs-addition">+endif(UNIX AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))</span>
</code></pre>
<p>And vice versa for another snippet in the same file:</p>
<pre><code class="lang-diff"><span class="hljs-deletion">-  if(UNIX)</span>
<span class="hljs-addition">+  if(UNIX AND NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))</span>
     target_link_libraries (spps rt)
<span class="hljs-deletion">-  endif(UNIX)</span>
<span class="hljs-addition">+  endif()</span>
</code></pre>
<p>Now you should be able to generate the build files under <code>build/</code> .</p>
<hr />
<h2 id="heading-opengl-tweaks">OpenGL Tweaks</h2>
<p>Remember what the repository said? Some special CMake directives of OpenGL are needed. Let us try running the build script first: <code>make VERBOSE=1</code>:</p>
<pre><code class="lang-plaintext">src/isimpa/./GL/opengl_inc.h:40:10: fatal error: 'GL/gl.h' file not found
#include &lt;GL/gl.h&gt;
         ^~~~~~~~~
1 error generated.
</code></pre>
<p>Hence, the OpenGL header is not properly included. A solution taken from <a target="_blank" href="https://stackoverflow.com/a/26745337">StackOverflow</a> hints the correct way:</p>
<pre><code class="lang-plaintext">#if defined(__APPLE__)
#include &lt;OpenGL/gl.h&gt;
#include &lt;OpenGL/glu.h&gt;
#else
#include &lt;GL/gl.h&gt;
#include &lt;GL/glu.h&gt;
#endif
</code></pre>
<p>Make the appropriate changes to all the files containing similar headers (except the ones specifically for Windows), run <code>make install</code>, then lastly you will be able to see the precious binary file at <code>build/bin/isimpa</code> !</p>
<hr />
<h2 id="heading-sad-news">😛 Sad news!</h2>
<pre><code class="lang-plaintext">&gt; ./bin/isimpa
dyld[4253]: Library not loaded: @rpath/libboost_system.dylib
  Referenced from: &lt;C9FD3A5A-FDBC-3356-ABCF-5CBF7085B819&gt; /Users/asuwish/Documents/sandbox/J-Simpa/build/bin/isimpa
  Reason: no LC_RPATH's found
zsh: abort      bin/isimpa
</code></pre>
<p>Why is that? We are indeed linking to the dynamic libraries of <code>boost</code> (like <code>.dll</code> as in Windows, <code>.dylib</code> as in Mac) when we run the executable every time. And we did not supply <code>LC_RPATH</code> at build time, so the PC has no way to find out where the library is located. By using <code>otool</code> (shipped in OSX), we can identify the loading path of respective binaries:</p>
<pre><code class="lang-plaintext">&gt; otool -L ./bin/isimpa
./bin/isimpa:
        @rpath/libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libboost_python38.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libboost_filesystem.dylib (compatibility version 0.0.0, current version 0.0.0)
        @rpath/libboost_regex.dylib (compatibility version 0.0.0, current version 0.0.0)
        /usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/Python (compatibility version 3.8.0, current version 3.8.0)
        ...
</code></pre>
<p>While a compact fix requires further effort, here is a simple fix:</p>
<pre><code class="lang-bash">&gt; install_name_tool -change @rpath/libboost_system.dylib <span class="hljs-variable">$HOME</span>/boost-install/lib ./bin/isimpa
&gt; ./bin/isimpa:
        /Users/abc/boost-install/lib/libboost_system.dylib (compatibility version 0.0.0, current version 0.0.0) (compatibility version 0.0.0, current version 0.0.0)
        ...
</code></pre>
<p><strong><em>After replacing all the</em></strong> <code>rpath</code><strong><em>... Voila!</em></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695906016211/999dbee8-9399-44fe-bca6-51a1277614c1.png" alt class="image--center mx-auto" /></p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">There are obviously smarter ways to optimize. We will try it out on Part 3! See you :)</div>
</div>]]></content:encoded></item><item><title><![CDATA[YDPA #01: You Don't Pay to do #Acoustics]]></title><description><![CDATA[Why?
I am wrapping up my studies in acoustics engineering and merely started job hunting.
Go for a casual walk on Linkedin for "acoustic engineer", and you will come across various entry-level jobs requiring experience/knowledge of using certain prop...]]></description><link>https://articles.vides-son.us/ydpa-01-you-dont-pay-to-do-acoustics</link><guid isPermaLink="true">https://articles.vides-son.us/ydpa-01-you-dont-pay-to-do-acoustics</guid><category><![CDATA[#Acoustics]]></category><dc:creator><![CDATA[Jay]]></dc:creator><pubDate>Thu, 28 Sep 2023 10:57:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1695897139808/5550a97f-f883-47c1-8dc0-befe48e8e6b5.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-why">Why?</h1>
<p>I am wrapping up my studies in acoustics engineering and merely started job hunting.</p>
<p>Go for a casual walk on Linkedin for "acoustic engineer", and you will come across various entry-level jobs requiring experience/knowledge of using certain <strong>proprietary</strong> software (MATLAB hey :)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695894848744/51083742-9a6a-4550-aa7c-3b91fad6bcb3.png" alt class="image--center mx-auto" /></p>
<p>These software suites do not always offer free trials or student versions, and I am neither rich enough to pay for one yet.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695897024478/59458682-9289-43d2-bf09-d7c4647bfa9b.jpeg" alt class="image--center mx-auto" /></p>
<p>That is why I am turning to open-source alternatives, as I need to get some <em>experience</em> :')</p>
<h1 id="heading-what">What?</h1>
<blockquote>
<p><strong>I-Simpa is a graphical user interface (GUI) developed to host three-dimensional numerical codes for the modelling of sound propagation in complex geometrical domains</strong>. (<a target="_blank" href="https://i-simpa-wiki.readthedocs.io/fr/latest/">https://i-simpa-wiki.readthedocs.io/fr/latest/</a>)</p>
</blockquote>
<p><img src="https://i-simpa-wiki.readthedocs.io/fr/latest/_images/illustration_I_Simpa_room.png" alt class="image--center mx-auto" /></p>
<p>Engineered in <em>Université Gustave Eiffel</em>, it could be a good starting point for C/C++-heavy acoustic software development. This software officially supports noise/sound propagations on Windows and Linux, and unfortunately, not Mac. The build toolchains and dependencies are not under active maintenance either.</p>
<hr />
<p>So what are we going to do? Take a look at the <a target="_blank" href="https://github.com/Universite-Gustave-Eiffel/I-Simpa/issues/21#issuecomment-1031163753">Issues</a>:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1695898326338/32fe78f4-4f08-4c0d-b33a-95fbfdd13c8b.png" alt class="image--center mx-auto" /></p>
<p>So our TODOs would be:</p>
<ol>
<li><p>Reproduce functional I-Simpa executable on MacOS</p>
</li>
<li><p>Translate the steps into Travis</p>
</li>
<li><p>Test binary packaging. We expect a DMG installer.</p>
</li>
<li><p>(Optional) Optimize build steps and dependencies</p>
</li>
<li><p>(Long-term) Add features / Experiment with the numerical methods</p>
</li>
</ol>
<h1 id="heading-so">So?</h1>
<p>I hope this walkthrough could be a <code>log</code> of my work, and hopefully a helpful guide to whoever planning to use this software on MacOS :)</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">We will kick-off the code inspection and planning in <a target="_blank" href="https://articles.come-hear.me/ydpa-02-you-dont-pay-to-do-acoustics">Part 2</a>. See you!</div>
</div>]]></content:encoded></item></channel></rss>