Re: Regression in old build system using CMake 3.12?
Ben Boeckel via vtkusers <[email protected]> Wed, 23 Jan 2019 08:47:55 -0500
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jan 22, 2019 at 16:31:38 -0700, BBerco wrote:
> I'm sorry for the confusion. Actually, the problem appears to arise when vtk
> and the armadillo library are loaded together. I haven't tried more
> combinations of library to see if the problem only arises in this specific
> case.
>
> Anyways, here's an even more minimal example demonstrating the problem. The
> CMakeLists.txt shows two different ways to find VTK. The call that's relying
> on COMPONENTS works fine, but the non-specific one leads to the error trace
> pasted below.
>
> *CMakeLists.txt*
> cmake_minimum_required(VERSION 3.12)
> project(main CXX)
> # Find VTK Package. The non-specific call leads to +20 errors to be
> generated at compile time
> # find_package(VTK REQUIRED COMPONENTS vtkCommonCore)
> find_package(VTK REQUIRED)
> find_package(armadillo)
> include(${VTK_USE_FILE})
> add_executable(main main.cpp)
> set(library_dependencies ${ARMADILLO_LIBRARIES} ${VTK_LIBRARIES})
> target_link_libraries(main PUBLIC ${library_dependencies})
>
> *
> main.cpp*
> #include <armadillo>
> int main(){
> return 1;
> }
>
> *log.txt
> *
> In file included from /Users/bbercovici/Desktop/testOmp/main.cpp:3:
> In file included from /usr/local/include/armadillo:26:
> /Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error:
> no member named 'signbit' in the global namespace
> using ::signbit;
This is usually due to the wrong `math.h` being included. If you look at
command line (visible with `make VERBOSE=1` or `ninja -v`) for this
compilation rule and replace `-o path/to/foo.o` with `-E -o
preproc.txt`, the full path to the `math.h` should be output in
`preproc.txt`. Ideally, it should come from the SDK beside the `cmath`
header, but I suspect it is coming from `/usr/include` or somewhere like
that. Basically, something is adding `-isystem /usr/include` or
`-I/usr/include` and the system headers there are conflicting with the
SDK's headers.
--Ben
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Search the list archives at: http://markmail.org/search/?q=vtkusers
Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers