enginmanap / limonEngine

3D FPS game engine with full dynamic lighting and shadows

Home Page:http://www.limonengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

glm on Ubuntu 16.04

reppolice opened this issue · comments

Not one to break with tradition, I am having problems building on a quite fresh Ubuntu 16.04. I was happy that the apt install command for 17.10 seemed to install everything correctly, and that includes liblgm-dev , but cmake could not find glmConfig.cmake and was asking for a solution. It is hard to imagine that is a problem with LimonEngine, somebody perhaps has packaged glm incorrectly in Ubuntu. Anyway, I was able to "cmake" correctly after getting the glm source and installing to its default location under /usr/local , but "make" showed some double definitions.

/usr/include/SDL2/../glm/gtx/../detail/type_vec1.inl:563:33: note: candidate: glm::tvec1<T, P> glm::operator>>(glm::tvec1<T, P>&, const T&) [with T = unsigned int; glm::qualifier P = (glm::qualifier)0u; glm::tvec1<T, P> = glm::vec<1, unsigned int, (glm::qualifier)0u>]
  GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T const & scalar)
                                 ^
In file included from /usr/local/include/glm/integer.hpp:212:0,
                 from /usr/local/include/glm/glm.hpp:136,
                 from /home/zat/limonEngine/src/GLHelper.h:8,
                 from /home/zat/limonEngine/src/main.cpp:6:
/usr/local/include/glm/detail/func_integer.inl: In instantiation of ‘static glm::vec<L, T, Q> glm::detail::compute_bitfieldBitCountStep<L, T, Q, Aligned, true>::call(const glm::vec<L, T, Q>&, T, T) [with int L = 1; T = unsigned int; glm::qualifier Q = (glm::qualifier)0u; bool Aligned = false]’:
/usr/local/include/glm/detail/func_integer.inl:311:146:   required from ‘glm::vec<L, int, Q> glm::bitCount(const glm::vec<L, T, Q>&) [with int L = 1; T = unsigned int; glm::qualifier Q = (glm::qualifier)0u]’
/usr/local/include/glm/detail/func_integer.inl:132:60:   required from ‘static glm::vec<L, int, Q> glm::detail::compute_findMSB_vec<L, T, Q, <anonymous> >::call(const glm::vec<L, T, Q>&) [with int L = 1; T = unsigned int; glm::qualifier Q = (glm::qualifier)0u; int <anonymous> = 32]’
/usr/local/include/glm/detail/func_integer.inl:355:67:   required from ‘glm::vec<L, int, Q> glm::findMSB(const glm::vec<L, T, Q>&) [with int L = 1; T = unsigned int; glm::qualifier Q = (glm::qualifier)0u]’
/usr/local/include/glm/detail/func_integer.inl:347:17:   required from ‘int glm::findMSB(genIUType) [with genIUType = unsigned int]’
/usr/local/include/glm/gtx/integer.inl:148:25:   required from here
/usr/local/include/glm/detail/func_integer.inl:60:14: error: ambiguous overload for ‘operator&’ (operand types are ‘const glm::vec<1, unsigned int, (glm::qualifier)0u>’ and ‘unsigned int’)
    return (v & Mask) + ((v >> Shift) & Mask);

I am wondering if the "note" warning above is relevant to the eventual error.

Removing libglm-dev gives
limonEngine/src/GameObjects/../GUI/../Utils/GLMConverter.h:9:37: fatal error: ../glm/gtx/quaternion.hpp: No such file or directory

This does feel like something Limon could be doing better, but I am not sure which would be the cleanest way forward.

AFAIK, Ubuntu 16.04 doesn't have a recent enough version of the GLM. I faced the same issue when trying to enable travis-ci builds, and couldn't find a better way then compiling a recent glm package myself.

Can you please check the version of glm on your machine? The required glm version is >0.9.9.0.

libglm-dev | 0.9.7.2-1

But as described, removing it and installing in default location did not do the trick for me, I am not sure how you proceeded.

Well, I choose the easy path and upgrade to ubuntu 18.04 :-) Did you try to install latest release from their release page, not package manager version?

Yes I tried from their page. BTW on my 18.04 I made the funny discovery that your apt install does not include cmake :)

Oh wow, I knew there was something rotten in LimonEngine :) On 18.04 I got

/limonEngine/src/Assets/ModelAsset.cpp:12:10: fatal error: ../../libs/imgui/imgui.h: No such file or directory
 #include "../../libs/imgui/imgui.h"


I thought you guys forgot this imgui, but in fact it is there with ImGui . I tried deleting ImGui but it is hardreferenced in cmake

`CMake Error at libs/CmakeLists.txt:17 (add_library):
Cannot find source file:

libs/ImGui/imgui.cpp

`

Then I tried having both imgui and ImGui directories but this resulted in error with duplicate definitions. How do you guys compile this thing!

That error is on me. I know travis builds were failing but I was working on another feature and didn't fix it in time. Now it is fixed, and Travis builds are successful. You can try again.

Please don't forget there are files needed from the releases, download a release and use Data folder in it.

Hey @reppolice were you able to compile?

Working on it!

Not sure if it is the same bug, but it appears to be glm-related (I also wanted to comment first before opening another issue).

When compiling on Debian Stretch the final leg of the build fails with:

[ 92%] Building CXX object CMakeFiles/customTriggers.dir/src/GamePlay/ShooterPlayerExtension.cpp.o
/home/jack/dev/contrib/limonengine/src/GamePlay/ShooterPlayerExtension.cpp: In member function ‘virtual void ShooterPlayerExtension::processInput(InputHandler&)’:
/home/jack/dev/contrib/limonengine/src/GamePlay/ShooterPlayerExtension.cpp:78:39: error: ‘quatLookAt’ is not a member of ‘glm’
                         orientation = glm::quatLookAt(hitNormal * -1.0f, glm::vec3(0,1,0));
                                       ^~~
CMakeFiles/customTriggers.dir/build.make:254: recipe for target 'CMakeFiles/customTriggers.dir/src/GamePlay/ShooterPlayerExtension.cpp.o' failed
make[2]: *** [CMakeFiles/customTriggers.dir/src/GamePlay/ShooterPlayerExtension.cpp.o] Error 1
CMakeFiles/Makefile2:144: recipe for target 'CMakeFiles/customTriggers.dir/all' failed
make[1]: *** [CMakeFiles/customTriggers.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Does this seem deserving of a separate issue?

That is the same issue. Can you remove that line and try again? If it compiles, it means that method is the only issue. That case I can just remove it.

@enginmanap commenting out

orientation = glm::quatLookAt(hitNormal * -1.0f, glm::vec3(0,1,0));
fixed the build (there are still other unrelated warnings though)

@jmcph4 can you test out the fix70 branch? I just pushed a commit with check about glm version, but I don't have a computer to test it at hand.

@enginmanap still failing on fix70, with the same error

Would you care to join discord so we can work on this together? Channel link is this: https://discord.gg/gqprbFd

Hey @jmcph4 did you manage to fix this issue? I would like to merge it with master if it got fixed. My invitation to chat about it on discord still stands.

Hi,

I fixed the issue on branch #70 and tested on Mint 18.03 which has GLM 0.9.7. If you can verify I will close the issue.

@enginmanap I cloned fix70 and the build succeeds out of the box. For reference, I'm running on Debian Stretch.

Thanks. I will close this issue because Mint 18.3 is based on 16.4 and I tested that, and your issue is resolved too.

merged and pushed, thanks @jmcph4 and @reppolice