8000 Cannot Build cpp due to clang++ unsupported option '-mrelaxed-simd' for target 'x86_64-pc-linux-gnu' · Issue #884 · faasm/faasm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cannot Build cpp due to clang++ unsupported option '-mrelaxed-simd' for target 'x86_64-pc-linux-gnu' #8 8000 84

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

Open
TRSWNCA opened this issue Oct 4, 2024 · 2 comments

Comments

@TRSWNCA
Copy link
TRSWNCA commented Oct 4, 2024

Hello, I'am trying to test with some cpp files with faasm.

I've cloned faasm v0.27.0 locally and checkouted the client/cpp v0.5.0 and faabric v0.2.0 according to the .env file.

After that I just go through following the tutorial:

$ source bin/workon.sh
$ faasmctl deploy.compose \ 
    --ini-file=./faasm.ini \
    --workers=0 \
    --mount-source=. \
    --clean
$ faasmctl cli.faasm
(faasm) inv dev.cmake
(faasm) inv dev.tools
(faasm) exit
$ faasmctl cli.cpp
(cpp) inv func demo hello
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=/usr/local/faasm/toolchain/tools/WasiToolchain.cmake -DCMAKE_BUILD_TYPE=Release /code/cpp/func
-- Faasm building STATIC libraries
-- Faasm building target 
System is unknown to cmake, create:
Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please post that file on discourse.cmake.org.
-- Detected wasm build (sysroot=/usr/local/faasm/llvm-sysroot)
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /code/cpp/build/func
[1/2] Building CXX object demo/CMakeFiles/hello.dir/hello.cpp.obj
FAILED: demo/CMakeFiles/hello.dir/hello.cpp.obj 
/usr/local/faasm/toolchain/bin/clang++ -DWASM_PROF=1 -D__faasm  -O3 -mrelaxed-simd -msimd128 --sysroot=/usr/local/faasm/llvm-sysroot -m32 -DANSI -D__faasm -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS -D_WASI_EMULATED_SIGNAL -std=gnu++17 -MD -MT demo/CMakeFiles/hello.dir/hello.cpp.obj -MF demo/CMakeFiles/hello.dir/hello.cpp.obj.d -o demo/CMakeFiles/hello.dir/hello.cpp.obj -c /code/cpp/func/demo/hello.cpp
clang++: error: unsupported option '-mrelaxed-simd' for target 'x86_64-pc-linux-gnu'
clang++: error: unsupported option '-msimd128' for target 'x86_64-pc-linux-gnu'
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/code/cpp/venv/bin/inv", line 8, in <module>
    sys.exit(program.run())
  File "/code/cpp/venv/lib/python3.10/site-packages/invoke/program.py", line 398, in run
    self.execute()
  File "/code/cpp/venv/lib/python3.10/site-packages/invoke/program.py", line 583, in execute
    executor.execute(*self.tasks)
  File "/code/cpp/venv/lib/python3.10/site-packages/invoke/executor.py", line 140, in execute
    result = call.task(*args, **call.kwargs)
  File "/code/cpp/venv/lib/python3.10/site-packages/invoke/tasks.py", line 138, in __call__
    result = self.body(*args, **kwargs)
  File "/code/cpp/tasks/func.py", line 75, in compile
    wasm_cmake(
  File "/code/cpp/faasmtools/compile_util.py", line 44, in wasm_cmake
    raise RuntimeError("failed on make for {}".format(target))
RuntimeError: failed on make for hello

I suppose maybe I should upgrade my clang or set right target, but I didn't find that in tutorial. I've noticed that in some of the pr you've support clang-18 in client/cpp but still clang-17 in faasm project, where I have no idea whether this is my local problem or incorrect setting from the cloud image.

(cpp) /usr/local/faasm/toolchain/bin/clang -v
Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/local/faasm/toolchain/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64

I tried to make change of FAASM_WASM_TRIPLE and WASM_CFLAGS within faasm docker, but that didn't work.
I'm wondering how I can fix it to continue to run some cpp in Faasm, or any steps I missed?

I'am looking forward to your reply. Thanks!

@TRSWNCA
Copy link
Author
TRSWNCA commented Oct 6, 2024

This may caused only for this version. v0.18.0 is fine.

@csegarragonz
Copy link
Collaborator

hey @TRSWNCA thanks for using Faasm!

It looks like something went wrong during your set-up.
Did you follow the quick start documents?

For example, the following works for me:

docker run --rm -it faasm.azurecr.io/cpp-sysroot:0.6.0 /usr/local/faasm/toolchain/bin/clang -v
clang version 18.1.0rc (https://github.com/llvm/llvm-project c6c86965d967886ca5a2ed8968c949cd42cdd49a)
Target: wasm32-unknown-wasi
Thread model: posix
InstalledDir: /usr/local/faasm/toolchain/bin

Could you clarify what steps did you follow to reproduce the issue?
In particular, could you confirm if the following works:

# Clone fresh version
git clone https://github.com/faasm/faasm
cd faasm
git submodule update --init

# Here I am assuming you want a development cluster
# (this prioritizes binaries cached in your host, non-existant at the beginning)
source ./bin/workon.sh
faasmctl deploy.compose --mount-source .

# Build the missing binaries
faasmctl cli.faasm
inv dev.tools --build=Debug
exit

# You are ready to run functions
faasmctl cli.cpp
inv func.local --clean
exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0