Giter Club home page Giter Club logo

Comments (11)

poletti-marco avatar poletti-marco commented on July 21, 2024

Hi, can you please post the full log from the cmake command and any other commands you ran? In case there's more interesting info.
Please also attach the generated CMakeCache.txt.

The fact that a plain #include <iostream> doesn't work suggests an issue with the setup, not really specific to Fruit. You can probably repro the same issue building a hello world program (with cmake).

You're already overriding the compiler locations, maybe you also need some flags to override the standard library locations?
Or maybe you installed the clang binaries but not the standard library headers?

from fruit.

poletti-marco avatar poletti-marco commented on July 21, 2024

I also found this:
opencv/opencv#8742 (comment)

Maybe you need similar cmake flags? Notably the tool chain override.

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024

Appreciate the fast response :)
The entire CMake log and CMakeCache is here.
I will be attempting the toolchain override soon to see if that improves.

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024

This is a log attempting to use the Android toolchain override.
https://gist.github.com/Fernthedev/d89c5f1d8797406af0411b4b1f7d479c

To clarify, I've used theses flags on another project being mimalloc with success, I'm not sure how Fruit differs to it however.

from fruit.

poletti-marco avatar poletti-marco commented on July 21, 2024

There are warnings that the build may be incomplete due to clock skew.
Maybe delete the build dir and try from scratch to see if it's different?
Make uses timestamps to decide what to rebuild so otherwise it may not be building everything it should.

You might also want to try using -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF in case it's just the PCH compilation failing.

mimalloc seems to be a C library so the fact that it builds doesn't say much on whether the C++ STL is installed correctly and the C++-related cmake flags are correct.

You can also run make in verbose mode, as make VERBOSE=1 to see the exact command that is failing (that you can then run on its own manually playing around with flags to see if sth helps).
Btw, what make command are you running? Just make with no arguments or sth else?

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024

-DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF fixes it however I'm not sure if that guarantees it will work. Every build run has been with a completely new cache (I've essentially just removed all changed/added files using git)

I was running make -j which you can see at the end of my long CMake build command.

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024

Would you mind telling me where the built files would be? Checking out/release it doesn't seem to have any .a or .so files 🤔

from fruit.

poletti-marco avatar poletti-marco commented on July 21, 2024

Oh great then it should be ok.
Pre compiled headers are a bit of an advanced feature, i guess they don't work well with cross compilation.

You can do make install DESTDIR=/some/dir to install the built fruit there.

Iirc the lib in the build tree ends up in src, but it's better to use make install than hunting down the various built pieces manually.

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024

Alright I found it in the src folder. Thank you very much for your help and I'll be closing the issue as it seems (for now) to be building correctly.

Have a good day :)

from fruit.

poletti-marco avatar poletti-marco commented on July 21, 2024

Great!
Can you please post the final working command here in case someone else needs to do this in the future?

from fruit.

Fernthedev avatar Fernthedev commented on July 21, 2024
export CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
export CXX=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
cmake . -DCMAKE_BUILD_TYPE=Release -DFRUIT_USES_BOOST=False -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=24 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_ANDROID_STL_TYPE=c++_static -DCXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF && make -j

seems to work nicely. I'll be trying linking in a while though so I may come back to this at a later date.

from fruit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.