rdicosmo / parmap

Parmap is a minimalistic library allowing to exploit multicore architecture for OCaml programs with minimal modifications.

Home Page:http://rdicosmo.github.io/parmap/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build error: No rule to make target 'setcore.cmi', needed by 'parmap.cma'

taskset opened this issue · comments

bash-4.3# git remote -v
origin https://github.com/rdicosmo/parmap.git (fetch)
origin https://github.com/rdicosmo/parmap.git (push)
bash-4.3#

bash-4.3# git pull
Already up-to-date.

bash-4.3# git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

bash-4.3# make
ocamlfind ocamlc -package "unix bigarray " -c bytearray.mli
ocamlfind ocamlc -package "unix bigarray " -c parmap_utils.mli
ocamlfind ocamlc -package "unix bigarray " -c parmap.mli
make: *** No rule to make target 'setcore.cmi', needed by 'parmap.cma'. Stop.

A workaround for this problem is to manually compile setcore.ml:
bash-4.3# ocamlc -g -c setcore.ml
bash-4.3# make
This time we can compile successfully.

Can you try this:

To compile from git, do this first :

aclocal -I m4
autoconf
autoheader
./configure
make

@UnixJunkie Thank you very much.
I tried this method, but it still had problems:

bash-4.3#
bash-4.3# git pull
Already up-to-date.
bash-4.3#
bash-4.3# git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
bash-4.3#
bash-4.3# aclocal -I m4
bash-4.3#
bash-4.3# autoconf
bash-4.3#
bash-4.3# autoheader
bash-4.3#
bash-4.3# ./configure
checking for ocamlc... ocamlc
OCaml version is 4.06.0
OCaml library path is /usr/lib64/ocaml
checking for ocamlopt... ocamlopt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for dynlink.cmxa... yes
checking for ocaml... ocaml
checking for ocamldep... ocamldep
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
checking for ocamlbuild... no
checking for ocamlfind... ocamlfind
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
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 accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking whether sched_setaffinity is declared... yes
checking mach/thread_policy.h usability... no
checking mach/thread_policy.h presence... no
checking for mach/thread_policy.h... no
checking whether thread_policy_set is declared... no
ocamlbuild does not exists or it does not support -use-ocamlfind
configure: creating ./config.status
config.status: creating Makefile_3.11
config.status: creating config.h
config.status: config.h is unchanged
bash-4.3#
bash-4.3# make
ocamlfind ocamlc -package "unix bigarray " -c bytearray.mli
ocamlfind ocamlc -package "unix bigarray " -c parmap_utils.mli
ocamlfind ocamlc -package "unix bigarray " -c parmap.mli
make: *** No rule to make target 'setcore.cmi', needed by 'parmap.cma'. Stop.
bash-4.3#

Can you install ocamlbuild and try again?

hi @UnixJunkie , thanks again.

1, I've install ocamlbuild.
$ opam list

Packages matching: installed

Name # Installed # Synopsis

base-bigarray base
base-threads base
base-unix base
conf-m4 1 Virtual package relying on m4
ocaml 4.06.0 The OCaml compiler (virtual package)
ocaml-config 1 OCaml Switch Configuration
ocaml-system 4.06.0 The OCaml compiler (system version, from outside of opam)
ocamlbuild 0.12.0 OCamlbuild is a build system with builtin rules to easily build most OCaml projects.
ocamlfind 1.8.0 A library manager for OCaml

2, but parmap still can't detect ocambuild.
$ ./configure
checking for ocamlc... ocamlc
OCaml version is 4.06.0
OCaml library path is /usr/lib64/ocaml
checking for ocamlopt... ocamlopt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for dynlink.cmxa... yes
checking for ocaml... ocaml
checking for ocamldep... ocamldep
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
checking for ocamlbuild... no
checking for ocamlfind... ocamlfind

3, I manually set up a soft link to ocamlbuild.native:
$ sudo ln -s ~/.opam/default/bin/ocamlbuild.native /usr/local/bin/ocamlbuild

4,ocambuild can be detected this time.
$ ./configure
checking for ocamlc... ocamlc
OCaml version is 4.06.0
OCaml library path is /usr/lib64/ocaml
checking for ocamlopt... ocamlopt
checking for ocamlc.opt... ocamlc.opt
checking for ocamlopt.opt... ocamlopt.opt
checking for dynlink.cmxa... yes
checking for ocaml... ocaml
checking for ocamldep... ocamldep
checking for ocamlmktop... ocamlmktop
checking for ocamlmklib... ocamlmklib
checking for ocamldoc... ocamldoc
checking for ocamlbuild... ocamlbuild
checking for ocamlfind... ocamlfind

4,and then, the parmap project can be compiled successfully.

Thanks.

So, the problem was that you tried to build parmap without having installed all your ocaml env with opam,
and that did not work.
I guess @rdicosmo will decide if this needs to be supported or if this issue can be closed.
My advice: forget all system-wide ocaml packages and install everything via opam.

Hi, @UnixJunkie and @rdicosmo thank you.
I really appreciate your help and instruction.
For this problem, parmap relies on ocamlbuild, and when the configure script detects that ocamlbuid does not exist, it should report an error rather than continue running.
Regards,

If you can provide a patch to the configure script in order to fix it this way, your help would be greatly appreciated. Unfortunately, I know nothing about configure and m4.

The user suggests the following fix:

the configure script detects that ocamlbuid does not exist, it should report an error rather

It seems reasonable.
I don't know configure/m4/autoconf but I guess it should be easy to implement.