[16.1] `GLIBC_2.18' not found

Bugs that are actually features.
Cobaia
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sat Jul 15, 2017 4:20 pm
Contact:

[16.1] `GLIBC_2.18' not found

Post by Cobaia »

Issue: Cant run factorio. Redownloaded five times.
Machine is AWS EC2 Amazon. Works fine with .15 version

x64]$ factorio
-bash: factorio: command not found

x64]$ ldd factorio
./factorio: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by ./fact orio)
linux-vdso.so.1 => (0x00007ffd169f3000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f30cdf4b000)
librt.so.1 => /lib64/librt.so.1 (0x00007f30cdd43000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f30cdb3f000)
libm.so.6 => /lib64/libm.so.6 (0x00007f30cd83d000)
libc.so.6 => /lib64/libc.so.6 (0x00007f30cd479000)
/lib64/ld-linux-x86-64.so.2 (0x00007f30ce167000)
Last edited by Cobaia on Wed Dec 13, 2017 9:24 pm, edited 1 time in total.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by Oxyd »

You need glibc version 2.18 or newer, which you apparently don't have. That is not a bug, but an outdated system.
GodricSeer
Inserter
Inserter
Posts: 30
Joined: Fri May 06, 2016 2:01 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by GodricSeer »

Yes, it is caused by factorio requiring a newer library, not a bug, but glibc 2.17 is the version supported by RHEL 7.4 (released in august) and all the related distros. If the upgrade was necessary because of bugs or features in the library that is one thing, but it does kill off the ease of running factorio on a wide range of common linux distributions.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by Oxyd »

GodricSeer wrote:Yes, it is caused by factorio requiring a newer library, not a bug, but glibc 2.17 is the version supported by RHEL 7.4 (released in august) and all the related distros. If the upgrade was necessary because of bugs or features in the library that is one thing, but it does kill off the ease of running factorio on a wide range of common linux distributions.
RHEL is notorious for shipping ancient software. glibc 2.18 was released in 2013, there is no reason why it shouldn't be available everywhere by now. RHEL users will simply have to upgrade to a distro that ships non-ancient software. Even Debian Jessie (oldstable) ships with glibc 2.19.

What happened is we essentially bumped up the minimum required Ubuntu version from 12.04 (which is EOL now) to 14.04. Since Ubuntu is what most people use, that is good enough as a minimum requirement for us.
User avatar
distortions864
Fast Inserter
Fast Inserter
Posts: 124
Joined: Thu Apr 20, 2017 12:56 am
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by distortions864 »

RHEL and derivatives is %24.5 of linux servers.

Are there any features from the newer glibc, you are actually using or need?
If there aren't, you can still compile against the older version. People with the newer glibc, will still have the improvements of the newer glibc (if they have it).

Linux distro server share:
https://w3techs.com/technologies/detail ... ux/all/all

glibc changelog:
https://abi-laboratory.pro/tracker/chan ... 8/log.html
M45 Science: A Factorio Community since 2017! https://m45sci.xyz/
millisa
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 02, 2017 9:05 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by millisa »

