Hi @treo I’m working on this with @zamlz. Thanks for all the help!
I’m wondering, where would we add custom build flags, such as -g ?
Also, how would we get our project to use this locally compiled version of nd4j as opposed to the one from maven central? Not sure what to do with our pom to make that happen.
If you switch your version to 1.0.0-SNAPSHOT, it’ll use the installed version instead of the Maven Central version (which is 1.0.0-beta6 only)
One thing to be aware of: if you have the snapshots repo set up in your project - which isn’t necessary I should add when doing a local build (as described here) - maven can decide to download and use the new snapshots instead of using the locally built ones, when it sees that the online version is newer. So don’t include the snapshots repo in your project, or periodically build locally to make sure that’s most recent, to avoid that happening.
Thanks Treo and AlexBlack! We greatly appreciate your help! I changed the versions in my pom file to 1.0.0-SNAPSHOT. For some reason, its also trying to find other artifacts that I don’t believe we built. It also appears like its trying to pull this from https://oss.sonatype.org/content/repositories/snapshots.
Here is the full error message. I feel like I’m suppose to be specifying which architecture in my pom file somehow.
[ERROR] Failed to execute goal on project SimpleDl4j: Could not resolve dependencies for project com.lts.simpledl4j:SimpleDl4j:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.nd4j:nd4j-native:jar:android-arm:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:android-arm64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:android-x86:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:android-x86_64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:ios-arm64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:ios-x86_64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:macosx-x86_64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:windows-x86_64:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:linux-ppc64le:1.0.0-SNAPSHOT, org.nd4j:nd4j-native:jar:linux-armhf:1.0.0-SNAPSHOT: Failure to find org.nd4j:nd4j-native:jar:android-arm:1.0.0-SNAPSHOT in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-nexus-snapshots has elapsed or updates are forced
I guess you are using nd4j-native-platform? When building locally, you usually aren’t building for all possible platforms, but only for the one you have. For this reason you have to change to the nd4j-native dependency. It should pick up the correct one then.
I’m runnng our codebase now and I’m getting an error message. I don’t see any exception or traceback.
==29990==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
The code worked just fine before, perhaps there is something I didn’t do properly while building the code?
I tried linking the libasan.so library in LD_PRELOAD and was still getting some weird errirs. So alternatively I tried disabling the sanitize feature from GCC. While that went successfully, it seems like building libnd4j does requre gcc to have the -lasan flag.
I guess you are using the libnd4j debug mode? when you enable that, it adds all of the following flags: -g -O0 -fPIC -fmax-errors=2 -fsanitize=address
That is what we typically use for our own debugging and hunting for memory access problems.
If you want anything other than that (like no address sanitizer) you are free to set them using the environment variable as described above. Or you can just modify the CMakeLists.txt file.
I guess you expected that only -g will be added with the debug flag. I apologize for wording it unclearly.