Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build OPAM 2 for Cygwin32 with "make cold" #3843

Closed
jfehrle opened this issue May 20, 2019 · 9 comments · Fixed by #4776
Closed

Can't build OPAM 2 for Cygwin32 with "make cold" #3843

jfehrle opened this issue May 20, 2019 · 9 comments · Fixed by #4776

Comments

@jfehrle
Copy link

jfehrle commented May 20, 2019

I'm having trouble building Opam 2 for Cygwin32. The first run failed because I didn't have flexdll installed. After fixing that, the build ends with a segfault. Is it correct to just rerun make cold in the same directory? Or should I start in a fresh directory? (I may have done a make clean before the second build.)

Also, I'm not sure what to make of the message "Some dependencies are missing." at the bottom. Is that part of the problem?

FWIW, I do have a copy of OCaml installed in this Cygwin, it is 4.06.1. Not sure if that's interfering.

My ultimate goal is to get Dune to compile Coq, either with or without Opam.

<many, many lines omitted>

Warning: jbuild files are deprecated, please convert this file to a dune file instead.
Note: You can use "dune upgrade" to convert your project to dune.
File "src_ext/result/jbuild", line 1, characters 0-0:
Warning: jbuild files are deprecated, please convert this file to a dune file instead.
Note: You can use "dune upgrade" to convert your project to dune.
Done: 0/0 (jobs: 0)make[1]: *** [Makefile:107: opam.install] Segmentation fault (core dumped)
make[1]: Leaving directory '/cygdrive/d/opam-2.0.4'
make: *** [Makefile:195: cold] Error 2
env PATH="`pwd`/bootstrap/ocaml/bin:$PATH" ./configure
Bootstrap compiler found -- activating
checking for ocamlc... ocamlc.opt
OCaml version is 4.07.1
OCaml library path is /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml
checking for ocamlopt... ocamlopt.opt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for ocaml... ocaml
checking for ocamldep... ocamldep
checking for ocamldep.opt... ocamldep.opt
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
checking for ocamldoc.opt... ocamldoc.opt
checking for ocamlbuild... no
checking OCaml Sys.os_type... Cygwin
checking for gawk... gawk
checking for compiler type... cc
checking for compiler architecture... i386
checking for compiler system... cygwin
checking for gcc... gcc -O2 -fno-strict-aliasing -fwrapv -U_WIN32 -D_FILE_OFFSET_BITS=64
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -O2 -fno-strict-aliasing -fwrapv -U_WIN32 -D_FILE_OFFSET_BITS=64 accepts -g... yes
checking for gcc -O2 -fno-strict-aliasing -fwrapv -U_WIN32 -D_FILE_OFFSET_BITS=64 option to accept ISO C89... none needed
checking for ocamlobjinfo... ocamlobjinfo
checking for ocamlfind... no
checking for curl... curl
checking for dune... dune
checking for patch... patch
checking for bunzip2... bunzip2

checking for OCaml findlib package unix... not found
checking for OCaml findlib package bigarray... not found
checking for OCaml findlib package extlib... not found
checking for OCaml findlib package re... not found
checking for OCaml findlib package re.glob... not found
checking for OCaml findlib package cmdliner... not found
checking for OCaml findlib package ocamlgraph... not found
checking for OCaml findlib package cudf... not found
checking for OCaml findlib package dose3.common... not found
checking for OCaml findlib package dose3.algo... not found
checking for OCaml findlib package opam-file-format... not found
checking for OCaml findlib package mccs... not found
checking for OCaml findlib package cppo... not found
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... CC
checking whether we are using the GNU C++ compiler... no
checking whether CC accepts -g... no

============================================================================
Some dependencies are missing. If you are just interested in the stand-alone
'opam' binary, run 'make lib-ext' to download and include them.
============================================================================
@dra27
Copy link
Member

dra27 commented May 20, 2019

Which version of Dune do you have installed, and where?

@jfehrle
Copy link
Author

jfehrle commented May 20, 2019

$ which dune
/usr/local/bin/dune

$ dune --version
%%VERSION%%

