bincrafters / community

Central repository for issues and recipes
http://bincrafters.readthedocs.io/en/latest/
MIT License
218 stars 36 forks source link

[glm] 0.9.8.5 compile time error #776

Closed bashbug closed 5 years ago

bashbug commented 5 years ago

Package and Environment Details (include every applicable attribute)

Conan profile

[settings] arch=x86_64 arch_build=x86_64 build_type=Release compiler=gcc compiler.libcxx=libstdc++11 compiler.version=7 os=Linux os_build=Linux [options] [build_requires] [env]

Steps to reproduce

In the log below there is this line:

/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/setup.hpp:456:100: note: #pragma message: GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components
 # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")

It seems that a wrong compiler is set.

ll ~/.conan/data/glm/0.9.8.5/g-truc/stable/export/ 
-rw-r--r-- 1 buildagent buildagent  427 May  8 16:28 FindGLM.cmake
-rw-r--r-- 1 buildagent buildagent 1062 May  8 16:28 LICENSE.md
-rw-r--r-- 1 buildagent buildagent 1173 May  8 16:28 conanfile.py
-rw-r--r-- 1 buildagent buildagent  216 May  8 16:28 conanmanifest.txt
cat ~/.conan/data/glm/0.9.8.5/g-truc/stable/export/conanfile.py

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from conans import ConanFile, tools
import os

class GlmConan(ConanFile):
    name = "glm"
    version = "0.9.8.5"
    description = "OpenGL Mathematics (GLM)"
    url = "https://github.com/bincrafters/conan-glm"
    homepage = "https://github.com/g-truc/glm"
    author = "Bincrafters <bincrafters@gmail.com>"
    license = "MIT"
    exports_sources = "platform.h.patch"
    exports = ["FindGLM.cmake", "LICENSE.md"]
    source_subfolder = "source_subfolder"
    no_copy_source = True

    def source(self):
        source_url = "https://github.com/g-truc/glm"
        tools.get("{0}/archive/{1}.tar.gz".format(source_url, self.version))
        extracted_dir = "glm-" + self.version
        os.rename(extracted_dir, self.source_subfolder)
        tools.patch(base_path=self.source_subfolder, patch_file="platform.h.patch")

    def package(self):
        self.copy("FindGLM.cmake")
        self.copy("*", src=os.path.join(self.source_subfolder, "glm"), dst=os.path.join("include", "glm"))
        self.copy("copying.txt", dst="licenses", src=self.source_subfolder)

    def package_id(self):
        self.info.header_only()

The pachtfile platform.h.patch seems to be missing. I've searched for that patchfile and it contains

diff --git a/glm/simd/platform.h b/glm/simd/platform.h
index a5510be..de97786 100644
--- a/glm/simd/platform.h
+++ b/glm/simd/platform.h
@@ -283,6 +283,8 @@
 #      define GLM_COMPILER (GLM_COMPILER_GCC71)
 #  elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 2)
 #      define GLM_COMPILER (GLM_COMPILER_GCC72)
+#  elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 3)
+#      define GLM_COMPILER (GLM_COMPILER_GCC72)
 #  elif (__GNUC__ >= 8)
 #      define GLM_COMPILER (GLM_COMPILER_GCC80)
 #  else

And I'm pretty certain, that because of that missing patch file, the error occurs.

Logs

Compile time error

In file included from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_int.hpp:6:0,
                 from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/fwd.hpp:6,
                 from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/glm.hpp:61,
                 from ../shared/image-rendering/include/image_rendering/mesh.h:3,
                 from ../shared/image-rendering/src/textured_mesh_renderer.h:8,
                 from ../shared/image-rendering/src/textured_mesh_renderer.cpp:1:
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/setup.hpp:456:100: note: #pragma message: GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components
 # pragma message("GLM: GCC older than 4.6 has a bug presenting the use of rgba and stpq components")
                                                                                                    ^
In file included from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4.inl:968:0,
                 from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4.hpp:453,
                 from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/vec4.hpp:6,
                 from /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/glm.hpp:70,
                 from ../shared/image-rendering/include/image_rendering/mesh.h:3,
                 from ../shared/image-rendering/src/textured_mesh_renderer.h:8,
                 from ../shared/image-rendering/src/textured_mesh_renderer.cpp:1:
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl: In static member function 'static glm::tvec4<float, (glm::precision)5> glm::detail::compute_vec4_div<float, (glm::precision)5, true>::call(const glm::tvec4<float, (glm::precision)5>&, const glm::tvec4<float, (glm::precision)5>&)':
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl:156:11: error: 'struct glm::tvec4<float, (glm::precision)5>' has no member named 'data'
    Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
           ^~~~
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl:156:31: error: 'const struct glm::tvec4<float, (glm::precision)5>' has no member named 'data'
    Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
                               ^~~~
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl:156:50: error: 'const struct glm::tvec4<float, (glm::precision)5>' has no member named 'data'
    Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
                                                  ^~~~
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl: In constructor 'glm::tvec4<T, P>::tvec4(T) [with T = float; glm::precision P = (glm::precision)5]':
/home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/glm/detail/type_vec4_simd.inl:367:3: error: class 'glm::tvec4<float, (glm::precision)5>' does not have any field named 'data'
   data(_mm_set1_ps(s))
   ^~~~
...
...
SSE4 commented 5 years ago

related: https://github.com/g-truc/glm/issues/726

SSE4 commented 5 years ago

@bashbug may you update to newer version, e.g. 0.9.9.5?

bashbug commented 5 years ago

Yes, I can do that. Will the package 0.9.8.5 get fixed or removed?

Croydon commented 5 years ago

We don't remove old packages.

Since this is an upstream issue, which is fixed in a newer upstream version I don't see why we should make a custom backport.

bashbug commented 5 years ago

I used the package in the past with the same compiler. Did not had issues at all. But somehow the package was changed. I can understand, to use a newer version makes sense. Although, existing packages shouldn't change/break suddenly.

SSE4 commented 5 years ago

how is it possible? you have used 0.9.8.5 with GCC 7.3 in the past and it worked? issue is since January 2018, when did you use it with GCC 7.3 with no issue?

braindevices commented 5 years ago

same error with gcc7.4

SSE4 commented 5 years ago

@braindevices may you update to 0.9.9.5?

bashbug commented 5 years ago

e.g. on one of our agents we have still a working version:

ls -la /home/buildagent/.conan/data/glm/0.9.8.5/g-truc/stable/package/
drwxrwxr-x 4 buildagent buildagent 4096 Feb 28 14:11 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9

On https://bintray.com/bincrafters/public-conan/glm%3Ag-truc/0.9.8.5%3Astable I can see that the package has a timestamp of "Updated in Apr 02, 2019" Maybe somehow between Feb - Apr the patch file got removed and not applied.

SSE4 commented 5 years ago

@bashbug @braindevices changes were applied: https://github.com/bincrafters/conan-glm/commit/6ffc9d7b6e36f729ec96221c4c4dd912fc913d6d please give an another try and lemme know

SSE4 commented 5 years ago

changes were applied, closing