Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running OpenFAST in Simuling on ubuntu 22.04 #2185

Closed
TorbenKnudsen opened this issue May 6, 2024 · 22 comments
Closed

Running OpenFAST in Simuling on ubuntu 22.04 #2185

TorbenKnudsen opened this issue May 6, 2024 · 22 comments

Comments

@TorbenKnudsen
Copy link

Dear supporters

I need to run OpenFAST in MATLAB Simulink under ubuntu 22.04. So far I have not
been able to produce a mex file FAST_SFunc.mexa64 so I would very much apriciate
some help.

I have tried to follow
https://openfast.readthedocs.io/en/main/source/install/index.html#compile-from-source.
Initially I have installed via anaconda. However, recently I followe
"2.3. Compile from source".

I can run the simple test with the below terminal output:
(base) tk@AAU118294:~/OpenFAST/install/bin$ ./openfast -v


OpenFAST

Copyright (C) 2024 National Renewable Energy Laboratory
Copyright (C) 2024 Envision Energy USA LTD

This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.


OpenFAST-v3.5.3
Compile Info:

  • Compiler: GCC version 11.4.0
  • Architecture: 64 bit
  • Precision: double
  • OpenMP: No
  • Date: May 2 2024
  • Time: 14:57:48
    Execution Info:
  • Date: 05/02/2024
  • Time: 15:39:05+0200

I got the impression that both BUILD_OPENFAST_SIMULINK_API and BUILD_SHARED_LIBS
should be on but cmake said this is not possible so I tried both combinations:
cmake .. -DBUILD_OPENFAST_SIMULINK_API=on -DBUILD_SHARED_LIBS=off and
cmake .. -DBUILD_OPENFAST_SIMULINK_API=off -DBUILD_SHARED_LIBS=on
In none of the cases I could make a mex function using create_FAST_SFunc

Finally I tried:
cmake .. -DBUILD_OPENFAST_SIMULINK_API=off -DBUILD_SHARED_LIBS=on
make openfastlib
make install
This did give a file libopenfastlib.so in
/home/tk/OpenFAST/build/modules/openfast-library/
This did not give a file libopenfastlib.so in
/home/tk/OpenFAST/modules/openfast-library/

Running the create_FAST_SFunc I still get

Creating ./FAST_SFunc.mexa64

Building with 'gcc'.
Error using mex
/usr/bin/ld: cannot find -lopenfastlib_mex: No such file or directory
collect2: error: ld returned 1 exit status

Let me know if you need more information to help

@TorbenKnudsen
Copy link
Author

I still don't understand why I can not run create_FAST_SFunc but I found out I might not need to

From #1740 I learned "Note that you do not need to use the create_FAST_SFunc.m to build the mex file, it will be generated in build/glue-codes/simulink when building with CMake."

So now I have OpenFAST running in Simulink but got some new error. I can struggle a bit with those. Maybe I need to get a DISCON for ubuntu manually?

Error:Error reported by S-function 'FAST_SFunc' in 'SystemSimulation/FAST Nonlinear Wind Turbine/S-Function':
FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:Yaw angle and rate are not commanded from Simulink model.
ValidatePrimaryData:Generator torque and power are not commanded from Simulink model.
ValidatePrimaryData:HSS brake is not commanded from Simulink model.
ValidatePrimaryData:Airfoil control is not commanded from Simulink model.
ValidatePrimaryData:Cable control is not commanded from Simulink model.
SrvD_Init:BladedInterface_Init:The dynamic library 5MW_Land_DLL_WTurb/../5MW_Baseline/ServoData/DISCON.dll could not be loaded. Check that the file exists in the specified location and that it is compiled for 64-bit applications.

@deslaughter
Copy link
Collaborator

@TorbenKnudsen As you found, you do not need to run create_FAST_SFunc.m unless you are building on Windows with Visual Studio, which is documented at the top of the create_FAST_SFunc.m file. For future users who find this issue, it is simpler to use -DBUILD_OPENFAST_SIMULINK_API=ON when configuring CMake and compiling on MacOS or Linux.

As for the second issue, not being able to find DISCON.dll, you need to configure CMake with -DBUILD_TESTING=ON to generate the DISCON controller that the example problem is referencing.

@TorbenKnudsen
Copy link
Author

Thanks for the quick response.
I have tried included testing but have the issue show below

~/OpenFAST/build $ cmake .. -DBUILD_TESTING=ON
-- Enabling Fortran 2008 features
-- Setting system file as: src/SysGnuLinux.f90
CMake Error at reg_tests/CMakeLists.txt:79 (add_subdirectory):
The source directory

/home/tk/OpenFAST/reg_tests/r-test

does not contain a CMakeLists.txt file.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline": No
such file or directory.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/AOC": No such file
or directory.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/AWT27": No such
file or directory.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/SWRT": No such file
or directory.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/UAE_VI": No such
file or directory.

CMake Error at reg_tests/CMakeLists.txt:89 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/WP_Baseline": No
such file or directory.

CMake Error at reg_tests/CMakeLists.txt:94 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline": No
such file or directory.

CMake Error at reg_tests/CMakeLists.txt:100 (file):
file COPY cannot find
"/home/tk/OpenFAST/reg_tests/r-test/glue-codes/fast-farm/5MW_Baseline": No
such file or directory.

CMake Error at /usr/share/cmake-3.22/Modules/ExternalProject.cmake:2882 (message):
No download info given for 'pfunit' and its source directory:

/home/tk/OpenFAST/unit_tests/pfunit

is not an existing non-empty directory. Please specify one of:

  • SOURCE_DIR with an existing non-empty directory
  • DOWNLOAD_COMMAND
  • URL
  • GIT_REPOSITORY
  • SVN_REPOSITORY
  • HG_REPOSITORY
  • CVS_REPOSITORY and CVS_MODULE
    Call Stack (most recent call first):
    /usr/share/cmake-3.22/Modules/ExternalProject.cmake:3716 (_ep_add_download_command)
    unit_tests/CMakeLists.txt:44 (ExternalProject_Add)

-- Configuring incomplete, errors occurred!
See also "/home/tk/OpenFAST/build/CMakeFiles/CMakeOutput.log".
See also "/home/tk/OpenFAST/build/CMakeFiles/CMakeError.log".
~/OpenFAST/build $

@TorbenKnudsen
Copy link
Author

I also have the below problem which might relate to the above

I have triedd to run Run_OpenLoop.m both in a local directory and where it was
after installing. In both cases I miss a lot of files. An example of the
output from Run_OpenLoop.m is

Run_OpenLoop


OpenFAST

Copyright (C) 2024 National Renewable Energy Laboratory
Copyright (C) 2024 Envision Energy USA LTD

This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.


OpenFAST-v3.5.3
Compile Info:

  • Compiler: GCC version 11.4.0
  • Architecture: 64 bit
  • Precision: double
  • OpenMP: No
  • Date: May 3 2024
  • Time: 13:33:53
    Execution Info:
  • Date: 05/06/2024
  • Time: 15:35:07+0200

OpenFAST completed.

Error using Run_OpenLoop (line 12)
Error reported by S-function 'FAST_SFunc' in 'OpenLoop/FAST Nonlinear Wind
Turbine/S-Function':
FAST_InitializeAll:FAST_Init:FAST_ReadPrimaryFile:OpenFInpFile:The input file,
"../../../reg_tests/r-test/glue-codes/openfast/AOC_WSt/AOC_WSt.fst", was not found.

I then tried to collect the files from
https://github.com/OpenFAST/openfast/tree/main/reg_tests but there seems to be
too many. Maybe it is because i miss the testing part so i tried

~/OpenFAST/build $ cmake .. -DBUILD_TESTING=ON
-- Enabling Fortran 2008 features
-- Setting system file as: src/SysGnuLinux.f90
CMake Error at reg_tests/CMakeLists.txt:79 (add_subdirectory):
The source directory

/home/tk/OpenFAST/reg_tests/r-test

does not contain a CMakeLists.txt file.

@deslaughter
Copy link
Collaborator

@TorbenKnudsen based on those messages, it looks like the submodules haven't been initialized. The regression tests are stored in a separate repository which is referenced as a submodule in the reg_tests/r-test directory. Please run git submodule update --init --recursive in the root of the cloned OpenFAST repo (/home/tk/OpenFAST in your case).

@TorbenKnudsen
Copy link
Author

TorbenKnudsen commented May 6, 2024

Thanks again. You brought me a step further to a new problem with a matlab crash as follows.
Maybe the botom part is more interesting?
I also got some messages about the mdl file being made by a earlier version of simulink/matlab

cd /home/tk/OpenFAST/glue-codes/simulink/examples/
Run_OpenLoop


OpenFAST

Copyright (C) 2024 National Renewable Energy Laboratory
Copyright (C) 2024 Envision Energy USA LTD

This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.


OpenFAST-v3.5.3
Compile Info:

  • Compiler: GCC version 11.4.0
  • Architecture: 64 bit
  • Precision: double
  • OpenMP: No
  • Date: May 3 2024
  • Time: 13:33:53
    Execution Info:
  • Date: 05/06/2024
  • Time: 17:57:17+0200

OpenFAST input file heading:
FAST Certification Test #6: AOC 15/50 with many DOFs with gen start, loss of grid, and
tip-brake shutdown. Many parameters are pure fiction.

Running ElastoDyn.
Nodal outputs section of ElastoDyn input file not found or improperly formatted.
Running AeroDyn14.
WARNING: AeroDyn 14 is deprecated and will be removed in a future release.
Running InflowWind.
Running ServoDyn.

FAST_InitializeAll:InflowWind_Init:IfW_UniformWind_Init: Could not read upflow column in uniform
wind files. Assuming upflow is 0.
FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:Yaw angle and rate are not commanded from
Simulink model.
ValidatePrimaryData:Pitch angles are not commanded from Simulink model.
ValidatePrimaryData:Generator torque and power are not commanded from Simulink model.
ValidatePrimaryData:HSS brake is not commanded from Simulink model.
ValidatePrimaryData:Airfoil control is not commanded from Simulink model.
ValidatePrimaryData:Cable control is not commanded from Simulink model.

Time: 0 of 60 seconds.
QXcbGlxIntegration::initialize

Xcb GLX gl-integration successfully initialized
QXcbGlxIntegration::initialize

Xcb GLX gl-integration successfully initialized
QXcbGlxIntegration::initialize

Xcb GLX gl-integration successfully initialized


      Segmentation violation detected at 2024-05-06 17:57:21 +0200

Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : ubuntu:GNOME
GNU C Library : 2.35 stable
Graphics Driver : Uninitialized software
Graphics card 1 : 0x8086 ( 0x8086 ) 0x3ea0 Version 0.0.0.0 (0-0-0)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 2613978
MATLAB Root : /usr/local/MATLAB/R2024a
MATLAB Version : 24.1.0.2537033 (R2024a)
OpenGL : software
Operating System : Ubuntu 22.04.4 LTS
Process ID : 57653
Processor ID : x86 Family 6 Model 142 Stepping 12, GenuineIntel
Session Key : 538623e0-0e49-4056-8343-e238cef3683d
Window System : The X.Org Foundation (12101004), display :0

Fault Count: 3

Abnormal termination:
Segmentation violation

Current Thread: 'MCR 0 interpret' id 140590064780864

Register State (from fault):
RAX = 0000000000000001 RBX = 00007fddacdd1fd8
RCX = 0000000000000001 RDX = 0000000000000001
RSP = 00007fddacdd0c08 RBP = 0000000000000000
RSI = 00000000aaaaaab3 RDI = 00007fddacdd1fd8

R8 = 00007fe7fe79efc0 R9 = 00000000aaaaaab3
R10 = 0000000800000000 R11 = 0000000000000000
R12 = 00007fe7fe79efc0 R13 = 00007fdd3b84cad8
R14 = 00007fdd3b84cad8 R15 = 00007fddacdd2868

RIP = 00007fdd386aee61 EFL = 0000000000010246

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007fdd386aee61 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20979297 mkl_blas_avx2_xidamax_nonan+00000417
[ 1] 0x00007fdd38609520 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20301088 mkl_blas_avx2_xidamax+00000064
[ 2] 0x00007fdd3795e42e /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+07017518 mkl_blas_idamax+00001006
[ 3] 0x00007fdd38135dbf /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15240639 mkl_lapack_dgetf2_team+00000975
[ 4] 0x00007fdd3813592c /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15239468 mkl_lapack_dgetrf_local_team+00002812
[ 5] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 6] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 7] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 8] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 9] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 10] 0x00007fdd3784f9fe /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05908990 mkl_lapack_dgetrf+00001934
[ 11] 0x00007fdf37555893 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01398931 __kmp_invoke_microtask+00000147
[ 12] 0x00007fdf374c8cb3 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00822451
[ 13] 0x00007fdf374c7bf2 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00818162
[ 14] 0x00007fdf37556603 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01402371
[ 15] 0x00007fdf5e5e7ac3 /lib/x86_64-linux-gnu/libc.so.6+00608963
[ 16] 0x00007fdf5e679850 /lib/x86_64-linux-gnu/libc.so.6+01206352