I started with a fresh installation of cygwin32. My first attempt was to try installing opam using make cold. That failed because I had not installed patch, so I added that with the cygwin install. When that also failed make cold, I tried to build Ocaml and Dune from sources. That also ran into problems (ocaml wanted flexlink, which I hadn't installed). Then I installed flexdll with the cygwin installer and retried the make cold.

@jfehrle
Copy link
Author

jfehrle commented May 20, 2019

I just created a fresh opam directory and did a make cold, which fails as shown below (I saw this on my first make cold attempt but I don't think I saw it after the first one). Perhaps I should install another fresh cygwin and try make cold again?

sh: ocamlfind: command not found
         gcc src_ext/mccs/src/constraint_generation.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o constraint_generation.o -c constraint_generation.cpp)
gcc: error: spawn: No such file or directory
File "src_ext/cmdliner/src/cmdliner_base.ml", line 14, characters 16-32:
Warning 3: deprecated: Stdlib.String.lowercase
Use String.lowercase_ascii instead.
File "src_ext/cmdliner/src/cmdliner_base.ml", line 15, characters 16-32:
Warning 3: deprecated: Stdlib.String.lowercase
Use String.lowercase_ascii instead.
File "src_ext/cmdliner/src/cmdliner_base.ml", line 16, characters 17-34:
Warning 3: deprecated: Stdlib.String.capitalize
Use String.capitalize_ascii instead.
      ocamlc src_ext/mccs/src/glpk/wclique1.o
src_ext/mccs/src/glpk/misc/wclique1.c: In function ‘_glp_wclique1’:
src_ext/mccs/src/glpk/misc/wclique1.c:121:7: warning: ‘memset’: specified size between 2147483648 and 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
src_ext/mccs/src/glpk/misc/wclique1.c:123:7: warning: ‘memset’: specified size between 2147483648 and 4294967295 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
         gcc src_ext/mccs/src/count_criteria.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o count_criteria.o -c count_criteria.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/cudf_reductions.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o cudf_reductions.o -c cudf_reductions.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/cudf_tools.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o cudf_tools.o -c cudf_tools.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/glpk_solver.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o glpk_solver.o -c glpk_solver.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/lexagregate_combiner.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o lexagregate_combiner.o -c lexagregate_combiner.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/lp_solver.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o lp_solver.o -c lp_solver.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/mccs_stubs.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o mccs_stubs.o -c mccs_stubs.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/mccscudf.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o mccscudf.o -c mccscudf.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/new_criteria.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o new_criteria.o -c new_criteria.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/notuptodate_criteria.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o notuptodate_criteria.o -c notuptodate_criteria.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/removed_criteria.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o removed_criteria.o -c removed_criteria.cpp)
gcc: error: spawn: No such file or directory
         gcc src_ext/mccs/src/changed_criteria.o (exit 1)
(cd _build/default/src_ext/mccs/src && /usr/bin/gcc -I /cygdrive/d/opam-2.0.4/bootstrap/ocaml/lib/ocaml -I ../../cudf -I ../../extlib/src -I glpk -O2 -fno-strict-aliasing -fwrapv -I . -DUSEGLPK -g -o changed_criteria.o -c changed_criteria.cpp)
gcc: error: spawn: No such file or directory
File "src_ext/cppo/src/cppo_eval.ml", line 88, characters 2-19:
Warning 3: deprecated: Stdlib.String.capitalize
Use String.capitalize_ascii instead.
File "src_ext/extlib/src/extArray.pp.ml", line 1:
Warning 3: deprecated: make_float
Use Array.create_float instead.
  File "array.mli", line 60, characters 0-91:
  Definition
  File "src_ext/extlib/src/extArray.mli", line 119, characters 2-37:
  Expected signature
File "src_ext/extlib/src/extArray.pp.ml", line 1:
Warning 3: deprecated: create
Use Array.make instead.
  File "array.mli", line 51, characters 0-107:
  Definition
  File "src_ext/extlib/src/extArray.mli", line 143, characters 2-60:
  Expected signature
File "src_ext/extlib/src/extArray.pp.ml", line 1:
Warning 3: deprecated: create_matrix
Use Array.make_matrix instead.
  File "array.mli", line 87, characters 0-110:
  Definition
  File "src_ext/extlib/src/extArray.mli", line 146, characters 2-56:
  Expected signature
File "src_ext/extlib/src/extHashtbl.ml", line 26, characters 2-90:
Warning 3: deprecated: [@@noalloc] should be used instead of "noalloc"
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: set
Use Bytes.set instead.
  File "string.mli", line 61, characters 0-112:
  Definition
  File "src_ext/extlib/src/extString.mli", line 179, characters 2-42:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: create
