unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54890] [PATCH 1/3] gnu: nomad-optimizer: Remove input labels.
@ 2022-04-12 18:57 Paul A. Patience
  2022-04-12 18:57 ` [bug#54891] [PATCH 2/3] gnu: nomad-optimizer: Remove trailing booleans Paul A. Patience
  2022-04-12 18:57 ` [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Paul A. Patience
  0 siblings, 2 replies; 6+ messages in thread
From: Paul A. Patience @ 2022-04-12 18:57 UTC (permalink / raw)
  To: 54890; +Cc: Paul A. Patience

* gnu/packages/maths.scm (nomad-optimizer)[native-inputs]: Remove
labels.
---
 gnu/packages/maths.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 10a1f69b8e..6a6ac22a3b 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1950,8 +1950,7 @@ (define-public nomad-optimizer
          "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
     (build-system cmake-build-system)
     (native-inputs
-     `(("python" ,python-wrapper)
-       ("python-cython" ,python-cython)))
+     (list python-wrapper python-cython))
     (arguments
      `(#:imported-modules ((guix build python-build-system)
                            ,@%cmake-build-system-modules)
--
2.35.1






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#54891] [PATCH 2/3] gnu: nomad-optimizer: Remove trailing booleans.
  2022-04-12 18:57 [bug#54890] [PATCH 1/3] gnu: nomad-optimizer: Remove input labels Paul A. Patience
@ 2022-04-12 18:57 ` Paul A. Patience
  2022-04-12 18:57 ` [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Paul A. Patience
  1 sibling, 0 replies; 6+ messages in thread
From: Paul A. Patience @ 2022-04-12 18:57 UTC (permalink / raw)
  To: 54891; +Cc: Paul A. Patience

* gnu/packages/maths.scm (nomad-optimizer)[arguments]: Remove trailing
booleans.
---
 gnu/packages/maths.scm | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 6a6ac22a3b..b68cb966c2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1994,8 +1994,7 @@ (define-public nomad-optimizer
                  (("^( +os_include_dirs = ).*" _ prefix)
                   (string-append prefix "[\"../../src\"]\n"))
                  (("^(installed_lib_dir = ).*" _ prefix)
-                  (string-append prefix "\"" out "/lib\"\n"))))
-             #t))
+                  (string-append prefix "\"" out "/lib\"\n"))))))

          ;; Fix the tests so they run in out-of-source builds.
          (add-after 'fix-sources-for-build 'fix-sources-for-tests
@@ -2060,8 +2059,7 @@ (define-public nomad-optimizer
                     (string-append builddir "/src/nomad ")))
                  (for-each
                   (lambda (f) (fix-exe-path dir f))
-                  '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))
-             #t))
+                  '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))))

          ;; The information in the .egg-info file is not kept up to date.
          (add-after 'install 'delete-superfluous-egg-info
@@ -2070,8 +2068,7 @@ (define-public nomad-optimizer
                            (site-packages inputs outputs)
                            "/PyNomad-0.0.0-py"
                            (python-version (assoc-ref inputs "python"))
-                           ".egg-info"))
-             #t)))))
+                           ".egg-info")))))))
     (home-page "https://www.gerad.ca/nomad/")
     (synopsis "Nonlinear optimization by mesh-adaptive direct search")
     (description
--
2.35.1






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0.
  2022-04-12 18:57 [bug#54890] [PATCH 1/3] gnu: nomad-optimizer: Remove input labels Paul A. Patience
  2022-04-12 18:57 ` [bug#54891] [PATCH 2/3] gnu: nomad-optimizer: Remove trailing booleans Paul A. Patience
@ 2022-04-12 18:57 ` Paul A. Patience
  2022-04-13 15:21   ` [bug#54892] [PATCH] gnu: nomad-optimizer: Fix some tests Paul A. Patience
       [not found]   ` <handler.54892.D54892.165036389832173.notifdone@debbugs.gnu.org>
  1 sibling, 2 replies; 6+ messages in thread
From: Paul A. Patience @ 2022-04-12 18:57 UTC (permalink / raw)
  To: 54892; +Cc: Paul A. Patience

* gnu/packages/maths.scm (nomad-optimizer): Update to 4.2.0.
[arguments]: Accommodate updated build process.
---
 gnu/packages/maths.scm | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b68cb966c2..8ebfb87480 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1937,17 +1937,17 @@ (define-public ipopt
 (define-public nomad-optimizer
   (package
     (name "nomad-optimizer")
-    (version "4.1.0")
+    (version "4.2.0")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
              (url "https://github.com/bbopt/nomad/")
-             (commit (string-append "v" version))))
+             (commit (string-append "v." version))))
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0w386d8r5ldbvnv0c0g7vz95pfpvwdxis26vaalk2amsa5akl775"))))
+         "1r4ygy3xn83dnppsw1451ynklsxpb238g5gk57inn84ghmdk08mj"))))
     (build-system cmake-build-system)
     (native-inputs
      (list python-wrapper python-cython))
