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

Cant run on Macbook M1 Pro #4

Open
birliks opened this issue Dec 9, 2023 · 4 comments
Open

Cant run on Macbook M1 Pro #4

birliks opened this issue Dec 9, 2023 · 4 comments
Assignees
Labels
dependencies Pull requests that update a dependency file question Further information is requested

Comments

@birliks
Copy link

birliks commented Dec 9, 2023

Hello fbarresi,

when i try to run SoftPlc on Macbook Pro M1, i am getting below error. i have already move files from native folder to net6.0 folder.
if you have any suggestion it would be great.

PS /Users/xxxxx/VisualStudioProjects/_Custom/SoftPlc/SoftPlc> dotnet run bin\Debug\net6.0\SoftPlc.dll --plcPort=102 --urls="http://localhost:8080/"
Initializing plc service...
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'snap7' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libsnap7, 0x0001): tried: 'libsnap7' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibsnap7' (no such file), '/usr/lib/libsnap7' (no such file, not in dyld cache), 'libsnap7' (no such file), '/usr/local/lib/libsnap7' (no such file), '/usr/lib/libsnap7' (no such file, not in dyld cache)
at SoftPlc.S7Server.Srv_Create()
at SoftPlc.S7Server..ctor() in /Users/xxxxx/VisualStudioProjects/_Custom/SoftPlc/SoftPlc/Snap7/snap7.net.cs:line 1918
at SoftPlc.Services.PlcService..ctor(IConfiguration configuration) in /Users/xxxxx/VisualStudioProjects/_Custom/SoftPlc/SoftPlc/Services/PlcService.cs:line 23
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
at Program.

$(String[] args) in /Users/xxxxx/VisualStudioProjects/_Custom/SoftPlc/SoftPlc/Program.cs:line 48

@fbarresi
Copy link
Owner

Hi!

What do you mean with you copied the native files into the .net6 folder?

The related native library should be copied into your destination build path.

Eventually, we might need to provide the native libra compiled for m1.

Did you already give a try with docker?

Best regards,
FB

@fbarresi fbarresi self-assigned this Dec 17, 2023
@fbarresi fbarresi added question Further information is requested dependencies Pull requests that update a dependency file labels Dec 17, 2023
@birliks
Copy link
Author

birliks commented Dec 17, 2023

Hi fbarresi,

"The related native library should be copied into your destination build path." I did that. But error is about low level addressing issue, so compatibility issue with m1 processor. because i have limited time to complete project, i purchased a windows pc for now.

i also tried docker on mac, but again i get compatibility related errors. so i gave up and switched to windows pc. but compiling for m1 processors, should be good.

thanks for your reply and support.

have a nice day.
birliks

@fbarresi
Copy link
Owner

All right.
I always had a bunch of such simulated plc running as a docker on a raspberry pi, so that might be an alternative.
I will look for this compatibility fix and update the project. Sadly, I don't have the chance to quickly rebuild on this architecture, so it might take a while.

Best regards,
FB

@birliks
Copy link
Author

birliks commented Dec 17, 2023

as i said, now i dont need a solution because i buy windows pc. but for others may suffer from the same issue, making mac(osx) version can be good.

Thank you for your support.

Regards,
birliks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants