Compiling problems with Ubuntu: uuid-dev package missing

Hello,

I have problems with compiling orthanc under Ubuntu 13.04 (64bit). After installing cmake the execution of

cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc

failed with

CMake Error at Resources/CMake/Compiler.cmake:87 (message):
Please install the uuid-dev package
Call Stack (most recent call first):
CMakeLists.txt:41 (include)

– Configuring incomplete, errors occurred!

The installation (sudo apt-get install uuid-dev) don’t change anything, the error persists. I have also checked with ubuntu 12.04 with the same error.

Any suggestions?

Thanks,
Christian

Dear Christian,

Are you sure that you have installed the “build-essential” package from the Ubuntu distribution?

Could you also send the content of the “CMakeFiles/CMakeError.log” and “CMakeFiles/CMakeOutput.log” files that should be present inside your build directory? They should give information about the missing dependency.

Finally, you can have a look at the list of dependencies that are required on Ubuntu 13.04 by checking the following page:
http://packages.ubuntu.com/raring/science/orthanc

HTH,
Sébastien-

Hi,

I can confirm that I had a similar issue. It is a weird problem with
some Ubuntu/Debian packages. I observed it on minimal Ubuntu 12.04 and
Debian systems (both 64 and 32-bit). On the full Ubuntu desktop the
problem was resolved by simply installing the uuid-dev package.
The confusing part is that the cmake file checks for

CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)

the uuid.h header file (I think it includes it in a source file and
tries to compile it), and it fails. However, when the same procedure
of including the uuid.h is done manually on a test file, it compiles
and works. The uuid-dev package and the header files are in the
correct directory.
There must be some other package that interacts with the build
process, or some environment setting. Any ideas what could be causing
it?

peter

P.S.: Sorry Sebastien, I mistakenly sent it as a reply to you, instead
of the group :slight_smile:

I'll install the packages you linked on the minimal system and give it a try.

Hi,

The confusing part is that the cmake file checks for
CHECK_INCLUDE_FILES(uuid/uuid.h HAVE_UUID_H)
the uuid.h header file (I think it includes it in a source file and
tries to compile it), and it fails. However, when the same procedure
of including the uuid.h is done manually on a test file, it compiles
and works. The uuid-dev package and the header files are in the
correct directory.

There must be some other package that interacts with the build
process, or some environment setting. Any ideas what could be causing
it?

Thanks for the update! I do not think that it is related to environment variables, as the Orthanc CMake script a priori uses none of them. I would rather suspect a missing package, perhaps an incomplete gcc installation.

The solution would probably consist in first checking that “build-essential” is installed, then in installing all the dependencies from the official package one by one, until finding the missing package:

http://anonscm.debian.org/viewvc/debian-med/trunk/packages/orthanc/trunk/debian/control?view=markup

The logs probably contains useful information.

P.S.: Sorry Sebastien, I mistakenly sent it as a reply to you, instead
of the group :slight_smile:

No problem, you’re welcome :slight_smile:

Hi Christian,

the following worked for me. I simply removed the build directory
after a failed build without the uuid-dev package. Here are the exact
steps:

1. Install a minimal Ubuntu 12.04 (either 32 or 64-bit)
2. sudo apt-get install mercurial
3. hg clone https://code.google.com/p/orthanc/
4. mkdir orthancbuild
5. cd orthancbuild
6. sudo apt-get install cmake
7. sudo apt-get install build-essential
8. cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../orthanc
9. the "install uuid-dev" package appears
10. sudo apt-get install uuid-dev

11. cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../orthanc
12. the "install uuid-dev" package appears again...

Rebooting the system did not help, however removing the orthancbuild
directory did. So 11. and 12. should be.

11. cd ..
12. rm -rf orthancbuild
13. mkdir orthancbuild
14. cd orthancbuild
15. cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../orthanc
16. install unzip error
17. sudo apt-get install unzip
18. cmake -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release ../orthanc
19. make
20. ./Orthanc

Sebastien, is there a way for cmake to check for the unzip dependency?
It is needed for the dcmtk archive during the static build.

peter

Hi Peter,

Thank you much for these detailed instructions! I have just added them to the FAQ:
https://code.google.com/p/orthanc/wiki/FAQ#Static_linking

I will have a look at how to detect the presence of “unzip” in CMake:
https://trello.com/c/waydbGXL

Cheers,
Sébastien-

Hello,

first thank you very much for the fast response. The process for building and making works. I don’t have an unzip error, only for missing doxygen.

But after the make with ./Orthanc I get the short error:

E0905 11:41:13.482972 29701 main.cpp:436] NATIVE EXCEPTION

After restarting the same.

Any ideas?

Thanks,
Christian

Dear Christian,

To understand your problem, please could you try and follow the debugging instructions of the following post:
https://groups.google.com/d/msg/orthanc-users/sUeUNBTil0s/MccDqfS6CwAJ

HTH,
Sébastien-

Dear Sebastien,

I have tested following:

# ./Orthanc --verbose
E0905 14:28:46.049497 5547 main.cpp:436] NATIVE EXCEPTION

# ./Orthanc --trace
E0905 14:29:00.901952 5549 main.cpp:436] NATIVE EXCEPTION

Make sure your configuration file (if any) is well-formatted: Just try
to start Orthanc without any configuration file.

Where can I find the configuration file? I'm a little bit confused with
the folders. The only executable Orthanc is in the folder orthancbuild.
But there is no systemwide Orthanc, "which Orthanc" gives no result - a
path problem?

# netstat -tulpn | grep :8042
# netstat -tulpn | grep :4242
gives nothing.

If this does not help, maybe you have moved the Orthanc binary from the
build directory to another place in your filesystem (e.g. "/usr/bin").
If this is the case, you have to compile Orthanc with the
STANDALONE_BUILD option:
# cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug
Runs but gives the same error.

# gdb --args ./Orthanc --verbose
  => enter "catch t", then "run", and finally "bt" when the exception
occurs to inspect the stack.

gives:
Reading symbols from /home/sistemas/orthancbuild/Orthanc...(no debugging
symbols found)...done.
(gdb) catch t
Catchpoint 1 (throw)
(gdb) run
Starting program: /home/sistemas/orthancbuild/Orthanc --verbose
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Catchpoint 1 (exception thrown), 0x00007ffff776d910 in __cxa_throw ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) bt
#0 0x00007ffff776d910 in __cxa_throw () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x0000000000441986 in void
boost::throw_exception<boost::bad_lexical_cast>(boost::bad_lexical_cast
const&) ()
#2 0x000000000045708d in
Orthanc::toolbox::EnumerationDictionary<Orthanc::MetadataType>::Add(Orthanc::MetadataType,
std::string const&) [clone .constprop.243] ()
#3 0x00000000004575ea in Orthanc::InitializeServerEnumerations() ()
#4 0x000000000042f911 in Orthanc::OrthancInitialize(char const*) ()
#5 0x0000000000410b76 in main ()
(gdb)

# valgrind ./Orthanc --verbose
I don't have valgrind, must I install first

# strace ./Orthanc
is very long, see attached file. A lot of "no such file or directory"
but it's too difficult for me.

Thanks for spending your time

Christian

strace.txt (9.1 KB)

Dear Christian,

Sorry for the long delay. A new version of Orthanc is now available (0.7.0). Is this release still causing trouble on your Ubuntu 13.04 installation?

If this is the case, please could you try and run “gdb” once again, this time without typing “catch t”:

gdb --args ./Orthanc --verbose

=> enter “run” then “bt” when the exception occurs to inspect the stack.

Regards,
Sébastien-