I have 64-bit F20 with the proprietary ATI Catalyst driver installed. My build fails with:
$ make -j4
make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'. Stop.
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2
tl;dr
The solution is to run this:
# ln -s /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so
Then make
again.
Full Explanation
This isn't your fault, it's the AMD graphics drivers, they mess with libGL and don't correctly symlink themselves in place.
I've solved this and you can close this issue, I'm just documenting the full steps here in case it's helpful to others.
I installed dependencies as per the readme.
Building fails:
$ make -j4
Scanning dependencies of target graphics
[ 10%] [ 10%] [ 20%] [ 20%] Building CXX object CMakeFiles/graphics.dir/g_src/command_line.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/basics.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/enabler.cpp.o
Building CXX object CMakeFiles/graphics.dir/g_src/enabler_input.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input(SDL_Event&, Uint32)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:81: warning: narrowing conversion of ‘next_serial()’ from ‘Time {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:522:90: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
Event e = {REPEAT_NOT, (InterfaceKey)INTERFACEKEY_OPTIONS, 0, next_serial(), now, 0};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp: In member function ‘void enabler_inputst::add_input_refined(KeyEvent&, Uint32, int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/enabler_input.cpp:689:77: warning: narrowing conversion of ‘now’ from ‘Uint32 {aka unsigned int}’ to ‘int’ inside { } [-Wnarrowing]
Event e = {key_repeat(*k), *k, 0, serial, now, enabler.simticks.read()};
^
[ 25%] Building CXX object CMakeFiles/graphics.dir/g_src/files.cpp.o
[ 30%] Building CXX object CMakeFiles/graphics.dir/g_src/find_files_posix.cpp.o
[ 35%] Building CXX object CMakeFiles/graphics.dir/g_src/graphics.cpp.o
[ 40%] Building CXX object CMakeFiles/graphics.dir/g_src/init.cpp.o
[ 45%] Building CXX object CMakeFiles/graphics.dir/g_src/interface.cpp.o
[ 50%] Building CXX object CMakeFiles/graphics.dir/g_src/keybindings.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp: In member function ‘void graphicst::addst(const string&, justification, int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenf’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
struct ttf_id id = {str, screenf, screenb, screenbright};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenb’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/graphics.cpp:226:60: warning: narrowing conversion of ‘((graphicst*)this)->graphicst::screenbright’ from ‘char’ to ‘unsigned char’ inside { } [-Wnarrowing]
[ 55%] Building CXX object CMakeFiles/graphics.dir/g_src/KeybindingScreen.cpp.o
[ 60%] Building CXX object CMakeFiles/graphics.dir/g_src/random.cpp.o
[ 65%] Building CXX object CMakeFiles/graphics.dir/g_src/renderer_offscreen.cpp.o
[ 70%] Building CXX object CMakeFiles/graphics.dir/g_src/resize++.cpp.o
[ 75%] Building CXX object CMakeFiles/graphics.dir/g_src/textures.cpp.o
[ 80%] Building CXX object CMakeFiles/graphics.dir/g_src/textlines.cpp.o
[ 85%] Building CXX object CMakeFiles/graphics.dir/g_src/ttf_manager.cpp.o
[ 90%] Building CXX object CMakeFiles/graphics.dir/g_src/ViewBase.cpp.o
[ 95%] Building CXX object CMakeFiles/graphics.dir/g_src/win32_compat.cpp.o
[100%] make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'. Stop.
make[2]: *** Waiting for unfinished jobs....
Building CXX object CMakeFiles/graphics.dir/g_src/music_and_sound_openal.cpp.o
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp: In member function ‘SDL_Surface* ttf_managerst::get_texture(int)’:
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:192:62: warning: narrowing conversion of ‘(Sint16)xpos’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
SDL_Rect left = {0, 0, Sint16(xpos), Sint16(height)};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:192:62: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:196:85: warning: narrowing conversion of ‘(Sint16)it.std::_List_const_iterator<_Tp>::operator-><ttf_managerst::todum>()->ttf_managerst::todum::pixel_width’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
SDL_Rect right = {Sint16(xpos), 0, Sint16(it->pixel_width), Sint16(height)};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:196:85: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:202:81: warning: narrowing conversion of ‘(Sint16)textimg_seg->SDL_Surface::w’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
SDL_Rect dest = {Sint16(xpos), 0, Sint16(textimg_seg->w), Sint16(height)};
^
/home/superjamie/.bin/df_linux/dwarf_fortress_unfuck/g_src/ttf_manager.cpp:202:81: warning: narrowing conversion of ‘(Sint16)height’ from ‘Sint16 {aka short int}’ to ‘Uint16 {aka short unsigned int}’ inside { } [-Wnarrowing]
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2
Running make
again produces:
$ make -j4
make[2]: *** No rule to make target `/usr/lib/libGL.so', needed by `libgraphics.so'. Stop.
make[1]: *** [CMakeFiles/graphics.dir/all] Error 2
make: *** [all] Error 2
The missing file is owned by mesa-libGL-devel
:
# rpm -qf /usr/lib/libGL.so
mesa-libGL-devel-10.3.3-1.20141110.fc20.i686
However it's a symlink to libGL.so.1.2.0
:
# file -s /usr/lib/libGL.so
/usr/lib/libGL.so: broken symbolic link to `libGL.so.1.2.0'
# ls -lgo /usr/lib/libGL.so
lrwxrwxrwx. 1 14 Jan 26 22:30 /usr/lib/libGL.so -> libGL.so.1.2.0
Usually this is a file in mesa-libGL
:
# yum provides "*/libGL.so.1.2.0"
...
mesa-libGL-10.3.3-1.20141110.fc20.i686 : Mesa libGL runtime libraries and DRI drivers
Repo : updates
Matched from:
Filename : /usr/lib/libGL.so.1.2.0
And it's missing:
# rpm -V mesa-libGL.i686
....L.... /usr/lib/libGL.so.1
missing /usr/lib/libGL.so.1.2.0
One could restore the original file with:
# yum reinstall mesa-libGL.i686
Which then allows build to complete:
$ make
Linking CXX shared library libgraphics.so
[100%] Built target graphics
However, one should link against the AMD OpenGL implementation:
# ln -s /usr/lib/fglrx/fglrx-libGL.so.1.2 /usr/lib/libGL.so
Which successfully builds and works:
$ make clean
$ make
[ 5%] Building CXX object CMakeFiles/graphics.dir/g_src/basics.cpp.o
...
[100%] Building CXX object CMakeFiles/graphics.dir/g_src/music_and_sound_openal.cpp.o
Linking CXX shared library libgraphics.so
[100%] Built target graphics