arrayfire / forge

High Performance Visualization
224 stars 48 forks source link

compilation error: Linking CXX executable ../../../glcontexts #130

Closed maikonadams closed 7 years ago

maikonadams commented 7 years ago

it was compiline fine, with make, and I got the error at the end :+1:

[ 92%] Linking CXX executable ../../../glcontexts /usr/bin/ld: /usr/local/lib/libglfw3.a(x11_window.c.o): undefined reference to symbol 'XConvertSelection' //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status source/tools/glcontexts/CMakeFiles/glcontexts.dir/build.make:98: recipe for target 'glcontexts' failed make[5]: [glcontexts] Error 1 CMakeFiles/Makefile2:212: recipe for target 'source/tools/glcontexts/CMakeFiles/glcontexts.dir/all' failed make[4]: [source/tools/glcontexts/CMakeFiles/glcontexts.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make[3]: [all] Error 2 src/backend/opengl/CMakeFiles/glb-ext.dir/build.make:111: recipe for target 'third_party/glb/src/glb-ext-stamp/glb-ext-build' failed make[2]: [third_party/glb/src/glb-ext-stamp/glb-ext-build] Error 2 CMakeFiles/Makefile2:216: recipe for target 'src/backend/opengl/CMakeFiles/glb-ext.dir/all' failed make[1]: [src/backend/opengl/CMakeFiles/glb-ext.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: [all] Error 2

9prady9 commented 7 years ago

@maikonadams Which OS are you using ? I believe glcontexts is a glbinding/glfw3 library example, not from forge. Are all the dependencies installed ?

maikonadams commented 7 years ago

it is ubuntu 14.04 , compiling from Jetson TK1, initially showed all dependecies ok , when I ran cmake . , then I did the compilation , not changing anything .

pavanky commented 7 years ago

@9prady9 sometimes on Ubuntu the order in which the libraries are linked can cause issues. I am not sure if this is the reason here.

9prady9 commented 7 years ago

@pavanky True. @maikonadams We are trying to check out build history for TX1 on build server and see if we have similar failure.

maikonadams commented 7 years ago

sorry , it is jetson tk1 :(

pavanky commented 7 years ago

//usr/lib/x86_64-linux-gnu/libX11.so.6

Should the TK1 be looking at this file ?

9prady9 commented 7 years ago

@maikonadams Unfortunately, we don't have a TK1 on our build servers or any other development machines. The closest test we can do is to test on TX1 and see if the problem is happening on it.

9prady9 commented 7 years ago

@pavanky That's what it points to on my system too.

pavanky commented 7 years ago

@9prady9 Is your system an ARM system ?

9prady9 commented 7 years ago

No it isn't, i thought you were referring to the standard location on any Linux distribution.

9prady9 commented 7 years ago

We don't see such problem on TX1 at least, just confirmed it from build logs on server.

mlloreda commented 7 years ago

@maikonadams, as @pavanky pointed out, it appears as though you've installed X11 for the wrong architecture.

maikonadams commented 7 years ago

Jeeeezzzzzz , looks like it's the wrong file , I don't remember of having installed it but will have a look. Tks for the effort guys.

shehzan10 commented 7 years ago

@maikonadams It looks like you are using static GLFW. We do NOT recommend using the static version. For Ubuntu 14.04, you will need to build GLFW, for which the instructions are here: https://github.com/arrayfire/arrayfire/wiki/GLFW-for-ArrayFire.

Once you have built GLFW, you should delete your build directory and start again. For double checking, once you generate the CMake cache, run cmake -LA | grep -i glfw to see which GLFW library is picked up.

Can you also post the CMake version that you are using?

maikonadams commented 7 years ago

cmake is 3.5.1

maikonadams commented 7 years ago

I downloaded glfw and run make , sudo make install : -- Install configuration: "" -- Up-to-date: /usr/local/include/GLFW -- Up-to-date: /usr/local/include/GLFW/glfw3native.h -- Up-to-date: /usr/local/include/GLFW/glfw3.h -- Up-to-date: /usr/local/lib/cmake/glfw3/glfw3Config.cmake -- Up-to-date: /usr/local/lib/cmake/glfw3/glfw3ConfigVersion.cmake -- Up-to-date: /usr/local/lib/cmake/glfw3/glfw3Targets.cmake -- Installing: /usr/local/lib/cmake/glfw3/glfw3Targets-noconfig.cmake -- Up-to-date: /usr/local/lib/pkgconfig/glfw3.pc -- Up-to-date: /usr/local/lib/libglfw3.a

and the command : cmake -LA | grep -i glfw -- Build files have been written to: /home/ebresearcher/forge/glfw GLFW_BUILD_DOCS:BOOL=ON GLFW_BUILD_EXAMPLES:BOOL=ON GLFW_BUILD_TESTS:BOOL=ON GLFW_DOCUMENT_INTERNALS:BOOL=OFF GLFW_INSTALL:BOOL=ON GLFW_USE_MIR:BOOL=OFF GLFW_USE_OSMESA:BOOL=OFF GLFW_USE_WAYLAND:BOOL=OFF GLFW_VULKAN_STATIC:BOOL=OFF

maikonadams commented 7 years ago

Now I am installing for ubuntu 16.04 , [ 91%] Built target glbinding [ 92%] Linking CXX executable ../../../glcontexts /usr/bin/ld: /usr/local/lib/libglfw3.a(x11_window.c.o): undefined reference to symbol 'XConvertSelection' //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status source/tools/glcontexts/CMakeFiles/glcontexts.dir/build.make:98: recipe for target 'glcontexts' failed make[5]: [glcontexts] Error 1 CMakeFiles/Makefile2:212: recipe for target 'source/tools/glcontexts/CMakeFiles/glcontexts.dir/all' failed make[4]: [source/tools/glcontexts/CMakeFiles/glcontexts.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make[3]: [all] Error 2 src/backend/opengl/CMakeFiles/glb-ext.dir/build.make:111: recipe for target 'third_party/glb/src/glb-ext-stamp/glb-ext-build' failed make[2]: [third_party/glb/src/glb-ext-stamp/glb-ext-build] Error 2 CMakeFiles/Makefile2:216: recipe for target 'src/backend/opengl/CMakeFiles/glb-ext.dir/all' failed make[1]: [src/backend/opengl/CMakeFiles/glb-ext.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: [all] Error 2

shehzan10 commented 7 years ago

Like I said in my previous message, you are using the static GLFW library. Did you follow the instructions on the link I posted and matched each command? If that is the case, it is highly unlikely that the static GLFW will be built.

Also, when you run cmake -LA | grep -i glfw, run it in the Forge build directory.

To summarize, here's what you should do:

  1. Delete all installed GLFW files
  2. Follow the instructions on the link above to compile the shared library of GLFW. When you run sudo make install, this should show that /usr/local/lib/libglfw*.so* files were installed.
  3. Clean the forge build directory and run CMake again.
  4. Run cmake -LA | grep -i glfw to ensure that the GLFW_LIBRARY variable is set to the installed shared library.
maikonadams commented 7 years ago

tks man , and sorry for the stupid questions ! I compiled ! I removed /usr/local/lib/libglfw3.a , and followed the instructions in the link, and looks it installed properly

ebresearcher@eb3:~/forge/glfw2/glfw/build$ ls -l /usr/local/lib/libglfw* lrwxrwxrwx 1 root root 12 Mar 1 09:39 /usr/local/lib/libglfw.so -> libglfw.so.3 lrwxrwxrwx 1 root root 14 Mar 1 09:39 /usr/local/lib/libglfw.so.3 -> libglfw.so.3.3 -rw-r--r-- 1 root root 156056 Mar 1 09:39 /usr/local/lib/libglfw.so.3.3

and

cmake -LA | grep -i glfw USE_WINDOW_TOOLKIT:STRING=glfw3 glfw3_DIR:PATH=/usr/local/lib/cmake/glfw3

tks , I am super excited to continue and try it. Regards.

tczaugg commented 6 years ago

I found solution here: https://devtalk.nvidia.com/default/topic/946136/building-an-opengl-application/?offset=7