March 27, 2011
On 2011-03-27 21:24, Ishan Thilina wrote:
> @Jacob:
>
> An error comes when the " ./dvm install dvm" command is given.
>
> "
> ./dvm: error while loading shared libraries: libz.so.1: cannot open shared object
> file: No such file or directory

You don't have libz installed? Oh, you're running 64bit, you need to install 32bit libraries. I also forgot to mention that DVM currently only installs the 32bit version of DMD. The 64bit version is quite new, don't know if it's experimental, alpha or beta.

>
> @Trass3r:
>
> No, dmd.conf in the dmd2/linux/bin is there safely

-- 
/Jacob Carlborg
March 27, 2011
On 2011-03-27 13:20, Jacob Carlborg wrote:
> On 2011-03-27 21:24, Ishan Thilina wrote:
> > @Jacob:
> > 
> > An error comes when the " ./dvm install dvm" command is given.
> > 
> > "
> > ./dvm: error while loading shared libraries: libz.so.1: cannot open
> > shared object file: No such file or directory
> 
> You don't have libz installed? Oh, you're running 64bit, you need to install 32bit libraries. I also forgot to mention that DVM currently only installs the 32bit version of DMD. The 64bit version is quite new, don't know if it's experimental, alpha or beta.

Probably alpha. I believe that it mostly works, but there are still plenty of bugs to find, I'm sure.

However, depending on what you mean by "installing" the compiler, there is no 32-bit vs 64-bit version. Only the libraries differ. There is only a 32-bit binary for the compiler, and you pass it -m64 if you want it to compile 64-bit binaries. So, if your tool deals with the compiler only, then 32-bit vs 64-bit is currently a moot point. On the other hand, if it deals with the standard libraries too (as it probably does), then 32-bit vs 64-bit _is_ an issue, but it isn't an issue for the compiler itself. And unless you're not using the standard dmd.conf as part of switching compilers, there would already be a difference in the library layout once 64-bit compilation was introduced, since the 32-bit Phobos was moved from dmd2/linux/lib to dmd2/linux/lib32 (with the 64-bit version in dmd2/linux/lib64). And if you made the lib32 change, then having it work with 64-bit is likely trivial. And if you didn't make such a change, you're going to have to eventually. Personally, I don't see tha alpha quality of the 64-bit code generation to be a reason not to support it. It's been released. But then again, I don't use your tool at all and find no need for it, so it's not like I'm one of your users.

- Jonathan M Davis
March 28, 2011
On 2011-03-27 23:05, Jonathan M Davis wrote:
> On 2011-03-27 13:20, Jacob Carlborg wrote:
>> On 2011-03-27 21:24, Ishan Thilina wrote:
>>> @Jacob:
>>>
>>> An error comes when the " ./dvm install dvm" command is given.
>>>
>>> "
>>> ./dvm: error while loading shared libraries: libz.so.1: cannot open
>>> shared object file: No such file or directory
>>
>> You don't have libz installed? Oh, you're running 64bit, you need to
>> install 32bit libraries. I also forgot to mention that DVM currently
>> only installs the 32bit version of DMD. The 64bit version is quite new,
>> don't know if it's experimental, alpha or beta.
>
> Probably alpha. I believe that it mostly works, but there are still plenty of
> bugs to find, I'm sure.
>
> However, depending on what you mean by "installing" the compiler, there is no
> 32-bit vs 64-bit version. Only the libraries differ. There is only a 32-bit
> binary for the compiler, and you pass it -m64 if you want it to compile 64-bit
> binaries. So, if your tool deals with the compiler only, then 32-bit vs 64-bit
> is currently a moot point. On the other hand, if it deals with the standard
> libraries too (as it probably does), then 32-bit vs 64-bit _is_ an issue, but
> it isn't an issue for the compiler itself. And unless you're not using the
> standard dmd.conf as part of switching compilers, there would already be a
> difference in the library layout once 64-bit compilation was introduced, since
> the 32-bit Phobos was moved from dmd2/linux/lib to dmd2/linux/lib32 (with the
> 64-bit version in dmd2/linux/lib64). And if you made the lib32 change, then
> having it work with 64-bit is likely trivial. And if you didn't make such a
> change, you're going to have to eventually. Personally, I don't see tha alpha
> quality of the 64-bit code generation to be a reason not to support it. It's
> been released. But then again, I don't use your tool at all and find no need
> for it, so it's not like I'm one of your users.
>
> - Jonathan M Davis

What I meant with "installing" is that he shouldn't expect to be able to produce 64bit binaries with a DMD installed with my tool.

I have changed the tool to handle the lib -> lib32/lib64 change. It is a trivial change to make the 64bit installation possible. The reason I have made that change yet is a couple of reasons:

* I was planning to refactor the whole tool into a library and a tool using that library. I was planning to wait with all the new functionality until after the refactoring was done.

* I'm not 100% how I want the default behavior to be. When the 64bit is mature enough that will probably be the default when running on a 64bit machine and otherwise 32bit. I will also provide an option to installed the non-native library as well. The question is, what should be the default behavior now on a 64bit machine, 32bit or 64bit?

Yes, I do have a custom dmd.conf. No reason to put the "bin" folder in an extra folder just because that's the layout in the zip file.

I guess you're right, that I shouldn't blame the current status of the 64bit code generation as a reason not to support installing it. Just thought it was easier to explain it that way the more complete explanation I gave here.

I do know that the compiler can produce both 32 and 64bit binaries and the only difference is the standard library.

-- 
/Jacob Carlborg
March 28, 2011
@Jonathan:

Yeah I checked. It's there :s. I dont know what has gone wrong, but I'm using the default settings . I have GDC installed too. Can this have any connection with this problem( just a wild guess ) ?

@Jacob:

I wasn't sure about which libraries you were talking about. The only lib set I left out was ia32-libs. So I installed it too.That didn't solve the problem. So I tried to install the deb file by force.

"sudo dpkg -i --force-architecture dmd***.dmd"

now I get a whole lot more errors :s.

"
ishan@ishan-Ubu-I1464:~/Geany Projects$ dmd untitle.d
/usr/include/d/dmd/phobos/object.d(51): C-style function pointer and pointer to
array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/format.d(672): no identifier for declarator
inout(fakevalue)
/usr/include/d/dmd/phobos/std/c/stdlib.d(43): C-style function pointer and pointer
to array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/c/stdlib.d(59): C-style function pointer and pointer
to array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/c/linux/linux.d(558): C-style function pointer and
pointer to array syntax is deprecated. Use 'function' to declare function pointers
/usr/include/d/dmd/phobos/std/c/linux/linux.d(574): C-style function pointer and
pointer to array syntax is deprecated. Use 'function' to declare function pointers
"

I'm trying to compile the following simple code. As you can see it should work without any problem.

"
import std.stdio;



int main()

{

	writefln("Hello world");



	return 0;

}

"
"
March 28, 2011
On 03/28/2011 04:49 PM, Ishan Thilina wrote:

> now I get a whole lot more errors :s.
>
> "
> ishan@ishan-Ubu-I1464:~/Geany Projects$ dmd untitle.d
> /usr/include/d/dmd/phobos/object.d(51): C-style function pointer and pointer to
> array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/format.d(672): no identifier for declarator
> inout(fakevalue)
> /usr/include/d/dmd/phobos/std/c/stdlib.d(43): C-style function pointer and pointer
> to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/stdlib.d(59): C-style function pointer and pointer
> to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/linux/linux.d(558): C-style function pointer and
> pointer to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/linux/linux.d(574): C-style function pointer and
> pointer to array syntax is deprecated. Use 'function' to declare function pointers
> "
>
> I'm trying to compile the following simple code. As you can see it should work
> without any problem.
>
> "
> import std.stdio;
>
>
>
> int main()
>
> {
>
> 	writefln("Hello world");
>
>
>
> 	return 0;
>
> }

I have no idea why and where your issues in using D with dmd come from. AFAIK, it just works out of the box if you use release versions.

Just 2 notes about the piece of code:
First, you often do not need in D a program result code (int).
Second, writefln, as opposed to writeln, expects a format string as first argument.

void main () {
    writeln("Hello, world!");
    auto userName = "Otto";
    writefln("Hello, %s!", userName);
}

Denis
-- 
_________________
vita es estrany
spir.wikidot.com

March 29, 2011
On 2011-03-28 16:49, Ishan Thilina wrote:
> @Jonathan:
>
> Yeah I checked. It's there :s. I dont know what has gone wrong, but I'm using the
> default settings . I have GDC installed too. Can this have any connection with
> this problem( just a wild guess ) ?
>
> @Jacob:
>
> I wasn't sure about which libraries you were talking about. The only lib set I
> left out was ia32-libs. So I installed it too.That didn't solve the problem. So I
> tried to install the deb file by force.

To run 32bit applications on a 64bit machine you need 32bit compatible runtime libraries, regardless if you run my installation tool or dmd (dmd is a 32bit tool even thought it can produce 64bit binaries). I don't know what exact runtime libraries are needed but for my tool you need the regular runtime libraries you would need running any kind of 32bit application and 32bit version of libz.

> "sudo dpkg -i --force-architecture dmd***.dmd"
>
> now I get a whole lot more errors :s.
>
> "
> ishan@ishan-Ubu-I1464:~/Geany Projects$ dmd untitle.d
> /usr/include/d/dmd/phobos/object.d(51): C-style function pointer and pointer to
> array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/format.d(672): no identifier for declarator
> inout(fakevalue)
> /usr/include/d/dmd/phobos/std/c/stdlib.d(43): C-style function pointer and pointer
> to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/stdlib.d(59): C-style function pointer and pointer
> to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/linux/linux.d(558): C-style function pointer and
> pointer to array syntax is deprecated. Use 'function' to declare function pointers
> /usr/include/d/dmd/phobos/std/c/linux/linux.d(574): C-style function pointer and
> pointer to array syntax is deprecated. Use 'function' to declare function pointers
> "
>
> I'm trying to compile the following simple code. As you can see it should work
> without any problem.
>
> "
> import std.stdio;
>
>
>
> int main()
>
> {
>
> 	writefln("Hello world");
>
>
>
> 	return 0;
>
> }
>
> "
> "


-- 
/Jacob Carlborg
March 29, 2011
On 3/27/11 12:28 PM, Ishan Thilina wrote:
> When I give "dmd untitled.d" command in my ubuntu maverick 64 bit laptop I get
> the following error.
>
> "
> object.d: Error: module object is in file 'object.d' which cannot be read
> import path[0] = /etc/../../src/phobos
> import path[1] = /etc/../../src/druntime/import
> "

Your dmd.conf doesn't have the correct include path for Phobos. If you post it here, along with the location of the Phobos sources (the directory that contains object.di) on your system, we might be able to give you a detailed description of how to resolve this issue.

David
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home