Use Bytes.create instead.
  File "string.mli", line 71, characters 0-104:
  Definition
  File "src_ext/extlib/src/extString.mli", line 180, characters 2-29:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: copy
  File "string.mli", line 96, characters 0-48:
  Definition
  File "src_ext/extlib/src/extString.mli", line 182, characters 2-29:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: fill
Use Bytes.fill instead.
  File "string.mli", line 110, characters 0-95:
  Definition
  File "src_ext/extlib/src/extString.mli", line 184, characters 2-50:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: uppercase
Use String.uppercase_ascii instead.
  File "string.mli", line 262, characters 0-93:
  Definition
  File "src_ext/extlib/src/extString.mli", line 200, characters 2-34:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: lowercase
Use String.lowercase_ascii instead.
  File "string.mli", line 269, characters 0-93:
  Definition
  File "src_ext/extlib/src/extString.mli", line 201, characters 2-34:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: capitalize
Use String.capitalize_ascii instead.
  File "string.mli", line 276, characters 0-95:
  Definition
  File "src_ext/extlib/src/extString.mli", line 202, characters 2-35:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: uncapitalize
Use String.uncapitalize_ascii instead.
  File "string.mli", line 282, characters 0-99:
  Definition
  File "src_ext/extlib/src/extString.mli", line 203, characters 2-37:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: unsafe_set
  File "string.mli", line 356, characters 0-96:
  Definition
  File "src_ext/extlib/src/extString.mli", line 219, characters 2-49:
  Expected signature
File "src_ext/extlib/src/extString.pp.ml", line 1:
Warning 3: deprecated: unsafe_fill
  File "string.mli", line 361, characters 0-116:
  Definition
  File "src_ext/extlib/src/extString.mli", line 221, characters 2-57:
  Expected signature
File "src_ext/dose3/common/util.ml", line 90, characters 6-23:
Warning 3: deprecated: Stdlib.String.capitalize
Use String.capitalize_ascii instead.
make[1]: *** [Makefile:107: opam.install] Error 1
make[1]: Leaving directory '/cygdrive/d/opam-2.0.4'
make: *** [Makefile:195: cold] Error 2

real    105m19.975s
user    13m22.562s
sys     89m6.161s

@jfehrle
Copy link
Author

jfehrle commented May 21, 2019

I installed a fresh cygwin32 and did a make cold in it. I got the same 13 "exit 1" errors shown in my previous comment. This cygwin doesn't have dune installed. $ find . -type f -executable -name "dune*" in the root directory finds nothing.

@dra27
Copy link
Member

dra27 commented Aug 20, 2019

Sorry for the extreme lag - the problem in that recent build log is that you don't have g++ installed (it's definitely a bug that that wasn't clearer)

@rjbou
Copy link
Collaborator

rjbou commented Feb 18, 2020

What is the status of this issue ? Does installing g++ resolved it @jfehrle ?

@jfehrle
Copy link
Author

jfehrle commented Feb 18, 2020

I have no idea. I set this aside soon after I filed the issue. Now I'm using WSL instead of Cygwin. When the virtual-machine version of WSL becomes available later this year, my system should behave about like a native Linux (e.g. supporting sandboxing).

@dra27 dra27 self-assigned this Jul 14, 2021
@dra27 dra27 added this to To do in Opam 2.2.0 via automation Jul 14, 2021
@dra27
Copy link
Member

dra27 commented Jul 16, 2021

Cross referencing #4452.

@dra27
Copy link
Member

dra27 commented Jul 29, 2021

autoconf is very strange where its detection of C++ compilers is concerned - not only does it not verify that the command it found is actually a C++ compiler, but if all else fails it just guesses g++ without even checking that g++ is a command! (it's a known bug for well over a decade).

opam was attempting to work around this weirdness, but it assumed that CXX=g++ and GXX empty was the strange "no C++ compiler" case. However, one of the more obscure commands which is guessed at as a C++ compiler is CC (as in cc in capitals). On Cygwin, which is case insensitive, this executes cc and so succeeds.

This will be fixed in 2.2.0

@dra27 dra27 linked a pull request Jul 29, 2021 that will close this issue
@dra27 dra27 moved this from To do to In progress in Opam 2.2.0 Jul 29, 2021
Opam 2.2.0 automation moved this from In progress to Done Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Opam 2.2.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants