Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: Darkmage on July 15, 2015, 02:40:03 pm
-
Hi guys,
I'm trying to build PCS2 on Debian 8.1, but when I compile it I'm getting errors regarding the OpenGL handling. Looks like there's been some changes to WXWidgets and there's a few messages about SwapBuffers and XID in X windows. Is anyone else building PCS2 on Linux?
-
I've built it on Mint 13 & 17. I even documented my experiences on the wiki (http://www.hard-light.net/wiki/index.php/Fs2_open_on_Linux/Compiling_PCS2)! :) Having said that I don't recall encountering any OpenGL errors so I'm not sure if that info will help or not.
-
wxgtk 2.8 has been deprecated, wxgtk3.0 is what ships in Debian now... It's because GTK-2.0 is deprecated in favour of GTK-3.0.
-
Urgh, I guess that wx 2.8 isn't available in the backports repo? If not then I guess PCS2 will need an update.
-
How exactly is the wxGTK versioning related to the base wxWidgets versioning? It's unfortunate that they seem to be sharing versions so much with GTK, unless that was by design but I'm thinking it wasn't. wxWidgets 2.8 won't work with wxGTK 3 is what I'm getting at? Shame there isn't a wxGTK that works with wxWidgets 2.8 and GTK3, unless there is and we just missed that.
-
They are similar, but there are changes. Several GLCanvas updates which prevent compilation/running. I was able to build PCS2 under the new WXWidgets, but the GL part was totally broken. If I comment out the Swapbuffers command I got a window to open but actions were unstable.
-
Hello,
I've been trying to build PCS2 in Ubuntu 16.04 with wxwidget 3.0
I'm sure this was the easy part, even if it took me a while to figure it out.
I encountered an issue with a SIGTRAP preventing the application start and due to SetCurrent()/SwapBuffers() called before having the window visible.
After some investigation and googleing the issue can be avoided by bailing out in Render() function if window is not yet visible on screen.
patch: "bail out from wxGL_PMFCanvas::Render() if window is not visible"
https://github.com/maurossi/PCS2/commit/c71416b7069ca8b793b6a47218559ead244422fe
Now I'm sharing and asking feedback/help about the remaining issues:
1) Error "Could not set current working directory (Error 2: no such file or directory)" after having selected a model to load.
This error is returned by wxwidget libraries, but I was not yet able to backtrace with gdb.
2) Assert error, generally non fatal in my understanding, I skip the Assert error windows by clicking Ok and everuthing proceeds.
It is due to wxString formats which since 3.0 are more strictly checked, not figure where is the problem exactly.
/usr/include/wx-3.0/wx/strvararg.h(456): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
3) Segfault (happening frequently when navigating the POF structure)
Thread 1 "pcs2" received signal SIGSEGV, Segmentation fault.
0x000000000092bb00 in wxGL_PMFCanvas::OnMouseEvt (this=0xfcea30, event=...) at /home/utente/Downloads/PCS2_wx3-0/src/wxGL_PMFCanvas.cpp:893
893 mainpanel->control_panel->push_undo();
(gdb) bt
#0 0x000000000092bb00 in wxGL_PMFCanvas::OnMouseEvt (this=0xfcea30, event=...) at /home/utente/Downloads/PCS2_wx3-0/src/wxGL_PMFCanvas.cpp:893
#1 0x00007ffff62091fe in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const ()
from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#2 0x00007ffff638f6c7 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) ()
from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#3 0x00007ffff638f7bb in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#4 0x00007ffff638fb6b in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#5 0x00007ffff638fbf3 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#6 0x00007ffff638fc55 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
#7 0x00007ffff638f9c7 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () from /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0
[attachment deleted by admin]
-
Hey there, I'm also working on this! :) it's nice to see someone else working on it. I found that the configuration file error is because it's trying to write to ~/.pcs2 instead of ~/.pcs2/pcs2.ini find that line and change it and you'll go further :) It looks like the program has a very half-done Unix filesystem implementation. Try adding #ifdef UNIX and #ifdef WIN32 wherever file paths are used and add a Unix equivalent of the windows paths. I'll post here again once I've done more.
-
Hi Darkmage,
Hey there, I'm also working on this! :) it's nice to see someone else working on it.
Pleased to meet you
I found that the configuration file error is because it's trying to write to ~/.pcs2 instead of ~/.pcs2/pcs2.ini find that line and change it and you'll go further :)
Thanks for the advise, I have modified the UNIX CONFIG_FILE , but I still need to check when ~/.pcs2 folder is created before finalizing the patch,
now I created the folder manually and the pcs2.ini file is written successfully.
I still have the following Error at each .pof model loading, I need to check what is trying to set/use the working directory.
"Pcs2 error - Could not set current working directory (Error 2: no such file or directory)"
Very very good news on the assert and segfault issues, they've been solved.
- assert issues are due to formats used wxString:Format and now solved, by correcting the arguments formats as done in wxlauncher some time ago.
- segmentation fault is avoided by skipping a push_undo() call in wxGL_PMFCanvass::OnMouseEvt
Proposed patches for review as follows:
[1/4] add support for wxWidgets 3.0 flags
https://github.com/maurossi/PCS2/commit/0df27a88143054d3b5729df22ee7783bc69180eb
[2/4] bail out from wxGL_PMFCanvas::Render() if window is not visible
https://github.com/maurossi/PCS2/commit/c71416b7069ca8b793b6a47218559ead244422fe
[3/4] fix format specifiers in wxString::Format calls
https://github.com/maurossi/PCS2/commit/6c9a6fa9a40a272d3ca3b59cc958619df2235012
[4/4] skip push_undo() to avoid SIGSEGV with wxWidgets 3.0
https://github.com/maurossi/PCS2/commit/be7edd41a4a7e44505c746bee5c830568f71548a
Tests results:
pcs2 is loading models without crashes and I can use all left pane controls when model is loaded (all working).
When using VBO is see some Z-culling artifacts and subobjects show transparencies not seen with wxWidgets 2.8,
but most of the issues/crashes seem resolved, but better to review the patches.
Now back to debugging the "working directory" issue
Mauro Rossi
PS: yesterday I saw that asarium also solved the issue about texture paths that needed / at the end, that's great!
-
The source code is also available in a GitHub repository (https://github.com/scp-fs2open/PCS2) so you can directly submit your changes there.
-
I agree with moving to a central repository. I'm trying to investigate the COB crashes. I'd like to get the Truespace support back up to scratch. I'm a very rusted on Truespace 6.6 user. I've actually got a second project aiming to rewrite Truespace for Linux using GTK. Once PCS2 is working, I'd like to extend its support to add .BXFM and .XMESH XML based formats.
-
hello Linux users! :)
the thing is: i compiled PCS2.1 for a 32bit Debian system (has wxwidgets2.8). i only needed to add 'SDL' to the SConstuct file in the "libs =" line, and it compiled. (i had some warnings). the program runs (i did not manage to bring it to crash) but the Collada importer does not seem to work properly. it imports a similar geometry, but it messes it up totally... (vertex and polygon counts and coordinates suffer from this) can someone tell me why it does so, and how can i fix this? it loads .pof files prooperly.
thank You!
regards,
Richard
ps: i used the Alliance code, that had some bugs. the SCP code does work better. i only had problems with CMake, it did not find libwxbase-headers v3.0+ because it found v2.8 first (both were installed) so i had to trick it a bit :D after that it compiled OK.
-
Ah, OK, glad you got that figured out. Could you clarify what you did to get it to find the right headers, for posterity? Others may run into the same issue, so if you used a particular config command that might be helpful.
-
Ah, OK, glad you got that figured out. Could you clarify what you did to get it to find the right headers, for posterity? Others may run into the same issue, so if you used a particular config command that might be helpful.
i am no great programmer and i am not proud of it what i did. :D and also i have no clue how CMake works. so what i did was: i moved away libwx-v2.8 headers from /usr/include/wx-2.8 and renamed /usr/include/wx-3.0 to /usr/include/wx-2.8
after that You only have to type: 'cmake -G "Unix Makefiles" ' to begin compilation in the directory You uncompressed the PCS2-master.zip ( https://github.com/scp-fs2open/PCS2/archive/master.zip ) (for me it was: /usr/src/PCS2-master/)
after compilation i made that reverse. i guess You MIGHT overcome this by removing libwx-2.8 headers, but i did not try that. i am sure this issue can be fixed in a more sophisticated way by someone who does understand CMake and fixes the CMake script.
my system is Debian 8.5 (Jessie) 32bit. i also had to install cmake v3.1+ from the jessie-backports repository. if this might help others, i can list some packages that i had and compiled with successfully:
ii libc6:i386 2.19-18+deb8u4 i386 GNU C Library: Shared libraries
ii libc6-dev:i386 2.19-18+deb8u4 i386 GNU C Library: Development Libraries and Header Files
ii cmake 3.6.2-2~bpo8+1 i386 cross-platform, open-source make system (from jessie-backports)
ii cmake-data 3.6.2-2~bpo8+1 all CMake data files (modules, templates and documentation) (from jessie-backports)
ii libwxbase3.0-0:i386 3.0.2-1+b1 i386 wxBase library (runtime) - non-GUI support classes of wxWidgets toolkit
ii libwxbase3.0-0-dbg:i386 3.0.2-1+b1 i386 debugging symbols for the wxBase library
ii libwxbase3.0-0-unofficial:i386 3.0.2-1.wheezy i386 wxBase library (runtime) - non-GUI support classes of wxWidgets toolkit
ii libwxbase3.0-dev 3.0.2-1+b1 i386 wxBase library (development) - non-GUI support classes of wxWidgets toolkit
ii libwxgtk3.0-0:i386 3.0.2-1+b1 i386 wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
ii libwxgtk3.0-0-dbg:i386 3.0.2-1+b1 i386 debugging symbols for the wxGTK GUI toolkit library
ii libwxgtk3.0-dev 3.0.2-1+b1 i386 wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)
ii gcc 4:4.9.2-2 i386 GNU C compiler
ii gcc-4.9 4.9.2-10 i386 GNU C compiler
ii gcc-4.9-base:i386 4.9.2-10 i386 GCC, the GNU Compiler Collection (base package)
ii libgcc-4.9-dev:i386 4.9.2-10 i386 GCC support library (development files)
i am not sure if this is all You need, but i guess it is most of them. i hope that helps.
regards,
Richard
-
maybe i should make a clean install (Debian v8.x; my system is several years old, i have packages from Etch :) ) and make (or update) a wiki page?
-
I am now on Debian Buster. I can build/run PCS2 on Linux. On Intel Graphics it has some glitches. On NVIDIA it runs fine. I have imported a DAE file. There needs to be a decent tutorial added to the PCS2 code repository so it's easier to get into using the program. It appears to work. I need to test Caligari .COB import once I've made some corrections to a model I've made. E.g Triangulation, naming detail0 etc.
-
hello!
i just switched from Debian Jessie (debian8/32bit) to Debian Stretch (9/64bit). Fresh installed Debian Strech 9.8/amd64 and compiled PCS2 for it. You need:
root@ip3000:/# apt-get install cmake libboost-regex-dev libboost-filesystem-dev libboost-system-dev libsdl1.2-dev libdevil-dev g++ gcc make
after that download PCS2-master.zip (https://github.com/scp-fs2open/PCS2/archive/master.zip), unzip it (i unzipped it into /usr/src/PCS2-master/) and:
root@ip3000:/usr/src/PCS2-master# cmake -G "Unix Makefiles"
root@ip3000:/usr/src/PCS2-master# make
because of my nVidia driver i also needed to fix a broken link:
root@ip3000:/usr/src/PCS2-master# ln -fs /usr/lib/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so
root@ip3000:/usr/src/PCS2-master# make
it had a few warnings, but it built OK:
root@ip3000:/usr/src/PCS2-master# file src/pcs2
src/pcs2: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=6b8282f1489646afe8a9972d7224973bc6b2cb8d, not stripped
good luck, and happy modding!
-
thanks for the info, I've added it to the wiki https://github.com/scp-fs2open/PCS2/wiki/Building-PCS2
(although; you really shouldn't build code as root! :) )
-
This is completely broken on Debian Buster. Errors with OpenGL, and errors with String handling.
james@James-Work:~/development/PCS2/src$ make -k
[ 9%] Built target fmt
[ 11%] Building CXX object CMakeFiles/pcs2.dir/geo_sphere.o
/home/james/development/PCS2/src/geo_sphere.cpp: In member function ‘ogl_vertex_buffer geo_sphere::make_vertex_buffer(int)’:
/home/james/development/PCS2/src/geo_sphere.cpp:188:2: error: ‘glGenBuffersARB’ was not declared in this scope
188 | glGenBuffersARB(1, &ret.buffer);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/geo_sphere.cpp:190:2: error: ‘glBindBufferARB’ was not declared in this scope
190 | glBindBufferARB(GL_ARRAY_BUFFER_ARB, ret.buffer);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/geo_sphere.cpp:191:2: error: ‘glBufferDataARB’ was not declared in this scope
191 | glBufferDataARB(GL_ARRAY_BUFFER_ARB, tri.size()*sizeof(vector3d),NULL, GL_STATIC_DRAW_ARB);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/geo_sphere.cpp:192:23: error: ‘glMapBufferARB’ was not declared in this scope
192 | float*map = (float *)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
| ^~~~~~~~~~~~~~
/home/james/development/PCS2/src/geo_sphere.cpp:195:3: error: ‘glUnmapBufferARB’ was not declared in this scope; did you mean ‘glXSwapBuffers’?
195 | glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
| ^~~~~~~~~~~~~~~~
| glXSwapBuffers
make[2]: *** [CMakeFiles/pcs2.dir/build.make:206: CMakeFiles/pcs2.dir/geo_sphere.o] Error 1
[ 14%] Building CXX object CMakeFiles/pcs2.dir/Main_Panel.o
[ 16%] Building CXX object CMakeFiles/pcs2.dir/MOI.o
[ 19%] Building CXX object CMakeFiles/pcs2.dir/ogl_vertex_buffers.o
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp: In member function ‘void pcs_sobj::make_vertex_buffer(int, int)’:
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp:82:2: error: ‘glGenBuffersARB’ was not declared in this scope
82 | glGenBuffersARB(1, &vertex_buffer[texture_slot].buffer);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp:84:2: error: ‘glBindBufferARB’ was not declared in this scope
84 | glBindBufferARB(GL_ARRAY_BUFFER_ARB, vertex_buffer[texture_slot].buffer);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp:85:2: error: ‘glBufferDataARB’ was not declared in this scope
85 | glBufferDataARB(GL_ARRAY_BUFFER_ARB, tri.size()*sizeof(OGL_vert), &tri[0], GL_STATIC_DRAW_ARB);
| ^~~~~~~~~~~~~~~
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp: In member function ‘void pcs_sobj::destroy_vertex_buffer()’:
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp:108:4: error: ‘glDeleteBuffersARB’ was not declared in this scope
108 | glDeleteBuffersARB(1, &vertex_buffer.buffer);
| ^~~~~~~~~~~~~~~~~~
/home/james/development/PCS2/src/ogl_vertex_buffers.cpp:113:4: error: ‘glDeleteBuffersARB’ was not declared in this scope
113 | glDeleteBuffersARB(1, &line_vertex_buffer.buffer);
-
OK I've been able to fix this by modifying the GLee.h file. Added GLEXT to it. GLX is basically dead on Linux.
I've also fixed up some Linux paths etc. Can someone either give me access to the git repo, or take some patches from me?
-
If you submit a PR on github I'll take a look at it: https://github.com/scp-fs2open/PCS2