-
Notifications
You must be signed in to change notification settings - Fork 418
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
/usr/bin/ld: cannot find -ltidy #190
Comments
@skynet, well at this point we are generating a libtidy5.so.4.9.23, aka -ltidy5, so an install of this version will not clobber any existing tidy install, so comparisons can be made... This will only be changed to 'libtidy.so...', aka -ltidy on the eventual release of tidy 5.0.0. In preparation for this name change I have just pushed a modified CMakeLists.txt using a macro for the name, like set(LIB_NAME tidy5). So do another pull... Taking a quick look in php-5.6.7 configure I can see (a) it seems to support both the static and shared libtidy, and (b) for sure it is searching for 'tidy', as it should, NOT 'tidy5'. Not sure how you could change that to seeking 'tidy5'... but there would be a way... But if you want to test compile with php as is, then just change the name in line 5 of CMakeLists.txt to set(LIB_NAME tidy), and recompile, install... Hope this helps, and look forward to your report of success. |
On my system I made a soft link from tidy to tidy5. That is not a repo |
@anEffingChamp thanks for that quick tip! Being mainly a 'windows' person I would never have thought of that ;=)) I took a look in my Ubuntu 14.04 and noted that the previous version of tidy installed is libtidy-0.99.so.0.0.0, and then there are 2 links -
And my new version is libtidy5.so.4.9.23, also with two links
So what, I delete the 2 current libtidy links, and then just do -
Is that it? Or have I got that in reverse? And maybe I do not need to do the deletes? And I also have 2 static libraries there, libtidy.a and libtidy5.a. Should I do anything about them? Sorry for all the questions on linux things... |
Based on the thread it sounds like we may just be looking for the compiled binary under the wrong name. |
@anEffingChamp, certainly in the @skynet case of building php from source, I think the automake tools are looking for the tidy library, not the console binary... And interestingly, in another project, that uses cmake, added a Only if I DELETED the installed static library, would it find the libtidy.so! Still to try the change-in-the-link thingy... and thanks for the pointer that And remember if you want to check EXACTLY what is being used in the compile and link add the option |
Reading around more on this Some other examples I have seem are just adding an 's' for static, tidys.lib. Others choose to change the archive name of the shared pair, like tidy_imp.lib/tidy.dll. And there are probably many other choices... And although in unix they CAN have the same base name, since one would be libtidy.a, and the other libtidy.so, the above exploration, and reading, shows libtidy.a is likely to be found first, although I have read others think this is the opposite! So also using libtidy_static.a, or libtidys.lib seems a better, clearer choice. Anyway, this is just a thought a little off topic... for discussion... ATM CMakeLists.txt builds only one or the other, and contains an option |
Can we still make it easy and ubiquitous to install tidy-html5 with php? I can also see some old PECL package: https://pecl.php.net/package/tidy. How about a new https://pecl.php.net/package/tidy-html5 |
Changed the name in line 5 of CMakeLists.txt to set(LIB_NAME tidy) Recompiled, installed. When compiling php still getting an error: /usr/bin/ld: /usr/local/lib/libtidy.a(alloc.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC |
I ended up configuring PHP without tidy-html5. I also wonder if anyone can actually compile php with it. We should make this possible again. |
@skynet as mentioned earlier it seems if you have BOTH the static And your errors indicate it found and tries to use Which PHP source are you using? If you point me to the source maybe I can download and try a compile... I agree we should be able to compile PHP with tidy5 support... |
PHP version is 5.6.9 (http://php.net/downloads.php) |
@denji do not know anything about the accuracy of the cppcheck tool, but will try to find time to test... But adding it to this thread is NOT the right places... Please perhaps delete it here and open a new issue... thanks... |
@skynet 3.6.9???? I can find the current stable release source 5.2.6... that's major version 5, not 3!!! So again from where? Is this an OLD source, or what? Are we talking about the same thing ;=)) |
5.6.9 :-) |
@geoffmcl Better small percentage of false positive (free opensource): https://scan.coverity.com/ |
Can we just make it standard and easy:
And then compiling php*:
*other php config options left out intentionally. |
@skynet but it is a new
Exactly like ./configure, cmake does configuration - checks for dependencies, etc, and then generates a Makefile... _AND_ cmake is cross-platform, so it works just as well in Wndows... Out of time tonight, but be back tomorrow... |
I don't have a problem with that, as long as it works. In order not to break all applications I had to go back to the old
@ermshiperete was able to get it right :-) |
@skynet, well so can I... and I had no trouble building php-5.6.9 ;=)) Used -
The relevant sections from the build log...
Note that I build tidy5 with The first is to ensure it is installed in The second is to ensure -DNDEBUG is added to the compile to remove Third is to build shared libraries... BIG NOTE, this presently installs as
I do also have static libtidy5.a there, but no soft link to it so other packages do not find it... If @ermshiperete does not want to support a windows build, or has kept the old very out of date MSVC stuff I supplied LONG ago, then that is fine too... CMake allows us to be fully cross-platform with ONE build system... And it works fine also ;=)) I too will be happy when we get to the 5.0.0 release stage, and the name is reset to just |
@skynet As you might have noticed, my repo hasn't been updated in a long time and is more or less in the state of this repo in 2012 with a few fixes applied (that I believe have been applied to this repo also in the meantime). I wouldn't recommend to use my fork nowadays if you want to benefit from the new features for HTML5. |
@ermshiperete have you tried This builds deb and rpm packages, and could do more, like a source tar.gz, etc... read cmake cpack capability... In Windows if you have the necessary tools installed, it presently builds -
Additionally 1 and 2 include an See http://www.htacg.org/binaries/ for a WIP on binary downloads... The links presently do NOT work properly, but will, eventually... Maybe open a new issue on this if this package build for debian/ubuntu is insufficient or wrong... |
@geoffmcl No I didn't try. But as I said, my repo hasn't been updated in a long time... |
@geoffmcl Going to test right now. So far, here I am:
Going to try to compile PHP now ... |
And here it is, new error:
|
@skynet WOW you are having a lot of TRYING fun ;=() The end of my log shows -
It looks like phar.php completed successfully for me... but no phar.phar because PEAR not installed... or something... The error message is quite confusing in that you have But maybe when given Anyway, please show me the complete list of tidy libraries installed -
There must be something screwed up here... |
Ran exactly the same setup on another new server and got into the infamous
|
http://nixos.org/patchelf.html
ldd php-5.6.9/sapi/cli/php
patchelf --set-rpath /opt/my-libs/lib:/foo/lib program |
This worked for me:
Are we talking about the same thing? I do not have the patchelf utility installed. Besides, we should be able to help others install tidy-html5 with php without too much hassle. |
@skynet |
Since ldconfig worked, do you think it's correct to use it?
|
ldconfig should always be enough for correct operation. |
You can implement the ways inside the ELF file, then no need to ldconfig:
|
Where's the ELF file? |
@skynet All Unix executable files, php build preload flag |
If fix cannot go in the tidy-html5 package we still need to include info for folks building php with tidy-html5. If possible, please submit a pull request. |
You got the above error because the system only searches in |
Okay thanks. That means - cannot fix from within tidy-html5 library. Maybe @geoffmcl can come up with an idea. |
|
Okay, but I would not bother with suggesting flags for PHP build. Again, if it can be included with the libary ok - if not, we just provide instructions. In certain circumstances it works without the flags. I built php earlier and I didn't have to run ldconfig. |
@skynet @denji wow, tried to read and understand all the above, and think I succeeded ;=)) Just a note on Thus I do not think the php config should be changed to use the In Windows on the other hand, dealing with the location of a DLL can be a real I will get around to adding this cmake module to the tidy repo in due course, and include it in the install... And if you want to try it, it is included in the tidy-test mentioned ealier - https://github.com/geoffmcl/tidy-test It seems to find and use the install tidy shared library in unix without any additional flags, or running ldconfig... I have also updated the README.md... advise if there is more to do... On the question of the version output you correctly quoted the current thinking -
And that was why tidyReleaseDate() had But your patch has now adjusted that to But that is a little off the topic of |
Here is a patch for php to use tidyLibraryVersion instead of tidyReleaseDate. Not sure how to make this work with both old and new tidy libraries in php. Reporting the unix epoch or the hard-coded 2015/01/22 is confusing and less than ideal. --- ext/tidy/tidy.c-tidy5 2015-05-13 19:02:08.000000000 -0500
+++ ext/tidy/tidy.c 2015-06-08 23:10:03.456421751 -0500
@@ -1102,7 +1102,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "Tidy support", "enabled");
- php_info_print_table_row(2, "libTidy Release", (char *)tidyReleaseDate());
+ php_info_print_table_row(2, "libTidy5 Version", (char *)tidyLibraryVersion());
php_info_print_table_row(2, "Extension Version", PHP_TIDY_MODULE_VERSION " ($Id: e066a98a414c7f79f89f697c19c4336c61bc617b $)");
php_info_print_table_end();
@@ -1357,7 +1357,7 @@
return;
}
- RETURN_STRING((char *)tidyReleaseDate(), 1);
+ RETURN_STRING((char *)tidyLibraryVersion(), 1);
}
/* }}} */ |
@mreiden This breaks backward compatibility need switcher non- |
There was an idea to mark this function deprecated, such that if used the developer would see a warning. But this was never implemented in a cross platform way. So for now revert to circa Jan 2015 when Jim added a build date to the version.txt file. And now both LIBTIDY_VERSION and RELEASE_DATE macros are established in CMakeLists.txt, and picked up in version.h. The idea is the date will now march forward with the version number, side by side in version.txt. Although have left tidy.c only emitting the version on the --version command. After this function has been marked deprecated for several release periods, only then should consideration be given to potentially removing it.
This should be cross referenced to issue #148 While the idea was to mark the So for now have reverted to what Jim added back in Jan 2015, and that is to have BOTH version and a date in the version.txt file. Then these two things can march forward together. That is each version increment will be accompanied by a date increment. Now the CMakeLists.txt emits both a LIBTIDY_VERSION and a RELEASE_DATE macro. And as @mreiden reminded me directly, both these macros are picked up in version.h. If and when we get around to clearly marking And for now our tidy.c will continue to only show the |
No comments for a few weeks, so closing this for now... Feel free to re-open, or post a new issue. |
Thank you @geoffmcl - I can now install new tidy-html5 with PHP, my problem is solved. We need to add some clear documentation though. |
@skynet glad the php link is sorted ;=)) Not sure what the Saw things like Surely most of this will disappear once we release 5.0.0 and drop the |
Clear doc for others installing PHP with tidy-html5. While you gave me plenty details on this thread, I believe that README on this repo won't get anyone closer to success. Should probably extract relevant info from this thread and include with the docs, specifically for PHP with tidy-html5 installation. And, yes, can wait for 5.0.0, and repeat the process. And then document it according to our own experience. Thanks, again, @geoffmcl ! |
Installed tidy-html5:
Building php-5.6.7 from source I get this:
Am I missing something here?
I used to do:
which actually worked.
The text was updated successfully, but these errors were encountered: