Comments (13)
if (FIPS_LINUX)
check_function_exists(__atomic_fetch_add_4 HAVE___ATOMIC_FETCH_ADD_4)
if (NOT HAVE___ATOMIC_FETCH_ADD_4)
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
if (HAVE_LIBATOMIC)
fips_deps(atomic)
endif()
endif()
endif()
from fips.
Hmm interesting, didn't know that. What system(s) requires this?
from fips.
At least my system which is a ubuntu 14.10. I will check the relevant lib
versions once i am on the machine again - if needed.
Am 12.02.2015 17:40 schrieb "Andre Weissflog" [email protected]:
Hmm interesting, didn't know that. What system(s) requires this?
—
Reply to this email directly or view it on GitHub
#54 (comment).
from fips.
Just digged a little bit deeper: They've moved atomics implementation since gcc 4.8 into libatomic.a - and this must be linked whenever you use atomics.
Do you think this patch can make it into fips? Or should I change something?
from fips.
Well, in fact gcc < 4.8 didn't support atomics at all... - just to clarify.
from fips.
I'd like to figure out first why Oryol is linking at all on Linux with gcc4.8 without explicitly linking libatomic... :) For instance I'm using std::atomic_exchange_explicit() and some operators (++, ...).
I'm on Linux Mint 17.1, based on Ubuntu 14.04.1 LTS
gcc -- version: gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
from fips.
So... it looks like it worked in older Ubuntu and/or gcc versions but no longer in newer ones? What's your exact gcc version?
from fips.
gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.10
Release: 14.10
Codename: utopic
from fips.
btw. oryol links for me, too - which is very weird. Maybe not all symbols are put into the atomic lib.
from fips.
in simpleai this works:
cd /home/mgerhardy/dev/simpleai/src/run && /usr/bin/cmake -E cmake_link_script CMakeFiles/simpleai-run.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 -Wall -Wextra -fno-exceptions CMakeFiles/simpleai-run.dir/GameEntity.cpp.o CMakeFiles/simpleai-run.dir/Main.cpp.o -o simpleai-run -L/home/mgerhardy/dev/simpleai/src/ai -rdynamic ../ai/libsimpleai.a -lpthread -latomic ../libs/lua/liblua.a -ldl -Wl,-rpath,/home/mgerhardy/dev/simpleai/src/ai
while this doesn't:
cd /home/mgerhardy/dev/simpleai/src/run && /usr/bin/cmake -E cmake_link_script CMakeFiles/simpleai-run.dir/link.txt --verbose=1
/usr/bin/c++ -std=c++11 -Wall -Wextra -fno-exceptions CMakeFiles/simpleai-run.dir/GameEntity.cpp.o CMakeFiles/simpleai-run.dir/Main.cpp.o -o simpleai-run -L/home/mgerhardy/dev/simpleai/src/ai -rdynamic ../ai/libsimpleai.a -lpthread -latomic ../libs/lua/liblua.a -ldl -Wl,-rpath,/home/mgerhardy/dev/simpleai/src/ai
the only difference is -latomic
CMakeFiles/simpleai-run.dir/GameEntity.cpp.o: In Funktion std::atomic<ai::Vector3f>::store(ai::Vector3f, std::memory_order)': GameEntity.cpp:(.text._ZNSt6atomicIN2ai8Vector3fEE5storeES1_St12memory_order[_ZNSt6atomicIN2ai8Vector3fEE5storeES1_St12memory_order]+0x27): Nicht definierter Verweis auf
__atomic_store'
CMakeFiles/simpleai-run.dir/GameEntity.cpp.o: In Funktion std::atomic<ai::Vector3f>::load(std::memory_order) const': GameEntity.cpp:(.text._ZNKSt6atomicIN2ai8Vector3fEE4loadESt12memory_order[_ZNKSt6atomicIN2ai8Vector3fEE4loadESt12memory_order]+0x42): Nicht definierter Verweis auf
__atomic_load'
collect2: error: ld returned 1 exit status
from fips.
Strange. Would you mind providing a pull request for fips? I think this should go into cmake-toolchains/linux.toolchain.cmake. There's already a couple of standard libs defined (-lpthread and -lrt),
additionally to your detection whether atomic exists, you could also limit this to gcc with an if (FIPS_GCC).
from fips.
created a pull request.
while we are on it - there are systems that don't have librt - they have clock_gettime somewhere else (afair in libc directly - but my memories might be wrong, fixed that for ufoai a felt decade ago)
I will try to fix it in a proper cmake way and provide another pull request.
from fips.
Cleaning up leftover tickets...
from fips.
Related Issues (20)
- c99
- Missing standard math library when build in Ubuntu. HOT 2
- fips diag tools for checking http-server??? HOT 2
- cmake.py/run_build() adds Visual Studio args for Android builds
- Install and CPack ? HOT 2
- MSVC treat warnings as errors HOT 4
- Is this FIPS possible to support VS2010 project? HOT 2
- How to use 'exec_program' in FIPS??? HOT 1
- LNK203 _MSC_VER HOT 2
- I find fips very interesting but ... HOT 1
- Ios Bundle assets and other Xcode settings HOT 3
- "fips run xxxxx" fails on github actions windows vm with "The system cannot find the path specified." HOT 4
- Moving Directories HOT 2
- android SDK changed the folder tree HOT 4
- Slow builds via cmd line HOT 3
- great build system, awesome! HOT 1
- Using --parallel in cmake does not build in parallel within projects HOT 4
- Included PyYaml (yaml3) breaks with python 3.10 HOT 2
- VSCode launch/build target fails HOT 3
- Working with projects outside the fips folder hierarchy is broken HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fips.