I have installed Orthanc 1.9.7 installed (compiled from source) on Ubuntu Server 20.04 LTS and now I’m migrating all my 20.04 servers to 22.04 if possible.
Has anyone successfully compiled Orthanc 1.11.1 from source for 22.04?
When I get to the “make” command, I get the following error:
/root/Orthanc/Build/boost_1_69_0/boost/thread/pthread/thread_data.hpp:60:5: error: missing binary operator before token “(”
60 | #if PTHREAD_STACK_MIN > 0
| ^~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/CoreLibrary.dir/build.make:116: CMakeFiles/CoreLibrary.dir/root/Orthanc/OrthancFramework/Sources/Cache/MemoryObjectCache.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:105: CMakeFiles/CoreLibrary.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Here is a link to my Orthanc for Ubuntu Server 20.04 documentation.
Here is a link to my Orthanc for Ubuntu Server 22.04 documentation.
Thanks,
LHammonds
As a quick workaround, you can apply this patch in the downloaded boost code: https://github.com/boostorg/thread/pull/297/commits/74fb0a26099bc51d717f5f154b37231ce7df3e98
Recent boost versions (post 1.73) have reverted back to
#ifdef PTHREAD_STACK_MIN
For future Orthanc versions, I made sure that the patch is applied automatically: https://hg.orthanc-server.com/orthanc/rev/caed453042db
I could build the latest “mainline” version on ubuntu 22.04 thanks to this Dockerfile:
FROM ubuntu:22.04
RUN apt-get --assume-yes update
RUN apt-get --assume-yes install wget
RUN apt-get --assume-yes install build-essential
RUN apt-get --assume-yes install unzip
RUN apt-get --assume-yes install mercurial
RUN apt-get --assume-yes install cmake
RUN mkdir -p /sources
RUN mkdir -p /build
RUN hg clone https://hg.orthanc-server.com/orthanc/ -r default /sources
RUN ls -al /sources
WORKDIR /build
RUN cmake -DSTATIC_BUILD=ON -DALLOW_DOWNLOADS=ON -DCMAKE_BUILD_TYPE=Release /sources/OrthancServer/
RUN make -j 6
HTH,
Alain.
Thanks. That got me past “Performing build step for ‘ConnectivityChecks’” and then this error showed up:
In file included from /usr/include/pthread.h:33,
from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr.h:148,
from /usr/include/c++/11/ext/atomicity.h:35,
from /usr/include/c++/11/bits/basic_string.h:39,
from /usr/include/c++/11/string:55,
from /root/Orthanc/Build/ConnectivityChecks-build/boost_1_69_0/boost/thread/exceptions.hpp:20,
from /root/Orthanc/Build/ConnectivityChecks-build/boost_1_69_0/boost/thread/pthread/thread_data.hpp:10,
from /root/Orthanc/Build/ConnectivityChecks-build/boost_1_69_0/boost/thread/thread_only.hpp:17,
from /root/Orthanc/Build/ConnectivityChecks-build/boost_1_69_0/libs/thread/src/pthread/thread.cpp:11:
/root/Orthanc/Build/ConnectivityChecks-build/boost_1_69_0/boost/thread/pthread/thread_data.hpp:60:5: error: missing binary operator before token “(”
60 | #if PTHREAD_STACK_MIN > 0
| ^~~~~~~~~~~~~~~~~
make[5]: *** [CMakeFiles/ConnectivityChecks.dir/build.make:141: CMakeFiles/ConnectivityChecks.dir/boost_1_69_0/libs/thread/src/pthread/thread.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ConnectivityChecks.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/ConnectivityChecks.dir/build.make:86: ConnectivityChecks-prefix/src/ConnectivityChecks-stamp/ConnectivityChecks-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:289: CMakeFiles/ConnectivityChecks.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I made the exact same code change on line 60 in that file to get past the error. Without knowing what I’m doing, I hope that was the correct answer.
When compiling again after the above change, I then get this error message:
In file included from /usr/include/pthread.h:33,
from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr.h:148,
from /usr/include/c++/11/ext/atomicity.h:35,
from /usr/include/c++/11/bits/basic_string.h:39,
from /usr/include/c++/11/string:55,
from /root/Orthanc/OrthancFramework/Sources/Cache/…/OrthancFramework.h:72,
from /root/Orthanc/OrthancFramework/Sources/Cache/MemoryObjectCache.h:26,
from /root/Orthanc/OrthancFramework/Sources/Cache/MemoryObjectCache.cpp:25:
/root/Orthanc/Build/DelayedDeletion-build/boost_1_69_0/boost/thread/pthread/thread_data.hpp:60:5: error: missing binary operator before token “(”
60 | #if PTHREAD_STACK_MIN > 0
| ^~~~~~~~~~~~~~~~~
make[5]: *** [CMakeFiles/DelayedDeletion.dir/build.make:90: CMakeFiles/DelayedDeletion.dir/root/Orthanc/OrthancFramework/Sources/Cache/MemoryObjectCache.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:83: CMakeFiles/DelayedDeletion.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/DelayedDeletion.dir/build.make:86: DelayedDeletion-prefix/src/DelayedDeletion-stamp/DelayedDeletion-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:315: CMakeFiles/DelayedDeletion.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
I again made the same code change on line 60 in this next file and started the compile once more and it finished.
LHammonds
Hello,
FYI, for future versions of Orthanc, I have updated Boost from 1.69.0 to 1.80.0 in the mainline. This notably fixes the compatibility issues with Ubuntu 22.04.
Kind Regards,
Sébastien-