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

fix(c/llama2): explicitly link libm to ensure compatibility with Linux #408

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

aofei
Copy link
Member

@aofei aofei commented Jun 24, 2024

~/llgo/_demo/llama2-c$ llgo run .
ld.lld: error: undefined symbol: sqrtf
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(rmsnorm)
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(forward)

ld.lld: error: undefined symbol: expf
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(softmax)
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(forward)

ld.lld: error: undefined symbol: powf
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(forward)

ld.lld: error: undefined symbol: cosf
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(forward)

ld.lld: error: undefined symbol: sinf
>>> referenced by llama2.c
>>>               /tmp/8c65852b6e4967ce8cf9d82f9eae6a8f9d613f08d32450c16e1703733d01ec3b-dllama2-7c1524.o:(forward)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.59%. Comparing base (e27daed) to head (d0fb5a4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #408   +/-   ##
=======================================
  Coverage   97.59%   97.59%           
=======================================
  Files          19       19           
  Lines        4114     4114           
=======================================
  Hits         4015     4015           
  Misses         82       82           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xushiwei xushiwei merged commit 00448d2 into goplus:main Jun 24, 2024
6 checks passed
@aofei aofei deleted the llama2-libm branch June 24, 2024 23:19
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 this pull request may close these issues.

2 participants