# Cannot build shared library into /user/local

**URL:** <https://discourse.channelflow.ch/t/cannot-build-shared-library-into-user-local/189>\
**Category:** Installation\
**Created:** [October 2, 2024, 2:10am UTC](https://discourse.channelflow.ch/t/cannot-build-shared-library-into-user-local/189 "2024-10-02T02:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![duc.nguyen](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.channelflow.ch/duc.nguyen/32/34_2.png) [@duc.nguyen](https://discourse.channelflow.ch/u/duc.nguyen)\
**Post date:** [October 2, 2024, 2:10am UTC](https://discourse.channelflow.ch/t/cannot-build-shared-library-into-user-local/189/1 "2024-10-02T02:10:46Z")

</div>

Hi all,

I’m a newbie here. I successfully installed Channelflow 2.0, and passed all tests. When I built it as shared library, I used ‘sudo make install’

“mkdir build  
cd build  
cmake …/channelflow -DCMAKE\_CXX\_COMPILER=/usr/bin/mpicxx -DCMAKE\_BUILD\_TYPE=release -DCMAKE\_INSTALL\_PREFIX=/user/local/ -DWITH\_HDF5CXX=On  
make -j4  
sudo make install”

and everything showed on the terminal as a complete installation within the folder ‘user/local’ like this  
‘-- Installing: /user/local/bin/  
– Set runtime path of “/user/local/bin/” to “/user/local/lib”’  
or this when I rebuilt  
‘-- Up-to-date: /user/local/bin/’

I tried to copy the example “couette.cpp” to a folder outside, and compile it for testing shared library of Channelflow. However, I always get errors

couette.cpp:7:10: fatal error: channelflow/dns.h: No such file or directory  
7 | #include “channelflow/dns.h”  
| ^ ~~~~~~~~~~~~~~~~~~  
compilation terminated.

I have checked ‘/user/local’ and found that nothing of Channelflow was installed here. I tried to build code in some folders. I found that I cannot build this library in folders of system (using ‘sudo make install’).

Now, I cannot add path to environment directly (I tried a few ways), so I decided to post this. I hope someone knows this and can help me overcome this.

Best,  
Duc

---

<div class="post-metadata">

**Author:** ![alexandersmith](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@alexandersmith](https://discourse.channelflow.ch/u/alexandersmith)\
**Post date:** [November 14, 2026, 4:13pm UTC](https://discourse.channelflow.ch/t/cannot-build-shared-library-into-user-local/189/2 "2026-11-14T16:13:57Z")

</div>

Your install prefix is `/user/local`, but the usual system prefix is `/usr/local`. If that was a typo, reconfigure with `-DCMAKE_INSTALL_PREFIX=/usr/local` (clear the CMake cache first if it was configured before), then run `sudo make install`. For the external example, compile with the matching include and library paths, e.g. `mpicxx couette.cpp -I/usr/local/include -L/usr/local/lib -lchannelflow ...`, and if runtime linking fails set `LD_LIBRARY_PATH=/usr/local/lib`. If you really want `/user/local`, use it consistently in both install and compile paths.
