PLCNext Simulation - Issues with missing libArp.Io.Profibus.so with AXCF3152 2023 LTS Simulation

Hi,
I am having issues when trying to run a c++ project on a simulated 3152 controller. I am using the following versions
c++ sdk : „2023.0.2 LTS (23.0.2.56)“
PLCNext engineer : 2023.0.1 (Build 6.0.339.0, Revision 97eb7ae5)
Problem:
When I try to load my project into the simulation, it fails since unable to open libArp.Io.Profibus.so . I don’t knowingly use/reference this library anywhere in my project (but I’m sure it’s probably a dependancy of something else in Arp).
Exact error message
18.07.23 11:36:14.086 Arp.Plc.Domain.Internal.PlcManager INFO - PlcManager::ResetPlc(async=true), current PlcState=Ready|Error
18.07.23 11:36:14.089 Arp.Plc.Domain.Internal.PlcManager INFO - Plc state transition from ‚Ready|Error‘ to ‚Ready‘
18.07.23 11:36:14.228 Arp.Plc.Domain.Internal.PlcManager INFO - PlcManager::LoadPlc(async=true), current Plc state=Ready
18.07.23 11:36:14.524 Arp.Plc.Domain.Internal.Config.PlcConfigManager INFO - Loading project ‚MY_PROJECT‘
18.07.23 11:36:14.747 Arp.Plc.Domain.Internal.PlcComponentController ERROR - Exception occurs while loading plc component ‚Arp.Plc.Plm‘: Exception of type ‚Arp::System::Ve::Exceptions::VeException‘ was thrown
Loading of the shared library ‚/opt/plcnext/shadowing/~libMyProject/libMyProject.so‘ failed with error ‚libArp.Io.Profibus.so : cannot open shared object file: No such file or directory‘
at: /usr/lib/libArp.System.Ve.so(+0x21c2a) [0x7f3a628e4c2a]
at: Arp::System::Acf::Internal::Pm::SharedLibraryLoader::Load(Arp::BasicString<char, std::allocator > const&, bool, std::vector<Arp::BasicString<char, std::allocator >, std::allocator<Arp::BasicString<char, std::allocator > > > const&)
at: Arp::Plc::Plm::Internal::ProgramLibrary::LoadLibrary(Arp::System::Acf::Internal::Sm::Config::Library const&)
at: Arp::Plc::Plm::Internal::LibraryManager::LoadLibraries(bool)
at: Arp::Plc::Plm::Internal::PlmDomain::Load(Arp::System::Commons::Configuration::ConfigurationSettings const&, bool)
at: Arp::Plc::Plm::PlmComponent::LoadPlc(bool)
at: Arp::Plc::Domain::Internal::PlcComponentInfo::LoadPlc(bool)
at: Arp::Plc::Domain::Internal::PlcComponentController::LoadAndSetupPlcComponents(bool)
at: Arp::Plc::Domain::Internal::PlcManager::LoadAndSetupPlcConditionally()
at: Arp::System::Commons::Threading::TaskQueue::ProcessTasksInternal(unsigned long)
at: Arp::System::Commons::Threading::TaskQueue::ProcessTasks()
at: Arp::System::Commons::Threading::TaskThread::RunInternal(void*)
at: Arp::System::Commons::Threading::thread::RunThread(Arp::System::Commons::Threading::ThreadBinaryCompatibilityExtensions*)
at: Arp::System::Commons::Threading::thread::RunInternal(void*)
at: Arp::System::Ve::Internal::Linux::ThreadService::RunInternal(void*)
at: /lib/libc.so.6(+0x8aa42) [0x7f3a62ae1a42]
at: /lib/libc.so.6(+0x10c6f0) [0x7f3a62b636f0]

18.07.23 11:36:14.752 Arp.Plc.Domain.Internal.PlcComponentController ERROR - Plc component ‚Arp.Plc.Plm‘ returns false while LoadPlc(isChanging=false) was called.
18.07.23 11:36:14.826 Arp.Plc.Domain.Internal.PlcManager INFO - Plc state transition from ‚Ready‘ to ‚Ready|Error‘

Thoughts/troubleshooting
* Digging around /usr/lib in the sim, it appears that as expected libArp.Io.Profibus.so is not there.
* Looking on an actual 3152 in the same directory and I can see that it the same lib does exist.
* I guess it is missing/ommitted from the sim image for some reason ? Any other tips to resolve (apart from trying to copy the so from an actual 3152).

Attaching contents of the /usr/lib directory for simulation :
admin@sim-axcf3152:~$ ls /usr/lib/libArp.Io*
/usr/lib/libArp.Io.Axioline.so /usr/lib/libArp.Io.EthernetIP.so /usr/lib/libArp.Io.ProfinetStack.so
/usr/lib/libArp.Io.Commons.so /usr/lib/libArp.Io.Interbus.so

The root cause(s) of this problem is (a) the 3152 simulation does not include the Profibus library, which it should, and (b) the Cmake file generated for C++ projects by earlier versions of the PLCnext toolchain links PLM and ACF projects to a huge number of usually unnecessary libraries, including the Profibus library.
Can you please try generating a new C++ project using the latest version of the PLCnext Toolchain (2023.0) and check if that project also has the same problem? I’m told that Toolchain version 2023.0 generates a CMake file that is a bit smarter about what it links to during the build, so that will hopefully work around this problem.
I will also report this problem to the developers of the Simulation, so that the same libraries are included as in the physical device.

Martin, thanks again for the prompt response. Just double checked, the project was built with the 2023 PLCNext toolchain (plcncli 23.0.0 LTS (23.0.0.1356)) , so that does not seem to fix things unfortunately.

I managed to resolve the issue by setting the cmake variable „ArpProgramming_ARP_IO_PROFIBUS_LIBRARY“ to 0 within the CMakelists.txt for my project and the respective consumable libs.

the project was built with the 2023 PLCNext toolchain (plcncli 23.0.0 LTS (23.0.0.1356)) As you have found, the key to the workaround is in the CMakeLists.txt file, and this is automatically generated during project creation. So in that case the version of toolchain that is used to build the project isn’t as relevant as the version of the toolchain that was used to create the project, because the CMakeLists.txt file is generated once during project creation.
I’m glad you’ve found a resolution. I have raised this issue with the developers of the Simulation.

Ah yep, sorry. I have a large project with a somewhat already customised CMakeLists.txt, so re executing the plcncli new project command is a bit painful. All good, I know for the future. Thanks :slight_smile:

Update: This problem should be fixed in simulation version 2024.0.