Skip to content
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

Softvector Build Fails on Mac and Windows #7

Closed
fpedd opened this issue Sep 16, 2021 · 3 comments · Fixed by #8
Closed

Softvector Build Fails on Mac and Windows #7

fpedd opened this issue Sep 16, 2021 · 3 comments · Fixed by #8

Comments

@fpedd
Copy link
Contributor

fpedd commented Sep 16, 2021

The softvector build on Mac, more specifically the linking, fails for some reason. The build for Linux appears to work just fine (until it gets stopped by the failing Mac build). The linker is having a hard time finding some symbols:

[ 91%] Linking CXX shared library libetiss_softvector.dylib
Undefined symbols for architecture x86_64:
  "VLSU::load_eew(std::__1::function<void (unsigned long, unsigned char*, unsigned long)>, unsigned char*, unsigned long long, unsigned long long, unsigned short, unsigned short, unsigned short, unsigned short, unsigned long long, unsigned short, unsigned char, short)", referenced from:
      _etiss_vload_encoded_unitstride in etiss_softvector.cpp.o
      _etiss_vload_encoded_stride in etiss_softvector.cpp.o
      _etiss_vload_segment_unitstride in etiss_softvector.cpp.o
      _etiss_vload_segment_stride in etiss_softvector.cpp.o
  "VLSU::store_eew(std::__1::function<void (unsigned long, unsigned char*, unsigned long)>, unsigned char*, unsigned long long, unsigned long long, unsigned short, unsigned short, unsigned short, unsigned short, unsigned long long, unsigned short, unsigned char, short)", referenced from:
      _etiss_vstore_encoded_unitstride in etiss_softvector.cpp.o
      _etiss_vstore_encoded_stride in etiss_softvector.cpp.o
      _etiss_vstore_segment_unitstride in etiss_softvector.cpp.o
      _etiss_vstore_segment_stride in etiss_softvector.cpp.o
  "VTYPE::decode(unsigned short, unsigned char*, unsigned char*, unsigned int*, unsigned char*, unsigned char*)", referenced from:
      _etiss_vload_encoded_unitstride in etiss_softvector.cpp.o
      _etiss_vload_encoded_stride in etiss_softvector.cpp.o
      _etiss_vload_segment_unitstride in etiss_softvector.cpp.o
      _etiss_vload_segment_stride in etiss_softvector.cpp.o
      _etiss_vstore_encoded_unitstride in etiss_softvector.cpp.o
      _etiss_vstore_encoded_stride in etiss_softvector.cpp.o
      _etiss_vstore_segment_unitstride in etiss_softvector.cpp.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/jitlibs/softvector/libetiss_softvector.dylib] Error 1
make[1]: *** [src/jitlibs/softvector/CMakeFiles/etiss_softvector.dir/all] Error 2
make: *** [all] Error 2
Error: Process completed with exit code 2.

EDIT: The windows build appears to be failing as well (sorry for the confusion).

@rafzi
Copy link
Member

rafzi commented Sep 16, 2021

I'm pretty sure this is the issue:

https://github.com/fabianpedd/etiss/blob/fabianpedd-vector/src/jitlibs/softvector/CMakeLists.txt#L36

INTERFACE does not link the specified libraries to the target.

https://cmake.org/cmake/help/latest/command/target_link_libraries.html#libraries-for-a-target-and-or-its-dependents

And since your target is SHARED, it does require linking, except on linux. .so shared libs can resolve undefined symbols at runtime, but .dll and .dylib can not.

Changing the link mode to PUBLIC should resolve this.

@fpedd fpedd changed the title Softvector Build Fails on Mac Softvector Build Fails on Mac and Windows Sep 16, 2021
@fpedd
Copy link
Contributor Author

fpedd commented Sep 16, 2021

@rafzi thanks, that fixed that issue.

The windows build appears to be failing as well. Apparently, Softvector uses "alternative tokens" for logical operators, for example here and here. According to this the MSVC compiler is actually nonconforming with default compilation settings and does not support them. So one solution would be to force the compiler to conformatiy with /permissive- or /Za, or include the <ciso646> header.

However, since Softvector is also using the "primary tokes" at other places, I would just recommend switching to primary tokes altogether.

@rafzi
Copy link
Member

rafzi commented Sep 17, 2021

I like the primary tokens more, because they are way more common.

Still, /permissive- is a healthy flag to have. We should try if etiss compiles with it.

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

Successfully merging a pull request may close this issue.

2 participants