From 006731f32799c0a4e4d2b083ca8588fbd1878311 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 29 Dec 2015 02:19:08 +0100 Subject: [PATCH] Fixed ocaml compiling --- README.md | 2 +- build.ninja | 4 ++-- ocaml/build.ninja | 20 ++++++++++---------- scripts/compile_ocaml_dep.sh | 12 +----------- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 797cd74..327dff6 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,6 @@ References [Quantum Monte Carlo for large chemical systems: Implementing efficient strategies for petascale platforms and beyond](http://dx.doi.org/10.1002/jcc.23216) > Anthony Scemama , Michel Caffarel , Emmanuel Oseret and William Jalby (2013), in: Journal of Computational Chemistry, 34:11(938--951) -[Quantum Monte Carlo with very large multideterminant wavefunctions](http://arxiv.org/abs/1509.03114) +[Quantum Monte Carlo with very large multideterminant wavefunctions](http://arxiv.org/abs/1510.00730) > Anthony Scemama , Thomas Applencourt , Emmanuel Giner and Michel Caffarel (2015), in: ArXiv ePrints:arXiv:1510.00730v2 [physics.chem-ph] diff --git a/build.ninja b/build.ninja index b949c98..7f83e08 100644 --- a/build.ninja +++ b/build.ninja @@ -44,7 +44,7 @@ rule clean # put all files of PROPERTIES here # -------------------------------- -build ezfio_config/properties.config: build_properties_config | scripts/create_properties_python.py src/PROPERTIES/properties.irp.f src/PROPERTIES/properties_energy.irp.f src/PROPERTIES/properties_general.irp.f || src/IRPF90_temp/build.ninja +build ezfio_config/properties.config ocaml/Property.ml: build_properties_config | scripts/create_properties_python.py src/PROPERTIES/properties.irp.f src/PROPERTIES/properties_energy.irp.f src/PROPERTIES/properties_general.irp.f || src/IRPF90_temp/build.ninja # EZFIO # ----- @@ -68,7 +68,7 @@ build qmcchem.tar.gz: create_archive # Ocaml # ----- -build ocaml/generated.ninja : compile_ocaml_dep | EZFIO/Ocaml/ezfio.ml always || src/irpf90.make +build ocaml/generated.ninja : compile_ocaml_dep | EZFIO/Ocaml/ezfio.ml ocaml/Property.ml always build ocaml/qmcchem : compile_ocaml | ocaml/generated.ninja EZFIO/Ocaml/ezfio.ml target = qmcchem diff --git a/ocaml/build.ninja b/ocaml/build.ninja index 358ee54..db12102 100644 --- a/ocaml/build.ninja +++ b/ocaml/build.ninja @@ -17,7 +17,7 @@ OCAMLC_FLAGS=-g -warn-error A # Flags to give to ocamlc, for example: # OCAMLC_FLAGS=-g -warn-error A -LINK_FLAGS=-cclib '-Wl,-rpath=../lib,--enable-new-dtags' +LINK_FLAGS= # Flags to give to the linker, for example: # LINK_FLAGS=-cclib '-Wl,-rpath=../lib,--enable-new-dtags' @@ -34,7 +34,7 @@ rule run_ninja_ocaml description = Finding dependencies in OCaml files rule run_clean - command = ninja -f $GENERATED_NINJA -t clean ; rm -f $GENERATED_NINJA rm -f *.cmx *.cmi *.o .ls_md5 + command = ninja -f $GENERATED_NINJA -t clean ; rm -f $GENERATED_NINJA rm -f *.cmx *.cmi *.o .ls_md5 ; ninja -t clean pool = console description = Cleaning directory @@ -51,7 +51,7 @@ rule ocamlc_link description = Compiling $out (bytecode) rule ocamlopt_link - command = ocamlfind ocamlopt $OCAMLC_FLAGS $THREAD $LINK_FLAGS $PACKAGES $SYNTAX -o $out $in + command = ocamlfind ocamlopt $OCAMLC_FLAGS $THREAD -linkpkg $PACKAGES $PACKAGES $SYNTAX -o $out $in description = Compiling $out (native) rule create_qptypes @@ -62,19 +62,19 @@ rule copy command = cp $in $out description = Copying $in to $out -build always: phony | ezfio.ml -build $GENERATED_NINJA: run_ninja_ocaml | always +build always: phony +build $GENERATED_NINJA: run_ninja_ocaml | Qptypes.ml ezfio.ml always build ezfio.ml: copy ../EZFIO/Ocaml/ezfio.ml -build Qptypes.ml: create_qptypes qptypes_generator -build qptypes_generator: run_ninja | $GENERATED_NINJA ezfio.ml - target = qptypes_generator +build Qptypes.ml: create_qptypes qptypes_generator | ezfio.ml +build qptypes_generator.o qptypes_generator.cmx: ocamlopt qptypes_generator.ml | ezfio.ml +build qptypes_generator: ocamlopt_link qptypes_generator.cmx build clean: run_clean -build $MAIN: run_ninja | $GENERATED_NINJA ezfio.ml Qptypes.ml +build $MAIN: run_ninja | ezfio.ml Qptypes.ml $GENERATED_NINJA target = $MAIN -build all: run_ninja | ezfio.ml $GENERATED_NINJA Qptypes.ml +build all: run_ninja | ezfio.ml Qptypes.ml $GENERATED_NINJA target = default $MAIN diff --git a/scripts/compile_ocaml_dep.sh b/scripts/compile_ocaml_dep.sh index cafbefc..519175a 100755 --- a/scripts/compile_ocaml_dep.sh +++ b/scripts/compile_ocaml_dep.sh @@ -25,17 +25,7 @@ if [[ ${MD5} != ${REF} ]] then echo ${MD5} > ${LSMD5_FILE} echo Finding dependencies in OCaml files - python ./ninja_ocaml.py - if [[ ! -f qptypes_generator ]] - then - ninja -f generated.ninja qptypes_generator - fi - if [[ ! -f Qptypes.ml ]] - then - ./qptypes_generator - python ./ninja_ocaml.py - fi - + exec python ./ninja_ocaml.py fi