Wrong python library gets linked against when finding boost library `numpy3`.
I recently updated CMake from 3.10 to 3.11.1 on my arch machine.
Previously, a configuration file of the type
set(CMAKE_VERBOSE_MAKEFILE ON)
find_package(PythonLibs 3 REQUIRED)
find_package(Boost COMPONENTS python3 COMPONENTS numpy3 REQUIRED)
add_executable (test test.cpp)
target_link_libraries(test ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
would be lead to CMake linking my program against 2 boost libraries: python3
and numpy3
.
Since the update, 3 libraries are being linked against, one of which seeminly corresponding to a different version of python.
Now,
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- python3
-- numpy3
-- python
Before,
-- Boost version: 1.66.0
-- Found the following Boost libraries:
-- python3
-- numpy3
This results in a linking error in a build script that I use,
and I also observe that error with the following minimal example, (test.cpp
)
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!" << endl;
}
In addition, if I replace the line with just
find_package(Boost COMPONENTS numpy3 REQUIRED)
the wrong version of python gets linked against instead of python3.
Is there a new way of linking against boost numpy?
Thank you!