labmec / neopz

An object oriented finite element programming environment
http://www.labmec.org.br
33 stars 11 forks source link

Unit tests with MKL crashing only in Xcode (Mac Big Sur 11.6.1) #126

Open nathanshauer opened 2 years ago

nathanshauer commented 2 years ago

TL;DR at the end. In my Mac (Big Sur 11.6.1), three unit tests crash if running them in Xcode with MKL. These crashes do not happen if PZ is compiled with Makefiles. The tests that fail are:

  1 - TestReduced (Failed)

  9 - TestMatrix (Failed)

 23 - TestSBFem (Failed)

Here is the crash message in TestReduced. This happens the first time an MKL pardiso call is made.

Screen Shot 2021-09-24 at 6 15 34 PM

Then, I started wondering why can't MKL be seen by the unit test library? Motivated by the following article: CMake: Public VS Private VS Interface

I thought that the problem could be related to the fact that MKL is linked to PZ via the cmake PRIVATE tag. See EnableMKL.cmake

And indeed, using the PUBLIC tag instead of PRIVATE solved the problem and all the unit tests passed successfully in Xcode.

However, this seems like overkill since we don't need every library that links with PZ to also link with MKL. Additionally, it seems especially weird since things work fine compiling with Makefile instead of Xcode.

Does anyone with a mac also have this issue?

I guess the lazy man solution would be to put, in cmake, an if(Xcode) {link PUBLIC} else {link PRIVATE}

TL;DR:

philippedevloo commented 2 years ago

I am running MacOS Monterey and all tests passed. I noted I needed to build all the targets before running the BuildTest?

nathanshauer commented 2 years ago

I am running MacOS Monterey and all tests passed. I noted I needed to build all the targets before running the BuildTest?

I tried building all the targets once more but it didn't help. I guess the way to go is to update my mac...