Request assistance in proper syntax to tell cmake where turbojpeg.h and library in my system

117 views
Skip to first unread message

SugarRayLua

unread,
May 11, 2021, 11:52:21 PM5/11/21
to TurboVNC User Discussion/Support
Dear TurboVNC Community,

Hello. I am a novice Linux user trying to build TurboVNC on my Alpine Linux x86 system and am having trouble pointing cmake to the directories where the turbojpeg header and library is installed in my system and would appreciate any assistance you could provide. I’ve followed all the build instructions from the TurboVNC website and have all the required libraries installed. 

My turbojpeg.h file is called turbojpeg.h and is in my /usr/include directory
My turbojpeg library file(s) are called libturbojpeg.a and libturbojpeg.so and are in my /user/lib directory

However, when I try and start the cmake command by entering:
$cmake  -DTJPEG_INCLUDE_DIR=“/usr/include” -DTJPEG_LIBRARY=“-L/usr/lib -llibturbojpeg.so" -G”Unix Makefiles”

cmake fails with the following error:
CMake Error at cmakescripts/FindTurboJPEG.cmake:67 (message):
  Could not link with TurboJPEG library -L/usr/lib -llibturbojpeg.so.  If it
  is installed in a different place, then set TJPEG_LIBRARY accordingly.
Call Stack (most recent call first):
  CMakeLists.txt:189 (include)

I admit that I don’t understand clearly the syntax to use in cmake to link libraries using relative and absolute paths and tried to use the same syntax as in the build example on the TurboVNC website. It was also not clear to me from the TurboVNC website whether I was supposed to link the static library (libturbojpeg.a), the dynamic library (libturbojpeg.so) or both and tried linking different combinations of the two libraries without any success. I also tried following the “relative path” syntax to link the libraries which was also not successful.

I appreciate any help or suggestions others may be able to offer. 

Of note, I previously was able to use cmake to build VirtualGL on my system and therefore feel confident that I can build TurboVNC if I can figure out how to properly link where the header and libraries are stored on my file system.

Thank you very much and have a good week. 

DRC

unread,
May 12, 2021, 6:51:09 PM5/12/21
to turbovn...@googlegroups.com

The build instructions in BUILDING.md (which I assume is what you meant by "the build instructions from the TurboVNC website") give the example of

    -DTJPEG_LIBRARY="-L/opt/libjpeg-turbo/lib64 -lturbojpeg"

for dynamic linking with the TurboJPEG API library.  Adapting that to your use case would result in:

    cmake  -DTJPEG_INCLUDE_DIR=“/usr/include” -DTJPEG_LIBRARY=“-L/usr/lib -lturbojpeg" -G”Unix Makefiles”

as opposed to

    cmake  -DTJPEG_INCLUDE_DIR=“/usr/include” -DTJPEG_LIBRARY=“-L/usr/lib -llibturbojpeg.so" -G”Unix Makefiles"

'-llibturbojpeg.so' is incorrect linker syntax.

--
You received this message because you are subscribed to the Google Groups "TurboVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbovnc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/turbovnc-users/3a9c15a3-4a43-4fd0-b1bd-c658b75b495dn%40googlegroups.com.

SugarRayLua

unread,
May 14, 2021, 12:27:16 AM5/14/21
to TurboVNC User Discussion/Support
Thanks, DRC, for the prompt reply. 

I tried your suggestion but unfortunately cmake still couldn’t link TJPEG_LIBRARY to my installed turbojpeg.so file. After further unsuccessful attempts, I opened up and reviewed the cmake error.logs. Interestingly, no matter how I named the turbojpeg dynamic library in the cmake command line that I was trying to link to, in the cmake error.log it said each time that cmake was trying to link to a file specifically called “libturbojpeg.so”. That still didn’t make sense since I saw that I had specifically a file called “turbojpeg.so” in the directory that I told cmake to link to. I then investigated more that specific turbojpeg.so library and learned that file name was actually a symbolic link to a newer version of the library named “libturbojpeg.so.0.2.0”. Thus, I wondered if maybe cmake was having difficulty using the symbolic link? Nevertheless, I decided to try the simpler route— I created the opt/ directories that the BUILDING.md file says the TurboVNC cmake file expects to find the turbojpeg library in by default and copied the required libraries into the new opt directories and renamed the libturbojpeg.so.0.2.0 library to libturbojpeg.so and cmake then found the library and worked fine.

Unfortunately the next step (make) stopped 50% of the way through saying it couldn’t find a specific Linux kernal header file (asm/page.h). I think that problem will be much tougher to fix; my standard Linux distribution (hardened Alpine Linux, x86) kernal does not contain that specific header file. I’m not sure if I can add that kernal header file without installing a completely new version of Alpine Linux (Alpine linux lts) which contains that kernal header file. As a novice Linux user, I decided to write Alpine Linux support to ask and am awaiting their reply. 

Fyi, and I hope this information might help other Alpine Linux users looking to install TurboVNC on their system. If I can get it to build and work, I think it would be a great addition to the Alpine Linux community.

Have a good rest of your week and upcoming weekend. 

DRC

unread,
May 18, 2021, 4:16:18 PM5/18/21
to turbovn...@googlegroups.com

I'm not sure where turbojpeg.so comes from, but whoever packaged that file made a mistake.  DSOs on Linux must always have a 'lib' prefix.  That is a downstream bug of some sort, which is out of my control.  If turbojpeg.so is part of an Alpine Linux package, then please inform the package maintainer that that file is misnamed.  However, you can probably work around the issue by setting TJPEG_LIBRARY=/usr/lib/turbojpeg.so.

As far as asm/page.h, I have no idea.  I'm guessing that one of the system headers tries to include that.  That file does not exist on my system, nor do any of the headers under /usr/include include it.  I would suggest grepping the headers in /usr/include and determining which one tries to include asm/page.h.  With that information, I can try to figure out where in the TurboVNC source the error is occurring.  In all likelihood, however, this is also a distribution-specific issue.

SugarRayLua

unread,
May 18, 2021, 8:17:24 PM5/18/21
to TurboVNC User Discussion/Support
Thanks, DRC.

I was able to get ahold of the Alpine Linux group and resolve these issues. It turned out that asm/page.h was a page header that Alpine Linux support helped me find located in another package I needed to download and extract. All of that let me complete cmake and continue on with the make build until I got to make build error in the “GetLocalClients” message you are still helping with.
Reply all
Reply to author
Forward
0 new messages