@@ -1959,7 +1959,8 @@ (define-public nomad-optimizer
                   (guix build cmake-build-system)
                   (guix build utils))
        #:configure-flags
-       '("-DBUILD_INTERFACES=ON"
+       '("-DBUILD_INTERFACE_C=ON"
+         "-DBUILD_INTERFACE_PYTHON=ON"
          "-DBUILD_TESTS=ON")
        #:phases
        (modify-phases %standard-phases
@@ -1993,8 +1994,11 @@ (define-public nomad-optimizer
                (substitute* "interfaces/PyNomad/setup_PyNomad.py"
                  (("^( +os_include_dirs = ).*" _ prefix)
                   (string-append prefix "[\"../../src\"]\n"))
-                 (("^(installed_lib_dir = ).*" _ prefix)
-                  (string-append prefix "\"" out "/lib\"\n"))))))
+                 (("^(installed_lib_dir1 = ).*" _ prefix)
+                  (string-append prefix "\"" out "/lib\"\n"))
+                 (("^installed_lib_dir2 = .*") "")
+                 (("^ +link_args\\.append\\(\"-Wl,-rpath,\" \\+ installed_lib_dir2\\)\n")
+                  "")))))

          ;; Fix the tests so they run in out-of-source builds.
          (add-after 'fix-sources-for-build 'fix-sources-for-tests
--
2.35.1






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#54892] [PATCH] gnu: nomad-optimizer: Fix some tests.
  2022-04-12 18:57 ` [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Paul A. Patience
@ 2022-04-13 15:21   ` Paul A. Patience
  2022-04-19 10:24     ` bug#54892: [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Ludovic Courtès
       [not found]   ` <handler.54892.D54892.165036389832173.notifdone@debbugs.gnu.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Paul A. Patience @ 2022-04-13 15:21 UTC (permalink / raw)
  To: 54892; +Cc: Paul A. Patience

* gnu/packages/maths.scm (nomad-optimizer)[arguments]<#:phases>
[fix-sources-for-tests]: Enable the pipefail option in the (generated)
script that runs tests. Enable the basic batch example3 test. Fix the
advanced library FixedVariable test (and seemingly the neighbor PSDMads
test). Expand some comments.
---
To be applied after the patch updating nomad-optimizer to 4.2.0.

 gnu/packages/maths.scm | 126 +++++++++++++++++++++++++++--------------
 1 file changed, 83 insertions(+), 43 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 8ebfb87480..a18f656e0e 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2001,8 +2001,27 @@ (define-public nomad-optimizer
                   "")))))

          ;; Fix the tests so they run in out-of-source builds.
