English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Build error w/ Findlib on Mandrake 10.1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-05-30 (22:50)
From: Matt Gushee <mgushee@h...>
Subject: Build error w/ Findlib on Mandrake 10.1
Hello, all--

A user of my Bantam file manager has reported a very strange compilation 

   ocamlfind ocamlopt -package "unix str labltk" -c common.ml
   ocamlfind ocamlopt -package "unix str labltk" -c util.ml
   ocamlfind ocamlopt -package "unix str labltk" -c config.ml
   ocamlfind ocamlopt -package "unix str labltk" -c images.ml
   ocamlfind ocamlopt -package "unix str labltk" -c bantam.ml
   ocamlfind ocamlopt -package "unix str labltk" -linkpkg -o bantam.bin \
     common.cmx util.cmx config.cmx images.cmx bantam.cmx
   Cannot find file /usr/lib/ocaml//labltk/labltk.so.cmxa
   make: *** [opt] Error 2

This user is not very familiar with OCaml; he is using the Mandrake 10.1 

Although I suspect there was an error on the part of whoever packaged 
OCaml (or Findlib) for Mandrake, perhaps there is an error on my part. 
Just in case, I have included my Makefiles below.

Does anyone have an idea what's wrong? I'd appreciate any suggestions.

Matt Gushee
Englewood, CO, USA

-- Makefile ----------------------------------------------------------
BANTAM_HOME = /usr/local
LIBDIR = $(BANTAM_HOME)/lib/bantam
DATADIR = $(BANTAM_HOME)/share/bantam


#SRCS = bantam.ml
#BYTE_OBJS = $(SRCS:.ml=.cmo)
#NAT_OBJS = $(SRCS:.ml=.cmx)

include Makefile.build

.PHONY : all byte opt install clean test

install :
	install -d $(BINDIR)
	$$(for sub in config scripts; do \
		install -d $(DATADIR)/skeleton/$$sub; \
	install bantam.bin $(BINDIR)
	install bantam.sh $(BINDIR)/bantam
	install -m 644 skeleton/config/* $(DATADIR)/skeleton/config
	install skeleton/scripts/* $(DATADIR)/skeleton/scripts
	install -m 644 VERSION $(DATADIR)

clean :
	-rm -f *.cm? *.o *.a bantam.ml
	-rm -rf testdata

distclean : clean
	-rm -f Makefile* bantam.sh *.ml

realclean : clean
	-rm -f bantam bantam.sh bantam.bin

test :
	#export BANTAM_USER_DIR=./skeleton
	#export PATH=$$BANTAM_USER_DIR/scripts:$$PATH
	#export BANTAM_BINDIR=.
	#export BANTAM_DATA=.
	#exec bantam.bin
	cp -R skeleton testdata
	BANTAM_USER_DIR=./testdata PATH=./testdata/scripts:$$PATH \
-- #EOF# -------------------------------------------------------------

-- Makefile.build ----------------------------------------------------
OCAMLC = ocamlc
OCAMLOPT = ocamlopt
OCAMLFIND = ocamlfind

BASE_SRCS = common.ml util.ml bConfig.ml images.ml
SRCS = $(BASE_SRCS) bantam_.ml
BYTE_OBJS = $(BASE_BYTE_OBJS) bantam.cmo
NAT_OBJS = $(BASE_SRCS:.ml=.cmx) bantam.cmx
DEPS = "unix str labltk"

RELIEF = $(shell bash -c '\
	version=`ocamlc -version`; \
	major=$${version:0:4}; \
	minor=$${version:5}; \
	if [ $$major = "3.08" ] && [ $$minor ] && [ $$minor -ge 3 ]; then \
		echo "Solid"; \
	else \
		echo "Flat"; \
	fi' )

.PHONY : all byte opt install clean


opt : $(NAT_OBJS) bantam.sh
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -linkpkg -o bantam.bin 

byte : $(BYTE_OBJS) bantam.sh
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -linkpkg -o bantam.bin $(BYTE_OBJS)

bantam.sh : bantam.sh.0 bantam.sh.2
	-rm -f bantam.sh
	cat bantam.sh.0 >> bantam.sh
	echo "    BANTAM_HOME=$(BANTAM_HOME)" >> bantam.sh
	cat bantam.sh.2 >> bantam.sh

bantam.cmx : bantam.ml
	#$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) \
	#	-pp "camlp4o pa_ifdef.cmo $(SOLID)" -c $<
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -c $<

bantam.cmo : bantam.ml
	#$(OCAMLFIND) $(OCAMLC) -package $(DEPS) \
	#	-pp "camlp4o pa_ifdef.cmo $(SOLID)" -c $<
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -c $<

bantam.ml : bantam_.ml
	sed "s/@RELIEF@/$(RELIEF)/" bantam_.ml >bantam.ml

%.cmx : %.ml
	$(OCAMLFIND) $(OCAMLOPT) -package $(DEPS) -c $<

%.cmo : %.ml
	$(OCAMLFIND) $(OCAMLC) -package $(DEPS) -c $<
-- #EOF# -------------------------------------------------------------