You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
However, after the make and make install, when I go to run the program, I get this:
$ /tmp/WAIFU2X/bin/waifu2x-converter-cpp --help
/tmp/WAIFU2X/bin/waifu2x-converter-cpp: error while loading shared libraries: libw2xc.so: cannot open shared object file: No such file or directory
It only runs correctly if I set LD_LIBRARY_PATH=/tmp/WAIFU2X/lib in the environment, which is annoying.
I'd like to suggest a minor change, which will cause the project's built binaries to have a relative RPATH setting that allows them to work cleanly in the above scenario:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a13b35d..5036a65 100644
--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -83,6 +83,7 @@ elseif(UNIX OR MINGW)
if (NOT FILE_SYSTEM_LIB AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
set(FILE_SYSTEM_LIB "stdc++fs")
endif()
+ set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib${LIB_SUFFIX}")
elseif(MSVC)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("/std:c++latest" have_std_cpp_latest)
(There may be a better place to put this setting, as it is only applicable to UNIX builds.)
The text was updated successfully, but these errors were encountered:
I can confirm I get the same error after installing. By default libw2xc.so gets installed to /usr/local/lib but the program looks for it in /usr/lib, hence the file not found error. A workaround is moving libw2xc.so from /usr/local/lib to /usr/lib, or create a symlink.
> waifu2x-converter-cpp --help
waifu2x-converter-cpp: error while loading shared libraries: libw2xc.so: cannot open shared object file: No such file or directory
So I did
sudo ldconfig
as suggested in BUILDING.md
Then waifu2x-converter-cpp --help worked as expected.
I am able to build the project successfully on Linux, using e.g.
However, after the
make
andmake install
, when I go to run the program, I get this:It only runs correctly if I set
LD_LIBRARY_PATH=/tmp/WAIFU2X/lib
in the environment, which is annoying.I'd like to suggest a minor change, which will cause the project's built binaries to have a relative RPATH setting that allows them to work cleanly in the above scenario:
(There may be a better place to put this setting, as it is only applicable to
UNIX
builds.)The text was updated successfully, but these errors were encountered: