Skip to content
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

Add library check to extconf #4

Closed
wants to merge 1 commit into from
Closed

Conversation

gemmaro
Copy link

@gemmaro gemmaro commented Aug 16, 2024

This might alleviate the following error on some environments (e.g. Guix):

ruby: symbol lookup error: /.../lib/edlib/edlibext.so: undefined symbol: edlibAlign

* ext/edlib/extconf.rb: Add edlib library check.
@kojix2
Copy link
Owner

kojix2 commented Aug 16, 2024

Hi @gemmaro
Thank you for the pull request.
However, the edlib gem contains the edlib source code (edlib.h and edlib.cpp) in the ext/edlib directory.
So, it shouldn't need any system library.

The error message says edlibext does not contain edlibAlign, but that shouldn't happen. What's wrong with it?

@gemmaro
Copy link
Author

gemmaro commented Aug 16, 2024

Hi @gemmaro Thank you for the pull request. However, the edlib gem contains the edlib source code (edlib.h and edlib.cpp) in the ext/edlib directory. So, it shouldn't need any system library.

Thank you for your prompt reply.
You are correct. This gem contains the original sources, so installing it with e.g. Bundler should work nicely.

The error message says edlibext does not contain edlibAlign, but that shouldn't happen. What's wrong with it?

I find that I've tried to use an already installed edlib shared library for this gem manually.

It can be insatiable to have the option, which uses the system library rather than the bundled one.

@kojix2
Copy link
Owner

kojix2 commented Aug 16, 2024

Using system libraries is important, but even without Bundler, gem should compile automatically.
I think edlib.cpp is not being used in the compilation. After deleting edlib.cpp, I ran:

bundle exec rake compile
bundle exec rake test

Compilation succeeded, but the same error occurred.

|/home/kojix2/.rbenv/versions/3.3.3/bin/ruby: symbol lookup error: /home/kojix2/Ruby/ruby-edlib/lib/edlib/edlibext.so: undefined symbol: edlibAlign

To investigate further:

cd ext/edlib/

Run ruby extconf.rb. A Makefile will be generated. I suspect ORIG_SRCS only lists edlibext.c without edlib.cpp.
Could you check that if you don't mind?

@gemmaro
Copy link
Author

gemmaro commented Aug 16, 2024

Using system libraries is important, but even without Bundler, gem should compile automatically.

Yes. To be more precise, RubyGems is indispensable.

I think edlib.cpp is not being used in the compilation. After deleting edlib.cpp, I ran:

[...]

Run ruby extconf.rb. A Makefile will be generated. I suspect ORIG_SRCS only lists edlibext.c without edlib.cpp. Could you check that if you don't mind?

It's true, ORIG_SRCS only has edlibext.c.
In my setup, I also deleted edlib.h altogether. And it has been working fine.


The problem with my pull request is that it requires the system library unconditionally. I'm closing this.

@gemmaro gemmaro closed this Aug 16, 2024
@kojix2
Copy link
Owner

kojix2 commented Aug 16, 2024

I would like to know why edlib.cpp in the same directory as edlibext.c is not used for compilation on Guix. Maybe I am missing something in extconf.rb to use the C++ source code.

I don't remember when I made this gem, but maybe the version of official edlib deb package on Ubuntu was out of date and I wanted to use the latest version of edlib. But now it's a bit old, so maybe the system edlib would be fine.
Thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants