-lpthreads

Added by sm3 almost 8 years ago

My compile bombed on Ubuntu server amd64:

/usr/bin/gcc -g -ftemplate-depth-48 -D_REENTRANT -Wall -ansi -W -Wpointer-arit h -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-st rict-aliasing -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileE xec.dir/CheckFunctionExists.c.o -o cmTryCompileExec -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads

Shouldn't this be -lpthread ? there is no libpthreads.so but there is a libpthread.so

Thanks,

sm3


Replies (6)

RE: -lpthreads - Added by sfb almost 8 years ago

sm3,

Are you using CMake? It looks like you're using the legacy build system. No one is managing that build system anymore. You're better off using CMake and then copying the bins into the folders for use with the shard start command.

Thanks,
sfb
/s

RE: -lpthreads - Added by sm3 almost 8 years ago

No, I'm using cmake.

sm3

RE: -lpthreads - Added by sfb almost 8 years ago

sm3,

Was this working at one point in time for you?

Thanks,
sfb
/s

RE: -lpthreads - Added by kervala almost 8 years ago

That's related to CMake which check for basic configuration, we can't do anything about it. Sorry.

Perhaps you didn't install all needed GCC packages :)

RE: -lpthreads - Added by sm3 almost 8 years ago

OK. Thanks Kervala. I guess it is my ignorance of how things are done on Linux.

This missing pthreads is part of cmake checking for libpthreads.so and libpthread.so.

I'm going to try the build again with Ubuntu desktop, following the instructions on the cmake wiki article for Linux.

Maybe I'll have better luck.

Thanks,

sm3

RE: -lpthreads - Added by sm3 almost 8 years ago

I did a make VERBOSE=1 and no -j# this time. Here is the error I'm getting:

Linking CXX shared module ../../../../../lib/libnel_drv_opengl.so
cd /home/sm3/ryzom/code/build/nel/src/3d/driver/opengl && /usr/bin/cmake -E cmake_link_script CMakeFiles/nel_drv_opengl.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -g -ftemplate-depth-48 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing -DNL_RELEASE -DNDEBUG -O6 -Wl,--no-undefined -Wl,--as-needed -shared -Wl,-soname,libnel_drv_opengl.so -o ../../../../../lib/libnel_drv_opengl.so CMakeFiles/nel_drv_opengl.dir/driver_opengl_vertex.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_vertex_buffer_hard.cpp.o CMakeFiles/nel_drv_opengl.dir/stdopengl.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_extension.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_states.cpp.o CMakeFiles/nel_drv_opengl.dir/unix_event_emitter.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_light.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_matrix.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_material.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_vertex_program.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_texture.cpp.o CMakeFiles/nel_drv_opengl.dir/driver_opengl_window.cpp.o ../../../../../lib/libnel3d.a ../../../../../lib/libnelmisc.a -lGL -lX11 -lXxf86vm -lXrandr -lXrender -ljpeg -lpng -lz -lc -ldl -lrt -lpthread -lxml2 -lfreetype
/usr/bin/ld: ../../../../../lib/libnel3d.a(viewport.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
../../../../../lib/libnel3d.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make2: * [lib/libnel_drv_opengl.so] Error 1
make2: Leaving directory `/home/sm3/ryzom/code/build'
make1:
[nel/src/3d/driver/opengl/CMakeFiles/nel_drv_opengl.dir/all] Error 2
make1: Leaving directory `/home/sm3/ryzom/code/build'
make: *
* [all] Error 2

Edit: was told on IRC not to build the OpenGL driver if I'm just wanting to build the server. I'm trying again using -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF

Edit: I was able to finish the build by using opengl and openal = off as listed above. So this fixed my issue.

(1-6/6)