Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Access AS hierarchy at Msg layer
[simgrid.git] / src / bindings / java / org / simgrid / msg / Msg.java
index 2cf133a..5a08809 100644 (file)
@@ -37,10 +37,19 @@ public final class Msg {
                nativeInit();
        }
        private static void loadLib (String name) {
-         String Os = System.getProperty("os.name");
-         //Windows may report its name in java differently from cmake, which generated the path
-               if(Os.toLowerCase().indexOf("win") >= 0) Os = "Windows";
-               String Path = "NATIVE/"+Os+"/"+System.getProperty("os.arch")+"/";
+               String Os = System.getProperty("os.name");
+               String Arch = System.getProperty("os.arch");
+               // Some OS/Arch may be different between Java and Cmake,
+               // which generated the path
+               if (Os.toLowerCase().startsWith("win"))
+                       Os = "Windows";
+               else if (Os.contains("OS X"))
+                       Os = "Darwin";
+               if (Arch.equalsIgnoreCase("x86"))
+                       Arch = "i386";
+               else if (Arch.equalsIgnoreCase("x86_64"))
+                       Arch = "amd64";
+               String Path = "NATIVE/" + Os + "/" + Arch + "/";
 
                String filename=name;
                InputStream in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);
@@ -183,6 +192,8 @@ public final class Msg {
         */
        public final static native void createEnvironment(String platformFile);
 
+       public final static native As environmentGetRoutingRoot();
+
        /**
         * The method to deploy the simulation.
         *