Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Clang build issues #289

Closed
LoneSimba opened this issue Dec 1, 2018 · 8 comments
Closed

[Linux] Clang build issues #289

LoneSimba opened this issue Dec 1, 2018 · 8 comments
Labels
Build issue The issue in the build-time. Help wanted Portability
Milestone

Comments

@LoneSimba
Copy link

Fatal error while building at Linux Ubuntu 18.04
CLang ver 6.0 used
There's console output:
$ CC=clang-6.0 CXX=clang++-6.0 CFLAGS="-march=native" CXXFLAGS="-march=native" cmake ..
-- The C compiler identification is Clang 6.0.0
-- The CXX compiler identification is Clang 6.0.0
-- Check for working C compiler: /usr/bin/clang-6.0
-- Check for working C compiler: /usr/bin/clang-6.0 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-6.0
-- Check for working CXX compiler: /usr/bin/clang++-6.0 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- cotire 1.8.0 loaded.
CMake build Release, CFLAGS=-march=native, CXXFLAGS=-march=native -fpermissive --std=c++17 -Wno-attributes -pipe -Wl,--no-undefined -fvisibility=hidden
-- Found GLEW: /usr/include
-- Found FreeImage: /usr/include, /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Found LockFile: /usr/include, /usr/lib/x86_64-linux-gnu/liblockfile.so
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so
-- Found Crypto++: /usr/include/crypto++, /usr/lib/x86_64-linux-gnu/libcryptopp.so
-- Found PugiXML: /usr/lib/x86_64-linux-gnu/libpugixml.so
-- PugiXML include = /usr/include
-- PugiXML library = /usr/lib/x86_64-linux-gnu/libpugixml.so
-- theora found: includes in /usr/include, library in /usr/lib/x86_64-linux-gnu/libtheora.so;/usr/lib/x86_64-linux-gnu/libogg.so;/usr/lib/x86_64-linux-gnu/libvorbis.so
-- Found Ogg: /usr/lib/x86_64-linux-gnu/libogg.so
-- Found SDL: /usr/lib/x86_64-linux-gnu/libSDL2.so (found version "2.0.8")
-- Found LZO: /usr/lib/x86_64-linux-gnu/liblzo2.so
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
-- Found Intel TBB, includes /usr/include, /usr/lib/x86_64-linux-gnu/libtbb.so;/usr/lib/x86_64-linux-gnu/libtbbmalloc.so;/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
-- The ASM compiler identification is Clang
-- Found assembler: /usr/bin/clang-6.0
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Found readline: /usr/lib/x86_64-linux-gnu/libreadline.so
-- Found Curses: /usr/lib/x86_64-linux-gnu/libcurses.so
DASM_FLAGS: -D FPU -D HFABI -D P64 -D JIT -D FFI -D SSE2 -D VER=
DASM_ARCH: x86
Build shared lib
adding ./src/GameSpy to GameSpy
adding ./src/GameSpy/common to GameSpy
adding ./src/GameSpy/gcdkey to GameSpy
adding ./src/GameSpy/ghttp to GameSpy
adding ./src/GameSpy/GP to GameSpy
adding ./src/GameSpy/gstats to GameSpy
adding ./src/GameSpy/gt2 to GameSpy
adding ./src/GameSpy/natneg to GameSpy
adding ./src/GameSpy/pt to GameSpy
adding ./src/GameSpy/qr2 to GameSpy
adding ./src/GameSpy/sake to GameSpy
adding ./src/GameSpy/sc to GameSpy
adding ./src/GameSpy/serverbrowsing to GameSpy
adding ./src/GameSpy/webservices to GameSpy
adding . to OPCODE
adding ode/src to ODE
adding include/ode to ODE
adding contrib/msvc7/ode_default to ODE
adding . to xrLCUtil
-- CXX target xrLCUtil cotired.
adding src to xrQSlim
adding . to xrMiscMath
-- CXX target xrMiscMath cotired.
adding . to xrRender_GL
adding ../xrRender to xrRender_GL
adding ../xrRender/blenders to xrRender_GL
adding ../xrRenderGL to xrRender_GL
adding ../xrRenderGL/MSAA to xrRender_GL
adding ../xrRenderGL/GL Rain to xrRender_GL
adding ../../Include/xrRender to xrRender_GL
-- CXX target xrRender_GL cotired.
adding . to xr_3da
adding . to xrAICore
adding Components to xrAICore
adding Navigation to xrAICore
adding Navigation/PatrolPath to xrAICore
adding Navigation/PathManagers to xrAICore
-- CXX target xrAICore cotired.
path /home/lonesimba/Desktop/stalker/xray-16/src/xrUICore
adding . to xrCDB
-- CXX target xrCDB cotired.
adding . to xrCore
adding Animation to xrCore
adding Compression to xrCore
adding Containers to xrCore
adding Crypto to xrCore
adding Math to xrCore
adding Media to xrCore
adding PostProcess to xrCore
adding Text to xrCore
adding Threading to xrCore
adding XML to xrCore
adding ../xrCommon to xrCore
commit: cf1329d
branch: xd_dev
-- CXX target xrCore cotired.
adding . to xrEngine
adding StringTable to xrEngine
-- CXX target xrEngine cotired.
adding . to xrGame
adding ai to xrGame
adding ai/crow to xrGame
adding ai/monsters to xrGame
adding ai/monsters/basemonster to xrGame
adding ai/monsters/bloodsucker to xrGame
adding ai/monsters/boar to xrGame
adding ai/monsters/burer to xrGame
adding ai/monsters/cat to xrGame
adding ai/monsters/chimera to xrGame
adding ai/monsters/controller to xrGame
adding ai/monsters/dog to xrGame
adding ai/monsters/flesh to xrGame
adding ai/monsters/fracture to xrGame
adding ai/monsters/group_states to xrGame
adding ai/monsters/poltergeist to xrGame
adding ai/monsters/pseudodog to xrGame
adding ai/monsters/pseudogigant to xrGame
adding ai/monsters/rats to xrGame
adding ai/monsters/snork to xrGame
adding ai/monsters/states to xrGame
adding ai/monsters/tushkano to xrGame
adding ai/monsters/zombie to xrGame
adding ai/phantom to xrGame
adding ai/stalker to xrGame
adding ai/trader to xrGame
adding CdkeyDecode to xrGame
adding ik to xrGame
adding ui to xrGame
adding gamespy to xrGame
adding ../xrServerEntities to xrGame
-- C CXX target xrGame cotired.
adding . to xrGameSpy
-- CXX target xrGameSpy cotired.
adding . to xrNetServer
adding empty to xrNetServer
-- CXX target xrNetServer cotired.
adding . to xrParticles
-- CXX target xrParticles cotired.
adding . to xrPhysics
adding tri-colliderknoopc to xrPhysics
adding dcylinder to xrPhysics
-- CXX target xrPhysics cotired.
adding . to xrScriptEngine
adding LuaStudio to xrScriptEngine
-- CXX target xrScriptEngine cotired.
adding . to xrSound
-- CXX target xrSound cotired.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lonesimba/Desktop/stalker/xray-16/bin
$ make -j2
Scanning dependencies of target minilua
Scanning dependencies of target cximage
[ 1%] Building C object Externals/CMakeFiles/minilua.dir/LuaJIT/src/host/minilua.c.o
[ 2%] Building CXX object Externals/cximage/CMakeFiles/cximage.dir/ximacfg.cpp.o
clang: warning: -Wl,--no-undefined: 'linker' input unused [-Wunused-command-line-argument]
In file included from /home/lonesimba/Desktop/stalker/xray-16/Externals/cximage/ximacfg.cpp:1:
In file included from /home/lonesimba/Desktop/stalker/xray-16/Externals/cximage/ximacfg.h:7:
In file included from /home/lonesimba/Desktop/stalker/xray-16/Externals/cximage/../../src/Common/Common.hpp:4:
In file included from /home/lonesimba/Desktop/stalker/xray-16/Externals/cximage/../../src/Common/Platform.hpp:22:
/home/lonesimba/Desktop/stalker/xray-16/Externals/cximage/../../src/Common/PlatformLinux.inl:88:9: error:
void function '_splitpath' should not return a value [-Wreturn-type]
return EINVAL;
^ ~~~~~~
1 error generated.
Externals/cximage/CMakeFiles/cximage.dir/build.make:62: recipe for target 'Externals/cximage/CMakeFiles/cximage.dir/ximacfg.cpp.o' failed
make[2]: *** [Externals/cximage/CMakeFiles/cximage.dir/ximacfg.cpp.o] Error 1
CMakeFiles/Makefile2:305: recipe for target 'Externals/cximage/CMakeFiles/cximage.dir/all' failed
make[1]: *** [Externals/cximage/CMakeFiles/cximage.dir/all] Error 2
make[1]: *** Ожидание завершения заданий…
[ 2%] Linking C executable minilua
[ 2%] Built target minilua
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

@Xottab-DUTY
Copy link
Member

Will be fixed with #282 merge.
This is because main Linux work is done in forks, so this repo can be a bit outdated time to time.

@Xottab-DUTY Xottab-DUTY reopened this Dec 2, 2018
@Xottab-DUTY
Copy link
Member

@q4a says that he can't build the engine even with #282. I'll leave it open for now.

@Xottab-DUTY Xottab-DUTY changed the title [Linux] [Linux] Clang build issues Dec 2, 2018
@Xottab-DUTY Xottab-DUTY added this to the Linux port milestone Dec 2, 2018
@Xottab-DUTY Xottab-DUTY added Bug The issue in the run-time. Portability labels Dec 2, 2018
@q4a
Copy link
Member

q4a commented Dec 6, 2018

Hi. I created branch, based on #282 and fixed building with clang:
https://github.com/q4a/xray-16/tree/clang
Tested on Ubuntu 18.10 (my system) and 16.04 (travis):
https://travis-ci.org/q4a/xray-16/builds/464035764

@LoneSimba
Copy link
Author

Hmm, wonder, why is this still open, or do I have to write that i've successfully built it on my 18.04 and it runs just fine (I mean, it lags, but the same goes for Windows, so it's laptop trouble)

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented May 16, 2019

Hmmmmmmmmmmmmmmmmmmmmm! Thanks for the news!

What compiler options you used? We still have #299 and #344 (related to Clang too) unmerged. Probably @q4a used more strict options than you?

@LoneSimba
Copy link
Author

LoneSimba commented May 18, 2019

I've just followed instructions in wiki, but had to edit files as mentioned here, built from latest commit in xd_dev. Everything is fine, but intro video is just green screen with sound, and menu background sometimes glitches into green as well

@eagleivg
Copy link
Contributor

What version of clang used? I just checked on clang-6 from ubuntu 18.04 - the problem remained.

@Xottab-DUTY Xottab-DUTY added the Developer Experience Engine's programmer experience label May 20, 2019
@LoneSimba
Copy link
Author

LoneSimba commented May 28, 2019

Sorry for not answering for so long. Checked my apt list, lookls like i have both 5.0 and 6.0 installed. I could try to send my game dir here in .zip, if required, but if i remember correctly, i built it with such arguments:

cmake .. CC=clang CXX=clang++ CFLAGS="-march=native" CXXFLAGS="-march=native"

and then:

make -j4

(i have 2 4 cores). And then did the rest as descripted in building manual. Then i tried to fire it up, but was getting the opengl window error:

Could not create drawing context: The specified window isn't an OpenGL window.

After that i found the issue i mentioned and did this:

I tried commenting out the if statement in src/xrEngine/Device_Initialize.cpp line 50
if (psDeviceFlags.test(rsRGL))

And then it started working

@Xottab-DUTY Xottab-DUTY reopened this Feb 28, 2020
@Xottab-DUTY Xottab-DUTY removed this from the Linux port milestone Mar 25, 2020
@Xottab-DUTY Xottab-DUTY removed the Developer Experience Engine's programmer experience label Mar 25, 2020
@Xottab-DUTY Xottab-DUTY added Build issue The issue in the build-time. and removed Bug The issue in the run-time. labels Oct 3, 2020
@Xottab-DUTY Xottab-DUTY linked a pull request May 5, 2021 that will close this issue
@Xottab-DUTY Xottab-DUTY added this to the Linux port milestone May 5, 2021
@Xottab-DUTY Xottab-DUTY linked a pull request May 5, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issue The issue in the build-time. Help wanted Portability
Projects
Status: Done
4 participants