Can't build from source, libwrap does not exists

Trying to build from source, as no package could successfully install Orthanc.

3:18
[alex@alex-b450aoruselite orthanc]$ makepkg
==> Making package: orthanc 1.12.0-0 (dom 23 abr 2023 13:23:59)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found Orthanc-1.12.0.tar.gz
  -> Found orthanc.service
  -> Found orthanc.sysusers
  -> Found orthanc.tmpfiles
==> Validating source files with sha512sums...
    Orthanc-1.12.0.tar.gz ... Passed
    orthanc.service ... Passed
    orthanc.sysusers ... Passed
    orthanc.tmpfiles ... Passed
==> Extracting sources...
  -> Extracting Orthanc-1.12.0.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
CMake Deprecation Warning at CMakeLists.txt:21 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


SQLite include dir: /usr/include
Detected version of SQLite: 3041002
patching file civetweb-1.14/src/civetweb.c
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file civetweb-1.14/src/civetweb.c.rej
Using libiconv
JsonCpp include dir: /usr/include
JsonCpp major version: 1
-- Found Boost: /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0")  
-- Found Boost: /usr/lib/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0") found components: locale filesystem thread system date_time regex iostreams 
-- Trying to find DCMTK expecting DCMTKConfig.cmake
-- Trying to find DCMTK expecting DCMTKConfig.cmake - ok
DCMTK configuration file: /usr/include/dcmtk/config/osconfig.h
DCMTK version: 367
Autodetected path to the DICOM dictionaries: /usr/share/dcmtk
Using local copy of https://orthanc.uclouvain.be/third-party-downloads/jquery-3.4.1.min.js
-- Configuring done (1.1s)
-- Generating done (0.3s)
-- Build files have been written to: /home/alex/GIT/orthanc/src/build
[  0%] Generating AUTOGENERATED/OrthancServerResources.h, AUTOGENERATED/OrthancServerResources.cpp
[  0%] Built target ProtobufCompiler
[  1%] Built target PluginsDependencies
[  1%] Built target OrthancDatabaseProtobuf
[  2%] Built target ServeFolders
[  3%] Built target ModalityWorklists
[  3%] Generating AUTOGENERATED/ConnectivityChecksResources.h, AUTOGENERATED/ConnectivityChecksResources.cpp
[  3%] Built target AutogeneratedTarget
[  5%] Built target DelayedDeletion
[  5%] Built target Housekeeper
[  9%] Built target MultitenantDicom
[ 10%] Building CXX object CMakeFiles/ConnectivityChecks.dir/AUTOGENERATED/ConnectivityChecksResources.cpp.o
[ 10%] Building CXX object CMakeFiles/ConnectivityChecks.dir/Plugins/Samples/ConnectivityChecks/Plugin.cpp.o
[ 11%] Building CXX object CMakeFiles/CoreLibrary.dir/AUTOGENERATED/OrthancServerResources.cpp.o
[ 12%] Linking CXX shared library libConnectivityChecks.so
[ 12%] Built target ConnectivityChecks
[ 12%] Linking CXX static library libCoreLibrary.a
[ 62%] Built target CoreLibrary
[ 62%] Linking CXX executable OrthancRecoverCompressedFile
[ 63%] Built target OrthancRecoverCompressedFile
[ 64%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/Database/StatelessDatabaseOperations.cpp.o
[ 64%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/Database/SQLiteDatabaseWrapper.cpp.o
[ 65%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/DicomInstanceToStore.cpp.o
[ 65%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/EmbeddedResourceHttpHandler.cpp.o
[ 65%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/LuaScripting.cpp.o
[ 65%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancConfiguration.cpp.o
/home/alex/GIT/orthanc/src/Orthanc-1.12.0/OrthancServer/Sources/OrthancConfiguration.cpp: In function ‘void Orthanc::ScanFolderForConfiguration(Json::Value&, const char*)’:
/home/alex/GIT/orthanc/src/Orthanc-1.12.0/OrthancServer/Sources/OrthancConfiguration.cpp:117:61: warning: ‘std::string boost::filesystem::extension(const path&)’ is deprecated: Use path::extension() instead [-Wdeprecated-declarations]
  117 |         std::string extension = boost::filesystem::extension(it->path());
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/boost/filesystem.hpp:21,
                 from /home/alex/GIT/orthanc/src/Orthanc-1.12.0/OrthancServer/Sources/OrthancConfiguration.h:32,
                 from /home/alex/GIT/orthanc/src/Orthanc-1.12.0/OrthancServer/Sources/OrthancConfiguration.cpp:24:
/usr/include/boost/filesystem/convenience.hpp:29:20: note: declared here
   29 | inline std::string extension(const path& p)
      |                    ^~~~~~~~~
[ 66%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancFindRequestHandler.cpp.o
[ 66%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancGetRequestHandler.cpp.o
[ 67%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancInitialization.cpp.o
[ 67%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancMoveRequestHandler.cpp.o
[ 67%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestAnonymizeModify.cpp.o
[ 68%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestApi.cpp.o
[ 68%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestArchive.cpp.o
[ 68%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestModalities.cpp.o
[ 68%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestResources.cpp.o
[ 69%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/OrthancRestApi/OrthancRestSystem.cpp.o
[ 69%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/QueryRetrieveHandler.cpp.o
[ 69%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/Search/HierarchicalMatcher.cpp.o
[ 70%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerContext.cpp.o
[ 70%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerIndex.cpp.o
[ 71%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerJobs/ArchiveJob.cpp.o
[ 71%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerJobs/LuaJobManager.cpp.o
[ 72%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerJobs/MergeStudyJob.cpp.o
[ 73%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerJobs/Operations/SystemCallOperation.cpp.o
[ 74%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerJobs/StorageCommitmentScpJob.cpp.o
[ 74%] Building CXX object CMakeFiles/ServerLibrary.dir/Sources/ServerToolbox.cpp.o
[ 74%] Building CXX object CMakeFiles/ServerLibrary.dir/Plugins/Engine/OrthancPlugins.cpp.o
[ 75%] Linking CXX static library libServerLibrary.a
[ 89%] Built target ServerLibrary
[ 89%] Building CXX object CMakeFiles/Orthanc.dir/Sources/main.cpp.o
[ 90%] Linking CXX executable Orthanc
[ 91%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/LuaServerTests.cpp.o
[ 91%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/ServerIndexTests.cpp.o
/usr/bin/ld: warning: libwrap.so.0, needed by /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so, not found (try using -rpath or -rpath-link)
[ 91%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/UnitTestsMain.cpp.o
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `hosts_access'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `request_set'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `request_init'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/Orthanc.dir/build.make:132: Orthanc] Error 1
make[1]: *** [CMakeFiles/Makefile2:243: CMakeFiles/Orthanc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 91%] Linking CXX executable UnitTests
/usr/bin/ld: warning: libwrap.so.0, needed by /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `hosts_access'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `request_init'
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so: undefined reference to `request_set'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/UnitTests.dir/build.make:517: UnitTests] Error 1
make[1]: *** [CMakeFiles/Makefile2:270: CMakeFiles/UnitTests.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
----------------------

libwrap is a dead library that no longer exists.

Hello,

How could we best help you if you don’t even indicate the GNU/Linux distribution you are using?

However, if you carefully read the logs, you will see the following line:

/usr/bin/ld: warning: libwrap.so.0, needed by /usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib/libdcmnet.so, not found (try using -rpath or -rpath-link)

This means that the issue is not within Orthanc, but within the libdcmnet.so shared library of your GNU/Linux distribution, which comes from the DCMTK-related package. You could get in touch with the maintainers of this package.

A possible way of directly solving your compilation issue would be to try adding the -DUSE_SYSTEM_DCMTK=OFF option while invoking CMake.

Best Regards,
Sébastien-

Hello

Thanks for your answer. pparently the problem is indeed dcmtk, see this comment. Thanks for pointing us in the right direction.

Regards
Alex