Cannot build shared library into /user/local

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

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.