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

Linking error #68

Closed
ignacio-rocco opened this issue Dec 25, 2019 · 1 comment
Closed

Linking error #68

ignacio-rocco opened this issue Dec 25, 2019 · 1 comment

Comments

@ignacio-rocco
Copy link
Contributor

Hi, I was getting a linking error during the compilation of the MinkowskiEngineBackend.

++ -pthread -shared -B /anaconda3/envs/pytorch13/compiler_compat -L/anaconda3/envs/pytorch13/lib -Wl,-rpath=/anaconda3/envs/pytorch13/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/pybind/minkowski.o -Lobjs -L/usr/local/cuda-10.1/lib64 -lminkowski -lopenblas -lcudart -o build/lib.linux-x86_64-3.6/MinkowskiEngineBackend.cpython-36m-x86_64-linux-gnu.so
/anaconda3/envs/pytorch13/compiler_compat/ld: cannot find -lm
/anaconda3/envs/pytorch13/compiler_compat/ld: cannot find -lpthread
/anaconda3/envs/pytorch13/compiler_compat/ld: cannot find -lc
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

I solved it by adding extra_link_args=['-L/usr/lib/x86_64-linux-gnu/'] to setup.py in the ExtModules section:

    ext_modules=[
        Extension(
            name='MinkowskiEngineBackend',
            include_dirs=['./', get_python_inc() + "/.."],
            sources=[
                'pybind/minkowski.cpp',
            ],
            libraries=[
                'minkowski',
                'openblas',  # for other blas, replace openblas
            ],
            library_dirs=['objs'],
            extra_compile_args=extra_compile_args,
            extra_link_args=['-L/usr/lib/x86_64-linux-gnu/']
        )
    ],
@ignacio-rocco
Copy link
Contributor Author

This seems to have disappeared on a new environment.

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