Skip to content

Ubuntu, S-Function, mex, error message #387

Description

@Balazs-G

Dear Developer,

I would like to run the OpenLoop Simulink model, but unfortunately I've stuck at creating the S-Function. OpenFAST is working seamless in terminal. Several r-tests has been performed, and the new simulation results fulfill the expectations, too. But when I run the 'create_FAST_SFunc.m', I got the error message (see below). MATLAB r2017b and MATLAB r2019b warned on different gcc versions ( both missing in my case), but resulted same undefined references
Can be the problem caused by the missing gcc version? I would like to try other ways before installing a gcc version not supported by Canonical.

Thank you for your great work and persistent efforts to support FAST!
Balazs

MATLAB error:

Warning: You are using gcc version '5.4.0'. The version of gcc is not supported. The version >currently supported with MEX is '6.3.x'. For a list of
currently supported compilers see: https://www.mathworks.com/support/compilers/current_release.
Error using mex
/home/balazs/OpenFAST/install/lib/libopenfastlib.a(FAST_Library.f90.o): In function FAST_OpFM_Step': FAST_Library.f90:(.text+0xb6): undefined reference to __fast_subs_MOD_fast_solution_t'
FAST_Library.f90:(.text+0x108): undefined reference to _gfortran_string_len_trim' FAST_Library.f90:(.text+0x147): undefined reference to _gfortran_concat_string'
FAST_Library.f90:(.text+0x18c): undefined reference to _gfortran_concat_string' FAST_Library.f90:(.text+0x2f1): undefined reference to _gfortran_concat_string'
FAST_Library.f90:(.text+0x38c): undefined reference to __supercontroller_MOD_sc_setoutputs' FAST_Library.f90:(.text+0x3fa): undefined reference to __supercontroller_MOD_sc_setinputs'
/home/balazs/OpenFAST/install/lib/libopenfastlib.a(FAST_Library.f90.o): In function FAST_OpFM_Restart': FAST_Library.f90:(.text+0x85b): undefined reference to __nwtc_library_MOD_nwtc_init'
FAST_Library.f90:(.text+0x896): undefined reference to `_gfortran_string_index'
.
.
.
..

FAST_Library.f90:(.text+0xaba13): undefined reference to _gfortran_runtime_error_at' FAST_Library.f90:(.text+0xaba1f): undefined reference to _gfortran_os_error'
collect2: error: ld returned 1 exit status

Error in create_FAST_SFunc (line 71)
mex('-largeArrayDims', ...

MATLAB environment
pwd
'/home/bala/OpenFAST/glue-codes/simulink/src'

The final form of mex command:
mex('-largeArrayDims', ...
'-L/home/bala/OpenFAST/install/lib', ...
'-lopenfastlib', ...
'-I/home/bala/OpenFAST/install/include', ...
'-I/home/bala/OpenFAST/modules/supercontroller/src', ...
'-I/home/bala/OpenFAST/modules/openfoam/src', ...
'-outdir', '.', ...
'COMPFLAGS=$COMPFLAGS -MT -D', ...
'S_FUNCTION_NAME=FAST_SFunc', ...
'-output', 'FAST_SFunc', ...
'FAST_SFunc.c');

OpenFAST Version


OpenFAST

Copyright (C) National Renewable Energy Laboratory
Copyright (C) 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-v2.2.0
Compile Info:

  • Architecture: 64 bit
  • Precision: double
  • Date: Jan 3 2020
  • Time: 23:27:19
    Execution Info:
  • Date: 02/09/2020
  • Time: 11:31:30+0100

System Information:

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions