caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] use cc instead of gcc as default C compiler?
@ 2017-10-19 15:05 Christopher Zimmermann
  2017-10-22  9:20 ` SP
  2017-10-23  7:57 ` Gabriel Scherer
  0 siblings, 2 replies; 18+ messages in thread
From: Christopher Zimmermann @ 2017-10-19 15:05 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Hi,

the Ocaml configure script uses gcc as default compiler. I wonder
whether this is still a sensible default with llvm being a viable
alternative.
A more portable default would be to use plain `cc`, which will usually
be the system-wide default compiler.
This is relevant because this compiler will also be hardcoded into
ocamlopt as default c compiler.

Christopher


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-19 15:05 [Caml-list] use cc instead of gcc as default C compiler? Christopher Zimmermann
@ 2017-10-22  9:20 ` SP
  2017-10-23  7:46   ` Sébastien Hinderer
  2017-10-23  7:57 ` Gabriel Scherer
  1 sibling, 1 reply; 18+ messages in thread
From: SP @ 2017-10-22  9:20 UTC (permalink / raw)
  To: caml-list


[-- Attachment #1.1: Type: text/plain, Size: 304 bytes --]

On 19/10/2017 16:05, Christopher Zimmermann wrote:
> A more portable default would be to use plain `cc`, which will usually
> be the system-wide default compiler.

A sensible idea. Wonder what the devs have to say?

Maybe if you made a pull request for this they would accept it.

-- 
    SP


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-22  9:20 ` SP
@ 2017-10-23  7:46   ` Sébastien Hinderer
  0 siblings, 0 replies; 18+ messages in thread
From: Sébastien Hinderer @ 2017-10-23  7:46 UTC (permalink / raw)
  To: caml-list

Hi,

Will look into it and give feedback here ASAP.

Thanks a lot for the suggestion!

Sébastien.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-19 15:05 [Caml-list] use cc instead of gcc as default C compiler? Christopher Zimmermann
  2017-10-22  9:20 ` SP
@ 2017-10-23  7:57 ` Gabriel Scherer
  2017-10-23 19:34   ` SP
  2017-10-23 19:41   ` Christopher Zimmermann
  1 sibling, 2 replies; 18+ messages in thread
From: Gabriel Scherer @ 2017-10-23  7:57 UTC (permalink / raw)
  To: Christopher Zimmermann; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 1386 bytes --]

My guess is that cc is a broken compiler on many exotic operating system
(or at least was when the ./configure was first written in the nineties),
and in particular does not support the (modest) gcc extensions that the
runtime relies on. Using a standardized (yet portable) compiler was deemed
an easier path to configure the OCaml distribution build system than trying
to support the oddities of every Unix's C compiler under the sun.

Note that the compiler distribution builds just fine under MacOS, which now
uses Clang (llvm) instead of GCC -- and that you can configure the C
compiler you want to use with (./configure -cc ...). I don't see what is
the problem here; and I would think that opting to choose GCC by default is
still a perfectly reasonable choice today.



On Thu, Oct 19, 2017 at 5:05 PM, Christopher Zimmermann <
christopher@gmerlin.de> wrote:

> Hi,
>
> the Ocaml configure script uses gcc as default compiler. I wonder
> whether this is still a sensible default with llvm being a viable
> alternative.
> A more portable default would be to use plain `cc`, which will usually
> be the system-wide default compiler.
> This is relevant because this compiler will also be hardcoded into
> ocamlopt as default c compiler.
>
> Christopher
>
>
> --
> http://gmerlin.de
> OpenPGP: http://gmerlin.de/christopher.pub
> 2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566
>

[-- Attachment #2: Type: text/html, Size: 1990 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-23  7:57 ` Gabriel Scherer
@ 2017-10-23 19:34   ` SP
  2017-10-23 19:41   ` Christopher Zimmermann
  1 sibling, 0 replies; 18+ messages in thread
From: SP @ 2017-10-23 19:34 UTC (permalink / raw)
  To: caml-list

I think cc nowadays is a link to the default compiler of the system.
On a Mac that is LLVM and on Linux distributions, mine at least, GCC.

So it's a neat way to call a C compiler, instead of hard-coding GCC.

Using configure scripts works fine too.

So is GCC really forced anywhere or not?

-- 
    SP

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-23  7:57 ` Gabriel Scherer
  2017-10-23 19:34   ` SP
@ 2017-10-23 19:41   ` Christopher Zimmermann
  2017-10-23 19:49     ` Adrien Nader
  1 sibling, 1 reply; 18+ messages in thread
From: Christopher Zimmermann @ 2017-10-23 19:41 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: caml users



On October 23, 2017 9:57:07 AM CEST, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
>My guess is that cc is a broken compiler on many exotic operating
>system
>(or at least was when the ./configure was first written in the
>nineties),
>and in particular does not support the (modest) gcc extensions that the
>runtime relies on. Using a standardized (yet portable) compiler was
>deemed
>an easier path to configure the OCaml distribution build system than
>trying
>to support the oddities of every Unix's C compiler under the sun.
>
>Note that the compiler distribution builds just fine under MacOS, which
>now
>uses Clang (llvm) instead of GCC -- and that you can configure the C
>compiler you want to use with (./configure -cc ...). I don't see what
>is
>the problem here; and I would think that opting to choose GCC by
>default is
>still a perfectly reasonable choice today.


My Problem is that custom OCaml builds, especially the ones done through opam will use gcc and therefore fail to build projects with not so modest requirements. At the moment I'm just wondering at which level in the toolchain this neuds fixing. OCaml configure, opam-repository or opam source?


>On Thu, Oct 19, 2017 at 5:05 PM, Christopher Zimmermann <
>christopher@gmerlin.de> wrote:
>
>> Hi,
>>
>> the Ocaml configure script uses gcc as default compiler. I wonder
>> whether this is still a sensible default with llvm being a viable
>> alternative.
>> A more portable default would be to use plain `cc`, which will
>usually
>> be the system-wide default compiler.
>> This is relevant because this compiler will also be hardcoded into
>> ocamlopt as default c compiler.
>>
>> Christopher
>>
>>
>> --
>> http://gmerlin.de
>> OpenPGP: http://gmerlin.de/christopher.pub
>> 2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566
>>


--
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
F190 D013 8F01 AA53 E080  3F3C F17F B0A1 D44E 4FEE

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-23 19:41   ` Christopher Zimmermann
@ 2017-10-23 19:49     ` Adrien Nader
  2017-10-24  5:15       ` [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)? Francois BERENGER
       [not found]       ` <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de>
  0 siblings, 2 replies; 18+ messages in thread
From: Adrien Nader @ 2017-10-23 19:49 UTC (permalink / raw)
  To: Christopher Zimmermann; +Cc: Gabriel Scherer, caml users

On Mon, Oct 23, 2017, Christopher Zimmermann wrote:
> 
> 
> On October 23, 2017 9:57:07 AM CEST, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
> >My guess is that cc is a broken compiler on many exotic operating
> >system
> >(or at least was when the ./configure was first written in the
> >nineties),
> >and in particular does not support the (modest) gcc extensions that the
> >runtime relies on. Using a standardized (yet portable) compiler was
> >deemed
> >an easier path to configure the OCaml distribution build system than
> >trying
> >to support the oddities of every Unix's C compiler under the sun.
> >
> >Note that the compiler distribution builds just fine under MacOS, which
> >now
> >uses Clang (llvm) instead of GCC -- and that you can configure the C
> >compiler you want to use with (./configure -cc ...). I don't see what
> >is
> >the problem here; and I would think that opting to choose GCC by
> >default is
> >still a perfectly reasonable choice today.
> 
> 
> My Problem is that custom OCaml builds, especially the ones done through opam will use gcc and therefore fail to build projects with not so modest requirements. At the moment I'm just wondering at which level in the toolchain this neuds fixing. OCaml configure, opam-repository or opam source?

Could you elaborate on that « therefore fail to build projects with not
so modest requirements » ?

-- 
Adrien


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)?
  2017-10-23 19:49     ` Adrien Nader
@ 2017-10-24  5:15       ` Francois BERENGER
  2017-10-24  7:55         ` Milo Davis
       [not found]       ` <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de>
  1 sibling, 1 reply; 18+ messages in thread
From: Francois BERENGER @ 2017-10-24  5:15 UTC (permalink / raw)
  To: caml-list

Dear list,

Just to be sure, it seems there are no OCaml bindings for this
library:

https://www.csie.ntu.edu.tw/~cjlin/liblinear/

Am I right or has anyone something under wraps that
he would be willing to share with the OCaml community?

My googling for such bindings was unsuccessful.

Thanks a lot,
F.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)?
  2017-10-24  5:15       ` [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)? Francois BERENGER
@ 2017-10-24  7:55         ` Milo Davis
  2017-10-25  2:31           ` Francois BERENGER
  0 siblings, 1 reply; 18+ messages in thread
From: Milo Davis @ 2017-10-24  7:55 UTC (permalink / raw)
  To: Francois BERENGER; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 832 bytes --]

There are bindings for libsvm available here
<https://bitbucket.org/ogu/libsvm-ocaml/>. It's not lib linear, but it
should have the functionality you're looking for.

--
Milo

On Tue, Oct 24, 2017 at 7:15 AM, Francois BERENGER <
berenger@bioreg.kyushu-u.ac.jp> wrote:

> Dear list,
>
> Just to be sure, it seems there are no OCaml bindings for this
> library:
>
> https://www.csie.ntu.edu.tw/~cjlin/liblinear/
>
> Am I right or has anyone something under wraps that
> he would be willing to share with the OCaml community?
>
> My googling for such bindings was unsuccessful.
>
> Thanks a lot,
> F.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 1695 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)?
  2017-10-24  7:55         ` Milo Davis
@ 2017-10-25  2:31           ` Francois BERENGER
  2017-10-25  7:06             ` [Caml-list] libsvm OCaml bindings and segfaults Francois BERENGER
  0 siblings, 1 reply; 18+ messages in thread
From: Francois BERENGER @ 2017-10-25  2:31 UTC (permalink / raw)
  Cc: caml-list

On 10/24/2017 04:55 PM, Milo Davis wrote:
> There are bindings for libsvm available here 
> <https://bitbucket.org/ogu/libsvm-ocaml/>. It's not lib linear, but it 
> should have the functionality you're looking for.

The functionality, yes by using libsvm with its linear kernel.
But not the performance of liblinear (from libsvm FAQ):

"libsvm is NOT particularly efficient for linear SVM, especially when C 
is large and the number of data is much larger than the number of 
attributes."

> --
> Milo
> 
> On Tue, Oct 24, 2017 at 7:15 AM, Francois BERENGER 
> <berenger@bioreg.kyushu-u.ac.jp <mailto:berenger@bioreg.kyushu-u.ac.jp>> 
> wrote:
> 
>     Dear list,
> 
>     Just to be sure, it seems there are no OCaml bindings for this
>     library:
> 
>     https://www.csie.ntu.edu.tw/~cjlin/liblinear/
>     <https://www.csie.ntu.edu.tw/~cjlin/liblinear/>
> 
>     Am I right or has anyone something under wraps that
>     he would be willing to share with the OCaml community?
> 
>     My googling for such bindings was unsuccessful.
> 
>     Thanks a lot,
>     F.
> 
>     -- 
>     Caml-list mailing list.  Subscription management and archives:
>     https://sympa.inria.fr/sympa/arc/caml-list
>     <https://sympa.inria.fr/sympa/arc/caml-list>
>     Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>     <http://groups.yahoo.com/group/ocaml_beginners>
>     Bug reports: http://caml.inria.fr/bin/caml-bugs
>     <http://caml.inria.fr/bin/caml-bugs>
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
       [not found]       ` <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de>
@ 2017-10-25  6:52         ` Adrien Nader
  2017-10-25  7:05           ` Gabriel Scherer
                             ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Adrien Nader @ 2017-10-25  6:52 UTC (permalink / raw)
  To: Christopher Zimmermann; +Cc: caml users

Hi,

On Wed, Oct 25, 2017, Christopher Zimmermann wrote:
> >> My Problem is that custom OCaml builds, especially the ones done
> >through opam will use gcc and therefore fail to build projects with not
> >so modest requirements. At the moment I'm just wondering at which level
> >in the toolchain this neuds fixing. OCaml configure, opam-repository or
> >opam source?
> >
> >Could you elaborate on that « therefore fail to build projects with not
> >so modest requirements » ?
> 
> In my case it is core_kernel v0.9 which fails on OpenBSD gcc 4.2.1 because it uses -mpopcnt, while it compiles just fine with OpenBSD cc clang 4.0.0.

I believe there are several things to change. I outline my thoughts
below; I've sorted them by due date:

1- (overdue): Openbsd should stop shipping GCC 4.2: it's ten years old
and unmaintained. *TEN* years. It shouldn't be a surprise it starts
causing issues. The very reason 'gcc' has been used by ocaml instead of
'cc' was to avoid bad compilers on old systems and now openbsd is
re-creating similar issues, only with a different twist.

2- (easy, compatible): OCaml's configure script should probably fallback
to clang if GCC isn't found. That way, with openbsd not shipping GCC 4.2
anymore, clang would be automatically selected. I assumue ports ship a
modern GCC and installing this one would still result in a working
setup. Unsurprisingly, this is the step where you're invited to
contribute: it should really be a small change. My only concern is that
I seem to recall past discussions related to detecting clang but not
their outcome.

3- (longer term): I know that there has been some work on a replacement
of the configure script with something autoconf-based (and before anyone
complains, this doesn't include automake nor libtool). I don't know the
current status of this work however.

-- 
Adrien

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-25  6:52         ` [Caml-list] use cc instead of gcc as default C compiler? Adrien Nader
@ 2017-10-25  7:05           ` Gabriel Scherer
  2017-10-25  7:14             ` Sébastien Hinderer
  2017-10-25  7:10           ` Sébastien Hinderer
  2017-10-25  8:04           ` Christopher Zimmermann
  2 siblings, 1 reply; 18+ messages in thread
