* OCaml compilation
@ 2010-05-27 20:38 Matthieu Dubuget
2010-05-28 7:01 ` [Caml-list] " David Allsopp
2010-06-08 9:24 ` Matthieu Dubuget
0 siblings, 2 replies; 6+ messages in thread
From: Matthieu Dubuget @ 2010-05-27 20:38 UTC (permalink / raw)
To: caml-list
Hello,
I'm trying to compile ocaml (mingw) on XP.
I did not succeed, and could reproduce the very same behaviour on two
computers (a real one, and in a virtual machine).
On my main development system, the compilation does not fail. The
difference may be that I don't touch at my currently working cygwin
installation. During the two failing installs, I did install a fresh
cygwin. Is this a known problem?
Following are some (pseudo)code extracted from the script I use to make
my installation.
Can anyone spot a mistake, that would explain the failure ?
Thanks in advance.
Matt
> 1/ cygwin installation: (where setup.exe is downloaded from cygwin web
> site)
> setup.exe -s http://cygwin.cict.fr/ -R c:\cygwin -q -l c:\depot_cygwin
> -n -C Base -P
> wget,unzip,binutils,diffutils,gcc-core,gcc-mingw-core,make,mingw-runtime,ncurses,w32api,m4,time,patch
>
>
> 2/ home creation: (.bat script)
> ---
> @echo off
>
> c:
> chdir c:\cygwin\bin
> set LANG=fr_FR.UTF-8
> bash --login -i
> ---
>
> 3/ After home is created,
>
> export LANG=fr_FR.UTF-8
>
> is added into .bash_profile
>
> 4/ a cygwin session is launched
>
> 5/ ActiveTcl installation
>
> #!/bin/bash
> activetcl=ActiveTcl8.5.8.0.291595-win32-ix86-threaded.exe
> activetcldownload=http://downloads.activestate.com/ActiveTcl/Windows/8.5.8/${activetcl}
>
> tkroot=C:/tcl
> tkdll=tk85.dll
> tcldll=tcl85.dll
> download_file ${activetcl} ${activetcldownload}
> chmod +x ${downloaddir}/${activetcl}
> ${downloaddir}/${activetcl} --directory ${tkroot}
>
> 6/ disconnect (windows xp session), reconnect, launch cygwin
> (because ActiveTcl modifies environment (path addded))
>
> 7/ flexlink install
>
> here=`pwd`
> prefix=/home/matt
> appsprefix=${prefix}/apps
> prefixwin=C:/cygwin${prefix}
> appsprefixwin=${prefixwin}/apps
> downloaddir=${here}/download
> extractdir=${here}/extracted
> mkdir ${prefix}/apps
>
> extract_archive_zip "${downloaddir}/${flexarchive}" ${flexdestdir}
> cp /usr/bin/gcc-3.exe ${flexdestdir}/gcc.exe
> cp /usr/bin/cpp-3.exe ${flexdestdir}/cpp.exe
>
> echo 'export PATH="${flexdestdir}:$PATH' >> ${HOME}/.bash_profile"
>
> 8/ Edit .bash_profile
>
> export PATH="/home/matt/apps/flex:$PATH"
>
> 9/ OCaml building
>
> #!/bin/bash
> ocaml=ocaml-3.11.2
> ocamlarchive=${ocaml}.tar.bz2
> ocamldownload=http://caml.inria.fr/pub/distrib/ocaml-3.11/${ocamlarchive}
>
> download_file ${ocamlarchive} ${ocamldownload}
>
> #Extract
> extract_archive ${downloaddir}/${ocamlarchive} ${extractdir} ${ocaml}
>
> #Configure
> cp ${extractdir}/${ocaml}/config/s-nt.h ${extractdir}/${ocaml}/config/s.h
> cp ${extractdir}/${ocaml}/config/m-nt.h ${extractdir}/${ocaml}/config/m.h
> cp ${extractdir}/${ocaml}/config/Makefile.mingw
> ${extractdir}/${ocaml}/config/Makefile
>
> tklink='$(TK_ROOT)'
> cmd1="s|PREFIX=C:/ocamlmgw|PREFIX=$ocamldirwin|"
> cmd2="s|TK_ROOT=c:/tcl|TK_ROOT=$tkroot|"
> cmd3="s|TK_LINK=$tklink/bin/tk84.dll $tklink/bin/tcl84.dll
> -lws2_32|TK_LINK=${tklink}/bin/${tkdll} ${tklink}/bin/${tcldll}
> -lws2_32|"
> sed -i.bak \
> -e "$cmd1" \
> -e "$cmd2" \
> -e "$cmd3" \
> ${extractdir}/${ocaml}/config/Makefile
>
>
> cd ${extractdir}/${ocaml} && \
> make -f Makefile.nt world
>
> Fails during ocamlbrowser compilation:
>
>> gcc -mno-cygwin -O -mms-bitfields -Wall -Wno-unused
>> -I../../../byterun -IC:/tcl/include -c winmain.c
>> ../../../ocamlcomp.sh -o ocamlbrowser.exe -I
>> ../../../otherlibs/win32unix -I ../../../otherlibs/str -I
>> ../../../otherlibs/systhreads -I ../labltk -I ../lib -I ../support -I
>> ../../../parsing -I ../../../utils -I ../../../typing \
>> ../../../toplevel/toplevellib.cma \
>> unix.cma str.cma threads.cma -custom -ccopt "-link
>> -Wl,--subsystem,windows" labltk.cma jglib.cma \
>> list2.cmo useunix.cmo setpath.cmo
>> lexical.cmo fileselect.cmo searchid.cmo searchpos.cmo
>> shell.cmo help.cmo viewer.cmotypecheck.cmo editor.cmo main.cmo
>> winmain.o
>> ** Cannot resolve symbols for descriptor object:
>> _Tcl_AppendResult
>> _Tcl_CreateChannelHandler
>> _Tcl_CreateCommand
>> _Tcl_CreateInterp
>> _Tcl_CreateTimerHandler
>> _Tcl_DStringAppend
>> _Tcl_DStringFree
>> _Tcl_DStringInit
>> _Tcl_DeleteChannelHandler
>> _Tcl_DeleteTimerHandler
>> _Tcl_DoOneEvent
>> _Tcl_Eval
>> _Tcl_EvalFile
>> _Tcl_ExternalToUtfDString
>> _Tcl_Finalize
>> _Tcl_FindExecutable
>> _Tcl_Free
>> _Tcl_GetCommandInfo
>> _Tcl_GetInt
>> _Tcl_GetVar
>> _Tcl_Init
>> _Tcl_MakeFileChannel
>> _Tcl_MakeTcpClientChannel
>> _Tcl_Merge
>> _Tcl_ResetResult
>> _Tcl_SetResult
>> _Tcl_SetVar
>> _Tcl_SplitList
>> _Tcl_TraceVar
>> _Tcl_UntraceVar
>> _Tcl_UntraceVar2
>> _Tcl_UtfToExternalDString
>> _Tk_GeometryRequest
>> _Tk_Init
>> _Tk_MainLoop
>> _Tk_MainWindow
>> File "_none_", line 1, characters 0-1:
>> Error: Error while building custom runtime system
>> make[2]: *** [ocamlbrowser.exe] Erreur 2
>> make[2]: quittant le répertoire «
>> /cygdrive/m/projets/Install/InstallDevTools/install_ocaml/InstallPack/extracted/ocaml-3.11.2/otherlibs/labltk/browser
>> »
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [Caml-list] OCaml compilation
2010-05-27 20:38 OCaml compilation Matthieu Dubuget
@ 2010-05-28 7:01 ` David Allsopp
2010-05-28 10:04 ` Matthieu Dubuget
[not found] ` <4BFF7AB7.6080003@gmail.com>
2010-06-08 9:24 ` Matthieu Dubuget
1 sibling, 2 replies; 6+ messages in thread
From: David Allsopp @ 2010-05-28 7:01 UTC (permalink / raw)
To: matthieu.dubuget, caml-list
Matthieu Dubuget wrote:
> Hello,
>
> I'm trying to compile ocaml (mingw) on XP.
>
> I did not succeed, and could reproduce the very same behaviour on two
> computers (a real one, and in a virtual machine).
>
> On my main development system, the compilation does not fail. The
> difference may be that I don't touch at my currently working cygwin
> installation. During the two failing installs, I did install a fresh
> cygwin. Is this a known problem?
Don't think it's Cygwin - looks from the error like it's your ActiveTcl
parameters.
<snip>
> > 5/ ActiveTcl installation
> >
> > #!/bin/bash
> > activetcl=ActiveTcl8.5.8.0.291595-win32-ix86-threaded.exe
> > activetcldownload=http://downloads.activestate.com/ActiveTcl/Windows/8
> > .5.8/${activetcl}
Installs Tcl 8.5
> > tkroot=C:/tcl
> > tkdll=tk85.dll
> > tcldll=tcl85.dll
> > download_file ${activetcl} ${activetcldownload} chmod +x
> > ${downloaddir}/${activetcl} ${downloaddir}/${activetcl} --directory
> > ${tkroot}
<snip>
> > 9/ OCaml building
> >
> > #!/bin/bash
> > ocaml=ocaml-3.11.2
> > ocamlarchive=${ocaml}.tar.bz2
> > ocamldownload=http://caml.inria.fr/pub/distrib/ocaml-3.11/${ocamlarchi
> > ve}
> >
> > download_file ${ocamlarchive} ${ocamldownload}
> >
> > #Extract
> > extract_archive ${downloaddir}/${ocamlarchive} ${extractdir} ${ocaml}
> >
> > #Configure
> > cp ${extractdir}/${ocaml}/config/s-nt.h
> > ${extractdir}/${ocaml}/config/s.h cp
> > ${extractdir}/${ocaml}/config/m-nt.h ${extractdir}/${ocaml}/config/m.h
> > cp ${extractdir}/${ocaml}/config/Makefile.mingw
> > ${extractdir}/${ocaml}/config/Makefile
> >
> > tklink='$(TK_ROOT)'
> > cmd1="s|PREFIX=C:/ocamlmgw|PREFIX=$ocamldirwin|"
> > cmd2="s|TK_ROOT=c:/tcl|TK_ROOT=$tkroot|"
> > cmd3="s|TK_LINK=$tklink/bin/tk84.dll $tklink/bin/tcl84.dll
> > -lws2_32|TK_LINK=${tklink}/bin/${tkdll} ${tklink}/bin/${tcldll}
> > -lws2_32|"
> > sed -i.bak \
> > -e "$cmd1" \
> > -e "$cmd2" \
> > -e "$cmd3" \
> > ${extractdir}/${ocaml}/config/Makefile
Does this definitely build the correct Makefile - you're searching for
tcl84.dll but out-of-the-box OCaml 3.11.2 uses references tcl85.dll. Your
sed instruction would be better if it was TK_ROOT=.* rather than assuming
the value that the OCaml Dev team will have left there. You shouldn't need
to update TK_LINK.
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Caml-list] OCaml compilation
2010-05-28 7:01 ` [Caml-list] " David Allsopp
@ 2010-05-28 10:04 ` Matthieu Dubuget
[not found] ` <4BFF7AB7.6080003@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Matthieu Dubuget @ 2010-05-28 10:04 UTC (permalink / raw)
To: caml-list
Thanks for your answer, David.
> Installs Tcl 8.5
>
>
Yes.
>>> tkroot=C:/tcl
>>> tkdll=tk85.dll
>>> tcldll=tcl85.dll
>>> download_file ${activetcl} ${activetcldownload} chmod +x
>>> ${downloaddir}/${activetcl} ${downloaddir}/${activetcl} --directory
>>> ${tkroot}
>>>
> <snip>
>
>
>>> 9/ OCaml building
>>>
>>> #!/bin/bash
>>> ocaml=ocaml-3.11.2
>>> ocamlarchive=${ocaml}.tar.bz2
>>> ocamldownload=http://caml.inria.fr/pub/distrib/ocaml-3.11/${ocamlarchi
>>> ve}
>>>
>>> download_file ${ocamlarchive} ${ocamldownload}
>>>
>>> #Extract
>>> extract_archive ${downloaddir}/${ocamlarchive} ${extractdir} ${ocaml}
>>>
>>> #Configure
>>> cp ${extractdir}/${ocaml}/config/s-nt.h
>>> ${extractdir}/${ocaml}/config/s.h cp
>>> ${extractdir}/${ocaml}/config/m-nt.h ${extractdir}/${ocaml}/config/m.h
>>> cp ${extractdir}/${ocaml}/config/Makefile.mingw
>>> ${extractdir}/${ocaml}/config/Makefile
>>>
>>> tklink='$(TK_ROOT)'
>>> cmd1="s|PREFIX=C:/ocamlmgw|PREFIX=$ocamldirwin|"
>>> cmd2="s|TK_ROOT=c:/tcl|TK_ROOT=$tkroot|"
>>> cmd3="s|TK_LINK=$tklink/bin/tk84.dll $tklink/bin/tcl84.dll
>>> -lws2_32|TK_LINK=${tklink}/bin/${tkdll} ${tklink}/bin/${tcldll}
>>> -lws2_32|"
>>> sed -i.bak \
>>> -e "$cmd1" \
>>> -e "$cmd2" \
>>> -e "$cmd3" \
>>> ${extractdir}/${ocaml}/config/Makefile
>>>
> Does this definitely build the correct Makefile - you're searching for
> tcl84.dll but out-of-the-box OCaml 3.11.2 uses references tcl85.dll. Your
> sed instruction would be better if it was TK_ROOT=.* rather than assuming
> the value that the OCaml Dev team will have left there. You shouldn't need
> to update TK_LINK.
>
>
Here are the corresponding lines in the Makefile just after sed ran:
### Configuration for LablTk
# Set TK_ROOT to the directory where you installed TCL/TK 8.5
# There must be no spaces or special characters in $(TK_ROOT)
TK_ROOT=C:/tcl
TK_DEFS=-I$(TK_ROOT)/include
TK_LINK=$(TK_ROOT)/bin/tk85.dll $(TK_ROOT)/bin/tcl85.dll -lws2_32
I'm ok with your advices in order to improve my small scripts. In this
case (3.11.2),
cmd3 does not modify anything. But it does when I'm installing an older
version of
Anyway,
the resulting Makefile seems ok to me. And it compiles fine in one computer.
Salutations
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <4BFF7AB7.6080003@gmail.com>]
* Re: OCaml compilation
2010-05-27 20:38 OCaml compilation Matthieu Dubuget
2010-05-28 7:01 ` [Caml-list] " David Allsopp
@ 2010-06-08 9:24 ` Matthieu Dubuget
1 sibling, 0 replies; 6+ messages in thread
From: Matthieu Dubuget @ 2010-06-08 9:24 UTC (permalink / raw)
Cc: caml-list
Hello,
I'm answering to myself, since I understood the problem.
I had LANG=fr_FR.UTF-8 in my environment.
This led objdump to generate a dump file with:
Table [Ordinal/Nom de pointeurs]
instead of
[Ordinal/Name Pointer] Table
This line is searched by flexlink.exe when parsing
objdump file, and was nether found.
Salutations
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-06-08 9:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-27 20:38 OCaml compilation Matthieu Dubuget
2010-05-28 7:01 ` [Caml-list] " David Allsopp
2010-05-28 10:04 ` Matthieu Dubuget
[not found] ` <4BFF7AB7.6080003@gmail.com>
[not found] ` <1275036886.4305.5.camel@Nokia-N900-02-8>
2010-05-28 10:06 ` Matthieu Dubuget
2010-05-28 12:43 ` Matthieu Dubuget
2010-06-08 9:24 ` Matthieu Dubuget
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).