New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crystal can't find libevent on CentOS 6.9 #5650

Open
zarianu opened this Issue Jan 28, 2018 · 13 comments

Comments

Projects
None yet
6 participants
@zarianu

zarianu commented Jan 28, 2018

Hello dear sirs,

I have problems running/building any .cr on my CentOS 6.9 system (Linode VM actually).

Here's error message:

E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, Fiber, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0xbf): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor+, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x15f): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x1ef): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, File, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x27f): undefined reference to `event_new'
E-vent5858E-vent.o: In function `*Event::Event#free:Bool':
Event::Event:(.text+0x1a7): undefined reference to `event_free'
collect2: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/kost/.cache/crystal/crystal-run-test.tmp'  -rdynamic  -lpcre -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

Here's additional info:

[kost@dev]% cat /etc/redhat-release
CentOS release 6.9 (Final)

[kost@dev]% ldconfig -p | grep event
	libevent_extra-1.4.so.2 (libc6,x86-64) => /usr/lib64/libevent_extra-1.4.so.2
	libevent_core-1.4.so.2 (libc6,x86-64) => /usr/lib64/libevent_core-1.4.so.2
	libevent-1.4.so.2 (libc6,x86-64) => /usr/lib64/libevent-1.4.so.2
	libdevmapper-event.so.1.02 (libc6,x86-64) => /lib64/libdevmapper-event.so.1.02
	libdevmapper-event-lvm2thin.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2thin.so
	libdevmapper-event-lvm2snapshot.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2snapshot.so
	libdevmapper-event-lvm2raid.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2raid.so
	libdevmapper-event-lvm2mirror.so (libc6,x86-64) => /lib64/libdevmapper-event-lvm2mirror.so
	libdevmapper-event-lvm2.so.2.02 (libc6,x86-64) => /lib64/libdevmapper-event-lvm2.so.2.02

[kost@dev]% crystal --version
Crystal 0.24.1 (2017-12-22)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu

[kost@dev]% cc --version
cc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Ready to submit more diagnostic info as needed.

Thanks for all your efforts.

@S-YOU

This comment has been minimized.

S-YOU commented Jan 28, 2018

May be you could try with --link-flags "-L/usr/lib64"

@zarianu

This comment has been minimized.

zarianu commented Jan 28, 2018

@S-YOU Nice point, but I forgot to mention that I tried without any result :(

[kost@dev]% crystal run --link-flags "-L/usr/lib64" test.cr
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, Fiber, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0xbf): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor+, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x15f): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x1ef): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, File, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x27f): undefined reference to `event_new'
E-vent5858E-vent.o: In function `*Event::Event#free:Bool':
Event::Event:(.text+0x1a7): undefined reference to `event_free'
collect2: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/kost/.cache/crystal/crystal-run-test.tmp' -L/usr/lib64 -rdynamic  -lpcre -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

@zarianu zarianu closed this Jan 28, 2018

@zarianu zarianu reopened this Jan 28, 2018

@ysbaddaden

This comment has been minimized.

Member

ysbaddaden commented Jan 28, 2018

You need libevent2 not libevent 1.x.

@zarianu

This comment has been minimized.

zarianu commented Jan 29, 2018

@ysbaddaden that's strange, because this version of libevent was installed by crystal package intself (from https://dist.crystal-lang.org/rpm/ repo).

[kost@dev]% repoquery --requires --recursive --resolve --pkgnarrow=all crystal | grep event
libevent-devel-0:1.4.13-4.el6.x86_64
libevent-devel-0:1.4.13-4.el6.i686

Just tried it on clean updated CentOS 6.9 as a doublecheck - same results.

@bcardiff

This comment has been minimized.

Member

bcardiff commented Jan 29, 2018

@zarianu could you confirm if this also happened in 0.23.1 ?
For 0.24.1 the packaging for 64 bits version was redone and maybe some dependency needs to be improved.
Note that the 0.24.1 packaging for 32 bits is the same as in 0.23.1.

@zarianu

This comment has been minimized.

zarianu commented Jan 29, 2018

@bcardiff just installed 0.23.1, same results:

[kost@dev]% crystal version
Crystal 0.23.1 [e2a1389e8] (2017-07-13) LLVM 3.8.1
[kost@dev]% crystal test.cr
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0xbf): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, IO::FileDescriptor+, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x14f): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, File, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x1ff): undefined reference to `event_new'
E-vent5858B-ase.o: In function `*Event::Base#new_event<Int32, LibEvent2::EventFlags, Fiber, &Proc(Int32, LibEvent2::EventFlags, Pointer(Void), Nil)>:Event::Event':
Event::Base:(.text+0x28f): undefined reference to `event_new'
E-vent5858E-vent.o: In function `*Event::Event#free:Bool':
Event::Event:(.text+0x197): undefined reference to `event_free'
collect2: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/kost/.cache/crystal/crystal-run-test.tmp'  -rdynamic  -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

@ysbaddaden

This comment has been minimized.

Member

ysbaddaden commented Jan 29, 2018

This is a Centos vs Fedora packaging compatibility issue. Centos provides both libevent (v1.4) and libevent2 (2.0) whereas Fedora only has libevent (2.0). The same RPM package can't be defined/installed properly for both, it would seem?

@zarianu

This comment has been minimized.

zarianu commented Jan 29, 2018

I've installed last release from .tar.gz and it works like a charm (with libevent2-devel package installed).

But libevent2-devel conflicts with libevent-devel so this might be a problem in some cases.

@RX14

This comment has been minimized.

Member

RX14 commented Jan 29, 2018

This kind of problem is exactly why we should work to get crystal into distro packages, not work to make our own standalone packages.

@clery

This comment has been minimized.

clery commented Jun 5, 2018

Hey guys, is there any solution for this issue ?

@RX14

This comment has been minimized.

Member

RX14 commented Jun 6, 2018

@plassa-b install the libevent2-devel package.

@clery

This comment has been minimized.

clery commented Jun 6, 2018

Yes but if I do this, the libevent-devel package conflicts with libevent2-devel. But if I uninstall libevent-devel, I can't install crystal because it requires libevent-devel.
So is a new rpm iteration planned ?

@RX14

This comment has been minimized.

Member

RX14 commented Jun 7, 2018

We'd need to have seperate RPMs for fedora and centos which differ only in the lists of dependencies. Shouldn't be too hard technically but then that requires 2 rpm repositories and changes all over the place in the packaging setup and instructions. So for now i'd say it's low priority since you can always use the tar.gz package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment