Project

General

Profile

new package atomics required 4.9.1

Added by Mark Travis about 1 year ago

What is this new required package on line 297 of the CMakeLists.txt file?

The only think I could find that could be related was allowing a raspberry pi to link against -latomic.

I'm running Linux and or Windows. Is it still required?


Replies (9)

RE: new package atomics required 4.9.1 - Added by Roel Standaert about 1 year ago

Is it causing you any problems?

The only think I could find that could be related was allowing a raspberry pi to link against -latomic.

That's precisely what it is. It's like how CMake's FindThreads module adds the required support library for threading support if that's necessary.

We added a FindAtomics module that we took from the JPEG XL project to make sure atomic operations are supported (std::atomic), and if necessary link with -latomic on those platforms that require it.

It doesn't introduce any new dependencies to Wt, it's just an explicit check for something that Wt already depended on.

RE: new package atomics required 4.9.1 - Added by Mark Travis about 1 year ago

ok. It was crashing on that part of the compile for me because I don't have that package installed.

CMake Error at cmake/FindAtomics.cmake:77 (message):
Neither lock free instructions nor -latomic found.
Call Stack (most recent call first):
CMakeLists.txt:297 (find_package)

I commented out the line and it compiled fine. I'm still not sure which package it's looking for. If I run 'brew search findatomics', I get nothing. It suggests package 'atom', but I know that's not right.
It DOES find the atomic libraries in boost (1.81), but that's always been the case.

I am using std::atomic in my application to communicate between threads.

I also change c++ 14 to c++ 17 in cmakelists.txt since I am using a number of c++17 features.

Should I just continue to comment it out for new Wt versions?

RE: new package atomics required 4.9.1 - Added by Roel Standaert about 1 year ago

Hm, I didn't have that kind of regression in my testing. What's your operating system/distribution? If it works otherwise, there must be something going wrong with the checks.

RE: new package atomics required 4.9.1 - Added by Mark Travis about 1 year ago

MacOS Ventura 13.2, Xcode 14.2.

I didn't have to make the change for Ubuntu 22.04 LTS. I just checked the log and there is a line that says "Performing Test ATOMICS_LOCK_FREE_INSTRUCTIONS - Success"

It must be strictly a MacOS Ventura issue.

RE: new package atomics required 4.9.1 - Added by Roel Standaert about 1 year ago

Hm, I just updated the M1 Mac Mini here to Ventura 13.2 and XCode 14.2, and I don't have any issues.

RE: new package atomics required 4.9.1 - Added by Mark Travis about 1 year ago

Interesting. What package am I missing? I’ve been successfully compiling projects since 4.5. Even my linux boxes don’t complain about 4.91.

RE: new package atomics required 4.9.1 - Added by Roel Standaert about 1 year ago

That's the strange thing: you shouldn't need any extra packages. The test should simply detect that atomics are supported without an extra library and that's it.

What options are you using to configure CMake? What compiler? I'm assuming it's AppleClang? What target architecture? (Both x86-64 and arm64 builds worked for me.)

Maybe you can share your CMakeCache.txt and some log output.

RE: new package atomics required 4.9.1 - Added by Mark Travis about 1 year ago

I simply download Wt. Unpack it. Create a new directory called /build. CD in to /build. Edit CMakeLists.txt to change 14 to 17 on line 57 (c++17)

Then I run cmake ../ in the /build directory. That's it.

Yes for AppleClang. I let it default for architecture.
I do not have QT4, 5, or 6 installed if that makes any difference.

Attached is the CMakeCache.txt file that works when Atomics is commented out.

The other three CMake files are with Atomics uncommented.

RE: new package atomics required 4.9.1 - Added by Mark Travis about 1 year ago

I found it. For a few months, Apple's version of c++ was out of sync. I reported the bug to Apple and they agreed it was their bug. The workaround was to install Command Line Tools in /Library/Developer/CommandLineTools.

They have since moved CommandLineTools into the /Applications/XCode.app package.

I deleted the old CLT directory and now the atomics requirement works fine.

Hopefully, I don't run in to the original C++ bug that caused the work-around in the first place.

    (1-9/9)