View previous topic :: View next topic |
Author |
Message |
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 3:52 am Post subject: dbk_link4 Error |
|
|
I am trying to setup FTN95 in a minimalist way on our CI server to build our application, however on the server I get the following exception when calling dbk_link4:
Code: |
PS C:\FTN95> dbk_link4
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Salford.Linker' threw an exception. -
--> System.TypeInitializationException: The type initializer for 'Salford.Fortran.RTLibrary' threw an exception. ---> Sy
stem.DllNotFoundException: Unable to load DLL 'SALFLIBC.dll': The specified module could not be found. (Exception from H
RESULT: 0x8007007E)
at Salford.Fortran.RTLibrary.__com_plus_initialise(Int32 hin)
at Salford.Fortran.RTLibrary.InitLibrary()
at Salford.Fortran.RTLibrary..cctor()
--- End of inner exception stack trace ---
at Salford.Fortran.RTLibrary.InitLibrary()
at Salford.Linker..cctor()
--- End of inner exception stack trace ---
at Salford.Linker.Main(String[] args) |
SALFLIBC.dll is in the same location as on my personal development machine but on the CI server I get the above error... How can I ensure it finds SALFLIBC.dll?
Thanks,
Alex. |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Mon Feb 08, 2021 10:12 am Post subject: |
|
|
Is salflibc.dll in the same place as dbk_link4? |
|
Back to top |
|
|
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 10:59 am Post subject: |
|
|
Yeah they are in the same folder and that folder is on the PATH. I am trying to deploy the CI server based on this docker image: https://hub.docker.com/_/microsoft-dotnet-framework-sdk/
mcr.microsoft.com/dotnet/framework/sdk:4.8
So I basically zipped up the installation and wrote a script to set it up the same as on my development machine, I then removed silverfrost completely from my development machine (deleted leftover folders, registry keys, cleaned path after uninstall) before running the same script the docker image runs to setup FTN95.
Testing on my development machine the build through jenkins works fine, but in the docker container calling dbk_link4 gives that error... So I am really not sure what the difference is between FTN95 on my dev machine and on the CI server I am trying to deploy to build my application.
This is the script I am using to setup FTN95 on both machines (FTN95.zip is simply my valid install zipped up):
Code: |
COPY "./FTN95.zip" "C:/FTN95.zip"
RUN Expand-Archive -Path "C:/FTN95.zip" -DestinationPath "C:/FTN95"
RUN setx /M PATH $($Env:PATH + ';C:\\FTN95')
RUN New-Item -Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Silverfrost\\Silverfrost FTN95' -Name '8.40' -Force
RUN Set-ItemProperty -Path 'HKLM:\\SOFTWARE\\WOW6432Node\\Silverfrost\\Silverfrost FTN95\\8.40' -Name InstallLocation -Value 'C:\\FTN95' -Type ExpandString
RUN Remove-Item -Path "C:/FTN95.zip" -Force
|
Could it be I am missing a required .NET framework version for dbk_link4 or something? |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Mon Feb 08, 2021 11:06 am Post subject: |
|
|
The error message is saying that ftn95lib.dll can't find salflibc.dll. Often ftn95lib.dll lives in the GAC. Can you run dbk_link4 in a command prompt? |
|
Back to top |
|
|
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 11:14 am Post subject: |
|
|
I get the same error just typing it into a console, I did copy the ftn95lib stuff out of redist into the bin with the dbk_link4.exe a while ago because it complained it could not find it. But I assumed I removed all the DLL files on my dev machine as well when I removed it and restored it from a zip of my FTN95 folder, but not getting the error on my development machine.
Could I have missed a step where these DLLs are actually registered? But the locations are different after using the script to restore the install and it still works on there. |
|
Back to top |
|
|
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 11:16 am Post subject: |
|
|
CLI inside docker container gives this:
Code: |
C:\>dbk_link4
Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'Salford.Linker' threw an exception. ---> System.TypeInitializationException:
The type initializer for 'Salford.Fortran.RTLibrary' threw an exception. ---> Sy
stem.DllNotFoundException: Unable to load DLL 'SALFLIBC.dll': The specified modu
le could not be found. (Exception from HRESULT: 0x8007007E)
at Salford.Fortran.RTLibrary.__com_plus_initialise(Int32 hin)
at Salford.Fortran.RTLibrary.InitLibrary()
at Salford.Fortran.RTLibrary..cctor()
--- End of inner exception stack trace ---
at Salford.Fortran.RTLibrary.InitLibrary()
at Salford.Linker..cctor()
--- End of inner exception stack trace ---
at Salford.Linker.Main(String[] args)
|
Development machine setup using the same script (but previously installed with installer) works fine:
Code: |
C:\Users\alexh>dbk_link4
[DBK_LINK Ver. 4.1.1 Copyright(c) Silverfrost Ltd 2001-2018]
|
|
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Mon Feb 08, 2021 12:28 pm Post subject: |
|
|
This is the declaration:
Code: |
[SuppressUnmanagedCodeSecurity()]
[DllImport("SALFLIBC.dll",CallingConvention=CallingConvention.Cdecl)]
private static extern void __com_plus_initialise(int hin);
|
Looks fairly straightforward that it cannot load salflibc.dll. Does ftn95.exe work - it also uses salflibc.dll. |
|
Back to top |
|
|
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 12:34 pm Post subject: |
|
|
Yeah my build script actually compiles all the FTN source files and fails at the very last step where it calls the linker... So that sounds even stranger if they both require the same DLL files as they are both in the same path. |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Mon Feb 08, 2021 3:59 pm Post subject: |
|
|
I am not really sure what to suggest. Usually the issue is ftn95lib.dll, it can end up being in the wrong GAC. I wonder if something like windbg would help determine what it is trying to load. |
|
Back to top |
|
|
alex21
Joined: 20 Apr 2011 Posts: 75 Location: Australia
|
Posted: Mon Feb 08, 2021 11:13 pm Post subject: |
|
|
Cheers I will try debugging the issue a bit more as it would be good for the productivity of my team to get this working.
Thanks,
Alex. |
|
Back to top |
|
|
|