Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-28 23:01:47



Reply to topic  [ 7 posts ] 
Help with building CoolVLViewer under Arch Linux 
Author Message

Joined: 2011-09-27 11:18:31
Posts: 169
Reply with quote
Greetings, Henri.

In order to build the viewer under Linux, one needs to (a) force the use of gcc 4.9 (I know you recommend 4.6 and I will try that, but I'm afraid I haven't even reached the point yet), and (b) force the use of python 2. In order to accomplish this, I have made this patch.

However, the compilation stops at the very beginning, when it's trying to download the libraries, with the following error:
Code:
[  0%] Building CXX object cmake/CMakeFiles/cmake.dir/cmake_dummy.cpp.o
make[2]: Leaving directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
make[2]: Entering directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
[  1%] Obtaining prebuilt binaries...
-- Obtaining prebuilt 'db'
[  1%] Linking CXX static library libcmake.a
  File "install.py", line 129
    print "md5 mismatch:", self.filename
                        ^
SyntaxError: Missing parentheses in call to 'print'
CMake Error at DownloadPrebuilt.cmake:26 (message):
  Failed to download or unpack prebuilt 'db'.  Process returned: 1


make[2]: *** [CMakeFiles/prepare.dir/build.make:62: prepare/prebuilt] Error 1
make[2]: Leaving directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/prepare.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
[  1%] Built target cmake
make[1]: Leaving directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
make: *** [Makefile:84: all] Error 2
make: Leaving directory '/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/viewer-linux-i686-release'
Error: the command 'make' exited with status 2


I am not a programmer, just a user, so I am thinking that perhaps something in my patch is wrong. Could you offer some help please?


2016-07-10 16:56:20
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
This is a problem with Python, obviously.

I don't know how Arch Linux works, but on RedHat derivatives, there's an "alternatives" command which allows to pick up the version of various programs (such as gcc and python), and you type:
Code:
alternatives --config python

and:

alternatives --config gcc
to choose which version will be linked to 'python', 'gcc', 'g++', etc... What 'alternatives' does is to change the links in /etc/alternatives/ to point to the right binaries, those link being themselves pointed to by '/usr/bin/python', '/usr/bin/gcc', etc... I.e, you get (with '->' denoting a soft link):
/usr/bin/python -> /etc/alternatives/python
/etc/alternatives/python -> /usr/bin/python2

This way, when you invoke '/usr/bin/python', it's /usr/bin/python2 which gets executed, and only the links in /etc/alternatives need to be changed to choose which python version to use. Things with gcc are more complex, because 'alternatives' also changes the links to 'cc', 'g++', 'c++', 'cpp', etc...

If you don't have an equivalent of the 'alternatives' utility in Arch Linux, then you still can use your patch, but you missed the indra/cmake/Python.cmake file. Change line 41 to read:
Code:
find_program(PYTHON_EXECUTABLE python2.7 python2.5 python2.3 python2 python PATHS /usr/bin)
I will change that for future releases.
Also, in your patch you wrongly spelled "CMAKE_C_COMPILER" as "CMAKE_C_COMPILE".


Alternatively, you may (as "root") type from a terminal:
Code:
cd /usr/bin
mv python python.orig
ln -s python2 python

Then compile the viewer, and revert the changes once done:
Code:
cd /usr/bin
rm -f python
mv python.orig python


2016-07-10 18:24:58
Profile WWW

Joined: 2011-09-27 11:18:31
Posts: 169
Reply with quote
Thank you, Henri, for your help. Especially for noticing my typo.

There is no "environment" utility as such, but there are tricks to change the environment, however I would rather avoid it and just patch the code, since this is to be put in a compiling and packaging script.

