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

/usr/bin/ld: cannot find -lEigen3::Eigen #4

Open
CallMeFrozenBanana opened this issue Feb 15, 2020 · 6 comments
Open

/usr/bin/ld: cannot find -lEigen3::Eigen #4

CallMeFrozenBanana opened this issue Feb 15, 2020 · 6 comments

Comments

@CallMeFrozenBanana
Copy link

Eigen is already installed.
Environment variable was set as: EIGEN3_INCLUDE_DIR=/usr/include/eigen3/Eigen
What happen ?= =

running install
running bdist_egg
running egg_info
writing src/pymagsac.egg-info/PKG-INFO
writing dependency_links to src/pymagsac.egg-info/dependency_links.txt
writing top-level names to src/pymagsac.egg-info/top_level.txt
reading manifest file 'src/pymagsac.egg-info/SOURCES.txt'
writing manifest file 'src/pymagsac.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
-- pybind11 v2.1.1
-- Configuring done
CMake Warning (dev) at lib/pybind11/tools/pybind11Tools.cmake:127 (add_library):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

Target "pymagsac" links to target "Eigen3::Eigen" but the target was not
found. Perhaps a find_package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
Call Stack (most recent call first):
CMakeLists.txt:55 (pybind11_add_module)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /data/for_jr/pymagsac/build/temp.linux-x86_64-3.5
[ 33%] Linking CXX shared module ../lib.linux-x86_64-3.5/pymagsac/pymagsac.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -lEigen3::Eigen
collect2: error: ld returned 1 exit status
CMakeFiles/pymagsac.dir/build.make:137: recipe for target '../lib.linux-x86_64-3.5/pymagsac/pymagsac.cpython-35m-x86_64-linux-gnu.so' failed
make[2]: *** [../lib.linux-x86_64-3.5/pymagsac/pymagsac.cpython-35m-x86_64-linux-gnu.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pymagsac.dir/all' failed
make[1]: *** [CMakeFiles/pymagsac.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 106, in
zip_safe=False,
File "/usr/local/lib/python3.5/dist-packages/setuptools/init.py", line 143, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/lib/python3.5/dist-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/usr/lib/python3.5/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 38, in run
self.build_extension(ext)
File "setup.py", line 69, in build_extension
cwd=self.build_temp)
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2

@ducha-aiki
Copy link
Owner

Sorry, cannot help you here. Eigen linking might be tricky, but I cannot do remote debugging.

@Smellly
Copy link

Smellly commented Mar 25, 2020

Update my Eigen version from 3.2 to 3.3.9 (git clone && make && make install)
Then replace find_package(Eigen3 REQUIRED) to
list(APPEND CMAKE_INCLUDE_PATH "/usr/local/include")
find_package (Eigen3 3.3 REQUIRED NO_MODULE)

it works for me.

@ZeyingXuHuaWei
Copy link

Update my Eigen version from 3.2 to 3.3.9 (git clone && make && make install)
Then replace find_package(Eigen3 REQUIRED) to
list(APPEND CMAKE_INCLUDE_PATH "/usr/local/include")
find_package (Eigen3 3.3 REQUIRED NO_MODULE)

it works for me.

This works for me. Thank you very much

@allenthreee
Copy link

Update my Eigen version from 3.2 to 3.3.9 (git clone && make && make install) Then replace find_package(Eigen3 REQUIRED) to list(APPEND CMAKE_INCLUDE_PATH "/usr/local/include") find_package (Eigen3 3.3 REQUIRED NO_MODULE)

it works for me.

it works for me too, though i don't know why this works

@Janebek
Copy link

Janebek commented Nov 13, 2021

Update my Eigen version from 3.2 to 3.3.9 (git clone && make && make install) Then replace find_package(Eigen3 REQUIRED) to list(APPEND CMAKE_INCLUDE_PATH "/usr/local/include") find_package (Eigen3 3.3 REQUIRED NO_MODULE)

it works for me.

omg!!Thank you so much!I finally solved this proble after 3 days searching...

@ismetdagli
Copy link

I spent ~2-3 hours on this problem before finding this comment and it is solved!

Note to others: My include path was different. If somebody reads this commend and the solution does not work, be careful with your includes path!

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

7 participants