From: Gabriel Scherer @ 2017-10-25  7:05 UTC (permalink / raw)
  To: Adrien Nader; +Cc: Christopher Zimmermann, caml users, Sébastien Hinderer

[-- Attachment #1: Type: text/plain, Size: 3252 bytes --]

If gcc is not found, then the current configure does fall back to `cc`,
which I suppose would work fine on a Clang-only OpenBSD system. (Currently
the configure fails if gcc is not found and we are in a cross-compiling
scenario (host <> target), and this could be improved, but the support for
cross-compilation is due to be overhauled anyway.)

As far as I know, the autoconf work has not started yet, but it is still
planned for a reasonably close future.

I guess it would also be possible for the ./configure to use clang by
default under OpenBSD -- but I'm not sure where to cleanly integrate this
in the configure script. Currently the major clang-using system that OCaml
users maintain in OSX, and there gcc is just an alias for clang (or maybe
they still use the GCC frontend and LLVM backend?), so we never had to
adapt configure to explicitly invoke clang to support it -- or really
implement much in the form of system-dependent compiler choice.

On Wed, Oct 25, 2017 at 8:52 AM, Adrien Nader <adrien@notk.org> wrote:

> Hi,
>
> On Wed, Oct 25, 2017, Christopher Zimmermann wrote:
> > >> My Problem is that custom OCaml builds, especially the ones done
> > >through opam will use gcc and therefore fail to build projects with not
> > >so modest requirements. At the moment I'm just wondering at which level
> > >in the toolchain this neuds fixing. OCaml configure, opam-repository or
> > >opam source?
> > >
> > >Could you elaborate on that « therefore fail to build projects with not
> > >so modest requirements » ?
> >
> > In my case it is core_kernel v0.9 which fails on OpenBSD gcc 4.2.1
> because it uses -mpopcnt, while it compiles just fine with OpenBSD cc clang
> 4.0.0.
>
> I believe there are several things to change. I outline my thoughts
> below; I've sorted them by due date:
>
> 1- (overdue): Openbsd should stop shipping GCC 4.2: it's ten years old
> and unmaintained. *TEN* years. It shouldn't be a surprise it starts
> causing issues. The very reason 'gcc' has been used by ocaml instead of
> 'cc' was to avoid bad compilers on old systems and now openbsd is
> re-creating similar issues, only with a different twist.
>
> 2- (easy, compatible): OCaml's configure script should probably fallback
> to clang if GCC isn't found. That way, with openbsd not shipping GCC 4.2
> anymore, clang would be automatically selected. I assumue ports ship a
> modern GCC and installing this one would still result in a working
> setup. Unsurprisingly, this is the step where you're invited to
> contribute: it should really be a small change. My only concern is that
> I seem to recall past discussions related to detecting clang but not
> their outcome.
>
> 3- (longer term): I know that there has been some work on a replacement
> of the configure script with something autoconf-based (and before anyone
> complains, this doesn't include automake nor libtool). I don't know the
> current status of this work however.
>
> --
> Adrien
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 4180 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Caml-list] libsvm OCaml bindings and segfaults
  2017-10-25  2:31           ` Francois BERENGER
@ 2017-10-25  7:06             ` Francois BERENGER
  2017-10-25  9:08               ` Philippe Veber
  0 siblings, 1 reply; 18+ messages in thread
From: Francois BERENGER @ 2017-10-25  7:06 UTC (permalink / raw)
  To: caml-list

Hello,

Are there many users of this library out there?

Is it rare to observe a segfault with it?

I can produce some very easily.

Since I can create a good classifier sometimes, I think
I use the library correctly.

Regards,
F.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-25  6:52         ` [Caml-list] use cc instead of gcc as default C compiler? Adrien Nader
  2017-10-25  7:05           ` Gabriel Scherer
@ 2017-10-25  7:10           ` Sébastien Hinderer
  2017-10-25  8:04           ` Christopher Zimmermann
  2 siblings, 0 replies; 18+ messages in thread
From: Sébastien Hinderer @ 2017-10-25  7:10 UTC (permalink / raw)
  To: caml-list

Hello Adrien, thanks for your contribution,

Adrien Nader (2017/10/25 08:52 +0200):
> 3- (longer term): I know that there has been some work on a replacement
> of the configure script with something autoconf-based (and before anyone
> complains, this doesn't include automake nor libtool). I don't know the
> current status of this work however.

There is a wish to have this in 4.07. I just need to find the time to
work on it once Inria's CI is fully working again and given that
ocamltest also needs some work both to be extended and to migrate more
tests.

Sébastien.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-25  7:05           ` Gabriel Scherer
@ 2017-10-25  7:14             ` Sébastien Hinderer
  2017-10-25  7:20               ` Adrien Nader
  0 siblings, 1 reply; 18+ messages in thread
From: Sébastien Hinderer @ 2017-10-25  7:14 UTC (permalink / raw)
  To: caml users

Unless it is really required, my suggestion would be not to touch the
current configure and re-examine whether the detection of the C compiler
is as we want it to be once we have the autoconf-generated script.

But of course in case of emergency the current configure can always be
patched.

Sébastien.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-25  7:14             ` Sébastien Hinderer
@ 2017-10-25  7:20               ` Adrien Nader
  0 siblings, 0 replies; 18+ messages in thread
From: Adrien Nader @ 2017-10-25  7:20 UTC (permalink / raw)
  To: caml users

On Wed, Oct 25, 2017, Sébastien Hinderer wrote:
> Unless it is really required, my suggestion would be not to touch the
> current configure and re-examine whether the detection of the C compiler
> is as we want it to be once we have the autoconf-generated script.
> 
> But of course in case of emergency the current configure can always be
> patched.

According to what Gabriel has said, the current situation is very close
to what I was proposing and the effect should be the same. As such, I
see no need for changes. :) 

-- 
Adrien

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] use cc instead of gcc as default C compiler?
  2017-10-25  6:52         ` [Caml-list] use cc instead of gcc as default C compiler? Adrien Nader
  2017-10-25  7:05           ` Gabriel Scherer
  2017-10-25  7:10           ` Sébastien Hinderer
@ 2017-10-25  8:04           ` Christopher Zimmermann
  2 siblings, 0 replies; 18+ messages in thread
From: Christopher Zimmermann @ 2017-10-25  8:04 UTC (permalink / raw)
  To: Adrien Nader; +Cc: caml users

On 2017-10-25 Adrien Nader <adrien@notk.org> wrote:
> Hi,
> 
> On Wed, Oct 25, 2017, Christopher Zimmermann wrote:
> > >> My Problem is that custom OCaml builds, especially the ones done  
> > >through opam will use gcc and therefore fail to build projects with not
> > >so modest requirements. At the moment I'm just wondering at which level
> > >in the toolchain this neuds fixing. OCaml configure, opam-repository or
> > >opam source?
> > >
> > >Could you elaborate on that « therefore fail to build projects with not
> > >so modest requirements » ?  
> > 
> > In my case it is core_kernel v0.9 which fails on OpenBSD gcc 4.2.1 because it uses -mpopcnt, while it compiles just fine with OpenBSD cc clang 4.0.0.  
> 
> I believe there are several things to change. I outline my thoughts
> below; I've sorted them by due date:
> 
> 1- (overdue): Openbsd should stop shipping GCC 4.2: it's ten years old
> and unmaintained. *TEN* years. It shouldn't be a surprise it starts
> causing issues. The very reason 'gcc' has been used by ocaml instead of
> 'cc' was to avoid bad compilers on old systems and now openbsd is
> re-creating similar issues, only with a different twist.

OpenBSD, FreeBSD, darwin all switched to clang because of licensing
issues. They won't integrate gcc >4.2.1 into the base system because it
is GPLv3. They do however ship a recent clang, called 'cc'. 'gcc' 4.2.1
is only included for a transition period on OpenBSD base system.

recent gcc compilers are installable from ports. They are called 'egcc'.

> 2- (easy, compatible): OCaml's configure script should probably fallback
> to clang if GCC isn't found.

It already does that.

> That way, with openbsd not shipping GCC 4.2 anymore

This may happen some time, but you might install a recent gcc from
ports then, which would confuse the build script.

> clang would be automatically selected. I assumue ports ship a
> modern GCC and installing this one would still result in a working
> setup. Unsurprisingly, this is the step where you're invited to
> contribute: it should really be a small change. My only concern is that
> I seem to recall past discussions related to detecting clang but not
> their outcome.

As I wrote above this is already the current behaviour.

> 3- (longer term): I know that there has been some work on a replacement
> of the configure script with something autoconf-based (and before anyone
> complains, this doesn't include automake nor libtool). I don't know the
> current status of this work however.

Still I would pledge to use 'cc' as default in such a new configure
script.


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
2779 7F73 44FD 0736 B67A  C410 69EC 7922 34B4 2566

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Caml-list] libsvm OCaml bindings and segfaults
  2017-10-25  7:06             ` [Caml-list] libsvm OCaml bindings and segfaults Francois BERENGER
@ 2017-10-25  9:08               ` Philippe Veber
  0 siblings, 0 replies; 18+ messages in thread
From: Philippe Veber @ 2017-10-25  9:08 UTC (permalink / raw)
  To: Francois BERENGER; +Cc: caml users

[-- Attachment #1: Type: text/plain, Size: 855 bytes --]

Hello François,

It's been a while since I've used libsvm (directly or through my own
primitive bindings), but at that time I've never witnessed any segfault
when using it directly. The bug is more likely to come from the binding I
think.

my 2 cent
ph.

2017-10-25 9:06 GMT+02:00 Francois BERENGER <berenger@bioreg.kyushu-u.ac.jp>
:

> Hello,
>
> Are there many users of this library out there?
>
> Is it rare to observe a segfault with it?
>
> I can produce some very easily.
>
> Since I can create a good classifier sometimes, I think
> I use the library correctly.
>
> Regards,
> F.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 1594 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-10-25  9:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 15:05 [Caml-list] use cc instead of gcc as default C compiler? Christopher Zimmermann
2017-10-22  9:20 ` SP
2017-10-23  7:46   ` Sébastien Hinderer
2017-10-23  7:57 ` Gabriel Scherer
2017-10-23 19:34   ` SP
2017-10-23 19:41   ` Christopher Zimmermann
2017-10-23 19:49     ` Adrien Nader
2017-10-24  5:15       ` [Caml-list] Are there any OCaml bindings to liblinear (a library for large linear classification)? Francois BERENGER
2017-10-24  7:55         ` Milo Davis
2017-10-25  2:31           ` Francois BERENGER
2017-10-25  7:06             ` [Caml-list] libsvm OCaml bindings and segfaults Francois BERENGER
2017-10-25  9:08               ` Philippe Veber
     [not found]       ` <152B8F33-A053-42AA-AF57-160FF3C897D0@gmerlin.de>
2017-10-25  6:52         ` [Caml-list] use cc instead of gcc as default C compiler? Adrien Nader
2017-10-25  7:05           ` Gabriel Scherer
2017-10-25  7:14             ` Sébastien Hinderer
2017-10-25  7:20               ` Adrien Nader
2017-10-25  7:10           ` Sébastien Hinderer
2017-10-25  8:04           ` Christopher Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).