(I am disappointed with abandoning RHEL/Centos, but it's their game).

Edit 7 - CentOS7 glibc 2.18 factorio headless.
Edit 8 - typo fix. Removing exports per GodricSeer suggestion. Thanks!
Edit 9 - mention of executable-path
Edit 10 - 20190227 - Factorio 0.17.1 is out! Verified the same glibc 2.18 method is still valid.
Edit 11 - 20190926 - Centos8 Released yesterday! glibc 2.28! We are saved! A test install with Factorio 0.17.69 starts up just fine with a stock install. Hooray!

I initially posted this with quick instructions on replacing the CentOS7 glibc with 2.18 - which is a very bad idea. I'll leave those instructions at the bottom, but they really shouldn't be used. After seeing that it was possible to get factorio 0.16.x working on centos7 with the wrong approach (replacing glibc), I started working on the right approach (side by side)

Side by Side glibc 2.18
Updated instructions for adding a side-by-side glibc 2.18 into /opt for you to use starting the factorio headless server on CentOS7/RHEL7:
Get your tools ready

Code: Select all

yum groupinstall "Development tools"
yum install glibc-devel.i686 glibc.i686
Now that you have your steel axe, layout the belts and get your materials.

Code: Select all

cd /tmp
wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar xvzf glibc-2.18.tar.gz
cd glibc-2.18
mkdir glibc-build
cd glibc-build
../configure --prefix='/opt/glibc-2.18'
Fix test script
fix line 179 of the test install script:
I like nano, use whatever text editor you like.

Code: Select all

nano +179 ../scripts/test-installation.pl
- change

Code: Select all

 if (/$ld_so_name/) { 
- to

Code: Select all

 if (/\Q$ld_so_name\E/) { 

Assemble!

Code: Select all

make
make install
At this point, you have glibc 2.18 in the /opt/glibc-2.18 path without getting in the way of the system glibc.
Now you have to login as your factorio user and change your startup to use the new glibc.


Specify the ld-linux-x86.so.2 in the /opt structure to be used when you start factorio and give it an appropriate path and LD_LIBRARY_PATH to use.
Creating a blank map (modify the path to your factorio binary appropriately):

Code: Select all

PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2  /home/factorio/factorio/bin/x64/factorio --create /home/factorio/factorio/saves/newmap16.zip
Running the latest save (I had trouble with this on one of my pre-0.16 maps - I converted it from a local save and uploaded the updated version and it worked fine)

Code: Select all

PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2  /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
Looks good to me!

Code: Select all

[factorio@factorio ~]$ PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2 /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
   0.000 2017-12-18 15:11:49; Factorio 0.16.6 (build 34439, linux64, headless)
   0.000 Operating system: Linux
   0.000 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--start-server-load-latest" 
   0.000 Read data path: /home/factorio/factorio/data
   0.000 Write data path: /home/factorio/factorio [110368/113336MB]
   0.000 Binaries path: /home/factorio/factorio/bin
   0.005 System info: [CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz, 8 cores, RAM: 15804MB]
   0.005 Running in headless mode
  ...
Note: Factorio will not auto-restart with this startup method if you are changing mods or auto-updating

Edit 20180209 - There was a recent thread where this format was used for startup and it looks a little prettier:

Code: Select all

/opt/glibc-2.18/lib/ld-2.18.so --library-path /opt/glibc-2.18/lib ./bin/x64/factorio --create test.zip --executable-path ./bin/x64/factorio

---------
The Wrong Way
And here is the wrong way that just replaced the default glibc:

The following is a bad idea. Replacing glibc in /usr works at the moment, but will likely be broken or will break future OS updates (and will almost certainly break other things on the system that expects the older glibc; but if your system is *just* for factorio . . .). I would say 'use at your own risk', but there really isn't much risk here - this will eventually break things on your system. There's probably a nice side-by-side way of doing this that someone could improve on.


Replacing glibc 2.17 with 2.18 (this is going to break things eventually!)
Get your tools ready

Code: Select all

yum groupinstall "Development tools"
yum install glibc-devel.i686 glibc.i686
Now that you have your steel axe, layout the belts and get your materials.

Code: Select all

cd /tmp
wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar xvzf glibc-2.18.tar.gz
cd glibc-2.18
mkdir glibc-build
cd glibc-build
../configure --prefix='/usr'

Fix rotation

fix line 179 of the test install script:
I like nano, use whatever text editor you like.

Code: Select all

nano +179 ../scripts/test-installation.pl
- change

Code: Select all

 if (/$ld_so_name/) { 
- to

Code: Select all

 if (/\Q$ld_so_name\E/) { 

Assemble!

Code: Select all

make
make install
Hooray!

Code: Select all

[factorio@factorio ~]$ cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[factorio@factorio ~]$ /home/factorio/factorio/bin/x64/factorio --start-server-load-latest
   0.000 2017-12-17 17:11:58; Factorio 0.16.5 (build 34419, linux64, headless)
   0.000 Operating system: Linux
   0.000 Program arguments: "/home/factorio/factorio/bin/x64/factorio" "--start-server-load-latest" 
   0.000 Read data path: /home/factorio/factorio/data
   0.000 Write data path: /home/factorio/factorio [110456/113336MB]
   0.000 Binaries path: /home/factorio/factorio/bin
   0.005 System info: [CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz, 8 cores, RAM: 15804MB]
   0.005 Running in headless mode
Last edited by millisa on Thu Sep 26, 2019 6:00 am, edited 6 times in total.
david
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Mar 09, 2016 9:37 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by david »

You sir, are a hero.

I recovered my account credentials created in Mar. 2016 so that I could thank you.

It would have been a tough decision between choosing to run something besides CentOS or RHEL, or not playing factorio.

Thanks.
GodricSeer
Inserter
Inserter
Posts: 30
Joined: Fri May 06, 2016 2:01 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by GodricSeer »

I will add another reponse here and say that millisa's process for a side-by-side install of v2.18 works. THere are a couple changes I would recommend.

First, configure with

Code: Select all

../configure --prefix='/opt/glibc-2.18'
so that the library is contained in its own subdirectory. I think this is just a typo, since later instructions seem to assume this is the case.

Also, I recommend not exporting the changes to PATH and LD_LIBRARY_PATH, as they do break utilities. Instead you can run only factorio with those changes:

Code: Select all

PATH=/opt/glibc-2.18/bin:$PATH LD_LIBRARY_PATH=/opt/glibc-2.18/lib:/usr/lib64 /opt/glibc-2.18/lib/ld-linux-x86-64.so.2 ~/games/factorio/bin/x64/factorio
I simply made a bash script with that line in it, and run it to start factorio. This keeps the rest of the console working as intended. Note I also had to add /usr/lib64 to my LD_LIBRARY_PATH so that it could find libasound.so.0.2 (?). Try without that addition first, to see if it works, if not add it. Also, factorio won't restart automatically this way, if you change mods or use the auto-updater.
millisa
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Jun 02, 2017 9:05 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by millisa »

Thanks!
Fixed the typo, took the suggestion to drop the exports from the 'side by side' method and put it in line. Added the note about auto-updater (I do mine by hand, so it didn't occur to me).
Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by Bisa »

You sir|madame are indeed a hero, thnx! :)

(needed this to get my development environment up and running after lying dormant for a year or so, yum upgrade didn't do the trick sadly :mrgreen: )
Hosting a factorio server? Take a look at this || init script ||.
japz
Manual Inserter
Manual Inserter
Posts: 3
Joined: Mon May 29, 2017 6:10 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by japz »

Oxyd wrote:
GodricSeer wrote:Yes, it is caused by factorio requiring a newer library, not a bug, but glibc 2.17 is the version supported by RHEL 7.4 (released in august) and all the related distros. If the upgrade was necessary because of bugs or features in the library that is one thing, but it does kill off the ease of running factorio on a wide range of common linux distributions.
RHEL is notorious for shipping ancient software. glibc 2.18 was released in 2013, there is no reason why it shouldn't be available everywhere by now. RHEL users will simply have to upgrade to a distro that ships non-ancient software. Even Debian Jessie (oldstable) ships with glibc 2.19.

What happened is we essentially bumped up the minimum required Ubuntu version from 12.04 (which is EOL now) to 14.04. Since Ubuntu is what most people use, that is good enough as a minimum requirement for us.
There is a reason RHEL ships with "ancient" libraries: stability above all else. That they keep glibc at version 2.17 does not mean it is unmaintained or bugged. Bugs still get fixed for the lifetime of the distribution and in many cases fixed get backported from newer versions to 2.17. What you see in this distribution as glibc 2.17 today was probably not the glibc that was released way back when. The reason myself and many other people run on RHEL/CentOS is it's stable. It doesn't crash, and upgrades never break anything.

I do not want to start any distro wars. Ubuntu/debian have their place in the world, and so do CentOS/RHEL. I feel you shouldn't be calling a distribution with as large a market share as RHEL and its derivatives (that is still being maintained and will be for a long time) outdated, and putting the burden of "upgrading to a distro that ships non-ancient software" on your customers. Assuming there are no technical reasons that prevent you from compiling against glibc-2.17, can you please maintain a build that runs on CentOS 7?

If this is still not an option for you, would you consider maintaining a docker container for factorio instead?
joe32
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Jan 05, 2018 1:58 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by joe32 »

How can I run that command in background e.g with screen?
Okay I got it. Just ran screen command alone and then typed magic command. Nice guide you wrote there good job thanks.
User avatar
Trashman992
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jan 29, 2017 1:54 am
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by Trashman992 »

Thankyou millisa and friends!

This still works with everything download fresh today. Lovely write-up, very easy to follow.
Super happy!
User avatar
Trashman992
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jan 29, 2017 1:54 am
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by Trashman992 »

Um. Any suggestions to get this script from the wiki working with the commands above? I can't figure it out.
https://github.com/Bisa/factorio-init

:D
tmzasz
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sat May 07, 2016 6:03 pm
Contact:

Re: [16.1] `GLIBC_2.18' not found

Post by tmzasz »

Bisa accepted my PR that adds the alternative glibc root options to the script Trashman992 so if you grab a new copy you should be able to edit the config and have it running buttery smooth :)
Post Reply

Return to “Not a bug”