I tried running an mpi program written in C# on OSX, however, I keep getting the permission denied error.
The steps I took to install mpi:
installed homebrew
using homebrew installed mpich
installed mono (so I can get a .exe file)
created a project in Rider, specified target frameworks to be net50 (latest .net core) and net48 (assume provided by mono)
installed mpi.net nuget package
went into the Debug directory of net48 containing ConsoleApp1.exe
ran the command mpirun -np 4 ./ConsoleApp1.exe with and without sudo
However, I get the following error:
[proxy:0:0#Marins-MacBook-Pro.local] HYDU_create_process (utils/launch/launch.c:74): execvp error on file ./ConsoleApp1.exe (Permission denied)
The error is repeated once for each process.
Using finder I selected the exe file and parent folder in question and gave everyone permissions to read and write (read permissions are granted by default). However, the problem still persists.
What can I try to solve this issue?
EDIT:
I also tried with the following command:
mpiexec -n 4 mono ConsoleApp1.exe
However, I get the error:
Unhandled Exception:
System.DllNotFoundException: msmpi.dll assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) MPI.Unsafe.MPI_Finalized(int&)
at MPI.Environment.get_Finalized () [0x00000] in <fa7716c2d3a447518b7b229d8fa8506f>:0
at MPI.Environment..ctor (System.String[]& args, MPI.Threading threading) [0x00006] in <fa7716c2d3a447518b7b229d8fa8506f>:0
at MPI.Environment..ctor (System.String[]& args) [0x00000] in <fa7716c2d3a447518b7b229d8fa8506f>:0
at ConsoleApp1.Program.Main (System.String[] args) [0x00001] in <4afb3f1ea5bc4367a9a7afd6da6576a3>:0
I'm not sure whether this is the correct way to use mpi on OS X.
Related
Trying to run a small C# project with uploaded DLLs on Replit.com
Uploaded my DLL (Unit4.dll).
In Visual Studio on my desktop it works after I Added References to three Windows DLLs:
System.Drawing.Common.dll, System.Windows.Forms.dll, System.Configuration.ConfigurationManager.dll.
Downloaded the three DLLs and Uploaded them to Files on Replit.com
Changed the .replit command to
run = "set -e; mcs Main.cs -r:Unit4.dll -r:System.Windows.Forms.dll -r:System.Drawing.Common.dll -r:System.Configuration.ConfigurationManager.dll; mono Main.exe"
It compiles and runs, but gets a the Runtime Exception I added below.
Not sure what is missing or what is wrong and how to fix it.
Please help.
Unhandled Exception:
System.EntryPointNotFoundException: SetConsoleTitle assembly: type: member:(null)
at (wrapper managed-to-native) Unit4.BinTreeCanvasLib.Window.SetConsoleTitle(string)
at Unit4.BinTreeCanvasLib.Window.get_Instance () [0x00067] in <6a068eaab6084265b4099e03c146f5d7>:0
at Unit4.BinTreeCanvasLib.TreeCanvas.InitTreeToDraw[T] (Unit4.CollectionsLib.BinNode1[T] tree) [0x00366] in <6a068eaab6084265b4099e03c146f5d7>:0 at Unit4.BinTreeCanvasLib.TreeCanvas.AddTree[T] (Unit4.CollectionsLib.BinNode1[T] tree) [0x00001] in <6a068eaab6084265b4099e03c146f5d7>:0
at Program.Main (System.String[] args) [0x00054] in <95445213fc8b4cc9ba753b3d428925d5>:0
I'm trying to build my first HoloLens app using Unity. I imported the MRTK and its features. I also connected the HoloLens through USB. As soon as I press "Build and Run" it provides 3 errors. My build settings for Universal Windows Platform are the following:
Target Device: HoloLens,
Architect: ARM (I also tried ARM64),
Build Type: D3D Project,
Target SDK Version: Latest Installed,
Minimum Platform Version: (all the versions give the same error),
Visual Studio Version: Latest Installed,
Build and Run on: USB Device,
Build Configuration: Release.
Regardless of the build settings, the following errors appear as soon as I press the "Build and Run":
BuildFailedException: Deployment failed.
Output:[22:13:39.766] Windows Phone Player Runner started.
[22:13:39.772] Connecting to device.
[22:13:39.788] An error occurred while running: Could not load file or assembly 'Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
at Microsoft.SmartDevice.Connectivity.DatastoreManager..ctor(DatastoreConfiguration configuration)
at Microsoft.SmartDevice.Connectivity.DatastoreManager.Get(Int32 localeId)
at Microsoft.SmartDevice.Connectivity.Wrapper.ConnectivityWrapper12.GetCurrentPlatform(Int32 localeId)
at WindowsPhonePlayerRunner.Program.GetDevice()
at WindowsPhonePlayerRunner.Program.Run(String appxPath, RunnerFlags runnerFlags, IEnumerable`1 copyFilesTo)
at WindowsPhonePlayerRunner.Program.Main(String[] args)
[22:13:39.788] Exiting Windows Phone Player Runner.
ApplicationLauncherImpl.RunOnPhone (System.String commandLine)
ApplicationLauncherImpl.Run (Utility+VisualStudio vs)
ApplicationLauncher.BuildAndRunProject (UnityEditor.Modules.BuildLaunchPlayerArgs args, UnityEditor.WSABuildAndRunDeployTarget deployTarget, System.String platform, Utility+VisualStudio vs)
UnityEditor.PostprocessBuildPlayer.Launch (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget buildTarget, System.String path, System.String productName, UnityEditor.BuildOptions options, UnityEditor.Build.Reporting.BuildReport buildReport) (at <55729f52d042492e9efc384182ae2feb>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Build completed with a result of 'Failed' in 177 seconds (176835 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <55729f52d042492e9efc384182ae2feb>:0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <55729f52d042492e9efc384182ae2feb>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
From the build log, the "Windows Phone Player Runner" related output should be caused by two possible reasons:
Incorrect Unity version.
Build and Run on: USB Device setting
For Unity version, we recommend using the Unity 2020 LTS version for HoloLens 2 development: https://unity3d.com/unity/qa/lts-releases?version=2020.3
For Build and Run on setting, it the issue is caused by Build and Run on: USB Device setting, this is a known issue and won't fix by Unity. The best practice is, please switch to Local Machine and generate the Visual Studio Project. With the help of Visual Studio, you can deploy to your HoloLens 2 via wireless network or USB cable. See:
Build and deploy the application section in this tutorial
Using Visual Studio to deploy and debug
I'm working on an iOS static library binding that requires CFNetwork framework.
I've seen examples of how to DllImport the CFNetwork, but it requires that the method is extern static.
Unfortunately this appears to be invalid on the methods in the linkwith.cs
The library seems to actually work and starts a curl command, but I get an error:
-[MKNetworkOperation operationFailedWithError:] [Line 1293] State: 0
I'm assuming this is because I haven't imported CFNetwork since the library works with a regular XCode iOS project.
Also, every time I run the project in the simulator it asks if I want to allow network connections.
This doesn't occur in a normal XCode project using the library either.
Here are all the relevant files:
ApiDefinition.cs http://pastebin.com/p3S0H28X
withlink.cs http://pastebin.com/UR0X2pZ1
Build output http://pastebin.com/aTbdW2Gj
App output http://pastebin.com/Hxcuufgj
I appreciate any help you folks can provide.
Thanks!
[EDIT - 2015-08-26]
So I found this:
https://developer.xamarin.com/guides/ios/advanced_topics/native_interop/
Which unfortunately just seems to have lead me down a rabbit hole.
In our test app I put in the extra build arguments as stated in the article:
To Configure Xamarin.iOS To Link the Library, on the project options for your final executable (not the library itself, but the final program) you need to add in iOS Build's Extra argument (these are part of your project options) the "-gcc_flags" option followed by a quoted string that contains all the extra libraries that are required for your program, for example:
-gcc_flags "-L${ProjectDir} -lMylibrary -force_load ${ProjectDir}/libMyLibrary.a"
The above example will link libMyLibrary.a
You can use the -gcc_flags to specify any set of command line
arguments to pass to the GCC compiler used to do the final link of
your executable. For example, this command line, also references the
CFNetwork framework:
-gcc_flags "-L${ProjectDir} -lMylibrary -lSystemLibrary -framework CFNetwork -force_load ${ProjectDir}/libMyLibrary.a"
I replaced -lMylibrary and libMyLibrary.a with the correct names and then I got a ton of errors stating I had duplicate entries. I imagine because I am already referencing the binding DLL. Also -lSystemLibrary was throwing errors so I removed it.
Finally I tried this:
-gcc_flags "-L${ProjectDir} -framework CFNetwork"
And it builds without error, but I still get
-[MKNetworkOperation operationFailedWithError:] [Line 1288]
The app's build output can be found here:
http://pastebin.com/sLNUwYwX
Still hoping someone can help!
[EDIT 2015-09-03]
I still get the MKNetworkOperation error when running in the simulators. Now that I have my iPad back I've tried to test it on that. The app crashes completely when run on the iPad with the following output:
Foundation.MonoTouchException: Objective-C exception thrown. Name:
NSInvalidArgumentException Reason: -[ApiEngine randomStringOfLength:]:
unrecognized selector sent to instance 0x1742a3900 at
ObjCRuntime.Runtime.ThrowNSException (IntPtr ns_exception) [0x00000]
in
/Users/builder/data/lanes/1977/2c66d2fe/source/maccore/src/ObjCRuntime/Runtime.cs:167
at ObjCRuntime.Runtime.throw_ns_exception (IntPtr exc) [0x00000] in
:0 at at (wrapper native-to-managed)
ObjCRuntime.Runtime:throw_ns_exception (intptr) at at (wrapper
managed-to-native) ApiDefinition.Messaging:void_objc_msgSend
(intptr,intptr) at shared2you.Shared2YouAdManager.StartDetection ()
[0x0001b] in :0 at
s2u_xamarin_uni.AppDelegate.FinishedLaunching (UIKit.UIApplication
application, Foundation.NSDictionary launchOptions) [0x00021] in
/Users/manns41078/Desktop/Xamarin
Projects/s2u_xamarin_uni/s2u_xamarin_uni/AppDelegate.cs:50 at at
(wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain
(int,string[],intptr,intptr) at UIKit.UIApplication.Main
(System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in
/Users/builder/data/lanes/1977/2c66d2fe/source/maccore/src/UIKit/UIApplication.cs:63
at UIKit.UIApplication.Main (System.String[] args, System.String
principalClassName, System.String delegateClassName) [0x0001c] in
/Users/builder/data/lanes/1977/2c66d2fe/source/maccore/src/UIKit/UIApplication.cs:46
at s2u_xamarin_uni.Application.Main (System.String[] args) [0x00008]
in /Users/manns41078/Desktop/Xamarin
Projects/s2u_xamarin_uni/s2u_xamarin_uni/Main.cs:12
The library IS a FAT library and works in XCode no problem. Why is Xamarin giving me such heartache for a binding?? The java version was a cake walk.
I'm using nunit-console for unit testing a Mono application on Debian. It runs all the tests and then crashes after reporting the failed tests. TestResult.xml is not generated. If I use nunit-console with either -out or -err argument, it runs the tests and then crashes before reporting the results.
Another weird thing is that if I cut down the number of tests (from about 800 to 100) it sometimes wont crash. Throwing out even more testcases seems to decrease the chance of crashing.
Platform: Debian 6, Mono 2.6.7, NUnit 2.4.7
Error details:
ERROR:../../mono/io-layer/handles-private.h:362:_wapi_handle_share_release: assertion failed: (info->handle_refs > 0)
Stacktrace:
at (wrapper managed-to-native) System.IO.MonoIO.Close (intptr,System.IO.MonoIOError&) <0x00050>
at (wrapper managed-to-native) System.IO.MonoIO.Close (intptr,System.IO.MonoIOError&) <0x00050>
at System.IO.FileStream.Dispose (bool) <0x000b7>
at System.IO.Stream.Close () <0x0001b>
at System.IO.StreamWriter.Dispose (bool) <0x000c8>
at System.IO.StreamWriter.Close () <0x0001b>
at NUnit.ConsoleRunner.ConsoleUi.Execute (NUnit.ConsoleRunner.ConsoleOptions) <0x007ed>
at NUnit.ConsoleRunner.Runner.Main (string[]) <0x00487>
at NUnit.ConsoleRunner.Class1.Main (string[]) <0x0000f>
at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0x00054>
Native stacktrace:
/usr/bin/cli() [0x487ad6]
/lib/libpthread.so.0(+0xeff0) [0x7fdd0379aff0]
/lib/libc.so.6(gsignal+0x35) [0x7fdd031da1b5]
/lib/libc.so.6(abort+0x180) [0x7fdd031dcfc0]
/lib/libglib-2.0.so.0(g_assertion_message+0x131) [0x7fdd03e175d1]
/lib/libglib-2.0.so.0(g_test_timer_start+0) [0x7fdd03e17b50]
/usr/bin/cli() [0x59d649]
/usr/bin/cli() [0x597658]
/usr/bin/cli() [0x597774]
/usr/bin/cli() [0x5095fc]
[0x4135b410]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
** (/usr/lib/nunit/nunit-console.exe:7436): WARNING **: process_set_termination_details: error looking up process handle 0x403
Try running NUnit with /noshadow, I recall this used to help, long time ago.
This is an old bug https://bugzilla.novell.com/show_bug.cgi?id=318809. I've not been able to find an up-to-date xamarin bug of this.
See also, https://stackoverflow.com/questions/4513928/handling-single-file-with-multiple-threads-in-mono.
So try running nunit with /nothread or better still, try mono 2.10.8.
I am trying to create a .app bundle of my mono program to run on Mac OS X, but despite having read virtually all articles and documentation on macpack and bundling mono, none of the methods work.
Using macpack the binaries are bundled successfully in a .app package:
macpack -m:x11 -o:. -r:sqlite3.dll -r:Nini.dll -r:extraIcons.ini -r:APP_DATABASE.db3 -r:APP_Values.db3 -r:./Documents/manual.pdf -r:GemBox.Spreadsheet.dll -r:Mono.Data.SqliteClient.dll -a:APP.exe -n:APP
. When I try to start the program from the package this happens:
FFMACM-2:MacOS dev$ open -a APP
LSOpenURLsWithRole() failed for the application /Users/dev/Workspace/Software/APP.app with error -10810.
I tried using this method but the script fails with the following error:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Nini, Version=1.1.0.0, Culture=neutral, PublicKeyToken=691faec150a7fa7b' or one of its dependencies.
File name: 'Nini, Version=1.1.0.0, Culture=neutral, PublicKeyToken=691faec150a7fa7b'
at APP.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
logout
I am fresh out of ideas. The Nini.dll is where it should be. I am using GTK# for the GUI.
Creating a package for MacOS X is now done using MonoMacPackager. You can find details here http://www.mono-project.com/MonoMacPackager.
However, the issue that you're seeing here is that you're missing your dll (The Nini assembly) from your package. It needs to be in your application path (after it has been bundled) to load properly.