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

Libdiscon compilation 32bits (BLADED and IVF) #12

Closed
cyril13windglaz opened this issue Jun 30, 2020 · 6 comments
Closed

Libdiscon compilation 32bits (BLADED and IVF) #12

cyril13windglaz opened this issue Jun 30, 2020 · 6 comments

Comments

@cyril13windglaz
Copy link

Dear Rosco team,

Thank you so much for your contribution to the open source wind industry knowledged.

I try to compile ROSCO in 32 bits for use with bladed but I didn't managed at the moment.
I try with your Cmake+MINGW32 procedure and also with IVF.
I managed to compile with IVF but then Bladed crash when using it.

Would it be possible that you share a 32bits compile version of your libdiscon.dll ? I could then see if my errors are during the compilation process or when I try to implement the .dll in Bladed.

Best regards,

Cyril

@rafmudaf
Copy link
Collaborator

@cyril13windglaz I think I've compiled this for 32 bit but I dont have a way to verify that. Give it a shot!

32bit build.zip

@cyril13windglaz
Copy link
Author

Hi rafmudaf,

Thx for your try.
Unfortunatly it is not working.

I managed to build one 32bits version with ivf. :
libdiscon_32build.zip

I don't know if it is the right way to proceed but for information, below are the modification applied on my side in the .f90.

  1. : comment in DISCON.f90 : "avcMSG = TRANSFER(TRIM(ErrMsg)//C_NULL_CHAR, avcMSG, SIZE(avcMSG))"

  2. : change in the subroutine ReadControlParameterFileSub of ReadSetparameters.f90,
    from file=accINFILE(1)
    to file='XXXYOURPATHXX\DISCON.IN',
    in the OPEN command.

  3. set the DISCON.IN, libdiscon.dll in the same folder than the Bladed simulation folder

  4. copy past in the bladed additionnal controller parameters the content of DISCON.IN

  5. select the option "force legacy DISCON, and use floating point protection", time steps 0.01s.

Hope this can help.
If anyone has a better way to proceed please let us know !

Cyril

@peter-greaves
Copy link

Thanks @cyril13windglaz ... This works for me - I would add that the calling convention needs to be __cdecl (C, C++, FORTRAN).

@dzalkind
Copy link
Collaborator

dzalkind commented Jun 6, 2022

ROSCO can be compiled in 32-bit Windows with these instructions: https://rosco.readthedocs.io/en/latest/source/install.html#compile-using-cmake

@salem-okpokparoro
Copy link

Below are the steps I took to compile and run ROSCO for Bladed v4.12:

  1. Compiling 32bit ROSCO in Windows:
    -With same folder structure as ROSCO repository, run the following commands:
    cd ROSCO/ROSCO
    mkdir build
    cd build
    cmake .. -G "MinGW Makefiles" # Windows only
    mingw32-make
  2. Setting for external controller in Bladed:

Control>>Define External Controllers..
Paste DISCON.IN content to the first 'Additional Controller Parameters' box
Set calling convent to _cdecl(C,C++,FORTRAN)
Enable 'Pass Parameters by File?'
Enable 'Force Legacy DISCON?'
Hope this helps.

@Abhi-postdoc
Copy link

Hi Cyril,
I have followed all the steps mentioned in your post for 32-bit .dll generation for BLADED. However, I got this error msg in the BLADED interface. Please help me to sort this out. Thanks in advance,

*** Note: Using legacy controller, 'DISCON' in controller C:\Users\PC00\ROSCO\Test_Cases\NREL-5MW\libdiscon.dll
*** ERROR: Unknown SEH (Structured Exception Handling) error encountered. This could be due to using the wrong calling convention being used when calling a dll, or a C++ exception being thrown from within an extern "C" function, or a missing dll dependency encountered in external controller.

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

No branches or pull requests

6 participants