Skip to content

Commit 88287f1

Browse files
committed
250720.083302.PDT update the comment of the bug of MATLAB R2025a
1 parent 193f342 commit 88287f1

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

matlab/mex_gateways/R2025a/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This directory contains temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults
2-
when the Fortran MEX function contains an internal procedure that is passed as an actual argument.
2+
on Linux if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
33

44
The MEX files use a module variable to store the function handle, which is essentially a
55
global variable and is not thread-safe or recursion-safe.

matlab/mex_gateways/R2025a/bobyqa_mex.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!--------------------------------------------------------------------------------------------------!
22
! The MEX gateway for BOBYQA
3-
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults when
4-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
3+
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults on Linux
4+
! if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
55
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
66
! global variable and is not thread-safe or recursion-safe.
77
! See MathWorks Technical Support Case 07931486 and
@@ -20,7 +20,7 @@
2020
!
2121
! Started in July 2020
2222
!
23-
! Last Modified: Sat 19 Jul 2025 11:34:45 PM PDT
23+
! Last Modified: Sun 20 Jul 2025 08:30:42 AM PDT
2424
!--------------------------------------------------------------------------------------------------!
2525

2626
#include "fintrf.h"

matlab/mex_gateways/R2025a/cobyla_mex.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!--------------------------------------------------------------------------------------------------!
22
! The MEX gateway for COBYLA
3-
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults when
4-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
3+
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults on Linux
4+
! if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
55
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
66
! global variable and is not thread-safe or recursion-safe.
77
! See MathWorks Technical Support Case 07931486 and
@@ -20,7 +20,7 @@
2020
!
2121
! Started in July 2020
2222
!
23-
! Last Modified: Sat 19 Jul 2025 11:40:45 PM PDT
23+
! Last Modified: Sun 20 Jul 2025 08:30:57 AM PDT
2424
!--------------------------------------------------------------------------------------------------!
2525

2626
#include "fintrf.h"

matlab/mex_gateways/R2025a/cobylb.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
! This is a temporary version of cobylb.f90 to circumvent the MATLAB R2025a bug that it segfaults when
2-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
1+
! This is a temporary version of cobylb.f90 to circumvent the MATLAB R2025a bug that it segfaults on
2+
! Linux if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
33
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
44
! global variable and is not thread-safe or recursion-safe.
55
! See MathWorks Technical Support Case 07931486 and
@@ -61,7 +61,7 @@ module cobylb_mod
6161
!
6262
! Started: July 2021
6363
!
64-
! Last Modified: Sun 20 Jul 2025 01:14:30 AM PDT
64+
! Last Modified: Sun 20 Jul 2025 08:31:19 AM PDT
6565
!--------------------------------------------------------------------------------------------------!
6666

6767
implicit none

matlab/mex_gateways/R2025a/lincoa_mex.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!--------------------------------------------------------------------------------------------------!
22
! The MEX gateway for LINCOA
3-
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults when
4-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
3+
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults on Linux
4+
! if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
55
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
66
! global variable and is not thread-safe or recursion-safe.
77
! See MathWorks Technical Support Case 07931486 and
@@ -20,7 +20,7 @@
2020
!
2121
! Started in July 2020
2222
!
23-
! Last Modified: Sat 19 Jul 2025 11:36:09 PM PDT
23+
! Last Modified: Sun 20 Jul 2025 08:31:41 AM PDT
2424
!--------------------------------------------------------------------------------------------------!
2525

2626
#include "fintrf.h"

matlab/mex_gateways/R2025a/newuoa_mex.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!--------------------------------------------------------------------------------------------------!
22
! The MEX gateway for NEWUOA
3-
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults when
4-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
3+
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults on Linux
4+
! if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
55
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
66
! global variable and is not thread-safe or recursion-safe.
77
! See MathWorks Technical Support Case 07931486 and
@@ -20,7 +20,7 @@
2020
!
2121
! Started in July 2020
2222
!
23-
! Last Modified: Sat 19 Jul 2025 11:34:27 PM PDT
23+
! Last Modified: Sun 20 Jul 2025 08:32:00 AM PDT
2424
!--------------------------------------------------------------------------------------------------!
2525

2626
#include "fintrf.h"

matlab/mex_gateways/R2025a/uobyqa_mex.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!--------------------------------------------------------------------------------------------------!
22
! The MEX gateway for UOBYQA
3-
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults when
4-
! the Fortran MEX function contains an internal procedure that is passed as an actual argument.
3+
! This is a temporary MEX gateway to circumvent the MATLAB R2025a bug that it segfaults on Linux
4+
! if the Fortran MEX function contains an internal procedure that is passed as an actual argument.
55
! This MEX uses a module variable FUN_PTR to store the function handle, which is essentially a
66
! global variable and is not thread-safe or recursion-safe.
77
! See MathWorks Technical Support Case 07931486 and
@@ -20,7 +20,7 @@
2020
!
2121
! Started in July 2020
2222
!
23-
! Last Modified: Sat 19 Jul 2025 11:34:10 PM PDT
23+
! Last Modified: Sun 20 Jul 2025 08:32:14 AM PDT
2424
!--------------------------------------------------------------------------------------------------!
2525

2626
#include "fintrf.h"

matlab/setup_tools/compile.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ function compile(solvers, mexdir, fortd, gateways, options)
6363

6464
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6565
% Zaikun 20250720:
66-
% The following code is to circumvent a bug in MATLAB R2025a, which segfaults when the Fortran
67-
% files contain internal procedures that are passed as actual arguments to other procedures.
66+
% The following code is to circumvent a bug in MATLAB R2025a, which segfaults on Linux when the
67+
% Fortran files contain internal procedures that are passed as actual arguments to other procedures.
6868
% To avoid this bug, we replace gateways/*_mex.F90 with gateways/R2025a/*_mex.F90, and
6969
% fortran/cobylb.f90 with gateways/R2025a/cobylb.f90, which uses module variables instead of
7070
% internal procedures. The price is that PRIMA becomes thread-unsafe and recursion-unsafe.
@@ -74,7 +74,7 @@ function compile(solvers, mexdir, fortd, gateways, options)
7474
% https://fortran-lang.discourse.group/t/implementation-of-a-parametrized-objective-function-without-using-module-variables-or-internal-subroutines
7575
% https://stackoverflow.com/questions/79705107/fortran-implementating-a-parametrized-objective-function-without-using-module-v
7676

77-
if verLessThan('matlab', '25.2') && ~verLessThan('matlab', '25.1') % The version number of R2025a is 25.1.
77+
if isunix && ~ismac && verLessThan('matlab', '25.2') && ~verLessThan('matlab', '25.1') % The version number of R2025a is 25.1.
7878
if verbose
7979
warning('prima:ThreadRecursionUnsafe', ...
8080
['MATLAB R2025a has a bug that causes segmentation faults when handling Fortran MEX files with internal procedures.\n', ...

0 commit comments

Comments
 (0)