Abnormal termination:
Segmentation violation

Current Thread: 'MCR 0 interpret' id 140597096609344

Register State (from fault):
RAX = 0000000000000001 RBX = 00007fdf4ffe4fd8
RCX = 0000000000000001 RDX = 0000000000000001
RSP = 00007fdf4ffe3c08 RBP = 0000000000000000
RSI = 00000000aaaaaab8 RDI = 00007fdf4ffe4fd8

R8 = 00007fe2a9249a00 R9 = 00000000aaaaaab8
R10 = 0000000800000000 R11 = 0000000000000000
R12 = 00007fe2a9249a00 R13 = 00007fdd3b84cad8
R14 = 00007fdd3b84cad8 R15 = 00007fdf4ffe5868

RIP = 00007fdd386aee61 EFL = 0000000000010246

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007fdd386aee61 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20979297 mkl_blas_avx2_xidamax_nonan+00000417
[ 1] 0x00007fdd38609520 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20301088 mkl_blas_avx2_xidamax+00000064
[ 2] 0x00007fdd3795e42e /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+07017518 mkl_blas_idamax+00001006
[ 3] 0x00007fdd38135dbf /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15240639 mkl_lapack_dgetf2_team+00000975
[ 4] 0x00007fdd3813592c /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15239468 mkl_lapack_dgetrf_local_team+00002812
[ 5] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 6] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 7] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 8] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 9] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 10] 0x00007fdd3784f9fe /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05908990 mkl_lapack_dgetrf+00001934
[ 11] 0x00007fdf37555893 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01398931 __kmp_invoke_microtask+00000147
[ 12] 0x00007fdf374c8cb3 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00822451
[ 13] 0x00007fdf374c7bf2 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00818162
[ 14] 0x00007fdf37556603 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01402371
[ 15] 0x00007fdf5e5e7ac3 /lib/x86_64-linux-gnu/libc.so.6+00608963
[ 16] 0x00007fdf5e679850 /lib/x86_64-linux-gnu/libc.so.6+01206352

Abnormal termination:
Segmentation violation

Current Thread: 'MCR 0 interpret' id 140595723413056

Register State (from fault):
RAX = 0000000000000001 RBX = 00007fdefe22bdd8
RCX = 0000000000000005 RDX = 00000000aaaaaa9f
RSP = 00007fdefe22aa08 RBP = 0000000000000022
RSI = 00000000aaaaaa9f RDI = 000000000005fd5f

R8 = 00007fdd53cf4500 R9 = 0000000000000004
R10 = 0000000800000000 R11 = 0000000000000000
R12 = 00007fdd53cf4500 R13 = 00007fdd3b84cad8
R14 = 00007fdd3b84cad8 R15 = 00007fdefe22c668

RIP = 00007fdd386aef3a EFL = 0000000000010287

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007fdd386aef3a /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20979514 mkl_blas_avx2_xidamax_nonan+00000634
[ 1] 0x00007fdd38609520 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20301088 mkl_blas_avx2_xidamax+00000064
[ 2] 0x00007fdd3795e42e /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+07017518 mkl_blas_idamax+00001006
[ 3] 0x00007fdd38135dbf /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15240639 mkl_lapack_dgetf2_team+00000975
[ 4] 0x00007fdd3813592c /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15239468 mkl_lapack_dgetrf_local_team+00002812
[ 5] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 6] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 7] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 8] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 9] 0x00007fdd381350eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 10] 0x00007fdd3784f9fe /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05908990 mkl_lapack_dgetrf+00001934
[ 11] 0x00007fdf37555893 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01398931 __kmp_invoke_microtask+00000147
[ 12] 0x00007fdf374c8cb3 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00822451
[ 13] 0x00007fdf374c9f7d /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00827261 __kmp_fork_call+00003965
[ 14] 0x00007fdf37485425 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00545829 _kmpc_fork_call+00000421
[ 15] 0x00007fdd37850e49 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05914185 mkl_lapack_dgetrf+00007129
[ 16] 0x00007fdd376a7af3 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+04172531 dgetrf_64
+00000259
[ 17] 0x00007fdd4399c0a3 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+26075299
[ 18] 0x00007fdd42f759ab /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+15432107
[ 19] 0x00007fdd42f82d30 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+15486256
[ 20] 0x00007fdd421a7df3 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+00957939
[ 21] 0x00007fdd421dcd94 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+01174932
[ 22] 0x00007fdd421dd2f7 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+01176311
[ 23] 0x00007fdd42122984 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+00412036
[ 24] 0x00007fdd42122da9 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+00413097
[ 25] 0x00007fdd421e0f86 /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+01191814
[ 26] 0x00007fdd4210803a /home/tk/Matlab/WindEnergy/OpenFAST/SMPCTurbineControlTestZone/FAST_SFunc.mexa64+00303162 mexFunction+00002282
[ 27] 0x00007fdf4e2c912f /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00966959
[ 28] 0x00007fdf4e2c91a7 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00967079
[ 29] 0x00007fdf4e2c9217 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00967191
[ 30] 0x00007fdf4e2ca7ca /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00972746
[ 31] 0x00007fdf4e2b6284 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00889476
[ 32] 0x00007fdf4e9b0f26 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01535782 ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00000166
[ 33] 0x00007fdf4e9b2c79 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01543289 ZN8Mfh_file8dispatchEiPP11mxArray_tagiS2+00000233
[ 34] 0x00007fdf4e940c38 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01076280 mdDoMatlabFcnCall+00000088
[ 35] 0x00007fdf4fcff38d /usr/local/MATLAB/R2024a/bin/glnxa64/builtins/sl_proxy_interface/../../../../bin/glnxa64/libmwsl_services.so+02990989 _ZN25CMatlabCommandNoWatermark7executeEbN6matrix9ErrorModeE+00000061
[ 36] 0x00007fdda94891bd /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_utility.so+00717245 _Z17slDoMatlabFcnCalliPP11mxArray_tagiPPKS_P13Mfh_MATLAB_fnbN6matrix9ErrorModeE+00000061
[ 37] 0x00007fddc12e57ba /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_lang_blocks.so+11147194 _Z17CallCMexSFcnStartP10slSFcnInfoP13SimStruct_tag+00000442
[ 38] 0x00007fddb368aa81 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+23652993 _ZN18SFunctionExecBlock5StartEv+00000513
[ 39] 0x00007fddb368b269 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+23655017 _ZN18SFunctionExecBlock21SetupRuntimeResourcesEv+00000537
[ 40] 0x00007fdd9f434db2 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00585138 _ZN6slexec4tldr6method12BlockMethods21setupRuntimeResourcesEv+00000130
[ 41] 0x00007fdd9f41b56e /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00480622
[ 42] 0x00007fdd9f437f0c /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00597772 _ZN6slexec4tldr6method12ModelMethods21setupRuntimeResourcesEv+00000060
[ 43] 0x00007fdf4ef1fc11 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_link_bd.so+00916497
[ 44] 0x00007fdf4ef304ee /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_link_bd.so+00984302 _Z22sleInitModelConditionsP8SLExecBDPK11mxArray_tagbbPS1_bbP14CmdlSimInpInfo+00001854
[ 45] 0x00007fddb370df7a /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24190842
[ 46] 0x00007fddb3711a4c /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24205900
[ 47] 0x00007fddb3716f26 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24227622
[ 48] 0x00007fddb370b590 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24180112
[ 49] 0x00007fddb3783382 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24671106
[ 50] 0x00007fddb2f184b6 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+15844534
[ 51] 0x00007fddb2e3bc87 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+14941319 Z14slFullSimulateiPP11mxArray_tagiS1+00000311
[ 52] 0x00007fdf4fed1142 /usr/local/MATLAB/R2024a/bin/glnxa64/builtins/sl_proxy_interface/../../../../bin/glnxa64/libmwsl_proxy_interface.so+00028994
[ 53] 0x00007fdf4e9146c4 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00894660
[ 54] 0x00007fdf4e917a58 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00907864
[ 55] 0x00007fdf4e8fa0c0 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00786624
[ 56] 0x00007fdf4e8fa46e /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00787566 ZN18Mfh_MATLAB_fn_impl8dispatchEiPSt10unique_ptrI11mxArray_tagN6matrix6detail17mxDestroy_deleterEEiPPS1+00000030
[ 57] 0x00007fdf4dd9fda2 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02555298
[ 58] 0x00007fdf4dda1304 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02560772
[ 59] 0x00007fdf40c4bb5f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11545439
[ 60] 0x00007fdf40c3e39d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11490205
[ 61] 0x00007fdf40bcc512 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11023634
[ 62] 0x00007fdf408dcd70 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07945584
[ 63] 0x00007fdf408df08c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07954572
[ 64] 0x00007fdf408dc62b /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943723
[ 65] 0x00007fdf408ed92f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08014127
[ 66] 0x00007fdf408ee389 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08016777
[ 67] 0x00007fdf408dc434 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943220
[ 68] 0x00007fdf408dc536 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943478
[ 69] 0x00007fdf40a374eb /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09364715
[ 70] 0x00007fdf40a3b5c6 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09381318
[ 71] 0x00007fdf4df26154 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+04153684
[ 72] 0x00007fdf4dd8dd21 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02481441
[ 73] 0x00007fdf4dd90f65 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02494309
[ 74] 0x00007fdf4e9b0f26 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01535782 ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00000166
[ 75] 0x00007fdf4e9b250c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01541388
[ 76] 0x00007fdf4e9b28ae /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01542318 ZN8Mfh_file8dispatchEiPSt10unique_ptrI11mxArray_tagN6matrix6detail17mxDestroy_deleterEEiPPS1+00000030
[ 77] 0x00007fdf4dd9fda2 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02555298
[ 78] 0x00007fdf4dda1304 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02560772
[ 79] 0x00007fdf40c4bb5f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11545439
[ 80] 0x00007fdf40c3e39d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11490205
[ 81] 0x00007fdf40bcc512 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11023634
[ 82] 0x00007fdf408dcd70 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07945584
[ 83] 0x00007fdf408df08c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07954572
[ 84] 0x00007fdf408dc62b /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943723
[ 85] 0x00007fdf408ed92f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08014127
[ 86] 0x00007fdf408ee389 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08016777
[ 87] 0x00007fdf408dc434 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943220
[ 88] 0x00007fdf408dc536 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943478
[ 89] 0x00007fdf40a374eb /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09364715
[ 90] 0x00007fdf40a3b5c6 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09381318
[ 91] 0x00007fdf4df26154 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+04153684
[ 92] 0x00007fdf4de011ef /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02953711
[ 93] 0x00007fdf4de088a7 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02984103
[ 94] 0x00007fdf4dec94f5 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+03773685
[ 95] 0x00007fdf4dec994e /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+03774798
[ 96] 0x00007fdf4ec92a62 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+01038946 _ZN3iqm14UserEvalPlugin7executeEP15inWorkSpace_tag+00000754
[ 97] 0x00007fdf4ec6b51f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00877855
[ 98] 0x00007fdf4ec78c22 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00932898
[ 99] 0x00007fdf4ec35e58 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00659032
[100] 0x00007fdf4e39eab9 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00498361
[101] 0x00007fdf4e39ef43 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00499523
[102] 0x00007fdf4e3ba592 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00611730 _Z22mnGetCommandLineBufferbRbN7mwboost8optionalIKP15inWorkSpace_tagEEbRKNS0_9function2IN6mlutil14cmddistributor17inExecutionStatusERKNSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEES4_EE+00000210
[103] 0x00007fdf4e3ba8f9 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00612601 _Z8mnParserv+00000521
[104] 0x00007fdf4eb11bdf /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00863199
[105] 0x00007fdf5f2606a4 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmvm.so+03384996 ZN14cmddistributor15PackagedTaskIIP10invokeFuncIN7mwboost8functionIFvvEEEEENS2_10shared_ptrINS2_6futureIDTclfp_EEEEEERKT+00000068
[106] 0x00007fdf5f260959 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmvm.so+03385689 _ZNSt17_Function_handlerIFN7mwboost3anyEvEZN14cmddistributor15PackagedTaskIIP10createFuncINS0_8functionIFvvEEEEESt8functionIS2_ET_EUlvE_E9_M_invokeERKSt9_Any_data+00000025
[107] 0x00007fdf4ec8c89d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+01013917 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tag+00000093
[108] 0x00007fdf4ec6b51f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00877855
[109] 0x00007fdf4ec34222 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00651810
[110] 0x00007fdf4ec34b73 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00654195
[111] 0x00007fdf4ec34e74 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00654964
[112] 0x00007fdf4eafe0be /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00782526
[113] 0x00007fdf4eafdcb5 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00781493
[114] 0x00007fdf4eafdf0d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00782093
[115] 0x00007fdf5e211277 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwboost_thread.so.1.78.0+00045687
[116] 0x00007fdf5e5e7ac3 /lib/x86_64-linux-gnu/libc.so.6+00608963
[117] 0x00007fdf5e679850 /lib/x86_64-linux-gnu/libc.so.6+01206352

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
** This crash report has been saved to disk as /home/tk/matlab_crash_dump.57653-3 **

-------------------------------------------------------------
This segmentation violation occurred while executing the 
S-function 'FAST_SFunc' in block 'OpenLoop/FAST Nonlinear Wind Turbine/S-Function'.
A common cause of this segmentation violation is an incorrect
input port direct feedthrough setting. Each input port of the
S-function that is read (accessed) in mdlOutputs and/or
mdlGetTimeOfNextVarHit must specify that it needs its input
signal in these routines by setting direct feedthrough for
these input ports.
Another cause can be incorrect memory accesses which occur
when your code accesses beyond the end of an array. For example
if you access input port 5 and in mdlInitializeSizes specify
that you only have 4 input ports.
To debug your C-MEX S-function, you can enable diagnostics
by compiling the S-function source with the -g flag, e.g.,
  mex -g sfunction_name.c
-------------------------------------------------------------

MATLAB is exiting because of fatal error

M-Shell killed

@deslaughter
Copy link
Collaborator

Are you compiling with the Intel compilers and MKL? Based on the stack trace something is failing in the MKL when calling dgetrf. However, the MKL being loaded is from inside MATLAB, which probably isn't the same MKL that CMake orginally found. Maybe there's a version incompatibility. Please provide the full CMake configuration command that you used to build OpenFAST. Also, please try compiling with -DBLA_STATIC=ON which should embed the MKL in the MEX file so it can't load the wrong one. If BLA_STATIC doesn't change anything, you can try -DUSE_LOCAL_STATIC_LAPACK=ON instead, which will build and link a static version of the netlib LAPACK into the mex file. This guarantees static linkage, but will be slower than using the MKL.

@TorbenKnudsen
Copy link
Author

I'm not perfectly sure what options I have used now but I have attached the file /home/tk/OpenFAST/CMakeLists.txt
CMakeLists.txt

Below you see the result of doing what I think you ask me to

~/OpenFAST/build $ cmake .. -DBLA_STATIC=ON
-- Enabling Fortran 2008 features
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5") found components: C
-- Could NOT find LAPACK (missing: LAPACK_LIBRARIES)
CMake Error at CMakeLists.txt:164 (message):
Unable to find BLAS and LAPACK

-- Configuring incomplete, errors occurred!
See also "/home/tk/OpenFAST/build/CMakeFiles/CMakeOutput.log".
See also "/home/tk/OpenFAST/build/CMakeFiles/CMakeError.log".
~/OpenFAST/build $

@TorbenKnudsen
Copy link
Author

I have been running Run_OpenLoop.m both in where it was after installing.

I tried both the options you suggested

~/OpenFAST/build $ cmake .. -DBLA_STATIC=ON -DLAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/liblapack.so"
-- Enabling Fortran 2008 features
-- Found LAPACK: /usr/lib/x86_64-linux-gnu/liblapack.so
-- Setting system file as: src/SysGnuLinux.f90
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tk/OpenFAST/build
~/OpenFAST/build $

~/OpenFAST/build $ cmake .. -DBLA_STATIC=OFF -DUSE_LOCAL_STATIC_LAPACK=ON -DLAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu/liblapack.so"
-- Enabling Fortran 2008 features
-- Downloading and building LAPACK as static libraries for linking with OpenFAST
-- Using LAPACK libraries: /home/tk/OpenFAST/build/dependencies/src/lapack-build/lib/liblapack.a;/home/tk/OpenFAST/build/dependencies/src/lapack-build/lib/libblas.a
-- Setting system file as: src/SysGnuLinux.f90
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tk/OpenFAST/build
~/OpenFAST/build $

unfortunately both produced Segmentation violation. Moreover, the stack trace
looks very similar and still with Matlab files

Stack Trace (from fault):
[ 0] 0x00007f1ea4b33e61 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20979297 mkl_blas_avx2_xidamax_nonan+00000417
[ 1] 0x00007f1ea4a8e520 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20301088 mkl_blas_avx2_xidamax+00000064
[ 2] 0x00007f1ea3de342e /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+07017518 mkl_blas_idamax+00001006
[ 3] 0x00007f1ea45badbf /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15240639 mkl_lapack_dgetf2_team+00000975
[ 4] 0x00007f1ea45ba92c /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15239468 mkl_lapack_dgetrf_local_team+00002812
[ 5] 0x00007f1ea45ba0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 6] 0x00007f1ea45ba0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 7] 0x00007f1ea45ba0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 8] 0x00007f1ea45ba0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 9] 0x00007f1ea45ba0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 10] 0x00007f1ea3cd49fe /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05908990 mkl_lapack_dgetrf+00001934
[ 11] 0x00007f209f955893 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01398931 __kmp_invoke_microtask+00000147
[ 12] 0x00007f209f8c8cb3 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00822451
[ 13] 0x00007f209f8c7bf2 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00818162
[ 14] 0x00007f209f956603 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01402371
[ 15] 0x00007f20c6af3ac3 /lib/x86_64-linux-gnu/libc.so.6+00608963
[ 16] 0x00007f20c6b85850 /lib/x86_64-linux-gnu/libc.so.6+01206352

Thanks for the help so far

@deslaughter
Copy link
Collaborator

deslaughter commented May 7, 2024 via email

@TorbenKnudsen
Copy link
Author

I then tried
cmake .. -DBLA_STATIC=ON -DUSE_LOCAL_STATIC_LAPACK=ON -DOPENMP=OFF -DLAPACK_LIBRARIES=""

and got

Stack Trace (from fault):
[ 0] 0x00007f305fca6f3a /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20979514 mkl_blas_avx2_xidamax_nonan+00000634
[ 1] 0x00007f305fc01520 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+20301088 mkl_blas_avx2_xidamax+00000064
[ 2] 0x00007f305ef5642e /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+07017518 mkl_blas_idamax+00001006
[ 3] 0x00007f305f72ddbf /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15240639 mkl_lapack_dgetf2_team+00000975
[ 4] 0x00007f305f72d92c /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15239468 mkl_lapack_dgetrf_local_team+00002812
[ 5] 0x00007f305f72d0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 6] 0x00007f305f72d0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 7] 0x00007f305f72d0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 8] 0x00007f305f72d0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 9] 0x00007f305f72d0eb /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+15237355 mkl_lapack_dgetrf_local_team+00000699
[ 10] 0x00007f305ee479fe /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05908990 mkl_lapack_dgetrf+00001934
[ 11] 0x00007f325ab55893 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+01398931 __kmp_invoke_microtask+00000147
[ 12] 0x00007f325aac8cb3 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00822451
[ 13] 0x00007f325aac9f7d /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00827261 __kmp_fork_call+00003965
[ 14] 0x00007f325aa85425 /usr/local/MATLAB/R2024a/bin/glnxa64/../../sys/os/glnxa64/libiomp5.so+00545829 _kmpc_fork_call+00000421
[ 15] 0x00007f305ee48e49 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+05914185 mkl_lapack_dgetrf+00007129
[ 16] 0x00007f305ec9faf3 /usr/local/MATLAB/R2024a/bin/glnxa64/mkl.so+04172531 dgetrf_64
+00000259
[ 17] 0x00007f306b99c0a3 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+26075299
[ 18] 0x00007f306af759ab /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+15432107
[ 19] 0x00007f306af82d30 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+15486256
[ 20] 0x00007f306a1a7df3 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+00957939
[ 21] 0x00007f306a1dcd94 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+01174932
[ 22] 0x00007f306a1dd2f7 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+01176311
[ 23] 0x00007f306a122984 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+00412036
[ 24] 0x00007f306a122da9 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+00413097
[ 25] 0x00007f306a1e0f86 /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+01191814
[ 26] 0x00007f306a10803a /home/tk/OpenFAST/install/lib/FAST_SFunc.mexa64+00303162 mexFunction+00002282
[ 27] 0x00007f327184512f /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00966959
[ 28] 0x00007f32718451a7 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00967079
[ 29] 0x00007f3271845217 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00967191
[ 30] 0x00007f32718467ca /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00972746
[ 31] 0x00007f3271832284 /usr/local/MATLAB/R2024a/bin/glnxa64/libmex.so+00889476
[ 32] 0x00007f3272020f26 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01535782 ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00000166
[ 33] 0x00007f3272022c79 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01543289 ZN8Mfh_file8dispatchEiPP11mxArray_tagiS2+00000233
[ 34] 0x00007f3271fb0c38 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01076280 mdDoMatlabFcnCall+00000088
[ 35] 0x00007f32731f438d /usr/local/MATLAB/R2024a/bin/glnxa64/builtins/sl_proxy_interface/../../../../bin/glnxa64/libmwsl_services.so+02990989 _ZN25CMatlabCommandNoWatermark7executeEbN6matrix9ErrorModeE+00000061
[ 36] 0x00007f30d12bc1bd /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_utility.so+00717245 _Z17slDoMatlabFcnCalliPP11mxArray_tagiPPKS_P13Mfh_MATLAB_fnbN6matrix9ErrorModeE+00000061
[ 37] 0x00007f30dd9b37ba /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_lang_blocks.so+11147194 _Z17CallCMexSFcnStartP10slSFcnInfoP13SimStruct_tag+00000442
[ 38] 0x00007f30df68aa81 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+23652993 _ZN18SFunctionExecBlock5StartEv+00000513
[ 39] 0x00007f30df68b269 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+23655017 _ZN18SFunctionExecBlock21SetupRuntimeResourcesEv+00000537
[ 40] 0x00007f30c6f26db2 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00585138 _ZN6slexec4tldr6method12BlockMethods21setupRuntimeResourcesEv+00000130
[ 41] 0x00007f30c6f0d56e /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00480622
[ 42] 0x00007f30c6f29f0c /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwslexec_tldr.so+00597772 _ZN6slexec4tldr6method12ModelMethods21setupRuntimeResourcesEv+00000060
[ 43] 0x00007f3246bd8c11 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_link_bd.so+00916497
[ 44] 0x00007f3246be94ee /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsl_link_bd.so+00984302 _Z22sleInitModelConditionsP8SLExecBDPK11mxArray_tagbbPS1_bbP14CmdlSimInpInfo+00001854
[ 45] 0x00007f30df70df7a /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24190842
[ 46] 0x00007f30df711a4c /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24205900
[ 47] 0x00007f30df716f26 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24227622
[ 48] 0x00007f30df70b590 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24180112
[ 49] 0x00007f30df783382 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+24671106
[ 50] 0x00007f30def184b6 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+15844534
[ 51] 0x00007f30dee3bc87 /usr/local/MATLAB/R2024a/bin/glnxa64/sl_proxy/sl_proxy_desktop/../../../../bin/glnxa64/libmwsimulink.so+14941319 Z14slFullSimulateiPP11mxArray_tagiS1+00000311
[ 52] 0x00007f32733c6142 /usr/local/MATLAB/R2024a/bin/glnxa64/builtins/sl_proxy_interface/../../../../bin/glnxa64/libmwsl_proxy_interface.so+00028994
[ 53] 0x00007f3271f846c4 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00894660
[ 54] 0x00007f3271f87a58 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00907864
[ 55] 0x00007f3271f6a0c0 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00786624
[ 56] 0x00007f3271f6a46e /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+00787566 ZN18Mfh_MATLAB_fn_impl8dispatchEiPSt10unique_ptrI11mxArray_tagN6matrix6detail17mxDestroy_deleterEEiPPS1+00000030
[ 57] 0x00007f327138ada2 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02555298
[ 58] 0x00007f327138c304 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02560772
[ 59] 0x00007f32603d4b5f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11545439
[ 60] 0x00007f32603c739d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11490205
[ 61] 0x00007f3260355512 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11023634
[ 62] 0x00007f3260065d70 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07945584
[ 63] 0x00007f326006808c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07954572
[ 64] 0x00007f326006562b /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943723
[ 65] 0x00007f326007692f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08014127
[ 66] 0x00007f3260077389 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08016777
[ 67] 0x00007f3260065434 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943220
[ 68] 0x00007f3260065536 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943478
[ 69] 0x00007f32601c04eb /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09364715
[ 70] 0x00007f32601c45c6 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09381318
[ 71] 0x00007f3271511154 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+04153684
[ 72] 0x00007f3271378d21 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02481441
[ 73] 0x00007f327137bf65 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02494309
[ 74] 0x00007f3272020f26 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01535782 ZN8Mfh_file20dispatch_file_commonEMS_FviPP11mxArray_tagiS2_EiS2_iS2+00000166
[ 75] 0x00007f327202250c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01541388
[ 76] 0x00007f32720228ae /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_dispatcher.so+01542318 ZN8Mfh_file8dispatchEiPSt10unique_ptrI11mxArray_tagN6matrix6detail17mxDestroy_deleterEEiPPS1+00000030
[ 77] 0x00007f327138ada2 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02555298
[ 78] 0x00007f327138c304 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02560772
[ 79] 0x00007f32603d4b5f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11545439
[ 80] 0x00007f32603c739d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11490205
[ 81] 0x00007f3260355512 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+11023634
[ 82] 0x00007f3260065d70 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07945584
[ 83] 0x00007f326006808c /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07954572
[ 84] 0x00007f326006562b /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943723
[ 85] 0x00007f326007692f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08014127
[ 86] 0x00007f3260077389 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+08016777
[ 87] 0x00007f3260065434 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943220
[ 88] 0x00007f3260065536 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+07943478
[ 89] 0x00007f32601c04eb /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09364715
[ 90] 0x00007f32601c45c6 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwm_lxe.so+09381318
[ 91] 0x00007f3271511154 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+04153684
[ 92] 0x00007f32713ec1ef /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02953711
[ 93] 0x00007f32713f38a7 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+02984103
[ 94] 0x00007f32714b44f5 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+03773685
[ 95] 0x00007f32714b494e /usr/local/MATLAB/R2024a/bin/glnxa64/libmwlxemainservices.so+03774798
[ 96] 0x00007f3272302a62 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+01038946 _ZN3iqm14UserEvalPlugin7executeEP15inWorkSpace_tag+00000754
[ 97] 0x00007f32722db51f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00877855
[ 98] 0x00007f32722e8c22 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00932898
[ 99] 0x00007f32722a5e58 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00659032
[100] 0x00007f327191aab9 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00498361
[101] 0x00007f327191af43 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00499523
[102] 0x00007f3271936592 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00611730 _Z22mnGetCommandLineBufferbRbN7mwboost8optionalIKP15inWorkSpace_tagEEbRKNS0_9function2IN6mlutil14cmddistributor17inExecutionStatusERKNSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEEES4_EE+00000210
[103] 0x00007f32719368f9 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwbridge.so+00612601 _Z8mnParserv+00000521
[104] 0x00007f3272181bdf /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00863199
[105] 0x00007f328287d6a4 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmvm.so+03384996 ZN14cmddistributor15PackagedTaskIIP10invokeFuncIN7mwboost8functionIFvvEEEEENS2_10shared_ptrINS2_6futureIDTclfp_EEEEEERKT+00000068
[106] 0x00007f328287d959 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmvm.so+03385689 _ZNSt17_Function_handlerIFN7mwboost3anyEvEZN14cmddistributor15PackagedTaskIIP10createFuncINS0_8functionIFvvEEEEESt8functionIS2_ET_EUlvE_E9_M_invokeERKSt9_Any_data+00000025
[107] 0x00007f32722fc89d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+01013917 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tag+00000093
[108] 0x00007f32722db51f /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00877855
[109] 0x00007f32722a4222 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00651810
[110] 0x00007f32722a4b73 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00654195
[111] 0x00007f32722a4e74 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwiqm.so+00654964
[112] 0x00007f327216e0be /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00782526
[113] 0x00007f327216dcb5 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00781493
[114] 0x00007f327216df0d /usr/local/MATLAB/R2024a/bin/glnxa64/libmwmcr.so+00782093
[115] 0x00007f328182e277 /usr/local/MATLAB/R2024a/bin/glnxa64/libmwboost_thread.so.1.78.0+00045687
[116] 0x00007f3281c04ac3 /lib/x86_64-linux-gnu/libc.so.6+00608963
[117] 0x00007f3281c96850 /lib/x86_64-linux-gnu/libc.so.6+01206352

This error was detected while a MEX-file was running. If the MEX-file
is not an official MathWorks function, please examine its source code
for errors. Please consult the External Interfaces Guide for information
on debugging MEX-files.
** This crash report has been saved to disk as /home/tk/matlab_crash_dump.33170-3 **

-------------------------------------------------------------
This segmentation violation occurred while executing the 
S-function 'FAST_SFunc' in block 'OpenLoop/FAST Nonlinear Wind Turbine/S-Function'.
A common cause of this segmentation violation is an incorrect
input port direct feedthrough setting. Each input port of the
S-function that is read (accessed) in mdlOutputs and/or
mdlGetTimeOfNextVarHit must specify that it needs its input
signal in these routines by setting direct feedthrough for
these input ports.
Another cause can be incorrect memory accesses which occur
when your code accesses beyond the end of an array. For example
if you access input port 5 and in mdlInitializeSizes specify
that you only have 4 input ports.
To debug your C-MEX S-function, you can enable diagnostics
by compiling the S-function source with the -g flag, e.g.,
  mex -g sfunction_name.c
-------------------------------------------------------------

MATLAB is exiting because of fatal error

@deslaughter
Copy link
Collaborator

I verified the method for building OpenFAST Simulink module on an CentOS 7 linux system with MATLAB 2023a. Let's try the following:

  • Delete your build directory and create a new one
  • cd into build directory
  • run cmake .. -DBUILD_OPENFAST_SIMULINK_API=ON -DUSE_LOCAL_STATIC_LAPACK=ON
  • I'm using the Intel oneAPI 2023.2 compilers which are automatically detected by CMake
  • run cmake --build . --target FAST_SFunc to build the simulink module in build/glue-codes/simulink
  • Start MATLAB and make sure that the build/glue-codes/simulink is the first path that will be searched.
  • Run the RUN_OpenLoop.m script

If this doesn't work, please post the full output of the CMake configure step so I can see which compilers you're using.

@TorbenKnudsen
Copy link
Author

I had the below result in matlab which is good.
However, am I not supposed to run make and make install to finalize this?

Run_OpenLoop


OpenFAST

Copyright (C) 2024 National Renewable Energy Laboratory
Copyright (C) 2024 Envision Energy USA LTD

This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY.
See the "LICENSE" file distributed with this software for details.


OpenFAST-v3.5.3-dirty
Compile Info:

  • Compiler: GCC version 11.4.0
  • Architecture: 64 bit
  • Precision: double
  • OpenMP: No
  • Date: May 7 2024
  • Time: 17:09:49
    Execution Info:
  • Date: 05/07/2024
  • Time: 17:57:23+0200

OpenFAST input file heading:
FAST Certification Test #6: AOC 15/50 with many DOFs with gen start, loss of grid, and
tip-brake shutdown. Many parameters are pure fiction.

Running ElastoDyn.
Nodal outputs section of ElastoDyn input file not found or improperly formatted.
Running AeroDyn14.
WARNING: AeroDyn 14 is deprecated and will be removed in a future release.
Running InflowWind.
Running ServoDyn.

FAST_InitializeAll:InflowWind_Init:IfW_UniformWind_Init: Could not read upflow column in uniform
wind files. Assuming upflow is 0.
FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:Yaw angle and rate are not commanded from
Simulink model.
ValidatePrimaryData:Pitch angles are not commanded from Simulink model.
ValidatePrimaryData:Generator torque and power are not commanded from Simulink model.
ValidatePrimaryData:HSS brake is not commanded from Simulink model.
ValidatePrimaryData:Airfoil control is not commanded from Simulink model.
ValidatePrimaryData:Cable control is not commanded from Simulink model.

Time: 0 of 60 seconds.

Time: 5 of 60 seconds. Estimated final completion at 17:57:60.

Time: 10 of 60 seconds. Estimated final completion at 17:57:37.

Time: 15 of 60 seconds. Estimated final completion at 17:57:37.

Time: 20 of 60 seconds. Estimated final completion at 17:57:37.

Time: 25 of 60 seconds. Estimated final completion at 17:57:37.

Time: 30 of 60 seconds. Estimated final completion at 17:57:37.

Time: 35 of 60 seconds. Estimated final completion at 17:57:37.

Time: 40 of 60 seconds. Estimated final completion at 17:57:37.

Time: 45 of 60 seconds. Estimated final completion at 17:57:37.

Time: 50 of 60 seconds. Estimated final completion at 17:57:37.

Time: 55 of 60 seconds. Estimated final completion at 17:57:37.

Time: 60 of 60 seconds. Estimated final completion at 17:57:37.

OpenFAST completed.

@deslaughter
Copy link
Collaborator

@TorbenKnudsen Now that it's working you can run cmake --build . --target install or make and make install to complete the compilation and installation.

@TorbenKnudsen
Copy link
Author

Thanks a lot. I will work on it tomorrow as my time is 7:50pm. I will let you know the result.

1 similar comment
@TorbenKnudsen
Copy link
Author

Thanks a lot. I will work on it tomorrow as my time is 7:50pm. I will let you know the result.

@TorbenKnudsen
Copy link
Author

Dear Derek

I haven't got any recent routine with Simulink so I still only know that Run_Openloop works. However, I suppose that is enough to close this issue. I am not sure if I am supposed to do that but I will give it a try.

Thanks a lot again and you will probably hear more from me.

@TorbenKnudsen TorbenKnudsen reopened this May 16, 2024
@TorbenKnudsen
Copy link
Author

I tried to adapt a simulink model from windows to run on ubuntu. I got the below error

5MW_Land_DLL_WTurb/../5MW_Baseline/ServoData/DISCON.dll could not be loaded. Check that
the file exists in the specified location and that it is compiled for 64-bit
applications.

I can only find dll versions of DISCON in my OpenFAST.
How do I get a proper ubuntu version?

@andrew-platt
Copy link
Collaborator

Dear @TorbenKnudsen,

We only provide the Windows versions of the DISCON dlls. For linux, you will need to compile the DISCON libraries. To compile these, run make regression_test_controllers in your build directory -- the resulting library will be located in your build directory under reg_tests/glue-codes/openfast/5MW_Baseline/ServoData/.

We had considered distributing the DISCON controllers on other platforms, but found there are too many differences in the installed system libraries between linux systems for that to be practical.

Regards,

@TorbenKnudsen
Copy link
Author

Dear Andrew

I tried to follow your instruction and got the error below. I also tried to follow something from https://github.com/openfast/r-test?tab=readme-ov-file#note-external-servodyn-controllers-for-5mw_baseline-cases but did only get a dll file which confuses me.

Welcome to the Emacs shell

~ $ cd OpenFAST/
~/OpenFAST $ cd build/
~/OpenFAST/build $ make regression_test_controllers
make: *** No rule to make target 'regression_test_controllers'. Stop.
~/OpenFAST/build $ cd /home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build/
~/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build $ ls
CMakeFiles CTestTestfile.cmake DISCON.dll Makefile cmake_install.cmake
~/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build $ cmake ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 11.4.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tk/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build
~/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build $ make
Scanning dependencies of target DISCON
[ 50%] Building Fortran object CMakeFiles/DISCON.dir/DISCON.F90.o
[100%] Linking Fortran shared library DISCON.dll
[100%] Built target DISCON
~/OpenFAST/reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON/build $

@deslaughter
Copy link
Collaborator

@TorbenKnudsen the output above says that the controller was built so you should see a file named DISCON.dll in the build directory. While the dll extension may seem odd for a Linux system, the CMake file in reg_tests/r-test/glue-codes/openfast/5MW_Baseline/ServoData/DISCON specifies this extension for all platforms so that the input files used in the regression tests will work across all platforms. Otherwise, there would need to be different input files for each platform just to deal with the shared library extension. If you move DISCON.dll to the 5MW_Land_DLL_WTurb/../5MW_Baseline/ServoData/DISCON.dll as expected by the Simulink model, then it should run.

@TorbenKnudsen
Copy link
Author

Thanks for this. It seems to work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants