Jump to page: 1 24  
Page
Thread overview
ImportC and #include files
Apr 27, 2023
Walter Bright
Apr 28, 2023
bachmeier
Apr 28, 2023
bachmeier
Apr 28, 2023
some_d_user
Apr 28, 2023
Walter Bright
Apr 29, 2023
Walter Bright
May 04, 2023
jmh530
May 05, 2023
bachmeier
May 05, 2023
bachmeier
May 06, 2023
jmh530
May 06, 2023
Walter Bright
May 06, 2023
bachmeier
May 06, 2023
jmh530
May 08, 2023
jmh530
May 08, 2023
bachmeier
May 08, 2023
jmh530
May 08, 2023
jmh530
May 08, 2023
bachmeier
May 08, 2023
jmh530
May 08, 2023
bachmeier
May 08, 2023
jmh530
May 08, 2023
Walter Bright
May 08, 2023
jmh530
May 11, 2023
jmh530
May 05, 2023
bachmeier
Apr 28, 2023
Walter Bright
Apr 29, 2023
Max Samukha
Apr 29, 2023
Walter Bright
Apr 30, 2023
Max Samukha
Apr 29, 2023
bachmeier
Apr 29, 2023
Walter Bright
Apr 29, 2023
bachmeier
Apr 29, 2023
bachmeier
May 02, 2023
Max Samukha
May 03, 2023
jmh530
May 03, 2023
bachmeier
May 03, 2023
jmh530
May 12, 2023
Andrej Mitrovic
May 12, 2023
Walter Bright
May 25, 2023
a11e99z
April 27, 2023
It turns out that every platform we support has "Standard" .h files that won't compile with Standard C11. They all rely on multiple extensions, each platform with a different set of reliances (usually unnecessary).

We cannot fix those .h files, we can only fix #ImportC so they work. There has been considerable progress on that front.

But I could use some help.

Try using ImportC on various popular C .h files on your platform. For the ones that fail to compile, please find the offending few lines of code and post them to bugzilla. (Just the error message and the name of the .h file is not enough, several of this sort have been posted to bugzilla, but sadly I can do nothing with them because I don't have those .h files.)

Of particular interest would be the Deimos project, as it would be good to make Deimos obsolete.

Thanks! Every .h file we can make work makes ImportC that much more useful. It's a high leverage activity for time invested.
April 28, 2023
On Thursday, 27 April 2023 at 20:16:32 UTC, Walter Bright wrote:

> Try using ImportC on various popular C .h files on your platform. For the ones that fail to compile, please find the offending few lines of code and post them to bugzilla. (Just the error message and the name of the .h file is not enough, several of this sort have been posted to bugzilla, but sadly I can do nothing with them because I don't have those .h files.)

Looks like you've made a lot of progress the last few months. I was going to file some bug reports to help you out. I tested DMD (latest commit on Github) with a couple of C programs that were not close to compiling in late December. Unfortunately there were no issues today. There was no difference when compiling and running using dmd or gcc.
April 28, 2023

On Friday, 28 April 2023 at 14:25:39 UTC, bachmeier wrote:

>

On Thursday, 27 April 2023 at 20:16:32 UTC, Walter Bright wrote:

>

Try using ImportC on various popular C .h files on your platform. For the ones that fail to compile, please find the offending few lines of code and post them to bugzilla. (Just the error message and the name of the .h file is not enough, several of this sort have been posted to bugzilla, but sadly I can do nothing with them because I don't have those .h files.)

Looks like you've made a lot of progress the last few months. I was going to file some bug reports to help you out. I tested DMD (latest commit on Github) with a couple of C programs that were not close to compiling in late December. Unfortunately there were no issues today. There was no difference when compiling and running using dmd or gcc.

In case anyone is curious about the details, I compiled test programs in the GNU Scientific Library. One was for function minimization and the other random number generation.

Compiling with gcc:

gcc test.c -I../../gsl-2.7.1 -I/usr/include -L/usr/lib/x86_64-linux-gnu/ -lgsl -lgslcblas -lm

Compiling with dmd:

dmd test.c -P-I../../gsl-2.7.1 -I/usr/include -I/usr/lib/x86_64-linux-gnu/ -L-lgsl -L-lgslcblas -L-lm
April 28, 2023

On Friday, 28 April 2023 at 14:35:25 UTC, bachmeier wrote:

>

On Friday, 28 April 2023 at 14:25:39 UTC, bachmeier wrote:

>

On Thursday, 27 April 2023 at 20:16:32 UTC, Walter Bright wrote:

>

Try using ImportC on various popular C .h files on your platform. For the ones that fail to compile, please find the offending few lines of code and post them to bugzilla. (Just the error message and the name of the .h file is not enough, several of this sort have been posted to bugzilla, but sadly I can do nothing with them because I don't have those .h files.)

Looks like you've made a lot of progress the last few months. I was going to file some bug reports to help you out. I tested DMD (latest commit on Github) with a couple of C programs that were not close to compiling in late December. Unfortunately there were no issues today. There was no difference when compiling and running using dmd or gcc.

In case anyone is curious about the details, I compiled test programs in the GNU Scientific Library. One was for function minimization and the other random number generation.

Compiling with gcc:

gcc test.c -I../../gsl-2.7.1 -I/usr/include -L/usr/lib/x86_64-linux-gnu/ -lgsl -lgslcblas -lm

Compiling with dmd:

dmd test.c -P-I../../gsl-2.7.1 -I/usr/include -I/usr/lib/x86_64-linux-gnu/ -L-lgsl -L-lgslcblas -L-lm

Appearently I'm not the only one interested in mathematical optimization ;)
I tried to build one of the examples of https://github.com/scipopt/scip (linking against a gcc compiled binary) and dmd screwed up on "assert(scip != NULL);". I tracked that down to https://issues.dlang.org/show_bug.cgi?id=23864 which seems to be caused by my system headers.

April 28, 2023
On 4/28/2023 7:25 AM, bachmeier wrote:
> Looks like you've made a lot of progress the last few months. I was going to file some bug reports to help you out. I tested DMD (latest commit on Github) with a couple of C programs that were not close to compiling in late December. Unfortunately there were no issues today. There was no difference when compiling and running using dmd or gcc.


Excellent!
April 28, 2023
On 4/28/2023 8:11 AM, some_d_user wrote:
> I tried to build one of the examples of https://github.com/scipopt/scip (linking against a gcc compiled binary) and dmd screwed up on "assert(scip != NULL);". I tracked that down  to https://issues.dlang.org/show_bug.cgi?id=23864 which seems to be caused by my system headers.


Thanks! I'll check it out.
April 29, 2023
On Thursday, 27 April 2023 at 20:16:32 UTC, Walter Bright wrote:
> Try using ImportC on various popular C .h files on your platform.

https://issues.dlang.org/show_bug.cgi?id=23866

Or just try to import "Windows.h", which should be in "um" subdirectory your Windows SDK's "Include" directory.
April 29, 2023
On 4/28/2023 12:03 PM, Walter Bright wrote:
> On 4/28/2023 8:11 AM, some_d_user wrote:
>> I tried to build one of the examples of https://github.com/scipopt/scip (linking against a gcc compiled binary) and dmd screwed up on "assert(scip != NULL);". I tracked that down  to https://issues.dlang.org/show_bug.cgi?id=23864 which seems to be caused by my system headers.
> 
> 
> Thanks! I'll check it out.

I have some questions for you in the bug report.
April 29, 2023
On 4/29/2023 3:09 AM, Max Samukha wrote:
> https://issues.dlang.org/show_bug.cgi?id=23866

Thanks for the help!

April 29, 2023
On Thursday, 27 April 2023 at 20:16:32 UTC, Walter Bright wrote:

> Thanks! Every .h file we can make work makes ImportC that much more useful. It's a high leverage activity for time invested.

I filed one earlier today:

https://issues.dlang.org/show_bug.cgi?id=23867

Seems to have an easy fix. I added

#define __builtin_isnan isnan

to the .c file and it compiled.
« First   ‹ Prev
1 2 3 4