# Building Orthanc 1.5.6 on FreeBSD 12

**URL:** <https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405>\
**Category:** Google Groups archive\
**Created:** [March 28, 2019, 12:53pm UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405 "2019-03-28T12:53:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hadi\_Rezaee](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@Hadi\_Rezaee](https://discourse.orthanc-server.org/u/Hadi_Rezaee)\
**Post date:** [March 28, 2019, 12:53pm UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405/1 "2019-03-28T12:53:03Z")

</div>

Dears,

I tried to build Orthanc on my FreeBSD machine, but I faced an error related to linking to “uuid” library :

Switching to C++11 standard in gcc/clang, as version of JsonCpp is \>= 1.0.0  
– Looking for uuid/uuid.h  
– Looking for uuid/uuid.h - found  
– Looking for uuid\_generate\_random in uuid  
– Looking for uuid\_generate\_random in uuid - not found  
CMake Error at Resources/CMake/UuidConfiguration.cmake:119 (message):  
Unable to find the uuid library  
Call Stack (most recent call first):  
Resources/CMake/OrthancFrameworkConfiguration.cmake:421 (include)  
CMakeLists.txt:49 (include)

/usr/bin/cc -I/usr/local/include  
-DCHECK\_FUNCTION\_EXISTS=uuid\_generate\_random  
CMakeFiles/cmTC\_7e17b.dir/CheckFunctionExists.c.o -o cmTC\_7e17b -luuid  
/usr/bin/ld: error: unable to find library -luuid

I’m pretty sure that I’ve “e2fsprogs-libuuid” package installed before building.  
Tried to clean up the Build directory and build again but still failed.

Any help will be appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/u/Luiz_Eduardo_Guida_V)\
**Post date:** [March 28, 2019, 1:18pm UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405/2 "2019-03-28T13:18:40Z")

</div>

Dear Hadi,

I’ve been through this and patched the [ORTHANC-SRC-ROOT]/Resources/CMake/UuidConfiguration.cmake

Here’s the fix, it should be applied at about line 117:

```auto
    IF( CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" )
      FIND_LIBRARY( LIBUUID uuid "/usr/local/lib" )
    ELSE()
      FIND_LIBRARY( LIBUUID uuid "/usr/lib" )
    ENDIF()

```

To be clear, the file is basically a if-wi dows-else-xnix-systems, you’ll want this fix to be applied in the else section.

What’s happens is FreeBSD installs most of its libraries in /use/local for as opposed to Linux usually doing it at /usr.

To be technically precise, this patch works on 1.5.5 but I see no reason for it not to work on the latest version.

Let me know if it helps. Should you need further assistance, just hit reply!

Best,  
Luiz

---

<div class="post-metadata">

**Author:** ![Hadi\_Rezaee](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@Hadi\_Rezaee](https://discourse.orthanc-server.org/u/Hadi_Rezaee)\
**Post date:** [March 28, 2019, 1:43pm UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405/3 "2019-03-28T13:43:02Z")

</div>

Hello Luiz,

Thanks for the reply, I think your solution is actually correct.

I’ve modified “UuidConfiguration.cmake” file according to your suggestion:

111 else()  
112 CHECK\_INCLUDE\_FILE(uuid/uuid.h HAVE\_UUID\_H)  
113 if (NOT HAVE\_UUID\_H)  
114 message(FATAL\_ERROR “Please install uuid-dev, e2fsprogs (OpenBSD) or e2fsprogs-libuuid (FreeBSD)”)  
115 endif()  
116  
117 IF( CMAKE\_SYSTEM\_NAME STREQUAL “FreeBSD” )  
118 FIND\_LIBRARY( LIBUUID uuid “/usr/local/lib” )  
119 ELSE()  
120 FIND\_LIBRARY( LIBUUID uuid “/usr/lib” )  
121 ENDIF()  
122  
123 check\_library\_exists(uuid uuid\_generate\_random “” HAVE\_UUID\_LIB)  
124 if (NOT HAVE\_UUID\_LIB)  
125 message(FATAL\_ERROR “Unable to find the uuid library”)  
126 endif()

But I still receive same errors.

Here it is where the uuid librray is located:

$ ls -ltr /usr/local/lib/libuuid\*  
-r-xr-xr-x 1 root wheel 16536 Dec 25 04:41 /usr/local/lib/libuuid.so.1.2  
lrwxr-xr-x 1 root wheel 14 Dec 25 04:41 /usr/local/lib/libuuid.so.1 → libuuid.so.1.2  
lrwxr-xr-x 1 root wheel 12 Dec 25 04:41 /usr/local/lib/libuuid.so → libuuid.so.1  
-r–r–r-- 1 root wheel 26740 Dec 25 04:41 /usr/local/lib/libuuid.a

---

<div class="post-metadata">

**Author:** ![Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Luiz\_Eduardo\_Guida\_V](https://discourse.orthanc-server.org/u/Luiz_Eduardo_Guida_V)\
**Post date:** [March 29, 2019, 2:19am UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405/4 "2019-03-29T02:19:11Z")

</div>

I didn’t know the reply went off the group. Tis why I’m replying and cc’ing the group. Anyways, glad to know it worked!

❤

---

<div class="post-metadata">

**Author:** ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)\
**Post date:** [April 4, 2019, 1:53pm UTC](https://discourse.orthanc-server.org/t/building-orthanc-1-5-6-on-freebsd-12/1405/5 "2019-04-04T13:53:13Z")

</div>

Hello,

Thanks for pointing this issue. It is now fixed by the following changeset:  
[https://bitbucket.org/sjodogne/orthanc/commits/9c8e119d0c5b48a4b23872d6295399938d07979b](https://bitbucket.org/sjodogne/orthanc/commits/9c8e119d0c5b48a4b23872d6295399938d07979b)

Sébastien-
