Subject: pkg/28410: math/scilab does not build
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <sutre@labri.fr>
List: pkgsrc-bugs
Date: 11/24/2004 17:45:01
>Number:         28410
>Category:       pkg
>Synopsis:       math/scilab does not build: missing ocaml buildlink
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 24 17:45:00 +0000 2004
>Originator:     sutre@labri.fr
>Release:        NetBSD 2.0_RC4
>Organization:
>Environment:
	
	
System: NetBSD gavarnie 2.0_RC4 NetBSD 2.0_RC4 (STD-PC) #0: Tue Nov 2 07:32:08 CET 2004 instsoft@gavarnie:/usr/src/sys/arch/i386/compile/STD-PC i386
Architecture: i386
Machine: i386
>Description:

I could not build math/scilab on my NetBSD 2.0_RC4 i386 system,
apparently for two reasons:

(1) the makefile scilab-3.0/ocaml/Makefile does not look like a NetBSD
    compliant Makefile.  This was fixed by modifying this Makefile,
    using a patch (see the Fix section below).
    
   
(2) make opt in scilab-3.0/ocaml fails as it cannot find ocaml's
    libasmrun.a library. This was fixed by adding a buildlink line
    for ocaml in math/scilab's Makefile (see the Fix section below).


Last lines of log for problem (1) :

making all in routines/pvm...
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c pvm_grp.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c pvm_proc_ctrl.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c pvm_send.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c pvm_info.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c pvm_recv.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c scipvmf77.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c varpack.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -c intpvm.c
g77 -O -c mycmatptr.f
Creation of ../../libs/pvm.a
making all in ocaml...
make: "/usr/pkgsrc/math/scilab/work.i386/scilab-3.0/ocaml/Makefile" line 69: warning: duplicate script for target "%.ml" ignored
make: "/usr/pkgsrc/math/scilab/work.i386/scilab-3.0/ocaml/Makefile" line 65: warning: using previous script for "%.ml" defined here
make: don't know how to make %.mly. Stop

make: stopped in /usr/pkgsrc/math/scilab/work.i386/scilab-3.0/ocaml
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/math/scilab/work.i386/scilab-3.0
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab


Last lines of log for problem (2), with fix (1) applied :

making all in routines/pvm...
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c pvm_grp.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c pvm_proc_ctrl.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c pvm_send.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c pvm_info.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c pvm_recv.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c scipvmf77.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c varpack.c
gcc -O2 -I/usr/pkg/include -I/usr/pkg/pvm3/include -I/usr/include -Dnetbsd  -I/usr/pkg/pvm3/include   -I/usr/pkg/include -I/usr/pkg/pvm3/includinclude -c intpvm.c
g77 -O -c mycmatptr.f
Creation of ../../libs/pvm.a
making all in ocaml...
make depend
42 states, 522 transitions, table size 2340 bytes
make opt
gcc: /usr/pkgsrc/math/scilab/work.i386/.buildlink/lib/ocaml/libasmrun.a: No such file or directory
Error during linking
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/math/scilab/work.i386/scilab-3.0/ocaml
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab/work.i386/scilab-3.0/ocaml
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab/work.i386/scilab-3.0
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/math/scilab



>How-To-Repeat:

cd math/scilab
make

>Fix:

(1) Apply the following patch to scilab's sources before building (or
    add this patch to the (local) patches directory) :

######################################################################
--- ocaml/Makefile.orig	Tue Mar 30 15:30:26 2004
+++ ocaml/Makefile	Thu Oct 28 19:56:30 2004
@@ -26,7 +26,7 @@ PLATFORM=$(shell uname -s)
 EXE=modelicac
 
 
-.SUFFIXES: .ml .mli .cmo .cmi .cmx .mlp .mpi
+.SUFFIXES: .ml .mli .cmo .cmi .cmx .mlp .mpi .mll .mly
 
 
 
@@ -60,12 +60,12 @@ EXE=modelicac
 	@$(OCAMLOPT) $(OCAMLOPTFLAGS) -c $(<)
 
 
-%.ml %.mli: %.mly
+.mly.ml:
 	@ocamlyacc $(<)
 	@$(RM) -f $(<:.mly=.mli)
 
 
-%.ml: %.mll
+.mll.ml:
 	@ocamllex $(<)
 
 
######################################################################


(2) Add the following line in : math/scilab/Makefile

    .include "../../lang/ocaml/buildlink3.mk"

>Unformatted: