Open ragonneau opened 1 year ago
My architecture is close to yours, except for clang version (clang-1300.0.29.30). I can compile with architecture x86_64 (by default I have arm64). But the compilation works fine.
I am not sure if there is just the utSetInterruptPending
function missing. Could you try to comment the lines
` //Check for Ctrl-C
if ( utIsInterruptPending() )
{
utSetInterruptPending(false); /* clear Ctrl-C status */
mexPrintf("\nCtrl-C Detected. Exiting NOMAD...\n\n");
count_eval = false;
NOMAD::Step::setUserTerminate();
return false;
}`
This is around line 368 in $NOMAD_HOME/interfaces/Matlab_MEX/Source/nomadmex.cpp. This function is used for CTRL-C detection.
It now compiles, but MATLAB crashes every time I run nomadOpt
. More precisely, I tried
nomadOpt(@(x)x^2,1)
Did I misunderstood the syntax and broke the MEX-file? Thanks :+1:
The syntax you used is not correct. Run the examples in $NOMAD_HOME/interfaces/Matlab_MEX/test_nomad_gerad.m
to make sure that everything works normally. You can use the examples to work your problem.
Nevertheless, Matlab should not crash if the nomadOpt is called with the wrong syntax. I will look into that and also how to replace the utIsInterruptPending()
function.
I understand. The tests runs on my machine, and produces
------------------------------------------------------------------
This is NOMAD v4.2.0
Authors: C. Audet, S. Le Digabel, V. Rochon Montplaisir and C. Tribes
MEX Interface C. Tribes 2021
Problem Properties:
# Decision Variables: 2
# Number of Objectives: 1
# Number of Nonlinear Constraints: 0
------------------------------------------------------------------
BBE OBJ
1 909
10 20
13 4.82
23 2.5
27 2.12
37 1.7
42 1.22
59 1
60 0.929419
63 0.80402
68 0.71065
72 0.694857
74 0.639846
76 0.631801
78 0.588927
80 0.5689
82 0.561994
84 0.505621
90 0.477985
91 0.461502
93 0.420715
97 0.400596
98 0.376996
99 0.359715
100 0.35004
A termination criterion is reached: Maximum number of blackbox evaluations (Eval Global) Success found and opportunistic strategy is used 100
Best feasible solution: #4590 ( 0.455 0.184 ) Evaluation OK f = 0.3500400000000000178 h = 0
Best infeasible solution: Undefined.
Blackbox evaluations: 100
Total model evaluations: 3664
Cache hits: 8
Total number of evaluations: 108
Feasible solution obtained
Thank you very much, Tom.
My problem
I am building nomad on macOS for MATLAB. I hence ran
This completed successfully. However, when building the library with
I get the following error.
I set up mex to run with
clang
.My architecture
Do you have any idea how I can fix my problem? Thank you very much for your help :grin: