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

mapscript-perl 6.2.0 does not link to libmapserver #4528

Closed
heikoklein opened this issue Nov 21, 2012 · 16 comments
Closed

mapscript-perl 6.2.0 does not link to libmapserver #4528

heikoklein opened this issue Nov 21, 2012 · 16 comments

Comments

@heikoklein
Copy link

mapscript-perl in release 6.2.0 does not link to libmapserver and thus does not work at all.

In Makefile.PL.in the libraries link to -lmapserver, which is not installed in /usr/lib at that stage, and perl therefore removes that libraries.

Adding the build-directories library like

$libs = "-L$libdir -L$home/.libs -lmapserver";

links to libmapserver, both in /usr/lib and mapserver-6.2.0/.libs.

Heiko

@unicolet
Copy link
Contributor

I have just downloaded and built mapserver and perl mapscript 6.2.0 on my
machine (Ubuntu 12 LTS i686) correctly as follows:

cd mapserver-6.2.0
./configure
make
sudo make install
cd mapscript/perl
perl Makefile.pl
make
sudo make install
cat > /etc/ld.so.conf.d/mapserver.conf <<EOF
/usr/local/lib
EOF
sudo ldconfig
cd examples
perl RFC24.pl ../../../tests/test.map
testGetLayerObj PASSED
testGetLayerObjByName PASSED
testLayerObj PASSED
testInsertLayerObj position PASSED
testInsertLayerObj notnull PASSED
testGetClassObj PASSED
testClassObj PASSED
testInsertClassObj position PASSED
testInsertClassObj notnull PASSED
checking that hashmap of parent ptrs is empty PASSED
No of keys:0
Dumping hashmap: HASH(0x9b0d5b0)

Note the ldconfig step, perhaps that's what you are missing?

HTH,
Umberto

On Wed, Nov 21, 2012 at 12:13 PM, heikoklein notifications@github.comwrote:

mapscript-perl in release 6.2.0 does not link to libmapserver and thus
does not work at all.

In Makefile.PL.in the libraries link to -lmapserver, which is not
installed in /usr/lib at that stage, and perl therefore removes that
libraries.

Adding the build-directories library like

$libs = "-L$libdir -L$home/.libs -lmapserver";

links to libmapserver, both in /usr/lib and mapserver-6.2.0/.libs.

Heiko


Reply to this email directly or view it on GitHubhttps://github.com//issues/4528.

@heikoklein
Copy link
Author

If you install mapserver before building the perl-library, you are right and mapscript-perl works.

But if you omit the step

sudo make install

before

cd mapscript/perl
perl Makefile.pl

it doesn't work.

Usually, 'make install' is the last step, or in the case of building debian packages, it never happens on the same machine.

@unicolet
Copy link
Contributor

With the recent move to libtool make install is now required for all
mapscript languages to work, as they depend on the shared library.
Unless you feel this is totally inappropriate (and even then I'm not sure
which options there are to improve this) do you think we can close this
issue?

On Wed, Nov 21, 2012 at 2:34 PM, heikoklein notifications@github.comwrote:

If you install mapserver before building the perl-library, you are right
and mapscript-perl works.

But if you omit the step

sudo make install

before

cd mapscript/perl
perl Makefile.pl

it doesn't work.

Usually, 'make install' is the last step, or in the case of building
debian packages, it never happens on the same machine.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4528#issuecomment-10596941.

@heikoklein
Copy link
Author

Do you mean 'with the recent move to libtool' the recent move to shared libraries? I understand that libmapserver.so needs to be installed, but I don't think it should be a requirement that it is installed in the middle of the build-process. Adding the build-directory as additional and temporary library directory is very usual for multi-library builds to come around the issue of installation order.

I send a patch to the ubuntu-maintainer of mapserver, since it must be fixed there for 6.2.0. I'd rather see a patch in the sources for 6.2.1 than a permanent patch in debian-packages.

@unicolet
Copy link
Contributor

@heikoklein For mapserver move to libtool === move to shared libraries

perhaps you could open a pull request with the proposed changes? I'd be glad to assist you.

@ghost ghost assigned unicolet Nov 21, 2012
@heikoklein
Copy link
Author

I'm not familiar to work with git/github, and since it is only a one line change, here is the patch:

--- a/mapscript/perl/Makefile.PL.in
+++ b/mapscript/perl/Makefile.PL.in
@@ -18,7 +18,8 @@

 $libs = <STREAM>;
 chomp $libs;
-$libs = "-L$libdir -lmapserver";
+# libmapserver.la not used here
+$libs = "-L$libdir -L$home/.libs -lmapserver";

 $static_libs = <STREAM>;
 chomp $static_libs;

@aboudreault
Copy link
Member

My coworker received the patch. He will be able to include it in UbuntuGIS tomorrow. @unicolet can you take care of pushing this patch in branch-6-2 ? Thanks @heikoklein

@unicolet
Copy link
Contributor

I can do it, but I propose we should check all other mapscripts as well.
I'm sure that at least java mapscript behaves as perl (there's a thread in
the ml).

On Wed, Nov 21, 2012 at 3:18 PM, Alan Boudreault
notifications@github.comwrote:

My coworker received the patch. He will be able to include it in UbuntuGIS
tomorrow. @unicolet https://github.com/unicolet can you take care of
pushing this patch in branch-6-2 ? Thanks @heikokleinhttps://github.com/heikoklein


Reply to this email directly or view it on GitHubhttps://github.com//issues/4528#issuecomment-10598451.

@jlarouche
Copy link
Contributor

Fixed in UbuntuGIS. Thanks for your patch.

unicolet added a commit that referenced this issue Feb 14, 2013
@unicolet
Copy link
Contributor

Pushed a fix for java, perl, ruby and python in 6-2 branch:

a4ac07d

If it's ok with you I will push it to master too.

unicolet added a commit that referenced this issue Feb 15, 2013
@unicolet
Copy link
Contributor

User reported success on ML.
Cherry picked in master, closing

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
@tbonfort
Copy link
Member

reopening, this fix has broken the builds for other packagers, c.f. http://osgeo-org.1560.x6.nabble.com/RPATH-build-error-for-v6-2-1-td5049992.html (cc /@kalxas) . Putting .libs in the LDFLAGS is clearly not a correct solution,we may need to fallback linking mapscripts to a static mapserver library...

@tbonfort tbonfort reopened this Apr 29, 2013
@unicolet
Copy link
Contributor

unicolet commented May 3, 2013

We have other options besides static linking: tell the user to define NO_BRP_CHECK_RPATH in the spec file to disable RPATH checking or implementing a --disable-rpath in the mapserver configure (disabled by default).

@tbonfort
Copy link
Member

tbonfort commented May 3, 2013

Linking to .libs/libmapserver.so is incorrect and should be removed. Conceptually, mapscript and mapserver are separate entities and therefore it's not surprising that we're having issues when linking against the uninstalled version of libmapserver in perl mapscript as the perl build is not using libtool. I would say our options are:

  • require libmapserver to be installed before buidling perl mapscript
  • make the perl build use libtool, but that does not seem trivial
  • link against the static version of mapserver

disabling the rpath checks in the rpm is not the solution, as that test has clearly showed that we are incorrectly linking perl mapscript against an uninstalled version of libmapserver.

@unicolet
Copy link
Contributor

unicolet commented May 7, 2013

Note that in the build log referenced by the email mapscript is not linked against an uninstalled version of mapserver, but against the current build, so no error there.

A proposed fix would be to disable rpath checks while I figure it out. I'll keep this open so that I remember to fix it.

@unicolet
Copy link
Contributor

closing old issues

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

No branches or pull requests

5 participants