www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd on ubuntu 64: how to unittest phobos with -m32?

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
So I am trying to unittest phobos in its 32-bit build on a Ubuntu64 
machine. I installed these additional packages:

sudo apt-get install libc6-dev-i386 libcurl3:i386

When I try to unittest a phobos module, e.g.:

make -f posix.mak MODEL=32 std/conv.test

I get:

/usr/bin/ld: cannot find -lcurl

What do I need to do to link libcurl/32 properly on my 64-bit platform? 
I've searched around for a while, no avail.


Thanks,

Andrei
Aug 06 2015
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 06/08/15 16:18, Andrei Alexandrescu wrote:
 So I am trying to unittest phobos in its 32-bit build on a Ubuntu64
 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit platform?
 I've searched around for a while, no avail.
Is the path were the 32bit libraries are installed in the standard search path? Otherwise add them, I'm guessing it's /usr/lib32 or something like that. BTW, the :i386 packages have never worked properly for me (they ended up uninstalling the whole GUI). I install the "ia32-libs" and "gcc-multilib" packages. -- /Jacob Carlborg
Aug 06 2015
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 8/6/15 10:30 AM, Jacob Carlborg wrote:
 On 06/08/15 16:18, Andrei Alexandrescu wrote:
 So I am trying to unittest phobos in its 32-bit build on a Ubuntu64
 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit platform?
 I've searched around for a while, no avail.
Is the path were the 32bit libraries are installed in the standard search path? Otherwise add them, I'm guessing it's /usr/lib32 or something like that.
I've added -L-L/usr/lib/i386-linux-gnu, where the 32-bit libs are on Ubuntu. Ultimately the command that fails is: gcc /tmp/parallelism.o -o /tmp/dmd_runqdeQbJ -g -m32 -L/usr/lib/i386-linux-gnu -lcurl generated/linux/debug/32/libphobos2.a -lpthread -lm -lrt Indeed some but not all of the libcurl paraphernalia does seem to be there: ls /usr/lib/i386-linux-gnu/libcurl* /usr/lib/i386-linux-gnu/libcurl.so.3 /usr/lib/i386-linux-gnu/libcurl.so.4 /usr/lib/i386-linux-gnu/libcurl.so.4.3.0 So the .a file is missing. How do I install it?
 BTW, the :i386 packages have never worked properly for me (they ended up
 uninstalling the whole GUI). I install the "ia32-libs" and
 "gcc-multilib" packages.
gcc-multilib was already installed, and: E: Package 'ia32-libs' has no installation candidate Thanks, Andrei
Aug 06 2015
prev sibling next sibling parent reply "rsw0x" <anonymous anonymous.com> writes:
On Thursday, 6 August 2015 at 14:18:09 UTC, Andrei Alexandrescu 
wrote:
 So I am trying to unittest phobos in its 32-bit build on a 
 Ubuntu64 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit 
 platform? I've searched around for a while, no avail.


 Thanks,

 Andrei
do you have gcc-multilib and g++multilib? It probably includes some necessary libraries for 32 bit compilation.
Aug 06 2015
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 8/6/15 10:37 AM, rsw0x wrote:
 On Thursday, 6 August 2015 at 14:18:09 UTC, Andrei Alexandrescu wrote:
 So I am trying to unittest phobos in its 32-bit build on a Ubuntu64
 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit
 platform? I've searched around for a while, no avail.


 Thanks,

 Andrei
do you have gcc-multilib and g++multilib? It probably includes some necessary libraries for 32 bit compilation.
Yes to the first. Just installed the second as well. In the meantime I figured I need this: sudo apt-get install libcurl4-openssl-dev:i386 However, when I tried to install it, I got: dpkg: error processing archive /var/cache/apt/archives/libcurl4-openssl-dev_7.37.1-1ubuntu3.4_i386.deb (--unpack): trying to overwrite shared '/usr/bin/curl-config', which is different from other instances of package libcurl4-openssl-dev:i386 Does this mean libcurl cannot have both 32- and 64-bit builds installed on the same machine? Andrei
Aug 06 2015
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 8/6/15 12:09 PM, Andrei Alexandrescu wrote:
 On 8/6/15 10:37 AM, rsw0x wrote:
 On Thursday, 6 August 2015 at 14:18:09 UTC, Andrei Alexandrescu wrote:
 So I am trying to unittest phobos in its 32-bit build on a Ubuntu64
 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit
 platform? I've searched around for a while, no avail.


 Thanks,

 Andrei
do you have gcc-multilib and g++multilib? It probably includes some necessary libraries for 32 bit compilation.
Yes to the first. Just installed the second as well. In the meantime I figured I need this: sudo apt-get install libcurl4-openssl-dev:i386 However, when I tried to install it, I got: dpkg: error processing archive /var/cache/apt/archives/libcurl4-openssl-dev_7.37.1-1ubuntu3.4_i386.deb (--unpack): trying to overwrite shared '/usr/bin/curl-config', which is different from other instances of package libcurl4-openssl-dev:i386 Does this mean libcurl cannot have both 32- and 64-bit builds installed on the same machine?
Update: I installed libcurl4-gnutls-dev:i386 instead. That seems to not conflict with libcurl4-openssl-dev and did go through. Subsequently things do seem to work. I've updated the intro: http://wiki.dlang.org/Starting_as_a_Contributor#0._Prerequisites Andrei
Aug 06 2015
prev sibling parent "rsw0x" <anonymous anonymous.com> writes:
On Thursday, 6 August 2015 at 16:09:16 UTC, Andrei Alexandrescu 
wrote:
 On 8/6/15 10:37 AM, rsw0x wrote:
 On Thursday, 6 August 2015 at 14:18:09 UTC, Andrei 
 Alexandrescu wrote:
 [...]
do you have gcc-multilib and g++multilib? It probably includes some necessary libraries for 32 bit compilation.
Yes to the first. Just installed the second as well. In the meantime I figured I need this: sudo apt-get install libcurl4-openssl-dev:i386 However, when I tried to install it, I got: dpkg: error processing archive /var/cache/apt/archives/libcurl4-openssl-dev_7.37.1-1ubuntu3.4_i386.deb (--unpack): trying to overwrite shared '/usr/bin/curl-config', which is different from other instances of package libcurl4-openssl-dev:i386 Does this mean libcurl cannot have both 32- and 64-bit builds installed on the same machine? Andrei
Sounds weird. Sorry, I don't use ubuntu/debian. Is your system fully up to date?
Aug 06 2015
prev sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Thursday, 6 August 2015 at 14:18:09 UTC, Andrei Alexandrescu 
wrote:
 So I am trying to unittest phobos in its 32-bit build on a 
 Ubuntu64 machine. I installed these additional packages:

 sudo apt-get install libc6-dev-i386 libcurl3:i386

 When I try to unittest a phobos module, e.g.:

 make -f posix.mak MODEL=32 std/conv.test

 I get:

 /usr/bin/ld: cannot find -lcurl

 What do I need to do to link libcurl/32 properly on my 64-bit 
 platform? I've searched around for a while, no avail.


 Thanks,

 Andrei
aptitude install libcurl-dev:i386 You need the 32 bits version of the libs to make that work.
Aug 06 2015