Skip to content

Overhaul Windows install docs #536

Merged
damiendoligez merged 8 commits intoocaml:4.03from
dra27:overhaul-install-docs
Apr 25, 2016
Merged

Overhaul Windows install docs #536
damiendoligez merged 8 commits intoocaml:4.03from
dra27:overhaul-install-docs

Conversation

@dra27
Copy link
Member

@dra27 dra27 commented Apr 8, 2016

  • Reformatted sections of INSTALL.adoc
  • Moved Cygwin instructions from README.win32.adoc to INSTALL.adoc
  • Removed out-of-date warnings and instructions (Cygwin packages, etc.)
  • Simplified the references to Windows ports by regarding 32/64-bit as a version, rather than a separate port (since Cygwin/MSVC/Mingw-w64 all work in both architectures)
  • Documented the MSVC/Mingw-w64 bootstrapping of FlexDLL introduced in 4.03
  • Added tools/msvs-promote-path to simplify the environment set-up for building MSVC
  • Updated the instructions for MSVC to cover all (literally, all) supported versions of Visual Studio and the Windows SDK which can build OCaml

Sorry that this is so close to the release date - though no code is touched.

Alain hasn't released FlexDLL 0.35 yet - when he does, the git submodule should be moved forwards to that commit both in trunk and 4.03.

dra27 added 8 commits April 7, 2016 15:16
MacOS X and Mac OS X changed to OS X.
tr is always installed.
Cygwin is a flavour of Unix. Coupled with the fact that it is built
using the normal Unix configure route, it adds to the confusion of the
Windows ports (especially the fact that the four native ports need a
Cygwin environment to be compiled) including its instructions in the
native port.

Various out-of-date instructions also removed: Cygwin hasn't provided
GCC 4.5.3 for a long time and FlexDLL can be recompiled from sources
without alteration since version 0.32.
Since it does work and is being maintained!
Script intended to make the compilation instructions for the Microsoft
Visual C++ Compiler ports a little simpler.

This script allows the user to start Cygwin from the appropriate Visual
Studio Command Prompt (e.g. by issuing `C:\cygwin\bin\mintty -`) and then,
from the OCaml sources directory, issue

```bash
eval `tools/msvs-promote-path`
```

This script emits an error if the Microsoft Linker cannot be found in any
of the directories in `PATH` or if the `link` command already refers to the
Microsoft Linker. If, as will usually be the default, `link` refers to the
coreutils `link` command, `PATH` is altered to move the first entry
containing the Microsoft Linker to the start of `PATH`. This has the
effect of overriding the Unix interpretation of the `link` command, but
this will never affect OCaml's build process.

This script is taken from msvs-tools
(https://github.com/metastack/msvs-tools) and re-licensed by the copyright
holder.
Simplified the instructions by de-duplicating the 32/64-bit instructions
now that every port is available for both architectures.

Removed out-of-date Cygwin information.

Included details on the new FlexDLL bootstrapping procedure.
@dra27
Copy link
Member Author

dra27 commented Apr 8, 2016

/cc @msprotz FlexDLL bootstrapping may be of interest for the binary installer?

@protz
Copy link

protz commented Apr 8, 2016

Not sure why... I'm happy to use Alain's binary. Is there a reason why I
would want to bootstrap?

On 4/8/2016 7:52 AM, David Allsopp wrote:

/cc @msprotz https://github.com/msprotz FlexDLL bootstrapping may be
of interest for the binary installer?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#536 (comment)

@dra27
Copy link
Member Author

dra27 commented Apr 9, 2016

Potentially simpler build? It would also mean that the x64 distribution would have a 64-bit compiled version of flexlink, rather than a 32-bit one (see part of Alain's #388 (comment) for when this may be desirable). I did mean "may be" not "will be" though 😄


make -f Makefile.nt flexdll world [bootstrap] opt opt.opt install

* `make -f Makefile.nt` will install FlexDLL by placing `flexlink.exe` (and the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be make -f Makefile.nt flexdll?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops - actually it should read make -f Makefile.nt install - it's describing the fact that a bootstrapped compilation also installs FlexDLL as part of OCaml.

@damiendoligez damiendoligez added this to the 4.03.0 milestone Apr 11, 2016
@alainfrisch
Copy link
Contributor

Should msvs-promote-path be installed? (Yes, it might be weird to install a Cygwin specific script for a native install...) Alternatively, one could direct people to download the tool from your repository directly.

@dra27
Copy link
Member Author

dra27 commented Apr 12, 2016

Up to you - the only thing if it is installed would be whether it wants to be installed with that name (or prefixed ocaml-)? As far as I can tell, it's certainly not uncommon to use the native ports from Cygwin bash, so it's definitely not a silly thing to want to do!

@alainfrisch
Copy link
Contributor

Do you plan to release msvs-tools as a standalone package? If so, I think the best would be to refer to it as an (optional) dependency from the README (msvs-detect would also probably be useful), and let Windows binary packagers decide whether to bundle the tools with their installer.

(Another approach for the "link" issue would be to address it within flexlink itself. This might be the most user friendly approach.)

@gasche
Copy link
Member

gasche commented Apr 18, 2016

Where are we on this? If we want to have it in 4.03, there should be a clear consensus to merge very soon (as in, the next day or so). I would personally be tempted to just blindly trust @dra27 on the documentation changes, but I can't assess the risk of the new instructions making it worse for someone than the old. Any opinion?

@dra27
Copy link
Member Author

dra27 commented Apr 18, 2016

Sorry for the slow reply.
@alainfrisch - msvs-tools is as released as I was planning (which is to say it's on GitHub and has a tagged version history). I anticipate it being like ocaml-autoconf, so something which you would tend to embed in other applications directly, rather than need installed as a dependency. The README kind of does refer to the tool already inasmuch as it recommends copying the script from tools/ if you want to use it after building OCaml - would you think that's sufficient? In the bright OPAM-driven future, this becomes moot - OPAM will necessary have to deal with the environment in order to support switching between different architectures. I agree that moving all of this to flexlink would be best, though there are two caveats - we'd been discussing it back in either December or January before the code-freeze and concluded that was best left to 4.04 (or at least 4.03.1) since it requires a change to the OCaml Windows build system for the cases where ocamlc/ocamlopt call the linker directly. I'm very happy to help with this work post 4.03!
@gasche - although moderately awkward (for checksums and so on), presumably the sources tarball can be re-released under the same version number if the only thing altered is documentation?

@mshinwell
Copy link
Contributor

I don't think we should re-release a version even if there is only a doc change.

@dra27
Copy link
Member Author

dra27 commented Apr 19, 2016

There is a confidence-test in the new instructions with the msvs-promote-path command which would be handy to have run by people with a system set-up that is manually configured "the old way" (@damiendoligez, @alainfrisch) - running eval $(tools/msvs-promote-path) should simply display link already refers to the Microsoft Linker on stderr and change nothing, because the correct link is already in PATH. That would confirm that backwards compatibility of the instructions hasn't been broken.
There is of course one tiny code change which I made in configure to remove the dependency on the dos2unix Cygwin package - I have tested that on both Cygwin and Cygwin64, and I think it's fairly clear by inspection that the two lines are equivalent?

@gasche
Copy link
Member

gasche commented Apr 19, 2016

Indeed, the ball would be in @alainfrisch and @damiendoligez 's court.

Note that the plan for after the release is to switch to a shorter release cycle (as in: have another release in 2016), so missing this one wouldn't be as much of a problem.

@damiendoligez
Copy link
Member

running eval $(tools/msvs-promote-path) should simply display link already refers to the Microsoft Linker on stderr and change nothing

It works as advertised, except that tools/msvs-promote-path doesn't have execute permission. Can you fix this?

@dra27 dra27 force-pushed the overhaul-install-docs branch from 9526244 to dcd2a09 Compare April 22, 2016 15:15
@dra27
Copy link
Member Author

dra27 commented Apr 22, 2016

Done (also squashed the typo commit and rebased)

@damiendoligez damiendoligez merged commit c1c2647 into ocaml:4.03 Apr 25, 2016
@dra27 dra27 deleted the overhaul-install-docs branch April 25, 2016 09:23
@dra27
Copy link
Member Author

dra27 commented Apr 26, 2016

Congratulations on the release of 4.03.0! Just a small note, in case in the last-minute rush it's slipped through, that this needs merging on trunk.

@gasche
Copy link
Member

gasche commented Apr 26, 2016

Thanks for the reminder, I just merged in trunk.

EduardoRFS pushed a commit to esy-ocaml/ocaml that referenced this pull request May 17, 2021
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Mar 22, 2022
…l#536)

* Fix flambda_o3 and flambda_oclassic attributes

The implementations of the `flambda_o3` and `flambda_oclassic`
attributes were calling into `Clflags`, but the flambda backend
implements optimization flags by circumventing `Clflags` entirely.
The only obvious solution is to add a hook to `Clflags` so we can
simply override what `Clflags.set_o3 ()` does. Fortunately, doing it
this way means that the other two ways of setting the flags - the
command line and `OCAMLPARAM` - no longer need to do anything
special.

Tested manually using the included .ml source file.

Note that `[@@@flambda_o3]` does nothing if `-Oclassic` is on. This
actually reflects existing behavior: `-Oclassic -O3` and `-O3
-Oclassic` are, as far as I can tell, effectively the same as
`-Oclassic`.

* Make later -O flags completely override earlier ones

Also document the test more thoroughly.

* Don't have -O* clobber earlier options

Now `-flambda2-cse-depth 7 -O3` will do the same thing as
`-O3 -flambda2-cse-depth 7`.

* Minimize the diff a bit

* Install optimization-flag handler in native toplevel

* Restore the behavior that -Oclassic implies -linscan

* Add missing settings to O levels

The explicit setting of `fallback_inlining_heuristic` to `false` in
the old `o2_flags` was redundant, but it's easier to review this way.

* Formatting
stedolan pushed a commit to stedolan/ocaml that referenced this pull request May 24, 2022
* Fix flambda_o3 and flambda_oclassic attributes

The implementations of the `flambda_o3` and `flambda_oclassic`
attributes were calling into `Clflags`, but the flambda backend
implements optimization flags by circumventing `Clflags` entirely.
The only obvious solution is to add a hook to `Clflags` so we can
simply override what `Clflags.set_o3 ()` does. Fortunately, doing it
this way means that the other two ways of setting the flags - the
command line and `OCAMLPARAM` - no longer need to do anything
special.

Tested manually using the included .ml source file.

Note that `[@@@flambda_o3]` does nothing if `-Oclassic` is on. This
actually reflects existing behavior: `-Oclassic -O3` and `-O3
-Oclassic` are, as far as I can tell, effectively the same as
`-Oclassic`.

* Make later -O flags completely override earlier ones

Also document the test more thoroughly.

* Don't have -O* clobber earlier options

Now `-flambda2-cse-depth 7 -O3` will do the same thing as
`-O3 -flambda2-cse-depth 7`.

* Minimize the diff a bit

* Install optimization-flag handler in native toplevel

* Restore the behavior that -Oclassic implies -linscan

* Add missing settings to O levels

The explicit setting of `fallback_inlining_heuristic` to `false` in
the old `o2_flags` was redundant, but it's easier to review this way.

* Formatting
stedolan added a commit to stedolan/ocaml that referenced this pull request May 24, 2022
64235a3 flambda-backend: Change Float.nan from sNaN to qNaN (ocaml#466)
14a8e27 flambda-backend: Track GC work for all managed bigarray allocations (upstream 11022) (ocaml#569)
c3cda96 flambda-backend: Add two new methods to targetint for dwarf (ocaml#560)
e6f1fed flambda-backend: Handle arithmetic overflow in select_addr (ocaml#570)
dab7209 flambda-backend: Add Target_system to ocaml/utils (ocaml#542)
82d5044 flambda-backend: Enhance numbers.ml with more primitive types (ocaml#544)
216be99 flambda-backend: Fix flambda_o3 and flambda_oclassic attributes (ocaml#536)
4b56e07 flambda-backend: Test naked pointer root handling (ocaml#550)
40d69ce flambda-backend: Stop local function optimisation from moving code into function bodies; opaque_identity fixes for class compilation (ocaml#537)
f08ae58 flambda-backend: Implemented inlining history and use it inside inlining reports (ocaml#365)
ac496bf flambda-backend: Disable the local keyword in typing (ocaml#540)
7d46712 flambda-backend: Bugfix for Typedtree generation of arrow types (ocaml#539)
61a7b47 flambda-backend: Insert missing page table check in roots_nat.c (ocaml#541)
323bd36 flambda-backend: Compiler error when -disable-all-extensions and -extension are used (ocaml#534)
d8956b0 flambda-backend: Persistent environment and reproducibility (ocaml#533)
4a0c89f flambda-backend: Revert "Revert bswap PRs (480 and 482)" (ocaml#506)
7803705 flambda-backend: Cause a C warning when CAMLreturn is missing in C stubs. (ocaml#376)
6199db5 flambda-backend: Improve unboxing during cmm for Flambda (ocaml#295)
96b9e1b flambda-backend: Print diagnostics at runtime for Invalid (ocaml#530)
42ab88e flambda-backend: Disable bytecode compilers in ocamltest (ocaml#504)
58c72d5 flambda-backend: Backport ocaml#10595 from upstream/trunk (ocaml#471)
1010539 flambda-backend: Use C++ name mangling convention (ocaml#483)
81881bb flambda-backend: Local allocation test no longer relies on lifting (ocaml#525)
f5c4719 flambda-backend: Fix an assertion in Closure that breaks probes (ocaml#505)
c2cf2b2 flambda-backend: Add some missing command line arguments to ocamlnat (ocaml#499)

git-subtree-dir: ocaml
git-subtree-split: 64235a3
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
This adds syntax completion and syntax error highlighting through merlin-js.
Merlin is introduced in a separate worker that is initialized asynchronously so as to not delay the first paint.
We updated the code-mirror bindings to support the features required by merlin-js.
The existing top-level worker is not initialized after the first paint.

Co-authored-by: Thibaut Mattio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants