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

Atomic test does not work correctly #1

Open
barracuda156 opened this issue Sep 17, 2024 · 2 comments
Open

Atomic test does not work correctly #1

barracuda156 opened this issue Sep 17, 2024 · 2 comments

Comments

@barracuda156
Copy link

Running the build on ppc (i.e. 32-bit), I get this:

--->  Building R-qs2
xinstall: mkdir /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-qs2/R-qs2/work/build
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-qs2/R-qs2/work/qs2" && /opt/local/bin/R CMD INSTALL . --configure-args="--without-simd --with-TBB" --library=/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-qs2/R-qs2/work/build --install-tests 
* installing *source* package ‘qs2’ ...
** package ‘qs2’ successfully unpacked and MD5 sums checked
** using staged installation
checking for pkg-config... /opt/local/bin/pkg-config
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether /opt/local/bin/g++-mp-13 -std=gnu++17 accepts -g... yes
C++ compiler: /opt/local/bin/g++-mp-13 -std=gnu++17
zstd 1.5.6 library detected -- skipping zstd compilation
Fixed blocksize
Using TBB
Does not require -latomic flag
configure: creating ./config.status
config.status: creating src/Makevars

However, ppc requires -latomic in order to support 64-bit atomics.
Needless to say, in result Makevars do not get the flag:

PKG_CPPFLAGS=-DRCPP_USE_UNWIND_PROTECT -DRCPP_NO_RTTI -DRCPP_NO_SUGAR -I../inst/include -I.    -DIS_UTF8_LOCALE=$(shell "${R_HOME}/bin/Rscript" -e "cat(as.integer(identical(utils::localeToCharset()[1], 'UTF-8')))")
PKG_CXXFLAGS =  $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::CxxFlags()")
PKG_LIBS = -L.  -L/opt/local/lib -lzstd $(shell ${R_HOME}/bin/Rscript -e "RcppParallel::RcppParallelLibs()")

LIBZSTD = ZSTD/zstd.o

$(SHLIB): 

libQSZSTD.a: $(LIBZSTD)
	$(AR) rcs libQSZSTD.a $(LIBZSTD)

clean:
	rm -f $(SHLIB) $(OBJECTS) 

I am not sure why, but the test gives an inaccurate result.

@traversc
Copy link
Collaborator

I still don't have a way to test, so I'd need your help. Maybe adding compiler flags to the test program (R CMD config CXXFLAGS) would that change the result?

@barracuda156
Copy link
Author

Ah, we have this issue with v. 1 as well: qsbase/qs#98

Has this check been confirmed to work anywhere though, where libatomic is needed? Like, on 32-bit arm or mips?

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