The updated patch is here, however I am afraid the result is still the same (quoting only the relevant bit). I changed the relevant lines (a bit before and after 41) of indra/cmake/Python.cmake, I even tried putting your changes in place.
Code:
===============================================================================
Building Release viewer for architecture: i686
===============================================================================
Running 'CXX=\'g++\' cmake -DCMAKE_BUILD_TYPE:STRING=RELEASE -G \'Unix Makefiles\' -DSTANDALONE:BOOL=OFF -DWORD_SIZE:STRING=32 -DROOT_PROJECT_NAME:STRING=CoolVLViewer -DCMAKE_C_COMPILER=/usr/bin/gcc-4.9 -DCMAKE_CXX_COMPILER=/usr/bin/g++-4.9"" \'/home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra\'' in 'viewer-linux-i686-release'

[…]

[  1%] Obtaining prebuilt binaries...
-- Obtaining prebuilt 'db'
[  1%] Linking CXX static library libcmake.a
  File "install.py", line 129
    print "md5 mismatch:", self.filename
                        ^
SyntaxError: Missing parentheses in call to 'print'
CMake Error at DownloadPrebuilt.cmake:26 (message):
  Failed to download or unpack prebuilt 'db'.  Process returned: 1


2016-07-11 11:46:21
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
This (the 'print' syntax error) is still a problem with the usage of python v3 as the default python engine, while normally, v2 is the default in all Linux distros (in which you have to explicitly invoke 'python3' to use Python v3).

Please, try the trick I gave you (i.e. changing /usr/bin/python to point to python v2 instead of v3): you'll not get it to work otherwise. I suggest you complain to your distro maker for not providing a standard development environment, or at the very least, an easy way to configure it.


2016-07-11 12:26:38
Profile WWW

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Try this patch (apply with 'patch -p1 -s <full_path_name_of_the_patch' from inside the linden/ directory of the sources) to the original sources of the Cool VL Viewer v1.26.18.14 or v1.26.19.16.

  • It fixes the Python.cmake script to properly search for the proper Python executable in the preferred version order (it used to pick up 'python' first, excepted on Debian systems).
  • It changes the Python scripts which used the "#!/usr/bin/python" shebang to use "#!/usr/bin/env python" instead, so that they use the PATH for finding the "python" executable.
  • It changes the buildlinux.sh script so that it overrides the system '/usr/bin/python' symbolic link when needed (i.e. when that link points to Python 3 instead of Python 2) by creating a custom symbolic link to a Python 2 interpreter and by setting the PATH variable so that this custom symbolic link is found before the system link.
  • It also adds a '-v4.x' option to the buildlinux.sh script so that you can specify a gcc version to use (from 4.6 to 4.9).

On you system, use as follow:
Code:
cd linden/indra
./buildlinux.sh -v4.9

It should work, this time, even on Arch Linux...


2016-07-11 20:08:04
Profile WWW

Joined: 2011-09-27 11:18:31
Posts: 169
Reply with quote
Thank you very much! It did work!
Code:
Forcing the use of python interpreter: /usr/bin/python2.7
Will use gcc/g++ v4.9.3 to build the viewer


Now, however, I get errors of the type
Code:
[  4%] Building CXX object llmath/CMakeFiles/llmath.dir/llbbox.cpp.o
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/c++/random:49:0,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/c++/bits/stl_algo.h:66,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/c++/algorithm:62,
                 from /home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/llcommon/llstring.h:36,
                 from /home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/llcommon/llfile.h:66,
                 from /home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/llcommon/linden_common.h:75,
                 from /home/nikos/Desktop/SRC-VIEWERS/coolvlviewer/src/linden/indra/llvfs/lldir.cpp:33:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/c++/bits/random.h:106:26: σφάλμα: expected unqualified-id before ‘__int128’
       { typedef unsigned __int128 type; };

but I will try with gcc 4.6 as advised within the next days and report back.

Again, thank you.


2016-07-12 13:39:16
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
It looks like an issue with your libstdc++ library headers... Very strange, and not an issue with the viewer sources themselves, apparently (which compile fine with gcc v4.9.2 here).


2016-07-12 13:49:43
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.