Source

BayesOpt / matlab / compile_octave.m

Diff from to

matlab/compile_octave.m

 % You can also change ../lib for the correspoding install path
 % Octave
-if exist('../lib/libbayesopt.a','file')
-    disp('Compiling static library');
-     mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
-        --mex "-Wl,-rpath=../lib" --output bayesoptcont.mex ...
-        bayesoptmex.c
+mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
+    --mex --output bayesoptcont.mex bayesoptmex.c
 
-    mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
-        --mex "-Wl,-rpath=../lib" --output bayesoptdisc.mex ...
-        bayesoptdiscmex.c
-else %TODO: Does not work in MacOS
-    disp('Compiling dynamic library');
-    mkoctfile -L../lib -l:bayesopt.so -lnlopt -I../include -I../wrappers ...
-        --mex "-Wl,-rpath=../lib" --output bayesoptcont.mex ...
-        bayesoptmex.c
+mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
+    --mex --output bayesoptdisc.mex bayesoptdiscmex.c
 
-    mkoctfile -L../lib -l:bayesopt.so -lnlopt -I../include -I../wrappers ...
-        --mex "-Wl,-rpath=../lib" --output bayesoptdisc.mex ...
-        bayesoptdiscmex.c
-end
+%     if exist('../lib/libbayesopt.a','file')
+%     disp('Compiling static library');
+%      mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
+%         --mex --output bayesoptcont.mex bayesoptmex.c
+
+%     mkoctfile -L../lib -lbayesopt -lnlopt -I../include -I../wrappers ...
+%         --mex --output bayesoptdisc.mex bayesoptdiscmex.c
+% else % TODO: Does not work in MacOS
+%     if (~ismac)
+%         disp('Compiling dynamic library');
+%         mkoctfile -L../lib -l:bayesopt.so -lnlopt -I../include -I../wrappers ...
+%             --mex --output bayesoptcont.mex bayesoptmex.c
+
+%         mkoctfile -L../lib -l:bayesopt.so -lnlopt -I../include -I../wrappers ...
+%             --mex --output bayesoptdisc.mex bayesoptdiscmex.c
+%     else
+%         disp('Dynamic library not supported in MacOS');
+%     end
+% end