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

[cmake] set -D__ACCELERATE on macOS if building with the Accelerate framework #91

Closed
dev-zero opened this issue Nov 9, 2018 · 10 comments
Assignees

Comments

@dev-zero
Copy link
Contributor

dev-zero commented Nov 9, 2018

is this still needed? https://developer.apple.com/documentation/accelerate/blas suggests that sdot in Accelerate returns a float, but the __ACCELERATE defs suggest a double:

#if defined (__ACCELERATE)
      REAL(KIND=real_8), EXTERNAL                        :: SCNRM2, SDOT
#else
      REAL(KIND=real_4), EXTERNAL                        :: SCNRM2, SDOT
#endif
@dev-zero dev-zero added this to the v1.0 milestone Nov 9, 2018
@dev-zero dev-zero self-assigned this Nov 9, 2018
@dev-zero dev-zero removed this from the v1.0 milestone Nov 9, 2018
@dev-zero dev-zero added the postpone Postpone the issue label Nov 9, 2018
@alazzaro
Copy link
Member

From my test on High Sierra, it looks like that we need the __ACCELERATE macro. This is already documented in the Makefile.inc.

@alazzaro alazzaro removed the postpone Postpone the issue label Nov 17, 2018
@dev-zero
Copy link
Contributor Author

CMake doesn't set it (yet)

@dev-zero dev-zero reopened this Nov 18, 2018
@dev-zero
Copy link
Contributor Author

for CMake I have to figure out how to detect whether we are linking against Accelerate and enabled the flag conditionally

@dev-zero
Copy link
Contributor Author

even with -DACCELERATE do the tests fail on tcopt1 (High Sierra) and Travis:

https://travis-ci.org/dev-zero/dbcsr/jobs/456879432

@alazzaro
Copy link
Member

could you confirm that you are using -D__ACCELERATE?

@alazzaro
Copy link
Member

It seems that it is still failing... Could you try to run makefile?
The only thing I do is to uncomment:

FCFLAGS += -D__NO_STATM_ACCESS -D__ACCELERATE

at the end of Makefile.inc

@dev-zero
Copy link
Contributor Author

It's ok. Forgot that we also have to define -D__ACCELERATE directly for the tests.

@alazzaro
Copy link
Member

OK, great, it works now, but the linking of the C++. I see that you are using

/Applications/Xcode-9.4.1.app/Contents/Developer/usr/bin/g++

which (see my previous post) point to LLVM. Brew installs g++-8. Could you check that?

@dev-zero
Copy link
Contributor Author

since the point of CMake is to hide away this kind of complexity, I added a different solution da2a53e which solved the issue on tcopt1.

@dev-zero
Copy link
Contributor Author

solved via #98

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

2 participants