+         ;;
+         ;; TODO: Add support for examples/basic/batch/single_obj_MPIparallel,
+         ;; by adding openmpi to native-inputs and adjusting the example's
+         ;; BB_EXE parameter.
          (add-after 'fix-sources-for-build 'fix-sources-for-tests
            (lambda _
+             (substitute* "examples/CMakeLists.txt"
+               ;; examples/basic/batch/example3 is accidentally omitted.
+               (("^(add_subdirectory\\(\\$\\{CMAKE_CURRENT_SOURCE_DIR\\}/basic/batch/example)2(\\)\n)"
+                 _ prefix suffix)
+                (string-append prefix "2" suffix
+                               prefix "3" suffix))
+
+               ;; The generated runExampleTest.sh script runs the test as part
+               ;; of a pipeline and incorrectly (because pipefail is unset)
+               ;; relies on the value of the exit status immediately after the
+               ;; pipeline.
+               ;; (The patch-shebangs phase runs later than this one, so no
+               ;; need to update the path to bash here.)
+               (("#!/bin/bash") "#!/bin/bash\nset -o pipefail"))
+
              (substitute*
                  (map (lambda (d) (string-append "examples/" d "/CMakeLists.txt"))
                       (append
@@ -2013,57 +2032,78 @@ (define-public nomad-optimizer
                             '("FixedVariable" "NMonly" "PSDMads" "Restart"
                               "c_api/example1" "c_api/example2"
                               "exampleSuggestAndObserve"))))
-               ;; The built examples are assumed to be in the source tree
-               ;; (which isn't the case here).
+               ;; The runExampleTest.sh script is run with WORKING_DIRECTORY
+               ;; set to CMAKE_CURRENT_SOURCE_DIR.
+               ;; Other scripts invoked by that script (for example
+               ;; examples/advanced/batch/SuggestAndObserve/loopSuggestAndObserve.sh)
+               ;; are in that same directory, but compiled examples are
+               ;; located in CMAKE_CURRENT_BINARY_DIR.
                (("(COMMAND \\$\\{CMAKE_BINARY_DIR\\}/examples/runExampleTest\\.sh )\\.(/.*)"
                  _ command test)
                 (string-append command "${CMAKE_CURRENT_BINARY_DIR}" test)))
+
+             ;; The examples/basic/batch/example3 executable is already named
+             ;; bb3.exe.
+             (substitute* "examples/basic/batch/single_obj_parallel/CMakeLists.txt"
+               (("bb3.exe") "bb_parallel.exe"))
+
              ;; (Unrelated to support for out-of-source testing.)
              (make-file-writable
               "examples/advanced/library/exampleSuggestAndObserve/cache0.txt")

-             (let* ((builddir (string-append (getcwd) "/../build"))
-                    ;; The BB_EXE and SURROGATE_EXE paths are interpreted
-                    ;; relative to the configuration file provided to NOMAD.
-                    ;; However, the configuration files are all in the source
-                    ;; tree rather than in the build tree (unlike the compiled
-                    ;; executables).
-                    (fix-exe-path (lambda* (dir #:optional
-                                                (file "param.txt")
-                                                (exe-opt "BB_EXE"))
-                                    (substitute* (string-append dir "/" file)
-                                      (((string-append "^" exe-opt " +"))
-                                       ;; The $ prevents NOMAD from prefixing
-                                       ;; the executable with the path of the
-                                       ;; parent directory of the configuration
-                                       ;; file NOMAD was provided with as
-                                       ;; argument (param.txt or some such).
-                                       (string-append exe-opt " $"
-                                                      builddir "/" dir "/"))))))
-               (for-each
-                (lambda (dir)
-                  (let ((dir (string-append "examples/" dir)))
-                    (substitute* (string-append dir "/CMakeLists.txt")
-                      ;; The install phase has not yet run.
-                      (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
-                       "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
-                    (fix-exe-path dir)
-                    (when (equal? dir "examples/basic/batch/surrogate_sort")
-                      (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
-                (append (map (lambda (d) (string-append "basic/batch/" d))
-                             '("example1" "example2"
-                               "single_obj" "single_obj_parallel"
-                               "surrogate_sort"))
-                        '("advanced/batch/LHonly")))
-
-               (let ((dir "examples/advanced/batch/FixedVariable"))
-                 (substitute* (string-append dir "/runFixed.sh")
-                   ;; Hardcoded path to NOMAD executable.
-                   (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
-                    (string-append builddir "/src/nomad ")))
+             (let ((builddir (string-append (getcwd) "/../build")))
+               ;; For some reason, omitting this fix causes the
+               ;; examples/advanced/library/PSDMads test to fail, even though
+               ;; it doesn't seem to reference any part of the FixedVariable
+               ;; test.
+               (let ((dir "examples/advanced/library/FixedVariable"))
+                 (substitute* (string-append dir "/fixedVariable.cpp")
+                   (("^( +std::string sExe = ).*" _ prefix)
+                    (string-append prefix "\"" builddir "/" dir "/ufl.exe" "\";\n"))))
+
+               ;; The BB_EXE and SURROGATE_EXE paths are interpreted relative
+               ;; to the configuration file provided to NOMAD.
+               ;; However, the configuration files are all in the source tree
+               ;; rather than in the build tree (unlike the compiled
+               ;; executables).
+               (let ((fix-exe-path (lambda* (dir #:optional
+                                                 (file "param.txt")
+                                                 (exe-opt "BB_EXE"))
+                                     (substitute* (string-append dir "/" file)
+                                       (((string-append "^" exe-opt " +"))
+                                        ;; The $ prevents NOMAD from prefixing
+                                        ;; the executable with the path of the
+                                        ;; parent directory of the configuration
+                                        ;; file NOMAD was provided with as
+                                        ;; argument (param.txt or some such).
+                                        (string-append exe-opt " $"
+                                                       builddir "/" dir "/"))))))
                  (for-each
-                  (lambda (f) (fix-exe-path dir f))
-                  '("param1.txt" "param2.txt" "param3.txt" "param10.txt"))))))
+                  (lambda (dir)
+                    (let ((dir (string-append "examples/" dir)))
+                      (substitute* (string-append dir "/CMakeLists.txt")
+                        ;; The install phase has not yet run.
+                        (("COMMAND \\$\\{CMAKE_INSTALL_PREFIX\\}/bin/nomad ")
+                         "COMMAND ${CMAKE_BINARY_DIR}/src/nomad "))
+                      (fix-exe-path dir)
+                      (when (equal? dir "examples/basic/batch/surrogate_sort")
+                        (fix-exe-path dir "param.txt" "SURROGATE_EXE"))))
+                  (append (map (lambda (d) (string-append "basic/batch/" d))
+                               '("example1" "example2" "example3"
+                                 "single_obj"
+                                 "single_obj_parallel"
+                                 ;; "single_obj_MPIparallel"
+                                 "surrogate_sort"))
+                          '("advanced/batch/LHonly")))
+
+                 (let ((dir "examples/advanced/batch/FixedVariable"))
+                   (substitute* (string-append dir "/runFixed.sh")
+                     ;; Hardcoded path to NOMAD executable.
+                     (("^\\.\\./\\.\\./\\.\\./\\.\\./bin/nomad ")
+                      (string-append builddir "/src/nomad ")))
+                   (for-each
+                    (lambda (f) (fix-exe-path dir f))
+                    '("param1.txt" "param2.txt" "param3.txt" "param10.txt")))))))

          ;; The information in the .egg-info file is not kept up to date.
          (add-after 'install 'delete-superfluous-egg-info
--
2.35.1






^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#54892: [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0.
  2022-04-13 15:21   ` [bug#54892] [PATCH] gnu: nomad-optimizer: Fix some tests Paul A. Patience
@ 2022-04-19 10:24     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2022-04-19 10:24 UTC (permalink / raw)
  To: Paul A. Patience; +Cc: 54892-done

Applied all 5 nomad-optimizer patches, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0.
       [not found]   ` <handler.54892.D54892.165036389832173.notifdone@debbugs.gnu.org>
@ 2022-04-19 10:31     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2022-04-19 10:31 UTC (permalink / raw)
  To: Paul A. Patience, 54892

Er, that’s 4 patches, not 5:

  d262a258bb gnu: nomad-optimizer: Fix some tests.
  11e761b9a6 gnu: nomad-optimizer: Update to 4.2.0.
  3a6703268b gnu: nomad-optimizer: Remove trailing booleans.
  3a9b925f44 gnu: nomad-optimizer: Remove input labels.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-19 10:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 18:57 [bug#54890] [PATCH 1/3] gnu: nomad-optimizer: Remove input labels Paul A. Patience
2022-04-12 18:57 ` [bug#54891] [PATCH 2/3] gnu: nomad-optimizer: Remove trailing booleans Paul A. Patience
2022-04-12 18:57 ` [bug#54892] [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Paul A. Patience
2022-04-13 15:21   ` [bug#54892] [PATCH] gnu: nomad-optimizer: Fix some tests Paul A. Patience
2022-04-19 10:24     ` bug#54892: [PATCH 3/3] gnu: nomad-optimizer: Update to 4.2.0 Ludovic Courtès
     [not found]   ` <handler.54892.D54892.165036389832173.notifdone@debbugs.gnu.org>
2022-04-19 10:31     ` [bug#54892] " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).