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

Improve blas link in lbfgsb_cpp #206

Open
hpwxf opened this issue Jun 20, 2022 · 1 comment
Open

Improve blas link in lbfgsb_cpp #206

hpwxf opened this issue Jun 20, 2022 · 1 comment

Comments

@hpwxf
Copy link
Member

hpwxf commented Jun 20, 2022

Due to conflicts with blas embedded in Armadillo, aliases have been done in lbfgsb (Fortran code) to rename hand-coded blas primitives without any conflict (see Lbfgsb.3.0/CMakeLists.txt), i.e.

if (EMBED_CUSTOM_BLAS)
    # to avoid collision with outer blas
    # short rename to avoid truncate code interpretation after column #72
    target_compile_definitions(${PROJECT_NAME} PRIVATE dcopy=Wcopy)
    target_compile_definitions(${PROJECT_NAME} PRIVATE dscal=Wscal)
    target_compile_definitions(${PROJECT_NAME} PRIVATE daxpy=Waxpy)
    target_compile_definitions(${PROJECT_NAME} PRIVATE dnrm2=Wnrm2)
    target_compile_definitions(${PROJECT_NAME} PRIVATE ddot=Wdot)
endif()

It should be possible to use blas embedded in armadillo but it can suffer on undefined symbol or multiple definitions (depending on config).

@hpwxf
Copy link
Member Author

hpwxf commented Jun 20, 2022

⚠️ Be careful, with Matlab (CI on Linux), the error seems to appear not at the link stage but at runtime.

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

1 participant